mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-25 18:13:10 +03:00
api docs for upload by cid and url
This commit is contained in:
parent
10c663e7a5
commit
e739e63bf7
@ -58,9 +58,9 @@ export default class APIDocsGetSlate extends React.Component {
|
||||
};
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div css={this.props.cssValue} style={this.props.style}>
|
||||
<System.DescriptionGroup
|
||||
style={{ maxWidth: 640, marginTop: 48, ...this.props.style }}
|
||||
style={{ maxWidth: 640 }}
|
||||
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."
|
||||
/>
|
||||
@ -72,7 +72,7 @@ export default class APIDocsGetSlate extends React.Component {
|
||||
onLanguageChange={this.props.onLanguageChange}
|
||||
multiLang="true"
|
||||
/>
|
||||
</React.Fragment>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -116,9 +116,9 @@ export default class APIDocsGet extends React.Component {
|
||||
};
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div css={this.props.cssValue} style={this.props.style}>
|
||||
<System.DescriptionGroup
|
||||
style={{ maxWidth: 640, marginTop: 48, ...this.props.style }}
|
||||
style={{ maxWidth: 640 }}
|
||||
label="Get your data"
|
||||
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."
|
||||
/>
|
||||
@ -137,7 +137,7 @@ export default class APIDocsGet extends React.Component {
|
||||
language="json"
|
||||
title="Get your data response"
|
||||
/>
|
||||
</React.Fragment>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -58,9 +58,9 @@ export default class APIDocsUpdateSlate extends React.Component {
|
||||
python: EXAMPLE_CODE_PY(key, slateId),
|
||||
};
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div css={this.props.cssValue} style={this.props.style}>
|
||||
<System.DescriptionGroup
|
||||
style={{ maxWidth: 640, marginTop: 48, ...this.props.style }}
|
||||
style={{ maxWidth: 640 }}
|
||||
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"
|
||||
/>
|
||||
@ -72,7 +72,7 @@ export default class APIDocsUpdateSlate extends React.Component {
|
||||
multiLang="true"
|
||||
onLanguageChange={this.props.onLanguageChange}
|
||||
/>
|
||||
</React.Fragment>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -73,9 +73,9 @@ export default class APIDocsUploadToSlate extends React.Component {
|
||||
python: SLATE_EXAMPLE_CODE_PY(key, slateId),
|
||||
};
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div css={this.props.cssValue} style={this.props.style}>
|
||||
<System.DescriptionGroup
|
||||
style={{ maxWidth: 640, marginTop: 48, ...this.props.style }}
|
||||
style={{ maxWidth: 640 }}
|
||||
label="Upload"
|
||||
description={
|
||||
"This API endpoint allows you to upload a file to your data. This uses our data transfer microservice to interact with Textile Buckets and upload data to the IPFS/Filecoin network."
|
||||
@ -98,7 +98,7 @@ export default class APIDocsUploadToSlate extends React.Component {
|
||||
multiLang="true"
|
||||
onLanguageChange={this.props.onLanguageChange}
|
||||
/>
|
||||
</React.Fragment>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -53,9 +53,9 @@ export default class APIDocsCreateCollection extends React.Component {
|
||||
python: EXAMPLE_CODE_PY(key, slateId),
|
||||
};
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div css={this.props.cssValue} style={this.props.style}>
|
||||
<System.DescriptionGroup
|
||||
style={{ maxWidth: 640, marginTop: 48, ...this.props.style }}
|
||||
style={{ maxWidth: 640 }}
|
||||
label="Create Collection"
|
||||
description="This API endpoint allows you to create a collection. All fields except name are optional."
|
||||
/>
|
||||
@ -67,7 +67,7 @@ export default class APIDocsCreateCollection extends React.Component {
|
||||
multiLang="true"
|
||||
onLanguageChange={this.props.onLanguageChange}
|
||||
/>
|
||||
</React.Fragment>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -49,9 +49,9 @@ export default class APIDocsCreateLink extends React.Component {
|
||||
python: EXAMPLE_CODE_PY(key, slateId),
|
||||
};
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div css={this.props.cssValue} style={this.props.style}>
|
||||
<System.DescriptionGroup
|
||||
style={{ maxWidth: 640, marginTop: 48, ...this.props.style }}
|
||||
style={{ maxWidth: 640 }}
|
||||
label="Create link"
|
||||
description="This API endpoint allows you to upload a link and optionally add it to a slate. Include a slate id to add it to a slate."
|
||||
/>
|
||||
@ -63,7 +63,7 @@ export default class APIDocsCreateLink extends React.Component {
|
||||
multiLang="true"
|
||||
onLanguageChange={this.props.onLanguageChange}
|
||||
/>
|
||||
</React.Fragment>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -58,9 +58,9 @@ export default class APIDocsGetCollection extends React.Component {
|
||||
};
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div css={this.props.cssValue} style={this.props.style}>
|
||||
<System.DescriptionGroup
|
||||
style={{ maxWidth: 640, marginTop: 48, ...this.props.style }}
|
||||
style={{ maxWidth: 640 }}
|
||||
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/v2/update-collection to update your collection."
|
||||
/>
|
||||
@ -72,7 +72,7 @@ export default class APIDocsGetCollection extends React.Component {
|
||||
onLanguageChange={this.props.onLanguageChange}
|
||||
multiLang="true"
|
||||
/>
|
||||
</React.Fragment>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -58,9 +58,9 @@ export default class APIDocsGetUser extends React.Component {
|
||||
};
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div css={this.props.cssValue} style={this.props.style}>
|
||||
<System.DescriptionGroup
|
||||
style={{ maxWidth: 640, marginTop: 48, ...this.props.style }}
|
||||
style={{ maxWidth: 640 }}
|
||||
label="Get user by ID"
|
||||
description="This API request will return a specific user"
|
||||
/>
|
||||
@ -72,7 +72,7 @@ export default class APIDocsGetUser extends React.Component {
|
||||
onLanguageChange={this.props.onLanguageChange}
|
||||
multiLang="true"
|
||||
/>
|
||||
</React.Fragment>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -117,9 +117,9 @@ export default class APIDocsGet extends React.Component {
|
||||
};
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div css={this.props.cssValue} style={this.props.style}>
|
||||
<System.DescriptionGroup
|
||||
style={{ maxWidth: 640, marginTop: 48, ...this.props.style }}
|
||||
style={{ maxWidth: 640 }}
|
||||
label="Get your data"
|
||||
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."
|
||||
/>
|
||||
@ -138,7 +138,7 @@ export default class APIDocsGet extends React.Component {
|
||||
language="javascript"
|
||||
title="Get your data response"
|
||||
/>
|
||||
</React.Fragment>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -60,9 +60,9 @@ export default class APIDocsUpdateFile extends React.Component {
|
||||
python: EXAMPLE_CODE_PY(key, slateId),
|
||||
};
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div css={this.props.cssValue} style={this.props.style}>
|
||||
<System.DescriptionGroup
|
||||
style={{ maxWidth: 640, marginTop: 48, ...this.props.style }}
|
||||
style={{ maxWidth: 640 }}
|
||||
label="Update file"
|
||||
description="This API endpoint allows you to modify a file by saving the collection object in the response from get-collection, modifying it, and sending it back"
|
||||
/>
|
||||
@ -74,7 +74,7 @@ export default class APIDocsUpdateFile extends React.Component {
|
||||
multiLang="true"
|
||||
onLanguageChange={this.props.onLanguageChange}
|
||||
/>
|
||||
</React.Fragment>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -59,9 +59,9 @@ export default class APIDocsUpdateCollection extends React.Component {
|
||||
python: EXAMPLE_CODE_PY(key, slateId),
|
||||
};
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div css={this.props.cssValue} style={this.props.style}>
|
||||
<System.DescriptionGroup
|
||||
style={{ maxWidth: 640, marginTop: 48, ...this.props.style }}
|
||||
style={{ maxWidth: 640 }}
|
||||
label="Update collection"
|
||||
description="This API endpoint allows you to modify a collection by saving the response from get-collection, modifying it, and sending it back"
|
||||
/>
|
||||
@ -73,7 +73,7 @@ export default class APIDocsUpdateCollection extends React.Component {
|
||||
multiLang="true"
|
||||
onLanguageChange={this.props.onLanguageChange}
|
||||
/>
|
||||
</React.Fragment>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -74,10 +74,10 @@ export default class APIDocsUploadToSlate extends React.Component {
|
||||
python: SLATE_EXAMPLE_CODE_PY(key, slateId),
|
||||
};
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div css={this.props.cssValue} style={this.props.style}>
|
||||
<System.DescriptionGroup
|
||||
style={{ maxWidth: 640, marginTop: 48, ...this.props.style }}
|
||||
label="Upload file"
|
||||
style={{ maxWidth: 640 }}
|
||||
label="Upload File"
|
||||
description={
|
||||
"This API endpoint allows you to upload file(s) to your collection. This uses our data transfer microservice to interact with Textile Buckets and upload data to the IPFS/Filecoin network."
|
||||
}
|
||||
@ -99,7 +99,7 @@ export default class APIDocsUploadToSlate extends React.Component {
|
||||
multiLang="true"
|
||||
onLanguageChange={this.props.onLanguageChange}
|
||||
/>
|
||||
</React.Fragment>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,8 @@ import APIDocsUpdateFileV2 from "~/components/api-docs/v2/update-file.js";
|
||||
import APIDocsUploadToSlateV2 from "~/components/api-docs/v2/upload.js";
|
||||
import APIDocsCreateLinkV2 from "~/components/api-docs/v2/create-link.js";
|
||||
import APIDocsCreateCollectionV2 from "~/components/api-docs/v2/create-collection.js";
|
||||
import APIDocsUploadByCidV2 from "~/components/api-docs/v2/upload-by-cid.js";
|
||||
import APIDocsUploadByUrlV2 from "~/components/api-docs/v2/upload-by-url.js";
|
||||
import WebsitePrototypeWrapper from "~/components/core/WebsitePrototypeWrapper";
|
||||
|
||||
const STYLES_API_KEY = css`
|
||||
@ -50,6 +52,15 @@ const STYLES_KEY_CONTAINER = css`
|
||||
margin-bottom: 8px;
|
||||
`;
|
||||
|
||||
const STYLES_EXAMPLE = css`
|
||||
margin-bottom: 48px;
|
||||
`;
|
||||
|
||||
const STYLES_SECTION_HEADER = css`
|
||||
margin-top: 48px;
|
||||
margin-bottom: 24px;
|
||||
`;
|
||||
|
||||
class Key extends React.Component {
|
||||
_input;
|
||||
|
||||
@ -313,56 +324,73 @@ export default class SceneSettingsDeveloper extends React.Component {
|
||||
|
||||
{tab === "v2" ? (
|
||||
<>
|
||||
<System.H2 style={{ marginTop: 64 }}>Read operations</System.H2>
|
||||
<System.H2 css={STYLES_SECTION_HEADER}>Get</System.H2>
|
||||
<APIDocsGetV2
|
||||
style={{ marginTop: 24 }}
|
||||
cssValue={STYLES_EXAMPLE}
|
||||
language={lang}
|
||||
APIKey={APIKey}
|
||||
onLanguageChange={this._handleChangeLanguage}
|
||||
/>
|
||||
<APIDocsGetSlateV2
|
||||
cssValue={STYLES_EXAMPLE}
|
||||
language={lang}
|
||||
APIKey={APIKey}
|
||||
slateId={slateId}
|
||||
onLanguageChange={this._handleChangeLanguage}
|
||||
/>
|
||||
<APIDocsGetUserV2
|
||||
cssValue={STYLES_EXAMPLE}
|
||||
language={lang}
|
||||
APIKey={APIKey}
|
||||
userId={userId}
|
||||
onLanguageChange={this._handleChangeLanguage}
|
||||
/>
|
||||
|
||||
<System.H2 style={{ marginTop: 64 }}>Update operations</System.H2>
|
||||
<System.H2 css={STYLES_SECTION_HEADER}>Update</System.H2>
|
||||
<APIDocsUpdateSlateV2
|
||||
style={{ marginTop: 24 }}
|
||||
cssValue={STYLES_EXAMPLE}
|
||||
language={lang}
|
||||
APIKey={APIKey}
|
||||
slateId={slateId}
|
||||
onLanguageChange={this._handleChangeLanguage}
|
||||
/>
|
||||
<APIDocsUpdateFileV2
|
||||
cssValue={STYLES_EXAMPLE}
|
||||
language={lang}
|
||||
APIKey={APIKey}
|
||||
slateId={slateId}
|
||||
onLanguageChange={this._handleChangeLanguage}
|
||||
/>
|
||||
|
||||
<System.H2 style={{ marginTop: 64 }}>Create operations</System.H2>
|
||||
<System.H2 css={STYLES_SECTION_HEADER}>Create</System.H2>
|
||||
<APIDocsCreateCollectionV2
|
||||
style={{ marginTop: 24 }}
|
||||
cssValue={STYLES_EXAMPLE}
|
||||
language={lang}
|
||||
APIKey={APIKey}
|
||||
slateId={slateId}
|
||||
onLanguageChange={this._handleChangeLanguage}
|
||||
/>
|
||||
<APIDocsUploadToSlateV2
|
||||
cssValue={STYLES_EXAMPLE}
|
||||
language={lang}
|
||||
APIKey={APIKey}
|
||||
slateId={slateId}
|
||||
onLanguageChange={this._handleChangeLanguage}
|
||||
/>
|
||||
<APIDocsUploadByCidV2
|
||||
cssValue={STYLES_EXAMPLE}
|
||||
language={lang}
|
||||
APIKey={APIKey}
|
||||
slateId={slateId}
|
||||
onLanguageChange={this._handleChangeLanguage}
|
||||
/>
|
||||
<APIDocsUploadByUrlV2
|
||||
cssValue={STYLES_EXAMPLE}
|
||||
language={lang}
|
||||
APIKey={APIKey}
|
||||
slateId={slateId}
|
||||
onLanguageChange={this._handleChangeLanguage}
|
||||
/>
|
||||
<APIDocsCreateLinkV2
|
||||
cssValue={STYLES_EXAMPLE}
|
||||
language={lang}
|
||||
APIKey={APIKey}
|
||||
slateId={slateId}
|
||||
@ -371,30 +399,31 @@ export default class SceneSettingsDeveloper extends React.Component {
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<System.H2 style={{ marginTop: 64 }}>Read operations</System.H2>
|
||||
<System.H2 css={STYLES_SECTION_HEADER}>Read operations</System.H2>
|
||||
<APIDocsGetV1
|
||||
style={{ marginTop: 24 }}
|
||||
cssValue={STYLES_EXAMPLE}
|
||||
language={lang}
|
||||
APIKey={APIKey}
|
||||
onLanguageChange={this._handleChangeLanguage}
|
||||
/>
|
||||
<APIDocsGetSlateV1
|
||||
cssValue={STYLES_EXAMPLE}
|
||||
language={lang}
|
||||
APIKey={APIKey}
|
||||
slateId={slateId}
|
||||
onLanguageChange={this._handleChangeLanguage}
|
||||
/>
|
||||
<System.H2 style={{ marginTop: 64 }}>Update operations</System.H2>
|
||||
<System.H2 css={STYLES_SECTION_HEADER}>Update operations</System.H2>
|
||||
<APIDocsUpdateSlateV1
|
||||
style={{ marginTop: 24 }}
|
||||
cssValue={STYLES_EXAMPLE}
|
||||
language={lang}
|
||||
APIKey={APIKey}
|
||||
slateId={slateId}
|
||||
onLanguageChange={this._handleChangeLanguage}
|
||||
/>
|
||||
<System.H2 style={{ marginTop: 64 }}>Create operations</System.H2>
|
||||
<System.H2 css={STYLES_SECTION_HEADER}>Create operations</System.H2>
|
||||
<APIDocsUploadToSlateV1
|
||||
style={{ marginTop: 24 }}
|
||||
cssValue={STYLES_EXAMPLE}
|
||||
language={lang}
|
||||
APIKey={APIKey}
|
||||
slateId={slateId}
|
||||
|
Loading…
Reference in New Issue
Block a user