mirror of
https://github.com/LukeHagar/website.git
synced 2025-12-10 04:22:18 +00:00
feat: server kotlin/java/rest/graphql
This commit is contained in:
@@ -74,6 +74,10 @@ const platformAliases: Record<string, keyof typeof languages> = {
|
||||
[Platform.ServerPython]: 'py',
|
||||
[Platform.ServerRuby]: 'rb',
|
||||
[Platform.ServerSwift]: 'swift',
|
||||
[Platform.ServerAndroidJava]: 'java',
|
||||
[Platform.ServerAndroidKotlin]: 'kotlin',
|
||||
[Platform.ServerGraphql]: 'graphql',
|
||||
[Platform.ServerRest]: 'http',
|
||||
vue: 'html',
|
||||
svelte: 'html'
|
||||
};
|
||||
|
||||
@@ -39,7 +39,11 @@ export enum Platform {
|
||||
ServerPhp = 'server-php',
|
||||
ServerPython = 'server-python',
|
||||
ServerRuby = 'server-ruby',
|
||||
ServerSwift = 'server-swift'
|
||||
ServerSwift = 'server-swift',
|
||||
ServerAndroidKotlin = 'server-android-kotlin',
|
||||
ServerAndroidJava = 'server-android-java',
|
||||
ServerGraphql = 'server-graphql',
|
||||
ServerRest = 'server-rest',
|
||||
}
|
||||
|
||||
export const platformMap: Record<Language | string, string> = {
|
||||
@@ -58,6 +62,10 @@ export const platformMap: Record<Language | string, string> = {
|
||||
[Platform.ServerPython]: 'Python',
|
||||
[Platform.ServerRuby]: 'Ruby',
|
||||
[Platform.ServerSwift]: 'Swift',
|
||||
[Platform.ServerAndroidKotlin]: 'Android (Kotlin)',
|
||||
[Platform.ServerAndroidJava]: 'Android (Java)',
|
||||
[Platform.ServerGraphql]: 'GraphQL',
|
||||
[Platform.ServerRest]: 'REST',
|
||||
sh: 'Shell',
|
||||
js: 'JavaScript',
|
||||
jsx: 'React',
|
||||
|
||||
@@ -208,9 +208,10 @@ export async function getService(
|
||||
/**
|
||||
* Exceptions for Android SDK.
|
||||
*/
|
||||
const isAndroidJava = platform === Platform.ClientAndroidJava;
|
||||
const isAndroidKotlin = platform === Platform.ClientAndroidKotlin;
|
||||
const isAndroidJava = platform === Platform.ClientAndroidJava || platform === Platform.ServerAndroidJava;
|
||||
const isAndroidKotlin = platform === Platform.ClientAndroidKotlin || platform === Platform.ServerAndroidKotlin;
|
||||
const isAndroid = isAndroidJava || isAndroidKotlin;
|
||||
const isAndroidServer = platform === Platform.ServerAndroidJava || platform === Platform.ServerAndroidKotlin;
|
||||
const api = await getApi(version, platform);
|
||||
const tag = api.tags?.find((n) => n.name === service);
|
||||
|
||||
@@ -266,7 +267,7 @@ export async function getService(
|
||||
);
|
||||
|
||||
const path = isAndroid
|
||||
? `/node_modules/@appwrite.io/repo/docs/examples/${version}/client-android/${
|
||||
? `/node_modules/@appwrite.io/repo/docs/examples/${version}/${isAndroidServer ? 'server-kotlin' : 'client-android'}/${
|
||||
isAndroidJava ? 'java' : 'kotlin'
|
||||
}/${operation['x-appwrite'].demo}`
|
||||
: `/node_modules/@appwrite.io/repo/docs/examples/${version}/${platform}/examples/${operation['x-appwrite'].demo}`;
|
||||
|
||||
Reference in New Issue
Block a user