Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/lib/utils/code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
};
Expand Down
10 changes: 9 additions & 1 deletion src/lib/utils/references.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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> = {
Expand All @@ -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',
Expand Down
7 changes: 4 additions & 3 deletions src/lib/utils/specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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}`;
Expand Down