Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide API information to 0xAvenue #1497

Closed
sync-by-unito bot opened this issue Apr 1, 2022 · 38 comments
Closed

Provide API information to 0xAvenue #1497

sync-by-unito bot opened this issue Apr 1, 2022 · 38 comments

Comments

@sync-by-unito
Copy link

sync-by-unito bot commented Apr 1, 2022

Tammy Yang According to the discussion today, we'll need to provide

  1. API for 0xAvanue to quest Numbers backend by Order ID
  2. return of Bump @capacitor/cli from 2.2.1 to 2.3.0 #1 API (Need CID & wallet address )
  3. Information we need for purchase info update

不確定需要多少時間,我先設定週四 due

Ref: https://app.mural.co/t/numbersprotocol9275/m/numbersprotocol9275/1646379754948/0b16b8d2651ecc391772e46c4c70b332b16f3193?sender=u35598127f07f9403e0a66899

┆Issue is synchronized with this Asana task by Unito
┆Created By: Sherry Chung

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 1, 2022

➤ PJ commented:

因為我負責串接0xAvenue API所以先 join task跟進目前進度,謝謝

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 1, 2022

➤ Sherry Chung commented:

Tammy YangPJ 已取得 0xAvenue URL 參數,再麻煩提供 API for 0xAvenue

  • blockchain (ethereum, solana....)
  • asset url
  • owner wallet address
  • (optional) user name
  • (optional) token name

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 1, 2022

➤ PJ commented:

Tammy Yang
I think the information they need is quite similar to the orderDB structure (What Ray demo yesterday), 0xAvenue can query our bubbleDB through order_id and retrieve info.(not sure with the idea)

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 1, 2022

➤ Sherry Chung commented:

Tammy Yang 這個我在等你回覆要提供給 0xAvenue 的 API 資訊,或請告知應該改 assign 給誰

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 1, 2022

➤ Tammy Yang commented:

Sherry Chung 你可以先請 PJ 提供,他上面訊息的概念很接近,我做 review 比較快

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 1, 2022

➤ PJ commented:

Sherry Chung 我明天會給一版spec放在這,再請 Tammy Yang review, thanks!

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 1, 2022

➤ PJ commented:

According to the flow here https://miro.com/app/board/o9J_knFcMnw=/?moveToWidget=3458764520664359089&cot=14 ( https://miro.com/app/board/o9J_knFcMnw=/?moveToWidget=3458764520664359089&cot=14 ) and the current OrderDB structure, I think we can simplify the flow:

