Compare commits

...

2 commits

Author SHA1 Message Date
Nicola Zambello f03d1227e5
add dashboard support api 2025-03-26 17:44:26 +02:00
Nicola Zambello c908425ca3
add environments 2025-03-26 17:44:16 +02:00
40 changed files with 651 additions and 0 deletions

View file

@ -0,0 +1,3 @@
vars {
baseUrl: http://localhost:7778
}

View file

@ -0,0 +1,3 @@
vars {
baseUrl: https://backend.memori.ai
}

View file

@ -0,0 +1,3 @@
vars {
baseUrl: https://backend-staging.memori.ai
}

View file

@ -0,0 +1,3 @@
vars {
baseUrl: https://backend.ai.wiit-cloud.io
}

View file

@ -0,0 +1,67 @@
meta {
name: Credits (userID)
type: http
seq: 2
}
post {
url: {{host}}/api/credits
body: json
auth: inherit
}
headers {
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0
}
body:json {
{
"tenant": "www.aisuru.com",
"userID": "262103a9-527b-4a82-b399-9b18bf3c42d8"
}
}
docs {
Verify credits and operations a user has enough tokens for.
Example:
```sh
http -v POST http://localhost:3000/api/credits userName=nicola tenant=aisuru-staging-tokenized.aclambda.online
http -v POST http://localhost:3000/api/credits userID=585ec0ff-e805-495e-b8fc-5b0b8dd288ff tenant=aisuru-staging-tokenized.aclambda.online
```
Returns:
```json
{
"outcome": {
"twin_creation": {
"cost": 1,
"permitted": true
},
"session_creation": {
"cost": 1,
"permitted": true
},
"dt_session_creation": {
"cost": 1,
"permitted": true
},
"gpt_messages": {
"cost": 1,
"permitted": true
},
"dt_gpt_messages": {
"cost": 3,
"permitted": false
},
"import_document": {
"cost": 6,
"permitted": false
}
},
"tokens": 1
}
```
}

View file

@ -0,0 +1,67 @@
meta {
name: Credits (username)
type: http
seq: 1
}
post {
url: {{host}}/api/credits
body: json
auth: inherit
}
headers {
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0
}
body:json {
{
"tenant": "www.aisuru.com",
"userName": "nzambello"
}
}
docs {
Verify credits and operations a user has enough tokens for.
Example:
```sh
http -v POST http://localhost:3000/api/credits userName=nicola tenant=aisuru-staging-tokenized.aclambda.online
http -v POST http://localhost:3000/api/credits userID=585ec0ff-e805-495e-b8fc-5b0b8dd288ff tenant=aisuru-staging-tokenized.aclambda.online
```
Returns:
```json
{
"outcome": {
"twin_creation": {
"cost": 1,
"permitted": true
},
"session_creation": {
"cost": 1,
"permitted": true
},
"dt_session_creation": {
"cost": 1,
"permitted": true
},
"gpt_messages": {
"cost": 1,
"permitted": true
},
"dt_gpt_messages": {
"cost": 3,
"permitted": false
},
"import_document": {
"cost": 6,
"permitted": false
}
},
"tokens": 1
}
```
}

View file

@ -0,0 +1,24 @@
meta {
name: Credits and stats
type: http
seq: 3
}
post {
url: {{host}}/api/credits-stats
body: json
auth: inherit
}
headers {
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0
}
body:json {
{
"authToken": "fd10bb42-98d9-4c08-8e02-2b08bd4e4975",
"userID": "262103a9-527b-4a82-b399-9b18bf3c42d8",
"tenant": "www.aisuru.com",
"month": "2024.06"
}
}

View file

@ -0,0 +1,20 @@
meta {
name: Verify tokens (agent creation)
type: http
seq: 4
}
post {
url: {{host}}/api/verify-tokens
body: json
auth: inherit
}
body:json {
{
"operation": "twin_creation",
"userName": "nzambello", // userName OR userID
"userID": "262103a9-527b-4a82-b399-9b18bf3c42d8",
"tenant": "www.aisuru.com"
}
}

View file

@ -0,0 +1,21 @@
meta {
name: Verify tokens (import doc)
type: http
seq: 5
}
post {
url: {{host}}/api/verify-tokens
body: json
auth: inherit
}
body:json {
{
"operation": "import_document",
"userName": "nzambello", // userName OR userID
"userID": "262103a9-527b-4a82-b399-9b18bf3c42d8",
"tenant": "www.aisuru.com",
"characters": 300
}
}

View file

