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

chore: Swapping Postman with Bruno #2422

Merged
merged 17 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ Dockerfile
commitlint.config.js
jest.config.base.js
renovate.json
postman
.postman
bruno

**/jest.config.js
**/jest.setup.js
Expand Down
4 changes: 1 addition & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ public
**/generated
dist
build
postman-scripts
postman
.postman
bruno
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ Checklist items become clickable check boxes once the pull request is created. T
- [ ] Tests added/updated
- [ ] Documentation added
- [ ] Make sure that all checks pass
- [ ] Postman collection updated
- [ ] Bruno collection updated
18 changes: 0 additions & 18 deletions .github/workflows/postman-publish-main.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/postman-publish-tag.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/postman-publish.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .postman/api

This file was deleted.

20 changes: 0 additions & 20 deletions .postman/api_84fc90ca-3153-4865-8b49-b91218e5d574

This file was deleted.

2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,5 @@ build
**/styles/*.css
.docusaurus
.cache-loader
postman
.postman
packages/documentation/src/content/docs/apis
.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
meta {
name: Create Outgoing Payment
type: graphql
seq: 3
}

post {
url: {{RafikiGraphqlHost}}/graphql
body: graphql
auth: none
}

body:graphql {
mutation CreateOutgoingPayment($input: CreateOutgoingPaymentInput!) {
createOutgoingPayment(input: $input) {
code
message
payment {
createdAt
error
metadata
id
walletAddressId
receiveAmount {
assetCode
assetScale
value
}
receiver
debitAmount {
assetCode
assetScale
value
}
sentAmount {
assetCode
assetScale
value
}
state
stateAttempts
}
success
}
}
}

body:graphql:vars {
{
"input": {
"walletAddressId": "{{gfranklinWalletAddressId}}",
"quoteId": "{{quoteId}}"
}
}
}

script:post-response {
const body = res.getBody();

bru.setEnvVar("outgoingPaymentId", body.data.createOutgoingPayment.payment.id);
}

tests {
test("Outgoing Payment id is string", function() {
expect(bru.getEnvVar("outgoingPaymentId")).to.be.a("string");
})
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
meta {
name: Create Quote
type: graphql
seq: 2
}

post {
url: {{RafikiGraphqlHost}}/graphql
body: graphql
auth: none
}

body:graphql {
mutation CreateQuote($input: CreateQuoteInput!) {
createQuote(input: $input) {
code
message
quote {
createdAt
expiresAt
highEstimatedExchangeRate
id
lowEstimatedExchangeRate
maxPacketAmount
minExchangeRate
walletAddressId
receiveAmount {
assetCode
assetScale
value
}
receiver
debitAmount {
assetCode
assetScale
value
}
}
}
}
}

body:graphql:vars {
{
"input": {
"walletAddressId": "{{gfranklinWalletAddressId}}",
"receiver": "{{receiverId}}"
}
}
}

script:pre-request {
const scripts = require('./scripts/scripts');

await scripts.getWalletAddressId('RafikiGraphqlHost', 'Grace Franklin', 'gfranklinWalletAddressId');
}

script:post-response {
const body = res.getBody();

bru.setEnvVar("quoteId", body.data.createQuote.quote.id);
}

tests {
test("Quote id is string", function() {
expect(bru.getEnvVar("quoteId")).to.be.a("string");
})
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
meta {
name: Create Receiver (remote Incoming Payment)
type: graphql
seq: 1
}

post {
url: {{RafikiGraphqlHost}}/graphql
body: graphql
auth: none
}

body:graphql {
mutation CreateReceiver($input: CreateReceiverInput!) {
createReceiver(input: $input) {
code
message
receiver {
completed
createdAt
expiresAt
metadata
id
incomingAmount {
assetCode
assetScale
value
}
walletAddressUrl
receivedAmount {
assetCode
assetScale
value
}
updatedAt
}
success
}
}
}

body:graphql:vars {
{
"input": {
"metadata": {
"description": "cross-currency"
},
"incomingAmount": {
"assetCode": "EUR",
"assetScale": 2,
"value": 500
},
"walletAddressUrl": "https://happy-life-bank-backend/accounts/lars"
}
}
}

script:post-response {
const body = res.getBody();

bru.setEnvVar("receiverId", body.data.createReceiver.receiver.id);
}

tests {
test("Receiver id is string", function() {
expect(bru.getEnvVar("receiverId")).to.be.a("string");
})
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
meta {
name: Get Outgoing Payment
type: graphql
seq: 4
}

post {
url: {{RafikiGraphqlHost}}/graphql
body: graphql
auth: none
}

body:graphql {
query GetOutgoingPayment($id: String!) {
outgoingPayment(id: $id) {
createdAt
error
metadata
id
walletAddressId
quote {
id
}
receiveAmount {
assetCode
assetScale
value
}
receiver
debitAmount {
assetCode
assetScale
value
}
sentAmount {
assetCode
assetScale
value
}
state
stateAttempts
}
}
}

body:graphql:vars {
{
"id": "{{outgoingPaymentId}}"
}
}
Loading
Loading