mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-24 17:44:50 +03:00
saving work
This commit is contained in:
parent
280746bec3
commit
7900ec9fc8
@ -17,7 +17,7 @@ Slate is the first open source file storage application designed to encourage co
|
||||
|
||||
Slate is tightly scoped for the present and more broadly thought out for the future. Our primary objective is to create a best-in-class experience for uploading, collecting, and sharing media. Additional filetypes will be supported, but our focus is to start with the pieces that apply to everyone and then dial into more specific formats.
|
||||
|
||||
- Example slate: https://slate.host/tara/loom
|
||||
- Example collection: https://slate.host/tara/loom
|
||||
- Example user profile: https://slate.host/gndclouds
|
||||
- New brand: https://slate.host/narative/slate-brand-identity
|
||||
- Monet on Filecoin: https://slate.host/slate/monet
|
||||
|
@ -65,56 +65,57 @@ export const error = {
|
||||
|
||||
//Add to slate
|
||||
SERVER_ADD_TO_SLATE_NO_SLATE:
|
||||
"We ran into issues while adding files to that slate. No slate was specified",
|
||||
SERVER_ADD_TO_SLATE_SLATE_NOT_FOUND: "We're having trouble locating that slate right now",
|
||||
"We ran into issues while adding files to that collection. No collection was specified",
|
||||
SERVER_ADD_TO_SLATE_SLATE_NOT_FOUND: "We're having trouble locating that collection right now",
|
||||
SERVER_ADD_TO_SLATE_NO_FILES:
|
||||
"We ran into issues while adding files to that slate. No files selected",
|
||||
SERVER_ADD_TO_SLATE_FAILED: "We're having trouble adding those files to that slate right now",
|
||||
"We ran into issues while adding files to that collection. No files selected",
|
||||
SERVER_ADD_TO_SLATE_FAILED:
|
||||
"We're having trouble adding those files to that collection right now",
|
||||
|
||||
//Slate create
|
||||
SERVER_CREATE_SLATE_EXISTING_SLATE_NAME:
|
||||
"You already have a slate with that name. Slate names must be unique",
|
||||
"You already have a collection with that name. Collection names must be unique",
|
||||
SERVER_CREATE_SLATE_FAILED:
|
||||
"We are having trouble creating that slate right now, please try again later",
|
||||
"We are having trouble creating that collection right now, please try again later",
|
||||
|
||||
//Slate delete
|
||||
SERVER_DELETE_SLATE_SLATE_NOT_FOUND:
|
||||
"We're having difficulty locating that slate. It may have already been deleted",
|
||||
"We're having difficulty locating that collection. It may have already been deleted",
|
||||
SERVER_DELETE_SLATE_FAILED:
|
||||
"We're having trouble deleting that slate right now, please try again later",
|
||||
"We're having trouble deleting that collection right now, please try again later",
|
||||
|
||||
//Get slate
|
||||
SERVER_GET_SERIALIZED_SLATE_SLATE_NOT_FOUND:
|
||||
"We were unable to locate that slate. It may be private or it may not exist",
|
||||
"We were unable to locate that collection. It may be private or it may not exist",
|
||||
SERVER_GET_SERIALIZED_SLATE_PRIVATE_ACCESS_DENIED:
|
||||
"We were unable to locate that slate. It may be private or it may not exist",
|
||||
"We were unable to locate that collection. It may be private or it may not exist",
|
||||
SERVER_GET_SLATE_NOT_FOUND:
|
||||
"We were unable to locate that slate. It may be private or it may not exist",
|
||||
"We were unable to locate that collection. It may be private or it may not exist",
|
||||
SERVER_GET_SLATE_PRIVATE_ACCESS_DENIED:
|
||||
"We were unable to locate that slate. It may be private or it may not exist",
|
||||
"We were unable to locate that collection. It may be private or it may not exist",
|
||||
|
||||
//Remove from slate
|
||||
SERVER_REMOVE_FROM_SLATE_NO_ID_PROVIDED:
|
||||
"Unable to remove from slate because no slate was specified",
|
||||
SERVER_REMOVE_FROM_SLATE_SLATE_NOT_FOUND: "We are having trouble locating that slate",
|
||||
SERVER_REMOVE_FROM_SLATE_FAILED: "We are having trouble removing from that slate right now",
|
||||
"Unable to remove from collection because no collection was specified",
|
||||
SERVER_REMOVE_FROM_SLATE_SLATE_NOT_FOUND: "We are having trouble locating that collection",
|
||||
SERVER_REMOVE_FROM_SLATE_FAILED: "We are having trouble removing from that collection right now",
|
||||
|
||||
//Update slate layout
|
||||
SERVER_UPDATE_SLATE_LAYOUT_MUST_PROVIDE_DATA: "No layout was provided to update",
|
||||
SERVER_UPDATE_SLATE_LAYOUT_NOT_FOUND: "We are having trouble locating that slate",
|
||||
SERVER_UPDATE_SLATE_LAYOUT_NOT_FOUND: "We are having trouble locating that collection",
|
||||
SERVER_UPDATE_SLATE_LAYOUT:
|
||||
"We are unable to update that slate's layout right now. Please try again later",
|
||||
"We are unable to update that collection's layout right now. Please try again later",
|
||||
|
||||
//Update slate
|
||||
SERVER_UPDATE_SLATE_MUST_PROVIDE_DATA:
|
||||
"We are unable to update that slate because no data was provided",
|
||||
SERVER_UPDATE_SLATE_NOT_FOUND: "We are having trouble locating that slate",
|
||||
"We are unable to update that collection because no data was provided",
|
||||
SERVER_UPDATE_SLATE_NOT_FOUND: "We are having trouble locating that collection",
|
||||
SERVER_UPDATE_SLATE_UPDATE_PRIVACY_FAILED:
|
||||
"We are having trouble updating the privacy of that slate",
|
||||
SERVER_UPDATE_SLATE_INVALID_NAME: "Please use a valid slate name",
|
||||
"We are having trouble updating the privacy of that collection",
|
||||
SERVER_UPDATE_SLATE_INVALID_NAME: "Please use a valid collection name",
|
||||
SERVER_UPDATE_SLATE_NAME_TAKEN:
|
||||
"You already have a slate with that name. Slate names must be unique",
|
||||
SERVER_UPDATE_SLATE_FAILED: "We are having trouble updating that slate right now",
|
||||
"You already have a collection with that name. Collection names must be unique",
|
||||
SERVER_UPDATE_SLATE_FAILED: "We are having trouble updating that collection right now",
|
||||
|
||||
//Create user
|
||||
SERVER_CREATE_USER_NOT_ALLOWED: "You can only create users while on slate.host",
|
||||
@ -171,10 +172,10 @@ export const error = {
|
||||
SERVER_SIGN_IN_WRONG_PASSWORD: "We were unable to locate that account with those credentials",
|
||||
|
||||
//Subscribe
|
||||
SERVER_SUBSCRIBE_MUST_PROVIDE_SLATE_OR_USER: "No slate or user to follow specified",
|
||||
SERVER_SUBSCRIBE_MUST_PROVIDE_SLATE_OR_USER: "No collection or user to follow specified",
|
||||
SERVER_SUBSCRIBE_CAN_NOT_SUBSCRIBE_TO_YOURSELF: "You cannot follow yourself",
|
||||
SERVER_SUBSCRIBE_TARGET_USER_NOT_FOUND: "We are unable to locate that user",
|
||||
SERVER_SUBSCRIBE_TARGET_SLATE_NOT_FOUND: "We are unable to locate that slate",
|
||||
SERVER_SUBSCRIBE_TARGET_SLATE_NOT_FOUND: "We are unable to locate that collection",
|
||||
SERVER_SUBSCRIBE_SUBSCRIPTION_CHECK_ERROR:
|
||||
"We are having trouble editing that subscription right now",
|
||||
SERVER_UNSUBSCRIBE_FAILED: "We were unable to unsubscribe, please try again later",
|
||||
|
@ -57,15 +57,15 @@ export const navigation = [
|
||||
{
|
||||
id: "NAV_SLATES",
|
||||
decorator: "SLATES",
|
||||
name: "Slates",
|
||||
pageTitle: "Slates",
|
||||
name: "Collections",
|
||||
pageTitle: "Collections",
|
||||
ignore: true,
|
||||
},
|
||||
{
|
||||
id: "NAV_SLATES_FOLLOWING",
|
||||
decorator: "SLATES_FOLLOWING",
|
||||
name: "Slates",
|
||||
pageTitle: "Slates",
|
||||
name: "Collections following",
|
||||
pageTitle: "Collections following",
|
||||
ignore: true,
|
||||
},
|
||||
{
|
||||
@ -84,8 +84,8 @@ export const navigation = [
|
||||
{
|
||||
id: "NAV_SLATE",
|
||||
decorator: "SLATE",
|
||||
name: "Slate",
|
||||
pageTitle: "Slate",
|
||||
name: "Collection",
|
||||
pageTitle: "Collection",
|
||||
ignore: true,
|
||||
},
|
||||
{
|
||||
|
@ -114,7 +114,9 @@ export const getCIDFromIPFS = (url) => {
|
||||
};
|
||||
|
||||
export const formatAsUploadMessage = (added, skipped, slate = false) => {
|
||||
let message = `${added || 0} file${added !== 1 ? "s" : ""} uploaded${slate ? " to slate" : ""}. `;
|
||||
let message = `${added || 0} file${added !== 1 ? "s" : ""} uploaded${
|
||||
slate ? " to collection" : ""
|
||||
}. `;
|
||||
if (skipped) {
|
||||
message += `${skipped || 0} duplicate / existing file${
|
||||
added !== 1 ? "s were" : " was"
|
||||
|
@ -13,7 +13,7 @@ const EXAMPLE_CODE_JS = (
|
||||
Authorization: 'Basic ${key}',
|
||||
},
|
||||
body: JSON.stringify({ data: {
|
||||
id: '${slateId}' // slate ID
|
||||
id: '${slateId}' // collection ID
|
||||
}})
|
||||
});
|
||||
|
||||
@ -25,7 +25,7 @@ const json = await response.json();
|
||||
if (json.error) {
|
||||
console.log(json.error);
|
||||
} else {
|
||||
const slate = json.slate;
|
||||
const collection = json.slate;
|
||||
}`;
|
||||
|
||||
const EXAMPLE_CODE_PY = (key, slateId) => `import requests
|
||||
@ -39,7 +39,7 @@ headers = {
|
||||
|
||||
json = {
|
||||
"data": {
|
||||
"id": "${slateId}" # slate ID
|
||||
"id": "${slateId}" # collection ID
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,14 +60,14 @@ export default class APIDocsGetSlate extends React.Component {
|
||||
<React.Fragment>
|
||||
<System.DescriptionGroup
|
||||
style={{ maxWidth: 640, marginTop: 64 }}
|
||||
label="Get slate by ID"
|
||||
description="This API request will return a specific slate. You can save the response locally and send this JSON back to our API server using the route /api/v1/update-slate to update your slate."
|
||||
label="Get collection by ID"
|
||||
description="This API request will return a specific collection. You can save the response locally and send this JSON back to our API server using the route /api/v1/update-slate to update your collection."
|
||||
/>
|
||||
<CodeBlock
|
||||
children={code}
|
||||
style={{ maxWidth: "820px" }}
|
||||
language={language}
|
||||
title="Get slate by ID"
|
||||
title="Get collection by ID"
|
||||
onLanguageChange={this.props.onLanguageChange}
|
||||
multiLang="true"
|
||||
/>
|
||||
|
@ -10,7 +10,7 @@ const EXAMPLE_CODE_JS = (key) => `const response = await fetch('https://slate.ho
|
||||
Authorization: 'Basic ${key}',
|
||||
},
|
||||
body: JSON.stringify({ data: {
|
||||
private: false // set private = true to include private slates
|
||||
private: false // set private = true to include private collections
|
||||
}})
|
||||
});
|
||||
|
||||
@ -22,7 +22,7 @@ const json = await response.json();
|
||||
if (json.error) {
|
||||
console.log(json.error);
|
||||
} else {
|
||||
const slates = json.slates;
|
||||
const collections = json.slates;
|
||||
const user = json.user;
|
||||
}`;
|
||||
|
||||
@ -37,7 +37,7 @@ headers = {
|
||||
|
||||
json = {
|
||||
"data": {
|
||||
"private": "false" # set private = true to include private slates
|
||||
"private": "false" # set private = true to include private collections
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ const EXAMPLE_RESPONSE = `
|
||||
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
|
||||
"slatename": "public-example",
|
||||
"data": {
|
||||
"body": "just a public slate, nothing special",
|
||||
"body": "just a public collection, nothing special",
|
||||
"name": "Public Example",
|
||||
"public": true,
|
||||
"layouts": {
|
||||
@ -114,7 +114,7 @@ export default class APIDocsGet extends React.Component {
|
||||
<System.DescriptionGroup
|
||||
style={{ maxWidth: 640, marginTop: 64 }}
|
||||
label="Get your data"
|
||||
description="This API request returns your user data and slates. If the request body is omitted, the request will return only your public slates by default."
|
||||
description="This API request returns your user data and collections. If the request body is omitted, the request will return only your public collections by default."
|
||||
/>
|
||||
<CodeBlock
|
||||
children={code}
|
||||
|
@ -4,12 +4,12 @@ import * as System from "~/components/system";
|
||||
import CodeBlock from "~/components/system/CodeBlock";
|
||||
|
||||
const EXAMPLE_CODE_JS = (key, slateId) => {
|
||||
return `const SLATE_ID = "${slateId}"
|
||||
return `const COLLECTION_ID = "${slateId}"
|
||||
|
||||
const slateResponseData = getSlateById(SLATE_ID);
|
||||
const collectionResponseData = getCollectionById(COLLECTION_ID);
|
||||
|
||||
const slate = slateResponseData.slate;
|
||||
slate.data.name = "New title"
|
||||
const collection = collectionResponseData.slate;
|
||||
collection.data.name = "New title"
|
||||
|
||||
const response = await fetch('https://slate.host/api/v1/update-slate', {
|
||||
method: 'POST',
|
||||
@ -17,7 +17,7 @@ const response = await fetch('https://slate.host/api/v1/update-slate', {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Basic ${key}', // API key
|
||||
},
|
||||
body: JSON.stringify({ data: slate })
|
||||
body: JSON.stringify({ data: collection })
|
||||
});`;
|
||||
};
|
||||
|
||||
@ -31,17 +31,17 @@ headers = {
|
||||
|
||||
json = { "id": "${slateId}" } # slate ID
|
||||
|
||||
get_slate = requests.post(
|
||||
get_collection = requests.post(
|
||||
"https://slate.host/api/v1/get-slate", headers=headers, json=json
|
||||
)
|
||||
|
||||
get_slate_response = get_slate.json()
|
||||
get_collection_response = get_collection.json()
|
||||
|
||||
|
||||
slate = get_slate_response["slate"]
|
||||
slate["data"]["name"] = "New title"
|
||||
collection = get_collection_response["slate"]
|
||||
collection["data"]["name"] = "New title"
|
||||
|
||||
postJson = { "data": slate }
|
||||
postJson = { "data": collection }
|
||||
|
||||
url = "https://slate.host/api/v1/update-slate"
|
||||
|
||||
@ -61,14 +61,14 @@ export default class APIDocsUpdateSlate extends React.Component {
|
||||
<React.Fragment>
|
||||
<System.DescriptionGroup
|
||||
style={{ maxWidth: 640, marginTop: 64 }}
|
||||
label="Update slate"
|
||||
description="This API endpoint allows you to modify a slate by saving the response from get-slate, modifying it, and sending it back"
|
||||
label="Update collection"
|
||||
description="This API endpoint allows you to modify a collection by saving the response from get-slate, modifying it, and sending it back"
|
||||
/>
|
||||
<CodeBlock
|
||||
children={code}
|
||||
style={{ maxWidth: "820px" }}
|
||||
language={language}
|
||||
title="Update slate"
|
||||
title="Update collection"
|
||||
multiLang="true"
|
||||
onLanguageChange={this.props.onLanguageChange}
|
||||
/>
|
||||
|
@ -32,7 +32,7 @@ r = requests.post(url, headers=headers, files=files)`;
|
||||
const SLATE_EXAMPLE_CODE_JS = (
|
||||
key,
|
||||
slateId
|
||||
) => `const url = 'https://uploads.slate.host/api/public/${slateId}'; // slate ID
|
||||
) => `const url = 'https://uploads.slate.host/api/public/${slateId}'; // collection ID
|
||||
|
||||
let file = e.target.files[0];
|
||||
let data = new FormData();
|
||||
@ -48,7 +48,7 @@ const response = await fetch(url, {
|
||||
|
||||
const SLATE_EXAMPLE_CODE_PY = (key, slateId) => `import requests
|
||||
|
||||
url = "https://uploads.slate.host/api/public/${slateId}" # slate ID
|
||||
url = "https://uploads.slate.host/api/public/${slateId}" # collection ID
|
||||
files = {
|
||||
"file": open("example-file.txt", "rb")
|
||||
}
|
||||
@ -78,7 +78,7 @@ export default class APIDocsUploadToSlate extends React.Component {
|
||||
style={{ maxWidth: 640, marginTop: 64 }}
|
||||
label="Upload"
|
||||
description={
|
||||
"This API endpoint allows you to upload file(s) to your slate. This uses our data transfer microservice to interact with Textile Buckets and upload data to the IPFS/Filecoin network."
|
||||
"This API endpoint allows you to upload file(s) to your data. This uses our data transfer microservice to interact with Textile Buckets and upload data to the IPFS/Filecoin network."
|
||||
}
|
||||
/>
|
||||
<CodeBlock
|
||||
@ -94,7 +94,7 @@ export default class APIDocsUploadToSlate extends React.Component {
|
||||
children={slateUploadCode}
|
||||
style={{ maxWidth: "820px" }}
|
||||
language={language}
|
||||
title="Upload to slate"
|
||||
title="Upload"
|
||||
multiLang="true"
|
||||
onLanguageChange={this.props.onLanguageChange}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user