Skip to content

Commit

Permalink
Merge pull request #235 from appwrite/feat-server-sdks-additions
Browse files Browse the repository at this point in the history
feat: server kotlin/java/rest/graphql
  • Loading branch information
TorstenDittmann committed Oct 11, 2023
2 parents 8574de6 + 3f8e613 commit e702fcb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
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

0 comments on commit e702fcb

Please sign in to comment.