rhoconnect 4.0.0.beta.10 → 4.0.0.beta.12
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +11 -0
- data/Gemfile.lock +6 -6
- data/Rakefile +1 -1
- data/commands/generators/controller.rb +1 -1
- data/commands/generators/model.rb +1 -1
- data/doc/deploying.txt +41 -38
- data/doc/source-adapters-js.txt +263 -0
- data/generators/templates/application/controllers/js/application_controller.js +6 -4
- data/generators/templates/source/controllers/js/controller.js +4 -4
- data/generators/templates/source/models/js/model.js +3 -1
- data/install.sh +76 -6
- data/installer/utils/constants.rb +4 -4
- data/js-adapters/ballroom.js +6 -7
- data/js-adapters/node_channel.rb +14 -8
- data/js-adapters/request.js +7 -8
- data/js-adapters/response.js +10 -2
- data/js-adapters/rhoconnect_helpers.js +34 -33
- data/js-adapters/router.js +15 -12
- data/lib/rhoconnect/controller/js_base.rb +2 -7
- data/lib/rhoconnect/document.rb +1 -1
- data/lib/rhoconnect/model/base.rb +25 -10
- data/lib/rhoconnect/model/js_base.rb +4 -3
- data/lib/rhoconnect/source.rb +15 -1
- data/lib/rhoconnect/version.rb +1 -1
- data/spec/apps/rhotestapp/models/js/js_sample.js +61 -14
- data/spec/apps/rhotestapp/models/ruby/sample_adapter.rb +5 -0
- data/spec/controllers/js_base_spec.rb +16 -11
- data/spec/models/js_model_spec.rb +68 -7
- data/spec/server/server_spec.rb +28 -0
- data/spec/source_adapter_spec.rb +0 -11
- data/spec/source_spec.rb +39 -0
- data/spec/spec_helper.rb +11 -0
- metadata +4 -44
- data/lib/rhoconnect/api/app/ans_login.rb +0 -3
- data/lib/rhoconnect/api/app/bulk_data.rb +0 -10
- data/lib/rhoconnect/api/app/fast_delete.rb +0 -11
- data/lib/rhoconnect/api/app/fast_insert.rb +0 -11
- data/lib/rhoconnect/api/app/fast_update.rb +0 -11
- data/lib/rhoconnect/api/app/login.rb +0 -5
- data/lib/rhoconnect/api/app/push_deletes.rb +0 -12
- data/lib/rhoconnect/api/app/push_objects.rb +0 -12
- data/lib/rhoconnect/api/app/query.rb +0 -8
- data/lib/rhoconnect/api/app/queue_updates.rb +0 -98
- data/lib/rhoconnect/api/app/search.rb +0 -8
- data/lib/rhoconnect/api/client/client_get_db_doc.rb +0 -5
- data/lib/rhoconnect/api/client/client_set_db_doc.rb +0 -8
- data/lib/rhoconnect/api/client/create.rb +0 -7
- data/lib/rhoconnect/api/client/get_client_params.rb +0 -4
- data/lib/rhoconnect/api/client/list_client_docs.rb +0 -17
- data/lib/rhoconnect/api/client/register.rb +0 -12
- data/lib/rhoconnect/api/client/reset.rb +0 -5
- data/lib/rhoconnect/api/readstate/set_refresh_time.rb +0 -9
- data/lib/rhoconnect/api/source/get_source_params.rb +0 -4
- data/lib/rhoconnect/api/source/list_sources.rb +0 -16
- data/lib/rhoconnect/api/source/update_source_params.rb +0 -6
- data/lib/rhoconnect/api/store/get_db_doc.rb +0 -4
- data/lib/rhoconnect/api/store/set_db_doc.rb +0 -7
- data/lib/rhoconnect/api/system/get_adapter.rb +0 -4
- data/lib/rhoconnect/api/system/get_license_info.rb +0 -9
- data/lib/rhoconnect/api/system/login.rb +0 -15
- data/lib/rhoconnect/api/system/reset.rb +0 -11
- data/lib/rhoconnect/api/system/save_adapter.rb +0 -4
- data/lib/rhoconnect/api/system/stats.rb +0 -22
- data/lib/rhoconnect/api/user/create_user.rb +0 -7
- data/lib/rhoconnect/api/user/delete_client.rb +0 -6
- data/lib/rhoconnect/api/user/delete_user.rb +0 -11
- data/lib/rhoconnect/api/user/list_clients.rb +0 -4
- data/lib/rhoconnect/api/user/list_source_docs.rb +0 -11
- data/lib/rhoconnect/api/user/list_users.rb +0 -3
- data/lib/rhoconnect/api/user/ping.rb +0 -3
- data/lib/rhoconnect/api/user/show_user.rb +0 -3
- data/lib/rhoconnect/api/user/update_user.rb +0 -5
- data/lib/rhoconnect/api/user/user_get_db_doc.rb +0 -5
- data/lib/rhoconnect/api/user/user_set_db_doc.rb +0 -10
@@ -1,4 +1,5 @@
|
|
1
|
-
var
|
1
|
+
var rc = require('rhoconnect_helpers');
|
2
|
+
var Store = rc.Store;
|
2
3
|
|
3
4
|
var JsSample = function() {
|
4
5
|
|
@@ -8,7 +9,11 @@ var JsSample = function() {
|
|
8
9
|
};
|
9
10
|
|
10
11
|
this.create = function(resp){
|
11
|
-
resp.
|
12
|
+
if(resp.params.create_object['txtfile-rhoblob'] === 'blob_created'){
|
13
|
+
resp.send('blob_created');
|
14
|
+
} else{
|
15
|
+
resp.send('2');
|
16
|
+
}
|
12
17
|
};
|
13
18
|
|
14
19
|
this.update = function(resp){
|
@@ -28,27 +33,69 @@ var JsSample = function() {
|
|
28
33
|
resp.send(true);
|
29
34
|
};
|
30
35
|
|
31
|
-
this.
|
32
|
-
|
33
|
-
|
34
|
-
resp.send(
|
36
|
+
this.testGetValue = function(resp){
|
37
|
+
resp.params = 'foo';
|
38
|
+
Store.getValue(resp,function(resp){
|
39
|
+
resp.send(resp.result);
|
40
|
+
});
|
41
|
+
};
|
42
|
+
|
43
|
+
this.testGetData = function(resp){
|
44
|
+
resp.params = 'foo';
|
45
|
+
Store.getData(resp,function(resp){
|
46
|
+
resp.send(resp.result);
|
47
|
+
});
|
48
|
+
};
|
49
|
+
|
50
|
+
this.testGetModelData = function(resp){
|
51
|
+
rc.getData(resp,function(resp){
|
52
|
+
resp.send(resp.result);
|
53
|
+
});
|
54
|
+
};
|
55
|
+
|
56
|
+
this.testPutValue = function(resp){
|
57
|
+
Store.putValue(resp,function(resp){
|
58
|
+
resp.send(resp.result);
|
35
59
|
});
|
36
60
|
};
|
37
61
|
|
62
|
+
this.testPutData = function(resp){
|
63
|
+
Store.putData(resp,function(resp){
|
64
|
+
resp.send(resp.result);
|
65
|
+
});
|
66
|
+
};
|
67
|
+
|
68
|
+
this.getUser = function(resp){
|
69
|
+
var user = resp.currentUser;
|
70
|
+
resp.send(user);
|
71
|
+
};
|
72
|
+
|
38
73
|
this.getSource = function(resp){
|
39
|
-
|
74
|
+
rc.source(resp,function(resp){
|
40
75
|
var source = resp['result']['id'];
|
41
76
|
resp.send(source);
|
42
77
|
});
|
43
78
|
};
|
44
79
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
80
|
+
this.testStashResult = function(resp){
|
81
|
+
for(var i = 0; i < 2; i++){
|
82
|
+
var item = i.toString();
|
83
|
+
resp.params = {};
|
84
|
+
resp.params[item] = {'name': item};
|
85
|
+
rc.stashResult(resp);
|
86
|
+
}
|
87
|
+
// Master Document now contains { '0': {'name': '0'}, '1': {'name': '1'} }
|
88
|
+
resp.send(true);
|
89
|
+
};
|
90
|
+
|
91
|
+
this.storeBlob = function(resp){
|
92
|
+
var fs = require('fs');
|
93
|
+
if(fs.existsSync(resp.params.path)){
|
94
|
+
resp.send('blob_created');
|
95
|
+
} else{
|
96
|
+
resp.send('no blob');
|
97
|
+
}
|
98
|
+
};
|
52
99
|
|
53
100
|
};
|
54
101
|
|
@@ -2,6 +2,11 @@ class SampleAdapter < SourceAdapter
|
|
2
2
|
def initialize(source)
|
3
3
|
super(source)
|
4
4
|
end
|
5
|
+
|
6
|
+
# to test custom partitions
|
7
|
+
def self.partition_name(user_id)
|
8
|
+
user_id[0..2] == 'cus' ? 'custom_partition' : user_id
|
9
|
+
end
|
5
10
|
|
6
11
|
def login
|
7
12
|
raise SourceAdapterLoginException.new('Error logging in') if _is_empty?(current_user.login)
|
@@ -72,18 +72,23 @@ describe "Rhoconnect::Controller::JsBase" do
|
|
72
72
|
last_response.should be_ok
|
73
73
|
end
|
74
74
|
|
75
|
-
it "should
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
75
|
+
it "should upload blob in multipart post" do
|
76
|
+
file1,file2 = 'upload1.txt'
|
77
|
+
@product1['txtfile-rhoblob'] = file1
|
78
|
+
@product1['_id'] = 'tempobj1'
|
79
|
+
cud = {'create'=>{'1'=>{'name'=>'hello'}},
|
80
|
+
:blob_fields => ['txtfile-rhoblob']}.to_json
|
81
|
+
post "/app/#{Rhoconnect::API_VERSION}/JsSample",
|
82
|
+
{:cud => cud,'txtfile-rhoblob-1' =>
|
83
|
+
Rack::Test::UploadedFile.new(File.join(File.dirname(__FILE__),'..','testdata',file1), "application/octet-stream")},
|
84
|
+
{Rhoconnect::CLIENT_ID_HEADER => @c.id}
|
85
|
+
last_response.should be_ok
|
86
|
+
get "/app/#{Rhoconnect::API_VERSION}/JsSample", {}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
|
87
|
+
json = JSON.parse(last_response.body)
|
88
|
+
json[5]['links'].should == { "1" => { "l" => "blob_created" } }
|
89
|
+
json[5]['delete'].should == { "blob_created" => { "name" => "hello", "txtfile-rhoblob" => "blob_created" } }
|
81
90
|
end
|
82
91
|
|
83
|
-
it "should
|
84
|
-
js = JsSample.new("JsSample")
|
85
|
-
res = js.foo
|
86
|
-
res.should == "foo method not defined for JsSample"
|
87
|
-
end
|
92
|
+
it "should register deprecated_route"
|
88
93
|
end
|
89
94
|
end
|
@@ -18,22 +18,83 @@ describe "Rhoconnect::Model::JsBase" do
|
|
18
18
|
|
19
19
|
after(:each) do
|
20
20
|
Rhoconnect::Node.kill_process
|
21
|
+
Source.valid_doctypes.delete('tmpdoc'.to_sym)
|
21
22
|
end
|
22
23
|
|
23
|
-
|
24
|
+
it "should call model's create method"
|
24
25
|
|
25
|
-
|
26
|
+
it "should call model's update method"
|
26
27
|
|
27
|
-
|
28
|
+
it "should call model's delete method"
|
28
29
|
|
29
|
-
|
30
|
+
it "should call model's query method"
|
30
31
|
|
31
|
-
|
32
|
+
it "should call model's login method"
|
32
33
|
|
33
|
-
|
34
|
+
it "should call model's logoff method"
|
34
35
|
|
35
|
-
|
36
|
+
it "should call js model method explicitly" do
|
37
|
+
js = JsSample.new(Source.load('JsSample', {:app_id => @a.id, :user_id => @u.id}))
|
38
|
+
res = js.login
|
39
|
+
res.should == "success"
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should print warning if model function not found" do
|
43
|
+
js = JsSample.new(Source.load('JsSample', {:app_id => @a.id, :user_id => @u.id}))
|
44
|
+
res = js.foo
|
45
|
+
res.should == "foo method not defined for JsSample"
|
46
|
+
end
|
47
|
+
|
48
|
+
it "should call currentUser from model" do
|
49
|
+
js = JsSample.new(Source.load('JsSample', {:app_id => @a.id, :user_id => @u.id}))
|
50
|
+
res = js.getUser
|
51
|
+
res.should == 'testuser'
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should call stashResult from model" do
|
55
|
+
data = { '0' => {'name' => '0'}, '1' => {'name' => '1'} }
|
56
|
+
Source.define_valid_doctypes(['tmpdoc'.to_sym])
|
57
|
+
js = JsSample.new(Source.load('JsSample', {:app_id => @a.id, :user_id => @u.id}))
|
58
|
+
js.inject_tmpdoc('tmpdoc')
|
59
|
+
js.testStashResult
|
60
|
+
js.get_data('tmpdoc').should == data
|
61
|
+
end
|
62
|
+
|
63
|
+
it "should call getData for a model" do
|
64
|
+
data = {'1' => {'name' => 'iPhone'}}
|
65
|
+
js = JsSample.new(Source.load('JsSample', {:app_id => @a.id, :user_id => @u.id}))
|
66
|
+
res = js.do_query
|
67
|
+
js.testGetModelData.should == data
|
68
|
+
end
|
69
|
+
|
70
|
+
context "Store" do
|
71
|
+
it "should call getValue" do
|
72
|
+
Store.put_value('foo', 'bar')
|
73
|
+
js = JsSample.new(Source.load('JsSample', {:app_id => @a.id, :user_id => @u.id}))
|
74
|
+
res = js.testGetValue
|
75
|
+
res.should == 'bar'
|
76
|
+
end
|
77
|
+
|
78
|
+
it "should call putValue" do
|
79
|
+
js = JsSample.new(Source.load('JsSample', {:app_id => @a.id, :user_id => @u.id}))
|
80
|
+
js.testPutValue('foo', 'baz')
|
81
|
+
Store.get_value('foo').should == 'baz'
|
82
|
+
end
|
83
|
+
|
84
|
+
it "should call getData" do
|
85
|
+
data = {'1' => {'name' => 'iPhone'}}
|
86
|
+
Store.put_data('foo', data)
|
87
|
+
js = JsSample.new(Source.load('JsSample', {:app_id => @a.id, :user_id => @u.id}))
|
88
|
+
res = js.testGetData
|
89
|
+
res.should == data
|
90
|
+
end
|
36
91
|
|
92
|
+
it "should call putData" do
|
93
|
+
data = {'1' => {'name' => 'iPhone'}}
|
94
|
+
js = JsSample.new(Source.load('JsSample', {:app_id => @a.id, :user_id => @u.id}))
|
95
|
+
res = js.testPutData('foo', data)
|
96
|
+
Store.get_data('foo').should == data
|
97
|
+
end
|
37
98
|
end
|
38
99
|
end
|
39
100
|
end
|
data/spec/server/server_spec.rb
CHANGED
@@ -412,6 +412,34 @@ describe "Server" do
|
|
412
412
|
{"count"=>0}, {"progress_count"=>0}, {"total_count"=>2},{}]
|
413
413
|
end
|
414
414
|
|
415
|
+
# check custom partitions
|
416
|
+
it "should return data for user with custom partition name" do
|
417
|
+
do_post "/rc/#{Rhoconnect::API_VERSION}/app/login", "login" => 'cus_user1', "password" => 'testpass'
|
418
|
+
@c_fields = {
|
419
|
+
:device_type => 'Apple',
|
420
|
+
:device_pin => 'abcd',
|
421
|
+
:device_port => '3333',
|
422
|
+
:user_id => 'cus_user1',
|
423
|
+
:app_id => @a.id
|
424
|
+
}
|
425
|
+
@c = Client.create(@c_fields,{:source_name => @s_fields[:name]})
|
426
|
+
@s = Source.load('SampleAdapter', {:user_id => 'cus_user1', :app_id => APP_NAME})
|
427
|
+
|
428
|
+
data = {'1'=>@product1,'2'=>@product2}
|
429
|
+
set_test_data('test_db_storage',data)
|
430
|
+
get "/app/#{Rhoconnect::API_VERSION}/#{@s.name}", {}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
|
431
|
+
last_response.should be_ok
|
432
|
+
token = @c.get_value(:page_token)
|
433
|
+
JSON.parse(last_response.body).should == [{'version'=>Rhoconnect::SYNC_VERSION},{"token"=>token},
|
434
|
+
{"count"=>2}, {"progress_count"=>0}, {"total_count"=>2},{'insert'=>data}]
|
435
|
+
get "/app/#{Rhoconnect::API_VERSION}/#{@s.name}", {:token => token}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
|
436
|
+
last_response.should be_ok
|
437
|
+
JSON.parse(last_response.body).should == [{'version'=>Rhoconnect::SYNC_VERSION},{"token"=>''},
|
438
|
+
{"count"=>0}, {"progress_count"=>0}, {"total_count"=>2},{}]
|
439
|
+
@s.docname(:md).should == "source:#{@s.app.id}:custom_partition:SampleAdapter:md"
|
440
|
+
verify_doc_result(@s, :md => data)
|
441
|
+
end
|
442
|
+
|
415
443
|
it "should create source for dynamic adapter if source_name is unknown" do
|
416
444
|
get "/app/#{Rhoconnect::API_VERSION}/Broken", {}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
|
417
445
|
last_response.status.should == 200
|
data/spec/source_adapter_spec.rb
CHANGED
@@ -1,16 +1,5 @@
|
|
1
1
|
require File.join(File.dirname(__FILE__),'spec_helper')
|
2
2
|
|
3
|
-
class Rhoconnect::Model::Base
|
4
|
-
def inject_result(result)
|
5
|
-
@result = result
|
6
|
-
end
|
7
|
-
|
8
|
-
def inject_tmpdoc(doctype)
|
9
|
-
@tmp_docname = doctype
|
10
|
-
@stash_size = 0
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
3
|
describe "loading Model" do
|
15
4
|
it_behaves_like "SharedRhoconnectHelper", :rhoconnect_data => true do
|
16
5
|
it "should load Model instance from user name" do
|
data/spec/source_spec.rb
CHANGED
@@ -114,5 +114,44 @@ describe "Source" do
|
|
114
114
|
)
|
115
115
|
Source.update_associations([@s.name,@s1.name, @s2.name])
|
116
116
|
end
|
117
|
+
|
118
|
+
# check custom partitions
|
119
|
+
it "should return custom partition for users if defined in the model" do
|
120
|
+
u1_fields = {:login => 'cus_user1'}
|
121
|
+
u1 = User.create(u1_fields)
|
122
|
+
u2_fields = {:login => 'cus_user2'}
|
123
|
+
u2 = User.create(u2_fields)
|
124
|
+
u3_fields = {:login => 'other_user'}
|
125
|
+
u3 = User.create(u3_fields)
|
126
|
+
|
127
|
+
s = Source.load('SampleAdapter', {:user_id => u1.login, :app_id => APP_NAME})
|
128
|
+
s.user_by_partition.should == 'custom_partition'
|
129
|
+
s.docname(:md).should == "source:#{s.app.id}:custom_partition:SampleAdapter:md"
|
130
|
+
s = Source.load('FixedSchemaAdapter', {:user_id => u1.login, :app_id => APP_NAME})
|
131
|
+
s.user_by_partition.should == 'cus_user1'
|
132
|
+
s = Source.load('SampleAdapter', {:user_id => u2.login, :app_id => APP_NAME})
|
133
|
+
s.user_by_partition.should == 'custom_partition'
|
134
|
+
s = Source.load('SampleAdapter', {:user_id => u3.login, :app_id => APP_NAME})
|
135
|
+
s.user_by_partition.should == 'other_user'
|
136
|
+
end
|
137
|
+
|
138
|
+
it "should delete data from custom partition" do
|
139
|
+
u1_fields = {:login => 'cus_user1'}
|
140
|
+
u1 = User.create(u1_fields)
|
141
|
+
data = {'1' => {'Name' => 'Value'}}
|
142
|
+
|
143
|
+
s = Source.load('SampleAdapter', {:user_id => u1.login, :app_id => APP_NAME})
|
144
|
+
s.user_by_partition.should == 'custom_partition'
|
145
|
+
Source.define_valid_doctypes([:md_source])
|
146
|
+
set_doc_state(s, {:md_source => data})
|
147
|
+
Store.get_data("source:#{s.app.id}:custom_partition:SampleAdapter:md_source").should == data
|
148
|
+
Store.get_data("source:#{s.app.id}:cus_user1:SampleAdapter:md_source").should == {}
|
149
|
+
Store.put_data("source:#{s.app.id}:cus_user1:SampleAdapter:md_source", data)
|
150
|
+
|
151
|
+
s.delete
|
152
|
+
Store.get_data("source:#{s.app.id}:custom_partition:SampleAdapter:md_source").should == {}
|
153
|
+
Store.get_data("source:#{s.app.id}:cus_user1:SampleAdapter:md_source").should == data
|
154
|
+
Source.valid_doctypes.delete(:md_source)
|
155
|
+
end
|
117
156
|
end
|
118
157
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -56,6 +56,17 @@ Dir["#{SPEC_PATH}/support/**/*.rb"].each { |f| require f }
|
|
56
56
|
ENV['RACK_ENV'] = 'test'
|
57
57
|
ERROR = '0_broken_object_id' unless defined? ERROR
|
58
58
|
|
59
|
+
class Rhoconnect::Model::Base
|
60
|
+
def inject_result(result)
|
61
|
+
@result = result
|
62
|
+
end
|
63
|
+
|
64
|
+
def inject_tmpdoc(doctype)
|
65
|
+
@tmp_docname = doctype
|
66
|
+
@stash_size = 0
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
59
70
|
module TestHelpers
|
60
71
|
def get_testapp_path
|
61
72
|
File.expand_path(File.join(File.dirname(__FILE__),'apps','rhotestapp'))
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rhoconnect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.0.beta.
|
4
|
+
version: 4.0.0.beta.12
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -418,6 +418,7 @@ files:
|
|
418
418
|
- doc/metadata.txt
|
419
419
|
- doc/rails-plugin.txt
|
420
420
|
- doc/java-plugin.txt
|
421
|
+
- doc/source-adapters-js.txt
|
421
422
|
- doc/adapters-intro.txt
|
422
423
|
- doc/migration.txt
|
423
424
|
- doc/stats-middleware.txt
|
@@ -619,47 +620,6 @@ files:
|
|
619
620
|
- lib/rhoconnect/version.rb
|
620
621
|
- lib/rhoconnect/user.rb
|
621
622
|
- lib/rhoconnect/stats/record.rb
|
622
|
-
- lib/rhoconnect/api/system/login.rb
|
623
|
-
- lib/rhoconnect/api/system/reset.rb
|
624
|
-
- lib/rhoconnect/api/system/save_adapter.rb
|
625
|
-
- lib/rhoconnect/api/system/get_license_info.rb
|
626
|
-
- lib/rhoconnect/api/system/stats.rb
|
627
|
-
- lib/rhoconnect/api/system/get_adapter.rb
|
628
|
-
- lib/rhoconnect/api/user/delete_user.rb
|
629
|
-
- lib/rhoconnect/api/user/user_set_db_doc.rb
|
630
|
-
- lib/rhoconnect/api/user/update_user.rb
|
631
|
-
- lib/rhoconnect/api/user/create_user.rb
|
632
|
-
- lib/rhoconnect/api/user/list_users.rb
|
633
|
-
- lib/rhoconnect/api/user/user_get_db_doc.rb
|
634
|
-
- lib/rhoconnect/api/user/list_source_docs.rb
|
635
|
-
- lib/rhoconnect/api/user/show_user.rb
|
636
|
-
- lib/rhoconnect/api/user/delete_client.rb
|
637
|
-
- lib/rhoconnect/api/user/list_clients.rb
|
638
|
-
- lib/rhoconnect/api/user/ping.rb
|
639
|
-
- lib/rhoconnect/api/client/client_set_db_doc.rb
|
640
|
-
- lib/rhoconnect/api/client/list_client_docs.rb
|
641
|
-
- lib/rhoconnect/api/client/create.rb
|
642
|
-
- lib/rhoconnect/api/client/register.rb
|
643
|
-
- lib/rhoconnect/api/client/reset.rb
|
644
|
-
- lib/rhoconnect/api/client/get_client_params.rb
|
645
|
-
- lib/rhoconnect/api/client/client_get_db_doc.rb
|
646
|
-
- lib/rhoconnect/api/app/fast_update.rb
|
647
|
-
- lib/rhoconnect/api/app/login.rb
|
648
|
-
- lib/rhoconnect/api/app/fast_insert.rb
|
649
|
-
- lib/rhoconnect/api/app/query.rb
|
650
|
-
- lib/rhoconnect/api/app/search.rb
|
651
|
-
- lib/rhoconnect/api/app/push_objects.rb
|
652
|
-
- lib/rhoconnect/api/app/queue_updates.rb
|
653
|
-
- lib/rhoconnect/api/app/ans_login.rb
|
654
|
-
- lib/rhoconnect/api/app/bulk_data.rb
|
655
|
-
- lib/rhoconnect/api/app/fast_delete.rb
|
656
|
-
- lib/rhoconnect/api/app/push_deletes.rb
|
657
|
-
- lib/rhoconnect/api/readstate/set_refresh_time.rb
|
658
|
-
- lib/rhoconnect/api/source/get_source_params.rb
|
659
|
-
- lib/rhoconnect/api/source/list_sources.rb
|
660
|
-
- lib/rhoconnect/api/source/update_source_params.rb
|
661
|
-
- lib/rhoconnect/api/store/set_db_doc.rb
|
662
|
-
- lib/rhoconnect/api/store/get_db_doc.rb
|
663
623
|
- lib/rhoconnect/api_token.rb
|
664
624
|
- lib/rhoconnect/generator.rb
|
665
625
|
- lib/rhoconnect/ping/rhoconnect_push.rb
|
@@ -828,7 +788,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
828
788
|
version: '0'
|
829
789
|
segments:
|
830
790
|
- 0
|
831
|
-
hash:
|
791
|
+
hash: -420963856285787510
|
832
792
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
833
793
|
none: false
|
834
794
|
requirements:
|
@@ -1,10 +0,0 @@
|
|
1
|
-
# Server.resource_api '', "/rc/#{Rhoconnect::API_VERSION}/app/bulk_data", \
|
2
|
-
# :post, {:login_required => true, :admin_route => false, :deprecated_route => {:verb => :get, :url => ['/application/bulk_data', '/api/application/bulk_data']}} do
|
3
|
-
# content_type :json
|
4
|
-
# sources_param = params[:sources]
|
5
|
-
# if sources_param.is_a?String
|
6
|
-
# sources_param = sources_param.split(',')
|
7
|
-
# end
|
8
|
-
# data = ClientSync.bulk_data(params[:partition].to_sym,current_client, sources_param)
|
9
|
-
# data.to_json
|
10
|
-
# end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# Server.resource_api '', "/app/#{Rhoconnect::API_VERSION}/:source_id/fast_delete", :post, \
|
2
|
-
# {:admin_route => true, :login_required => false, :deprecated_route => {:verb => :post, :url => ['/api/fast_delete', '/api/source/fast_delete']}} do
|
3
|
-
# source = Source.load(params[:source_id],{:app_id=>APP_NAME,:user_id=>params[:user_id]})
|
4
|
-
# # if source does not exist create one for dynamic adapter
|
5
|
-
# source = Source.create({:name => params[:source_id]},{:app_id => APP_NAME,:user_id=>params[:user_id]}) unless source
|
6
|
-
# source_sync = SourceSync.new(source)
|
7
|
-
# timeout = params[:timeout] || 10
|
8
|
-
# raise_on_expire = params[:raise_on_expire] || false
|
9
|
-
# source_sync.fast_delete(params[:data], timeout,raise_on_expire)
|
10
|
-
# 'done'
|
11
|
-
# end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# Server.resource_api '', "/app/#{Rhoconnect::API_VERSION}/:source_id/fast_insert", :post, \
|
2
|
-
# {:admin_route => true, :login_required => false, :deprecated_route => {:verb => :post, :url => ['/api/fast_insert', '/api/source/fast_insert']}} do
|
3
|
-
# source = Source.load(params[:source_id],{:app_id=>APP_NAME,:user_id=>params[:user_id]})
|
4
|
-
# # if source does not exist create one for dynamic adapter
|
5
|
-
# source = Source.create({:name => params[:source_id]},{:app_id => APP_NAME,:user_id=>params[:user_id]}) unless source
|
6
|
-
# source_sync = SourceSync.new(source)
|
7
|
-
# timeout = params[:timeout] || 10
|
8
|
-
# raise_on_expire = params[:raise_on_expire] || false
|
9
|
-
# source_sync.fast_insert(params[:data], timeout,raise_on_expire)
|
10
|
-
# 'done'
|
11
|
-
# end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# Server.resource_api '', "/app/#{Rhoconnect::API_VERSION}/:source_id/fast_update", :post, \
|
2
|
-
# {:admin_route => true, :login_required => false, :deprecated_route => {:verb => :post, :url => ['/api/fast_update', '/api/source/fast_update']}} do
|
3
|
-
# source = Source.load(params[:source_id],{:app_id=>APP_NAME,:user_id=>params[:user_id]})
|
4
|
-
# # if source does not exist create one for dynamic adapter
|
5
|
-
# source = Source.create({:name => params[:source_id]},{:app_id => APP_NAME,:user_id=>params[:user_id]}) unless source
|
6
|
-
# source_sync = SourceSync.new(source)
|
7
|
-
# timeout = params[:timeout] || 10
|
8
|
-
# raise_on_expire = params[:raise_on_expire] || false
|
9
|
-
# source_sync.fast_update(params[:delete_data], params[:data],timeout,raise_on_expire)
|
10
|
-
# 'done'
|
11
|
-
# end
|
@@ -1,5 +0,0 @@
|
|
1
|
-
# Server.resource_api '', "/rc/#{Rhoconnect::API_VERSION}/app/login", :post, \
|
2
|
-
# {:admin_route => false, :login_required => false, :deprecated_route => {:verb => :post, :url => ['/application/clientlogin', '/api/application/clientlogin']}} do
|
3
|
-
# logout
|
4
|
-
# do_login
|
5
|
-
# end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# Server.resource_api '', "/app/#{Rhoconnect::API_VERSION}/:source_id/push_deletes", :post, \
|
2
|
-
# {:admin_route => true, :login_required => false, :deprecated_route => {:verb => :post, :url => ['/api/push_deletes', '/api/source/push_deletes']}} do
|
3
|
-
# source = Source.load(params[:source_id],{:app_id=>APP_NAME,:user_id=>params[:user_id]})
|
4
|
-
# # if source does not exist create one for dynamic adapter
|
5
|
-
# source = Source.create({:name => params[:source_id]},{:app_id => APP_NAME,:user_id=>params[:user_id]}) unless source
|
6
|
-
# source_sync = SourceSync.new(source)
|
7
|
-
# timeout = params[:timeout] || 10
|
8
|
-
# raise_on_expire = params[:raise_on_expire] || false
|
9
|
-
# rebuild_md = params[:rebuild_md].nil? ? true : params[:rebuild_md]
|
10
|
-
# source_sync.push_deletes(params[:objects],timeout,raise_on_expire,rebuild_md)
|
11
|
-
# 'done'
|
12
|
-
# end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# Server.resource_api '', "/app/#{Rhoconnect::API_VERSION}/:source_id/push_objects", :post, \
|
2
|
-
# {:admin_route => true, :login_required => false, :deprecated_route => {:verb => :post, :url => ['/api/push_objects', '/api/source/push_objects']}} do
|
3
|
-
# source = Source.load(params[:source_id],{:app_id=>APP_NAME,:user_id=>params[:user_id]})
|
4
|
-
# # if source does not exist create one for dynamic adapter
|
5
|
-
# source = Source.create({:name => params[:source_id]},{:app_id => APP_NAME,:user_id=>params[:user_id]}) unless source
|
6
|
-
# source_sync = SourceSync.new(source)
|
7
|
-
# timeout = params[:timeout] || 10
|
8
|
-
# raise_on_expire = params[:raise_on_expire] || false
|
9
|
-
# rebuild_md = params[:rebuild_md].nil? ? true : params[:rebuild_md]
|
10
|
-
# source_sync.push_objects(params[:objects],timeout,raise_on_expire,rebuild_md)
|
11
|
-
# 'done'
|
12
|
-
# end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
# Server.resource_api '', "/app/#{Rhoconnect::API_VERSION}/:source_name", :get, \
|
2
|
-
# {:admin_route => false, :login_required => true, :deprecated_route => {:verb => :get, :url => ['/api/application', '/application', '/api/application/query']}} do
|
3
|
-
# content_type :json
|
4
|
-
# res = current_client_sync.send_cud(params[:token],params[:query])
|
5
|
-
# response.headers[Rhoconnect::PAGE_TOKEN_HEADER] = res[1]['token']
|
6
|
-
# response.headers[Rhoconnect::PAGE_OBJECT_COUNT_HEADER] = res[2]['count'].to_s
|
7
|
-
# res.to_json
|
8
|
-
# end
|
@@ -1,98 +0,0 @@
|
|
1
|
-
# Server.api4 '', "/app/#{Rhoconnect::API_VERSION}/:source_name/queue_updates", :post, \
|
2
|
-
# {:admin_route => false, :login_required => true, :deprecated_route => {:verb => :post, :url => ['/api/application', '/application', '/api/application/queue_updates']}} do
|
3
|
-
# begin
|
4
|
-
# if params["cud"]
|
5
|
-
# cud = JSON.parse(params["cud"])
|
6
|
-
# params.delete("cud")
|
7
|
-
# params.merge!(cud)
|
8
|
-
# end
|
9
|
-
# rescue JSON::ParserError => jpe
|
10
|
-
# log jpe.message + jpe.backtrace.join("\n")
|
11
|
-
# throw :halt, [500, "Server error while processing client data"]
|
12
|
-
# rescue Exception => e
|
13
|
-
# log e.message + e.backtrace.join("\n")
|
14
|
-
# throw :halt, [500, "Internal server error"]
|
15
|
-
# end
|
16
|
-
#
|
17
|
-
# catch_all do
|
18
|
-
# current_client_sync.receive_cud(params)
|
19
|
-
# status 200
|
20
|
-
# end
|
21
|
-
# end
|
22
|
-
#
|
23
|
-
# Server.api4 '', "/app/#{Rhoconnect::API_VERSION}/:source_name", :post, \
|
24
|
-
# {:login_required => true, :admin_route => false} do
|
25
|
-
# begin
|
26
|
-
# if params["cud"]
|
27
|
-
# cud = JSON.parse(params["cud"])
|
28
|
-
# params.delete("cud")
|
29
|
-
# params.merge!(cud)
|
30
|
-
# end
|
31
|
-
# rescue JSON::ParserError => jpe
|
32
|
-
# log jpe.message + jpe.backtrace.join("\n")
|
33
|
-
# throw :halt, [500, "Server error while processing client data"]
|
34
|
-
# rescue Exception => e
|
35
|
-
# log e.message + e.backtrace.join("\n")
|
36
|
-
# throw :halt, [500, "Internal server error"]
|
37
|
-
# end
|
38
|
-
#
|
39
|
-
# catch_all do
|
40
|
-
# current_client_sync.receive_cud(params)
|
41
|
-
# status 200
|
42
|
-
# end
|
43
|
-
# end
|
44
|
-
#
|
45
|
-
# Server.api4 '', "/app/#{Rhoconnect::API_VERSION}/:source_name/:id", :put, \
|
46
|
-
# {:login_required => true, :admin_route => false} do
|
47
|
-
# begin
|
48
|
-
# if params["cud"]
|
49
|
-
# cud = JSON.parse(params["cud"])
|
50
|
-
# params.delete("cud")
|
51
|
-
# params.merge!(cud)
|
52
|
-
# end
|
53
|
-
# rescue JSON::ParserError => jpe
|
54
|
-
# log jpe.message + jpe.backtrace.join("\n")
|
55
|
-
# throw :halt, [500, "Server error while processing client data"]
|
56
|
-
# rescue Exception => e
|
57
|
-
# log e.message + e.backtrace.join("\n")
|
58
|
-
# throw :halt, [500, "Internal server error"]
|
59
|
-
# end
|
60
|
-
#
|
61
|
-
# begin
|
62
|
-
# if params["update"]
|
63
|
-
# cud = params["update"]
|
64
|
-
# params.delete("update")
|
65
|
-
# params.merge!("update" => {params[:id] => cud})
|
66
|
-
# end
|
67
|
-
# rescue JSON::ParserError => jpe
|
68
|
-
# log jpe.message + jpe.backtrace.join("\n")
|
69
|
-
# throw :halt, [500, "Server error while processing client data"]
|
70
|
-
# rescue Exception => e
|
71
|
-
# log e.message + e.backtrace.join("\n")
|
72
|
-
# throw :halt, [500, "Internal server error"]
|
73
|
-
# end
|
74
|
-
#
|
75
|
-
# catch_all do
|
76
|
-
# current_client_sync.receive_cud(params)
|
77
|
-
# status 200
|
78
|
-
# end
|
79
|
-
# end
|
80
|
-
#
|
81
|
-
# Server.api4 '', "/app/#{Rhoconnect::API_VERSION}/:source_name/:id", :delete, \
|
82
|
-
# {:login_required => true, :admin_route => false} do
|
83
|
-
# begin
|
84
|
-
# obj = current_client.get_object(:cd, params[:id])
|
85
|
-
# params.merge!("delete" => { params[:id] => obj } )
|
86
|
-
# rescue JSON::ParserError => jpe
|
87
|
-
# log jpe.message + jpe.backtrace.join("\n")
|
88
|
-
# throw :halt, [500, "Server error while processing client data"]
|
89
|
-
# rescue Exception => e
|
90
|
-
# log e.message + e.backtrace.join("\n")
|
91
|
-
# throw :halt, [500, "Internal server error"]
|
92
|
-
# end
|
93
|
-
#
|
94
|
-
# catch_all do
|
95
|
-
# current_client_sync.receive_cud(params)
|
96
|
-
# status 200
|
97
|
-
# end
|
98
|
-
# end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
# Server.resource_api '', "/rc/#{Rhoconnect::API_VERSION}/app/search", :post, \
|
2
|
-
# {:admin_route => false, :login_required => true, :deprecated_route => {:verb => :get, :url => ['/application/search', '/api/application/search']}} do
|
3
|
-
# content_type :json
|
4
|
-
# res = ClientSync.search_all(current_client,params)
|
5
|
-
# response.headers[Rhoconnect::PAGE_TOKEN_HEADER] = res[0][1]['token'] if res[0][1] and res[0][1]['token']
|
6
|
-
# response.headers[Rhoconnect::PAGE_OBJECT_COUNT_HEADER] = res[0][3]['count'].to_s if res[0][3] and res[0][3]['count']
|
7
|
-
# res.to_json
|
8
|
-
# end
|
@@ -1,5 +0,0 @@
|
|
1
|
-
# Server.api4 :client_get_db_doc, :get, "/rc/#{Rhoconnect::API_VERSION}/clients/:client_id/sources/:source_id/docs/:doc", true, nil do |params,user|
|
2
|
-
# c = Client.load(params[:client_id],{:source_name => params[:source_id]})
|
3
|
-
# db_key = c.docname(params[:doc])
|
4
|
-
# Store.get_db_doc(db_key)
|
5
|
-
# end
|