@ -0,0 +1,20 @@
meta {
name: Verify tokens (session creation)
type: http
seq: 6
}
post {
url: {{host}}/api/verify-tokens
body: json
auth: inherit
}
body:json {
{
"operation": "session_creation",
"userName": "nzambello", // userName OR userID
"userID": "262103a9-527b-4a82-b399-9b18bf3c42d8",
"tenant": "www.aisuru.com"
}
}

View file

@ -0,0 +1,3 @@
meta {
name: Billing / Credits
}

View file

@ -0,0 +1,65 @@
meta {
name: Image resize
type: http
seq: 2
}
get {
url: https://imgresize.memori.ai/api/imgresize/:width/:height/:url?format={{format}}&fit={{fit}}
body: none
auth: inherit
}
params:query {
format: {{format}}
fit: {{fit}}
}
params:path {
width: 200
height: 200
url: https%3A%2F%2Fmemori.ai%2Flogo.png
}
vars:pre-request {
format: png
fit: inside
}
docs {
# Image resize API
Endpoint: [https://imgresize.memori.ai](https://imgresize.memori.ai).
Repo: [https://code.nzambello.dev/nzambello/resize-img-api](https://code.nzambello.dev/nzambello/resize-img-api).
# resize-img-api
The structure of the API path is:
```
/api/imgresize/:width/:height/:url
```
Where `:width` and `:height` can be numbers in pixels or `auto`.
The `:url` is the URL of the image to be resized and should be URL encoded, which can be done in JS with `encodeURIComponent`(). See [MDN ref](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent).
Example encoded URL for [https://memori.ai/logo.png](https://memori.ai/logo.png):
```
https%3A%2F%2Fmemori.ai%2Flogo.png
```
Then call the API as, for example:
```
/api/imgresize/200/200/https%3A%2F%2Fmemori.ai%2Flogo.png
```
You can also specify a format using the querystring `?format=` and indicating one of the following: `avif`, `gif`, `heif`, `jpeg`, `jpg`, `pdf`, `png`, `svg`, `tiff`, `webp`. (Note: Experimental!)
Another querystring parameter is `fit` which can be `cover`, `contain`, `fill`, `inside`, `outside` (Ref: [sharp](https://sharp.pixelplumbing.com/api-resize#resize)). Default is `inside`.
}

View file

@ -0,0 +1,11 @@
meta {
name: Azure Speech Key
type: http
seq: 9
}
get {
url: {{host}}/api/speechkey
body: none
auth: inherit
}

View file

@ -0,0 +1,29 @@
meta {
name: ConvertAPI Token
type: http
seq: 5
}
get {
url: {{host}}/api/convertapi-token
body: none
auth: inherit
}
docs {
# Generate ConvertAPI token
Calls ConvertAPI to generate a token
[https://www.convertapi.com/](https://www.convertapi.com/
)
Example:
```sh
http http://localhost:3000/api/convertapi-token
```
Ref: [https://www.convertapi.com/doc/auth](https://www.convertapi.com/doc/auth)
Returns: Token string
}

View file

@ -0,0 +1,28 @@
meta {
name: Feedback
type: http
seq: 6
}
post {
url: {{host}}/api/feedback
body: json
auth: inherit
}
headers {
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0
}
body:json {
{
"userID": "",
"userEmail": "",
"type": "bug",
"subject": "",
"text": "",
"tenant": "www.aisuru.com",
"captchaToken": "",
"userToken": ""
}
}

View file

@ -0,0 +1,15 @@
meta {
name: Functions middleware
type: http
seq: 1
}
get {
url: {{host}}/api/functions-middleware/:webhookUrl
body: none
auth: inherit
}
params:path {
webhookUrl:
}

View file

@ -0,0 +1,15 @@
meta {
name: Intents middleware
type: http
seq: 3
}
get {
url: {{host}}/api/webhook-middleware/:webhookUrl
body: none
auth: inherit
}
params:path {
webhookUrl:
}

View file

@ -0,0 +1,30 @@
meta {
name: Mail to followers
type: http
seq: 4
}
post {
url: {{host}}/api/mail2followers/:sessionID
body: json
auth: inherit
}
params:path {
sessionID:
}
headers {
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0
}
body:json {
{
"userEmail": "{{email}}",
"subject": "{{subject}}",
"message": "{{message}}",
"to": "{{to}}",
"twinName": "{{twinName}}",
"publicPageURL": "{{publicPageURL}}"
}
}

View file

@ -0,0 +1,16 @@
meta {
name: Public page manifest
type: http
seq: 2
}
get {
url: {{host}}/api/:userName/:memoriName/manifest.json
body: none
auth: inherit
}
params:path {
userName: nzambello
memoriName: Nicola
}

View file

@ -0,0 +1,3 @@
meta {
name: Internal
}

View file

@ -0,0 +1,15 @@
meta {
name: robots.txt (allowed)
type: http
seq: 9
}
get {
url: {{host}}/api/robots.txt
body: none
auth: inherit
}
headers {
host: www.aisuru.com
}

View file

@ -0,0 +1,15 @@
meta {
name: robots.txt (not allowed)
type: http
seq: 8
}
get {
url: {{host}}/api/robots.txt
body: none
auth: inherit
}
headers {
host: test.aclambda.online
}

View file

@ -0,0 +1,44 @@
meta {
name: Link preview
type: http
seq: 1
}
get {
url: {{host}}/api/linkpreview/:url
body: none
auth: inherit
}
params:path {
url: https%3A%2F%2Fmemori.ai
}
docs {
# Get link preview info
Uses [nzambello/link-previewer](https://github.com/nzambello/link-previewer).
Example:
```sh
http http://localhost:3000/api/linkpreview/https%3A%2F%2Frawmaterial.it%2Fen
```
Returns:
```json
{
"description": "RawMaterial is an innovative and emerging company at the forefront of providing sustainable web solutions and environmental consulting services for a sustainable, inclusive, equitable and community future.",
"favicon": "https://rawmaterial.it/favicon.ico",
"image": "https://rawmaterial.it/en/@@images/33b46076-8aca-430e-bdf5-4c6154d4a3a7.png",
"imageHeight": 295,
"imageWidth": 800,
"images": [
"https://rawmaterial.it/it/risorse/plone-logo.svg/@@images/image/icon",
"https://rawmaterial.it/it/risorse/rawmaterial-it.png/@@images/image/icon",
"https://rawmaterial.it/it/risorse/logo_treedom_friend_green.png/@@images/image/icon"
],
"title": "RawMaterial",
"videos": []
}
```
}

View file

@ -0,0 +1,15 @@
meta {
name: Tenant Data
type: http
seq: 4
}
get {
url: {{host}}/api/tenant/:tenantName
body: none
auth: inherit
}
params:path {
tenantName: www.aisuru.com
}

View file

@ -0,0 +1,16 @@
meta {
name: Media HTML viewer
type: http
seq: 1
}
get {
url: {{host}}/api/media?mimeType=image/png&url=https://memori.ai/logo.png
body: none
auth: inherit
}
params:query {
mimeType: image/png
url: https://memori.ai/logo.png
}

View file

@ -0,0 +1,15 @@
meta {
name: Privacy Page VR
type: http
seq: 2
}
get {
url: {{host}}/api/privacy_vr?lang=it
body: none
auth: inherit
}
params:query {
lang: it
}

View file

@ -0,0 +1,19 @@
meta {
name: VR Tutorial
type: http
seq: 3
}
get {
url: {{host}}/api/vrtutorial?lang=it
body: none
auth: inherit
}
params:query {
lang: it
}
headers {
accept-language: it-IT
}

View file

@ -0,0 +1,16 @@
meta {
name: VR vuplex
type: http
seq: 4
}
get {
url: {{host}}/api/vrvuplex?tenant=www.aisuru.com&lang=it
body: none
auth: inherit
}
params:query {
tenant: www.aisuru.com
lang: it
}

View file

@ -0,0 +1,3 @@
meta {
name: Virtual spaces / VR support
}

View file

@ -0,0 +1,11 @@
meta {
name: Lexicon map
type: http
seq: 1
}
get {
url: {{host}}/api/lexiconmap
body: none
auth: inherit
}

View file

@ -0,0 +1,3 @@
meta {
name: Widget support
}

View file

@ -0,0 +1,9 @@
{
"version": "1",
"name": "Memori Dashboard API",
"type": "collection",
"ignore": [
"node_modules",
".git"
]
}

View file

@ -0,0 +1,3 @@
vars {
host: http://localhost:3000
}

View file

@ -0,0 +1,3 @@
vars {
host: https://www.aisuru.com
}

View file

@ -0,0 +1,3 @@
vars {
host: https://aisuru-staging.aclambda.online
}

View file

@ -0,0 +1,3 @@
vars {
host: https://ai.wiit-cloud.io
}

View file

@ -0,0 +1,3 @@
vars {
baseUrl: http://localhost:7778
}

View file

@ -0,0 +1,3 @@
vars {
baseUrl: https://engine.memori.ai
}

View file

@ -0,0 +1,3 @@
vars {
baseUrl: https://backend.memori.ai
}

View file

@ -0,0 +1,3 @@
vars {
baseUrl: https://engine.ai.wiit-cloud.io
}