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 Sep 26, 2017
1 parent e1af914 commit 9cd2f82
Show file tree
Hide file tree
Showing 42 changed files with 1,684 additions and 457 deletions.
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
4 changes: 2 additions & 2 deletions ios/StatusIm.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,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 +1770,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 @@ -269,7 +269,11 @@ function validateSend(params, context) {
params["bot-db"] = {};
}

if (!params["bot-db"]["public"] || !params["bot-db"]["public"]["recipient"] || !params["bot-db"]["public"]["recipient"]["address"]) {
console.log(context);

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 @@ -476,6 +480,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 @@ -510,6 +520,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 9cd2f82

Please sign in to comment.