openprofile 0.1.1 → 0.1.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -8,7 +8,7 @@ const ready = (token, data) => ({
|
|
|
8
8
|
users: {
|
|
9
9
|
get: async (id) => {
|
|
10
10
|
try {
|
|
11
|
-
const response = await fetch(`https://auth.
|
|
11
|
+
const response = await fetch(`https://auth.openprofile.app/v2/accounts?id=${id}`, {
|
|
12
12
|
method: "GET", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${token}`}
|
|
13
13
|
}); if (!response.ok) {const text = await response.text(); throw new Error(`Failed to fetch user: ${response.status}, ${text}`);}
|
|
14
14
|
const data = await response.json();
|
|
@@ -20,7 +20,7 @@ const ready = (token, data) => ({
|
|
|
20
20
|
profiles: {
|
|
21
21
|
get: async (id, { read = false } = {}) => {
|
|
22
22
|
try {
|
|
23
|
-
const response = await fetch(`https://auth.
|
|
23
|
+
const response = await fetch(`https://auth.openprofile.app/v2/profiles?id=${id}&reading=${read}`, {
|
|
24
24
|
method: "GET", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${token}`}
|
|
25
25
|
}); if (!response.ok) {const text = await response.text(); throw new Error(`Failed to fetch profile: ${response.status}, ${text}`);}
|
|
26
26
|
let data = await response.json(); if (read) {data.values = accessor(data.values);}
|
|
@@ -34,7 +34,7 @@ const ready = (token, data) => ({
|
|
|
34
34
|
const op5 = {
|
|
35
35
|
login: async (id, token) => {
|
|
36
36
|
try {
|
|
37
|
-
const response = await fetch("https://auth.
|
|
37
|
+
const response = await fetch("https://auth.openprofile.app/v2/session", {
|
|
38
38
|
method: "POST", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${token}`}, body: JSON.stringify({ id, token })
|
|
39
39
|
}); if (!response.ok) {const text = await response.text(); throw new Error(`Login failed: ${response.status}, ${text}`);}
|
|
40
40
|
const data = await response.json(); const client = ready(token, data);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openprofile",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.101",
|
|
4
4
|
"description": "OpenProfile is a free original character database and collaboration platform made by and for writers.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"keywords": ["original character database", "OC database", "writing collaboration", "character creation tool", "worldbuilding platform", "writers' community" ,"roleplaying character storage", "digital character sheet", "OC management tool", "collaborative storytelling"],
|