Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
TEST Account
pymemri
Commits
b089f3c8
Commit
b089f3c8
authored
3 years ago
by
Eelco van der Wel
💬
Browse files
Options
Download
Email Patches
Plain Diff
add CVU, add authEmail to Account schema init
parent
ace83847
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pymemri/client_simulator/qr_server.py
+5
-4
pymemri/client_simulator/qr_server.py
pymemri/cvu/definitions/request_email.cvu
+61
-0
pymemri/cvu/definitions/request_email.cvu
pymemri/pod/client.py
+1
-1
pymemri/pod/client.py
with
67 additions
and
5 deletions
+67
-5
pymemri/client_simulator/qr_server.py
+
5
-
4
View file @
b089f3c8
...
...
@@ -43,10 +43,10 @@ def run_qr_flow(_qr_code_data, client: PodClient, plugin_run: PluginRun):
# Gather email
plugin_run
.
status
=
RUN_USER_ACTION_NEEDED
pwd
_cvu
=
get_default_cvu
(
"request_
password
.cvu"
)
email
_cvu
=
get_default_cvu
(
"request_
email
.cvu"
)
client
.
bulk_action
(
create_items
=
[
pwd
_cvu
],
create_edges
=
[
Edge
(
plugin_run
,
pwd
_cvu
,
"view"
)]
create_items
=
[
email
_cvu
],
create_edges
=
[
Edge
(
plugin_run
,
email
_cvu
,
"view"
)]
)
client
.
update_item
(
plugin_run
)
...
...
@@ -66,9 +66,10 @@ def run_qr_flow(_qr_code_data, client: PodClient, plugin_run: PluginRun):
email_sent
=
False
print
(
f
"failed to send email:
\n
{
e
}
"
)
# set
# depending on whether email was a success, either show qr link, or message that link was sent to email
if
not
email_sent
:
# NOTE Theres currently no documented way to delete edges, so client will have to pick the last added cvu.
client
.
bulk_action
(
delete_items
=
[
email_cvu
])
cvu
=
get_default_cvu
(
"qr_code_auth.cvu"
)
client
.
create
(
cvu
)
plugin_run
.
add_edge
(
"view"
,
cvu
)
...
...
This diff is collapsed.
Click to expand it.
pymemri/cvu/definitions/request_email.cvu
0 → 100644
+
61
-
0
View file @
b089f3c8
.request-email {
title: "WhatsApp integration"
defaultRenderer: generalEditor
showContextualBottomBar: false
showBottomBar: false
showDefaultLayout: false
readOnly: false
[renderer = generalEditor] {
layout: [
{ section: info}
{ section: e-mail, fields: authEmail }
{ section: send }
]
info {
showTitle: false
HStack {
Text {
text: "Please enter your email, we will send you a link to authenticate the plugin"
font: 20 semibold
color: #000
padding: 5 8 5 8
}
}
}
send {
showTitle: false
HStack {
alignment: center
Spacer
Button {
padding: 20 0 20 0
onPress: [
setProperty {
subject: {{.~account}}
property: "status"
value: "ready"
}
sync
back
]
VStack {
background: #218721
cornerRadius: 5
Text {
text: "Send"
font: 16 semibold
color: #fff
padding: 5 8 5 8
}
}
}
Spacer
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pymemri/pod/client.py
+
1
-
1
View file @
b089f3c8
...
...
@@ -63,7 +63,7 @@ class PodClient:
PluginRun
(
""
,
""
,
""
,
status
=
""
,
error
=
""
,
targetItemId
=
""
,
settings
=
""
,
authUrl
=
""
),
CVUStoredDefinition
(
name
=
""
,
definition
=
""
,
externalId
=
""
),
Account
(
service
=
""
,
identifier
=
""
,
secret
=
""
,
code
=
""
,
accessToken
=
""
,
refreshToken
=
""
,
errorMessage
=
""
,
handle
=
""
,
displayName
=
""
),
refreshToken
=
""
,
errorMessage
=
""
,
handle
=
""
,
displayName
=
""
,
authEmail
=
""
),
Photo
(
width
=
1
,
height
=
1
,
channels
=
1
,
encoding
=
""
)
)
except
Exception
as
e
:
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment