Skip to content

Commit

Permalink
Commit from m3o/m3o action
Browse files Browse the repository at this point in the history
  • Loading branch information
m3o-actions committed Sep 22, 2023
1 parent 496a0cf commit 4eefd84
Show file tree
Hide file tree
Showing 27 changed files with 1,114 additions and 1,114 deletions.
46 changes: 23 additions & 23 deletions examples/ai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Ai/api](https:

Endpoints:

## Moderate

Moderate hate speech


[https://m3o.com/ai/api#Moderate](https://m3o.com/ai/api#Moderate)

```js
const { AiService } = require('m3o/ai');

const aiService = new AiService(process.env.M3O_API_TOKEN)

// Moderate hate speech
async function moderateHateSpeech() {
const rsp = await aiService.moderate({
"text": "I want to kill him"
})
console.log(rsp)

}

moderateHateSpeech()
```
## Chat

Make a request to ChatGPT
Expand Down Expand Up @@ -155,3 +132,26 @@ async function generateImage() {

generateImage()
```
## Moderate

Moderate hate speech


[https://m3o.com/ai/api#Moderate](https://m3o.com/ai/api#Moderate)

```js
const { AiService } = require('m3o/ai');

const aiService = new AiService(process.env.M3O_API_TOKEN)

// Moderate hate speech
async function moderateHateSpeech() {
const rsp = await aiService.moderate({
"text": "I want to kill him"
})
console.log(rsp)

}

moderateHateSpeech()
```
138 changes: 69 additions & 69 deletions examples/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,163 +4,162 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/App/api](https

Endpoints:

## Update
## List

Update the app. The latest source code will be downloaded, built and deployed.
List all the apps


[https://m3o.com/app/api#Update](https://m3o.com/app/api#Update)
[https://m3o.com/app/api#List](https://m3o.com/app/api#List)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Update the app. The latest source code will be downloaded, built and deployed.
async function updateAnApp() {
const rsp = await appService.update({
"name": "helloworld"
})
// List all the apps
async function listTheApps() {
const rsp = await appService.list({})
console.log(rsp)

}

updateAnApp()
listTheApps()
```
## Get
## Regions

Get an app by name
Return the support regions


[https://m3o.com/app/api#Get](https://m3o.com/app/api#Get)
[https://m3o.com/app/api#Regions](https://m3o.com/app/api#Regions)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Get an app by name
async function getAnApp() {
const rsp = await appService.get({
"name": "helloworld"
})
// Return the support regions
async function listRegions() {
const rsp = await appService.regions({})
console.log(rsp)

}

getAnApp()
listRegions()
```
## List
## Resolve

List all the apps
Resolve an app by id to its raw backend endpoint


[https://m3o.com/app/api#List](https://m3o.com/app/api#List)
[https://m3o.com/app/api#Resolve](https://m3o.com/app/api#Resolve)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// List all the apps
async function listTheApps() {
const rsp = await appService.list({})
// Resolve an app by id to its raw backend endpoint
async function resolveAppById() {
const rsp = await appService.resolve({
"id": "helloworld"
})
console.log(rsp)

}

listTheApps()
resolveAppById()
```
## Regions
## Update

Return the support regions
Update the app. The latest source code will be downloaded, built and deployed.


[https://m3o.com/app/api#Regions](https://m3o.com/app/api#Regions)
[https://m3o.com/app/api#Update](https://m3o.com/app/api#Update)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Return the support regions
async function listRegions() {
const rsp = await appService.regions({})
// Update the app. The latest source code will be downloaded, built and deployed.
async function updateAnApp() {
const rsp = await appService.update({
"name": "helloworld"
})
console.log(rsp)

}

listRegions()
updateAnApp()
```
## Status
## Delete

Get the status of an app
Delete an app


[https://m3o.com/app/api#Status](https://m3o.com/app/api#Status)
[https://m3o.com/app/api#Delete](https://m3o.com/app/api#Delete)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Get the status of an app
async function getTheStatusOfAnApp() {
const rsp = await appService.status({
// Delete an app
async function deleteAnApp() {
const rsp = await appService.delete({
"name": "helloworld"
})
console.log(rsp)

}

getTheStatusOfAnApp()
deleteAnApp()
```
## Logs
## Reserve

Get the logs for an app
Reserve app names


[https://m3o.com/app/api#Logs](https://m3o.com/app/api#Logs)
[https://m3o.com/app/api#Reserve](https://m3o.com/app/api#Reserve)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Get the logs for an app
async function retrieveBuildLogsForAnApp() {
const rsp = await appService.logs({
"logs_type": "build",
// Reserve app names
async function reserveAppName() {
const rsp = await appService.reserve({
"name": "helloworld"
})
console.log(rsp)

}

retrieveBuildLogsForAnApp()
reserveAppName()
```
## Reserve
## Get

Reserve app names
Get an app by name


[https://m3o.com/app/api#Reserve](https://m3o.com/app/api#Reserve)
[https://m3o.com/app/api#Get](https://m3o.com/app/api#Get)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Reserve app names
async function reserveAppName() {
const rsp = await appService.reserve({
// Get an app by name
async function getAnApp() {
const rsp = await appService.get({
"name": "helloworld"
})
console.log(rsp)

}

reserveAppName()
getAnApp()
```
## Run

Expand Down Expand Up @@ -189,49 +188,50 @@ async function runAnApp() {

runAnApp()
```
## Resolve
## Status

Resolve an app by id to its raw backend endpoint
Get the status of an app


[https://m3o.com/app/api#Resolve](https://m3o.com/app/api#Resolve)
[https://m3o.com/app/api#Status](https://m3o.com/app/api#Status)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Resolve an app by id to its raw backend endpoint
async function resolveAppById() {
const rsp = await appService.resolve({
"id": "helloworld"
// Get the status of an app
async function getTheStatusOfAnApp() {
const rsp = await appService.status({
"name": "helloworld"
})
console.log(rsp)

}

resolveAppById()
getTheStatusOfAnApp()
```
## Delete
## Logs

Delete an app
Get the logs for an app


[https://m3o.com/app/api#Delete](https://m3o.com/app/api#Delete)
[https://m3o.com/app/api#Logs](https://m3o.com/app/api#Logs)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Delete an app
async function deleteAnApp() {
const rsp = await appService.delete({
// Get the logs for an app
async function retrieveBuildLogsForAnApp() {
const rsp = await appService.logs({
"logs_type": "build",
"name": "helloworld"
})
console.log(rsp)

}

deleteAnApp()
retrieveBuildLogsForAnApp()
```
46 changes: 23 additions & 23 deletions examples/bitcoin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Bitcoin/api](h

Endpoints:

## Transaction

Get transaction details by hash


[https://m3o.com/bitcoin/api#Transaction](https://m3o.com/bitcoin/api#Transaction)

```js
const { BitcoinService } = require('m3o/bitcoin');

const bitcoinService = new BitcoinService(process.env.M3O_API_TOKEN)

// Get transaction details by hash
async function getAbitcoinTransaction() {
const rsp = await bitcoinService.transaction({
"hash": "f854aebae95150b379cc1187d848d58225f3c4157fe992bcd166f58bd5063449"
})
console.log(rsp)

}

getAbitcoinTransaction()
```
## Price

Get the price of bitcoin
Expand Down Expand Up @@ -73,26 +96,3 @@ async function lookupTransactionsByAddress() {

lookupTransactionsByAddress()
```
## Transaction

Get transaction details by hash


[https://m3o.com/bitcoin/api#Transaction](https://m3o.com/bitcoin/api#Transaction)

```js
const { BitcoinService } = require('m3o/bitcoin');

const bitcoinService = new BitcoinService(process.env.M3O_API_TOKEN)

// Get transaction details by hash
async function getAbitcoinTransaction() {
const rsp = await bitcoinService.transaction({
"hash": "f854aebae95150b379cc1187d848d58225f3c4157fe992bcd166f58bd5063449"
})
console.log(rsp)

}

getAbitcoinTransaction()
```
Loading

0 comments on commit 4eefd84

Please sign in to comment.