Skip to content

Commit

Permalink
API commands scopes, changes for API semantics (#1546)
Browse files Browse the repository at this point in the history
  • Loading branch information
alwx committed Oct 3, 2017
1 parent c3b20b2 commit 16caaad
Show file tree
Hide file tree
Showing 47 changed files with 1,731 additions and 574 deletions.
2 changes: 1 addition & 1 deletion .re-natal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "StatusIm",
"interface": "reagent",
"androidHost": "localhost",
"androidHost": "10.0.3.2",
"modules": [
"react-native-contacts",
"react-native-invertible-scroll-view",
Expand Down
4 changes: 2 additions & 2 deletions env/dev/env/android/main.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
(re-frame.core/dispatch [:load-commands!]))

(figwheel/watch-and-reload
:websocket-url "ws://localhost:3449/figwheel-ws"
:websocket-url "ws://10.0.3.2:3449/figwheel-ws"
:heads-up-display false
:jsload-callback callback)

(rr/enable-re-frisk-remote! {:host "localhost:4567" :on-init core/init :pre-send (fn [db] (update db :chats #(into {} %)))})
(rr/enable-re-frisk-remote! {:host "10.0.3.2:4567" :on-init core/init :pre-send (fn [db] (update db :chats #(into {} %)))})
4 changes: 2 additions & 2 deletions env/dev/env/ios/main.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
(def root-el (r/as-element [reloader]))

(figwheel/watch-and-reload
:websocket-url "ws://10.0.1.15:3449/figwheel-ws"
:websocket-url "ws://localhost:3449/figwheel-ws"
:heads-up-display false
:jsload-callback #(swap! cnt inc))

(rr/enable-re-frisk-remote! {:host "10.0.1.15:4567" :on-init core/init :pre-send (fn [db] (update db :chats #(into {} %)))})
(rr/enable-re-frisk-remote! {:host "localhost:4567" :on-init core/init :pre-send (fn [db] (update db :chats #(into {} %)))})
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: d05403e3fce258b6985bd3b614ffe02a0e01b9f7

COCOAPODS: 1.3.1
COCOAPODS: 1.2.1
25 changes: 23 additions & 2 deletions ios/StatusIm.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,7 @@
A97BA941B2FB44B4B66EE6D3 /* Frameworks */,
1E7837547A9A40E18AD63CF3 /* Resources */,
5C1C8762251D6EF495FB2384 /* Pods */,
B280E73E1F7E6CB000B5E1A6 /* Recovered References */,
);
indentWidth = 2;
sourceTree = "<group>";
Expand Down Expand Up @@ -1051,6 +1052,26 @@
name = Products;
sourceTree = "<group>";
};
B280E73E1F7E6CB000B5E1A6 /* Recovered References */ = {
isa = PBXGroup;
children = (
674B3D9595A047AB8D518F4E /* libRNFS.a */,
52F6ED6465184513A082652B /* libRNI18n.a */,
DF1CD4C3D1254774ACCAE4E8 /* libBVLinearGradient.a */,
5535217F57E44D77AA9CF083 /* libRCTOrientation.a */,
78C55F15EB4D4DAF9202A662 /* libRNRandomBytes.a */,
11632AA0A5F84F029DD91797 /* libRNVectorIcons.a */,
CD48A32459B64E96843BB238 /* libRealmReact.a */,
C2A4E93F6B154AEFA3485B45 /* libTcpSockets.a */,
2BEE3436791D42248F853999 /* libRCTImageResizer.a */,
4EC426A98043452BB6F9C134 /* libRNInstabug.a */,
AF2BF381BC7B4EB0887F0091 /* libRNSVG.a */,
7F752F17B1E04216B1337A72 /* libRNFIRMessaging.a */,
B2E945DF3D3D4E58845B95DA /* libRCTMapboxGL.a */,
);
name = "Recovered References";
sourceTree = "<group>";
};
B2A5F4301DEC36B200174F4D /* Products */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1752,7 +1773,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
49A69B853BD9751F84878340 /* [CP] Check Pods Manifest.lock */ = {
Expand All @@ -1770,7 +1791,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
967469AF8BA27D5CEC47B13C /* [CP] Copy Pods Resources */ = {
Expand Down
27 changes: 24 additions & 3 deletions resources/default_contacts.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"unremovable?": true
},

"wallet":
{
"name":
Expand All @@ -36,12 +37,10 @@
"add-chat?": true,
"dapp?": true,
"groups": ["dapps"],
"has-global-command?": true,
"dapp-url":
{
"en": "https://status.im/dapps/wallet/"
},
"bot-url": "local://wallet-bot",
"unremovable?": true
},

Expand All @@ -53,10 +52,32 @@
"ru": "Печкин"
},
"dapp?": true,
"has-global-command?": true,
"mixable?": true,
"bot-url": "local://mailman-bot"
},

"transactor-group":
{
"name":
{
"en": "Transactor"
},
"dapp?": true,
"mixable?": true,
"bot-url": "local://transactor-group-bot"
},

"transactor-personal":
{
"name":
{
"en": "Transactor"
},
"dapp?": true,
"mixable?": true,
"bot-url": "local://transactor-personal-bot"
},

"demo-bot":
{
"name":
Expand Down
10 changes: 8 additions & 2 deletions resources/js/bots/browse/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,15 @@ function browse(params, context) {
}

status.command({
name: "global",
name: "browse",
title: I18n.t('browse_title'),
registeredOnly: true,
scope: {
isGlobal: true,
registeredOnly: true,
personalChats: true,
groupChats: true,
canUseForDApps: true
},
description: I18n.t('browse_description'),
color: "#ffa500",
fullscreen: true,
Expand Down
30 changes: 14 additions & 16 deletions resources/js/bots/console/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,6 @@ function phoneSuggestions(params, context) {

var phoneConfig = {
name: "phone",
registeredOnly: true,
icon: "phone_white",
color: "#5bb2a2",
title: I18n.t('phone_title'),
Expand Down Expand Up @@ -491,7 +490,6 @@ var phoneConfig = {
}
};
status.response(phoneConfig);
status.command(phoneConfig);

var faucets = [
/*{
Expand Down Expand Up @@ -540,7 +538,13 @@ status.command({
title: I18n.t('faucet_title'),
description: I18n.t('faucet_description'),
color: "#7099e6",
registeredOnly: true,
scope: {
isGlobal: false,
registeredOnly: true,
personalChats: true,
groupChats: true,
canUseForDApps: true
},
params: [{
name: "url",
type: status.types.TEXT,
Expand Down Expand Up @@ -611,7 +615,13 @@ status.command({
title: I18n.t('debug_mode_title'),
description: I18n.t('debug_mode_description'),
color: "#7099e6",
registeredOnly: true,
scope: {
isGlobal: false,
registeredOnly: true,
personalChats: true,
groupChats: true,
canUseForDApps: true
},
params: [{
name: "mode",
suggestions: debugSuggestions,
Expand All @@ -635,18 +645,6 @@ status.command({
}
});


// status.command({
// name: "help",
// title: "Help",
// description: "Request help from Console",
// color: "#7099e6",
// params: [{
// name: "query",
// type: status.types.TEXT
// }]
// });

status.response({
name: "confirmation-code",
color: "#7099e6",
Expand Down
6 changes: 6 additions & 0 deletions resources/js/bots/mailman/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ function locationsSuggestions (params) {
status.command({
name: "location",
title: I18n.t('location_title'),
scope: {
registeredOnly: true,
personalChats: true,
groupChats: true,
canUseForDApps: false
},
description: I18n.t('location_description'),
sequentialParams: true,
hideSendButton: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ function validateSend(params, context) {
params["bot-db"] = {};
}

if (!params["bot-db"]["public"] || !params["bot-db"]["public"]["recipient"] || !params["bot-db"]["public"]["recipient"]["address"]) {
if (!params["bot-db"]["public"]
|| !params["bot-db"]["public"]["recipient"]
|| !params["bot-db"]["public"]["recipient"]["address"]) {
return {
markup: status.components.validationMessage(
"Wrong address",
Expand Down Expand Up @@ -508,6 +510,12 @@ function shortPreviewSend(params, context) {

var send = {
name: "send",
scope: {
isGlobal: false,
personalChats: false,
groupChats: true,
canUseForDApps: false
},
icon: "money_white",
color: "#5fc48d",
title: I18n.t('send_title'),
Expand Down Expand Up @@ -542,6 +550,12 @@ var paramsRequest = [

status.command({
name: "request",
scope: {
isGlobal: false,
personalChats: false,
groupChats: true,
canUseForDApps: false
},
color: "#5fc48d",
title: I18n.t('request_title'),
description: I18n.t('request_description'),
Expand Down
File renamed without changes.
Loading

0 comments on commit 16caaad

Please sign in to comment.