Since the information 0xAvenue needs(blockchain name, asset url(cid?), owner wallet address are in OrderDB, also this network app doesn't require $NUM, I think we can skip the work for storage backend ←→ 0xAvenue here. We can leverage bubble workflow for 0xAvenue to access these information by order_id.

For example,
call type: POST
url: https://numbers-upvote.bubbleapps.io/api/1.1/wf/0xAvenue ( https://numbers-upvote.bubbleapps.io/version-test/api/1.1/wf )
test_url: https://numbers-upvote.bubbleapps.io/version-test/api/1.1/wf/0xAvenue ( https://numbers-upvote.bubbleapps.io/version-test/api/1.1/wf/0xAvenue )
(Name are subject to change)
query_params: {order_id: string}
return: {blockchain: str,
asset_cid(or asset_url): str,
owner_wallet_address: str}

For purchase info update
call type: POST
url: https://numbers-upvote.bubbleapps.io/api/1.1/wf/0xAvenue-update ( https://numbers-upvote.bubbleapps.io/version-test/api/1.1/wf )

(Name are subject to change)
body_params: info to update
return: {blockchain: str,
asset_cid(or asset_url): str,
owner_wallet_address: str,
update_info: updated info}
Sherry ChungTammy Yang

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 1, 2022

➤ Tammy Yang commented:

PJ we don't have those APIs yet, right?

Suggest endpoints

order-create
order-update

instead of "0xAvenue" and "0xAvenue-update" ALWAYS prevent putting user name or company name in the endpoint or anywhere.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 1, 2022

➤ Tammy Yang commented:

If they have been implemented, submit a QA release and only share AFTER test passes.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 1, 2022

➤ PJ commented:

Tammy Yang Yes, I haven't implemented these endpoints since the design is different from the miro flow: https://miro.com/app/board/o9J_knFcMnw=/?moveToWidget=3458764520664359089&cot=14 ( https://miro.com/app/board/o9J_knFcMnw=/?moveToWidget=3458764520664359089&cot=14 ) . If the spec proposed above works for you, I will implement 'order-create' and 'order-update' API in numbers-upvote tomorrow.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 1, 2022

➤ Tammy Yang commented:

User story for Scott Yan

As a 0xAvenue developer, I need APIs and clear instructions so that I know how to create Capture App network action with Numbers together.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 1, 2022

➤ Sherry Chung commented:

Scott Yan 明天這裡會有一個多餘的測試

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 1, 2022

➤ PJ commented:

QA Test Detail:
目前為測試API階段,測試兩隻API: order-info / order-update (目前endpoint已建好)
[order-info]
url: https://numbers-upvote.bubbleapps.io/version-avenue0x/api/1.1/wf/order-info
request body: {order_id: str}
response: {blockchain_name: str, asset_cid: str, owner_wallet_address: str}

[order-update]
url: https://numbers-upvote.bubbleapps.io/version-avenue0x/api/1.1/wf/order-update
request body:
{ network_action_cost: number(required),
cost_token_ticker: str(required),
blockchain_name: str(optional),
result_tx: str(optional),
result_url: str(optional)}

return:
{success: true/false}

TESTING DATA:
#1 : order_id: "123", 資料: blockchain_name: IOTA, asset_cid: test_asset_cid_1, owner_wallet_address: test_wallet_address_1
#2: order_id: "456", 資料: blockchain_name: IOTA, asset_cid: test_asset_cid_2, owner_wallet_address: test_wallet_address_2
#3: order_id: "789", 資料: blockchain_name: IOTA, asset_cid: test_asset_cid_3 owner_wallet_address: test_wallet_address_3

Suggest testing steps:

  1. 用order-info測試是否能取到如測試資料一樣的內容
  2. 用order-update測試修改測試資料的內容,並於bubble db中確認Order中對應order_id的欄位內容於預期被修改成user input

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 1, 2022

➤ Tammy Yang commented:

請問這個項目的進度?

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 1, 2022

➤ PJ commented:

Tammy Yang waiting for ‘extend network action to redirect to other side’

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 2, 2022

➤ Tammy Yang commented:

Add it to dependency

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 6, 2022

➤ PJ commented:

Tammy Yang
About the API spec mentioned during demo, if we want to let 0xAvenue to use data api given order_id, the spec will look like this:
Method: "GET"
Url: https://numbers-upvote.bubbleapps.io/api/1.1/obj/Order/?constraints=[{"key": "order_id", "constraint_type": "text contains", "value": "${order_id}"}]

We can choose to let 0xAvenue use

  1. Workflow → POST, with body parameter ${order_id}, we deal with constraints in workflow
  2. Data API → the above

Personally I think it's clearer with the workflow way.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 6, 2022

➤ PJ commented:

In both ways the APIs are implemented and can be tested

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 13, 2022

➤ Tammy Yang commented:

If it is GET. it should be GET instead of POST (i.e. using default API instead of creating workflow) unless there is a very good reason (for example, we want to control the API key or we want to add customized field)

In this case, I think it does not worth maintaining the workflow API, I will choose the Data API

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 13, 2022

➤ PJ commented:

OK, 今天會完成給0xAvenue的spec跟提交QA Test

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 13, 2022

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Apr 13, 2022

➤ PJ commented:

Tammy Yang 沒問題,會做類似這樣的

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 10, 2022

➤ Tammy Yang commented:

PJ 請問這個 task 完成了嗎

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 19, 2022

➤ PJ commented:

0xAvenue Network Action:

User clicks capture → More Network Action → 0xAvenue Action

When confirm, Redirects to https://www.0xavenue.io/launch?cid={cid}&order_id={order_id} ( https://www.0xavenue.io/launch?cid={cid}&order_id={order_id} )
and 0xAvenue can fetch the order information by
GET https://numbers-upvote.bubbleapps.io/version-qa-release/api/1.1/obj/Order/?constraints=[{"key": "order_id", "constraint_type": "text contains", "value": "{order_id}"}]

and the result_url will be https://0xavenue.io/launch/?channel=numbers&order_id={order_id}

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 19, 2022

➤ Tammy Yang commented:

Wiki: https://github.com/numbersprotocol/enterprise-service/wiki/3.-Capture-Network-Action ( https://github.com/numbersprotocol/enterprise-service/wiki/3.-Capture-Network-Action )

PJ the information you provide is very good. Can you please add them to wiki as well? (remove 0xaveneue and make it more general)

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 19, 2022

➤ Tammy Yang commented:

Sherry Chung let us know if you need anything more

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 19, 2022

➤ PJ commented:

Sherry ChungTammy Yang 這邊有一個問題,0xAvenue希望我們打過去的url是

https://www.0xavenue.io/launch?channel=numbers&order_id={order_id} ( https://www.0xavenue.io/launch?channel=numbers&order_id={order_id} )
但因為Capture App code寫死了,只能打
https://www.0xavenue.io/launch?cid={cid}&order_id={order_id} ( https://www.0xavenue.io/launch?cid={cid}&order_id={order_id} )
或是
https://www.0xavenue.io/launch/numbers?cid={cid}&order_id={order_id} ( https://www.0xavenue.io/launch?cid={cid}&order_id={order_id} )

如果要配合他們,需要在App端修改,或是跟他們開會討論

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 19, 2022

➤ PJ commented:

Tammy Yang 可以,但我目前不確定這版是不是最終版

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 19, 2022

➤ PJ commented:

我會先送QA 測試
能夠正常redirect → 0xAvenue
搜尋order功能正常
正常呈現result url

如果正常的話,再跟對方討論url細節

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 19, 2022

➤ Sherry Chung commented:

PJ url 的部分你提議的 1 or 2 都可以。如果我們沒有其他考量,我建議 #2

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 19, 2022

➤ PJ commented:

Sherry Chung那我改成2的模式,連同result_url一起更改為一致囉

capture app would open this page in browser when action triggers:
https://www.0xavenue.io/launch/numbers?cid={cid}&order_id={order_id} ( https://www.0xavenue.io/launch?cid={cid}&order_id={order_id} )

and the result for printing merch would be the same
https://www.0xavenue.io/launch/numbers?cid={cid}&order_id={order_id} ( https://www.0xavenue.io/launch?cid={cid}&order_id={order_id} )

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 19, 2022

➤ Tammy Yang commented:

PJ 不是,是希望例如說明

  • Receiving side: accept ?cid={cid}&order_id={order=id} from URL, the use the cid and order ID to query, here is the example

類似這樣

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 19, 2022

➤ PJ commented:

updated document.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 27, 2022

➤ PJ commented:

0527 更新lambda proxy for data api
傳送資料給0xAvenue的部分相同
0xAvenue 可以透過
curl --location --request GET 'https://lambda.numbersprotocol.io/order/Network-Action-Order?order_id= ( https://lambda.numbersprotocol.io/order/Network-Action-Order?order_id=661c7104-a022-437c-b28d-bb5d7e9a8dc5 ){order_id}'
--header 'x-api-key: xMLFP6QDxt2i1CvokqYy98LlSzy2kfbr8Y7Bii1b'
來取得order_id資訊

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 27, 2022

➤ Scott Yan commented:

Sherry Chung 0527 qa 測試通過
如果對方需要可以提供一個 demo 用的 order id : 3540b705-2576-4474-8fd2-7251297fb938 讓對方實際取得一次 order 內容
uid_text = 他們需要的 wallet address
asset_id_text = 他們需要的 cid

@sync-by-unito sync-by-unito bot closed this as completed May 30, 2022
@sync-by-unito
Copy link
Author

sync-by-unito bot commented Jun 1, 2022

➤ Sherry Chung commented:

PJ 抱歉我詢問一下你之前的訊息

Sherry Chung那我改成2的模式

capture app would open this page in browser when action triggers:
https://www.0xavenue.io/launch/numbers?cid={cid}&order_id={order_id} ( https://www.0xavenue.io/launch?cid={cid}&order_id={order_id} )
and the result for printing merch would be
https://www.0xavenue.io/launch/numbers?order_id={order_id} ( https://www.0xavenue.io/launch?order_id={order_id} )

這兩個網址是我們已經確定的,我需要提供給對方工程師的嗎? 所以對方需要建立這兩個網頁? 還是第二個網址是 Optional ?

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Jun 1, 2022

➤ PJ commented:

Sherry Chung Optional, 可以統一採第一個的格式沒問題

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants