diff --git a/README.md b/README.md index 1eb79c1c..ce1ad108 100644 --- a/README.md +++ b/README.md @@ -172,11 +172,13 @@ Before use the `Achievement Methods` of the plugin, you need to setup your Achie ### signIn() ```typescript -signIn() => Promise +signIn() => Promise<{ player_name: string; player_id: string; }> ``` * Method to sign-in a user +**Returns:** Promise<{ player_name: string; player_id: string; }> + -------------------- diff --git a/dist/docs.json b/dist/docs.json index 8f263fb2..23f7981c 100644 --- a/dist/docs.json +++ b/dist/docs.json @@ -7,9 +7,9 @@ "methods": [ { "name": "signIn", - "signature": "() => Promise", + "signature": "() => Promise<{ player_name: string; player_id: string; }>", "parameters": [], - "returns": "Promise", + "returns": "Promise<{ player_name: string; player_id: string; }>", "tags": [], "docs": "* Method to sign-in a user", "complexTypes": [], diff --git a/dist/esm/definitions.d.ts b/dist/esm/definitions.d.ts index 8b2065a3..e2ff08f0 100644 --- a/dist/esm/definitions.d.ts +++ b/dist/esm/definitions.d.ts @@ -4,7 +4,10 @@ export interface CapacitorGameConnectPlugin { * * */ - signIn(): Promise; + signIn(): Promise<{ + player_name: string; + player_id: string; + }>; /** * * Method to display the Leaderboards * diff --git a/dist/esm/definitions.js.map b/dist/esm/definitions.js.map index 64b89bc5..c2b59723 100644 --- a/dist/esm/definitions.js.map +++ b/dist/esm/definitions.js.map @@ -1 +1 @@ -{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface CapacitorGameConnectPlugin {\n /**\n * * Method to sign-in a user\n *\n *\n */\n signIn(): Promise;\n\n /**\n * * Method to display the Leaderboards\n *\n * @param leaderboardID as string\n */\n showLeaderboard(options: { leaderboardID: string }): Promise;\n\n /**\n * * Method to submit a score to the Google Play Services SDK\n *\n */\n submitScore(options: {\n leaderboardID: string;\n totalScoreAmount: number;\n }): Promise;\n\n /**\n * * Method to display the Achievements view\n *\n */\n showAchievements(): Promise;\n\n /**\n * * Method to unlock an achievement\n *\n */\n unlockAchievement(options: { achievementID: string }): Promise;\n\n /**\n * * Method to increment the progress of an achievement\n */\n incrementAchievementProgress(options: {\n achievementID: string;\n pointsToIncrement: number;\n }): Promise;\n}\n"]} \ No newline at end of file +{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface CapacitorGameConnectPlugin {\n /**\n * * Method to sign-in a user\n *\n *\n */\n signIn(): Promise<{\n player_name: string;\n player_id: string;\n }>;\n\n /**\n * * Method to display the Leaderboards\n *\n * @param leaderboardID as string\n */\n showLeaderboard(options: { leaderboardID: string }): Promise;\n\n /**\n * * Method to submit a score to the Google Play Services SDK\n *\n */\n submitScore(options: {\n leaderboardID: string;\n totalScoreAmount: number;\n }): Promise;\n\n /**\n * * Method to display the Achievements view\n *\n */\n showAchievements(): Promise;\n\n /**\n * * Method to unlock an achievement\n *\n */\n unlockAchievement(options: { achievementID: string }): Promise;\n\n /**\n * * Method to increment the progress of an achievement\n */\n incrementAchievementProgress(options: {\n achievementID: string;\n pointsToIncrement: number;\n }): Promise;\n}\n"]} \ No newline at end of file diff --git a/dist/esm/web.d.ts b/dist/esm/web.d.ts index 2b1bb4a1..4769fec0 100644 --- a/dist/esm/web.d.ts +++ b/dist/esm/web.d.ts @@ -1,11 +1,16 @@ import { WebPlugin } from '@capacitor/core'; import type { CapacitorGameConnectPlugin } from './definitions'; +export interface User { + player_id: string; + player_name: string; +} export declare class CapacitorGameConnectWeb extends WebPlugin implements CapacitorGameConnectPlugin { /** * * Method to sign-in a user to Google Play Services - * + * * TODO: migrate interface to a different file + * * Add web support for signIn */ - signIn(): Promise; + signIn(): Promise; /** * Method to display the Leaderboards view from Google Play Services SDK * diff --git a/dist/esm/web.js b/dist/esm/web.js index 8eb4d255..71683594 100644 --- a/dist/esm/web.js +++ b/dist/esm/web.js @@ -2,10 +2,11 @@ import { WebPlugin } from '@capacitor/core'; export class CapacitorGameConnectWeb extends WebPlugin { /** * * Method to sign-in a user to Google Play Services - * + * * TODO: migrate interface to a different file + * * Add web support for signIn */ async signIn() { - return Promise.resolve(); + return Promise.resolve({}); } /** * Method to display the Leaderboards view from Google Play Services SDK diff --git a/dist/esm/web.js.map b/dist/esm/web.js.map index cc6f3b90..fca2ca04 100644 --- a/dist/esm/web.js.map +++ b/dist/esm/web.js.map @@ -1 +1 @@ -{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,uBACX,SAAQ,SAAS;IAGjB;;;OAGG;IACH,KAAK,CAAC,MAAM;QACV,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,eAAe,CAAC,OAAkC;QACtD,OAAO,CAAC,IAAI,CAAC,0CAA0C,EAAE,OAAO,CAAC,CAAC;QAClE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,WAAW,CAAC,OAGjB;QACC,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,OAAO,CAAC,CAAC;QAC9D,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,gBAAgB;QACpB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,iBAAiB,CAAC,OAAkC;QACxD,OAAO,CAAC,IAAI,CAAC,4CAA4C,EAAE,OAAO,CAAC,CAAC;QACpE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,4BAA4B,CAAC,OAGlC;QACC,OAAO,CAAC,IAAI,CACV,uDAAuD,EACvD,OAAO,CACR,CAAC;QACF,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { CapacitorGameConnectPlugin } from './definitions';\n\nexport class CapacitorGameConnectWeb\n extends WebPlugin\n implements CapacitorGameConnectPlugin\n{\n /**\n * * Method to sign-in a user to Google Play Services\n *\n */\n async signIn(): Promise {\n return Promise.resolve();\n }\n\n /**\n * Method to display the Leaderboards view from Google Play Services SDK\n *\n * @param leaderboardID as string\n */\n async showLeaderboard(options: { leaderboardID: string }): Promise {\n console.info('showLeaderboard function has been called', options);\n return Promise.resolve();\n }\n\n /**\n * * Method to submit a score to the Google Play Services SDK\n *\n * @returns Promise\n */\n async submitScore(options: {\n leaderboardID: string;\n totalScoreAmount: number;\n }): Promise {\n console.info('submitScore function has been called', options);\n return Promise.resolve();\n }\n\n /**\n * * Method to display the Achievements view from Google Play SDK\n *\n * @returns Promise\n */\n async showAchievements(): Promise {\n return Promise.resolve();\n }\n\n /**\n * * Method to unlock an achievement\n *\n * @returns Promise\n */\n async unlockAchievement(options: { achievementID: string }): Promise {\n console.info('unlockAchievement function has been called', options);\n return Promise.resolve();\n }\n\n /**\n * * Method to increment the progress of an achievement\n *\n * @returns Promise\n */\n async incrementAchievementProgress(options: {\n achievementID: string;\n pointsToIncrement: number;\n }): Promise {\n console.info(\n 'incrementAchievementProgress function has been called',\n options,\n );\n return Promise.resolve();\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAS5C,MAAM,OAAO,uBACX,SAAQ,SAAS;IAGjB;;;;OAIG;IACH,KAAK,CAAC,MAAM;QACV,OAAO,OAAO,CAAC,OAAO,CAAC,EAAU,CAAC,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,eAAe,CAAC,OAAkC;QACtD,OAAO,CAAC,IAAI,CAAC,0CAA0C,EAAE,OAAO,CAAC,CAAC;QAClE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,WAAW,CAAC,OAGjB;QACC,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,OAAO,CAAC,CAAC;QAC9D,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,gBAAgB;QACpB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,iBAAiB,CAAC,OAAkC;QACxD,OAAO,CAAC,IAAI,CAAC,4CAA4C,EAAE,OAAO,CAAC,CAAC;QACpE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,4BAA4B,CAAC,OAGlC;QACC,OAAO,CAAC,IAAI,CACV,uDAAuD,EACvD,OAAO,CACR,CAAC;QACF,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { CapacitorGameConnectPlugin } from './definitions';\n\nexport interface User {\n player_id: string;\n player_name: string;\n}\n\nexport class CapacitorGameConnectWeb\n extends WebPlugin\n implements CapacitorGameConnectPlugin\n{\n /**\n * * Method to sign-in a user to Google Play Services\n * * TODO: migrate interface to a different file\n * * Add web support for signIn\n */\n async signIn(): Promise {\n return Promise.resolve({} as User);\n }\n\n /**\n * Method to display the Leaderboards view from Google Play Services SDK\n *\n * @param leaderboardID as string\n */\n async showLeaderboard(options: { leaderboardID: string }): Promise {\n console.info('showLeaderboard function has been called', options);\n return Promise.resolve();\n }\n\n /**\n * * Method to submit a score to the Google Play Services SDK\n *\n * @returns Promise\n */\n async submitScore(options: {\n leaderboardID: string;\n totalScoreAmount: number;\n }): Promise {\n console.info('submitScore function has been called', options);\n return Promise.resolve();\n }\n\n /**\n * * Method to display the Achievements view from Google Play SDK\n *\n * @returns Promise\n */\n async showAchievements(): Promise {\n return Promise.resolve();\n }\n\n /**\n * * Method to unlock an achievement\n *\n * @returns Promise\n */\n async unlockAchievement(options: { achievementID: string }): Promise {\n console.info('unlockAchievement function has been called', options);\n return Promise.resolve();\n }\n\n /**\n * * Method to increment the progress of an achievement\n *\n * @returns Promise\n */\n async incrementAchievementProgress(options: {\n achievementID: string;\n pointsToIncrement: number;\n }): Promise {\n console.info(\n 'incrementAchievementProgress function has been called',\n options,\n );\n return Promise.resolve();\n }\n}\n"]} \ No newline at end of file diff --git a/dist/plugin.cjs.js b/dist/plugin.cjs.js index ac5cbe45..aff600f0 100644 --- a/dist/plugin.cjs.js +++ b/dist/plugin.cjs.js @@ -11,10 +11,11 @@ const CapacitorGameConnect = core.registerPlugin('CapacitorGameConnect', { class CapacitorGameConnectWeb extends core.WebPlugin { /** * * Method to sign-in a user to Google Play Services - * + * * TODO: migrate interface to a different file + * * Add web support for signIn */ async signIn() { - return Promise.resolve(); + return Promise.resolve({}); } /** * Method to display the Leaderboards view from Google Play Services SDK diff --git a/dist/plugin.cjs.js.map b/dist/plugin.cjs.js.map index fbb532bd..7b98f04f 100644 --- a/dist/plugin.cjs.js.map +++ b/dist/plugin.cjs.js.map @@ -1 +1 @@ -{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapacitorGameConnect = registerPlugin('CapacitorGameConnect', {\n web: () => import('./web').then(m => new m.CapacitorGameConnectWeb()),\n});\nexport * from './definitions';\nexport { CapacitorGameConnect };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorGameConnectWeb extends WebPlugin {\n /**\n * * Method to sign-in a user to Google Play Services\n *\n */\n async signIn() {\n return Promise.resolve();\n }\n /**\n * Method to display the Leaderboards view from Google Play Services SDK\n *\n * @param leaderboardID as string\n */\n async showLeaderboard(options) {\n console.info('showLeaderboard function has been called', options);\n return Promise.resolve();\n }\n /**\n * * Method to submit a score to the Google Play Services SDK\n *\n * @returns Promise\n */\n async submitScore(options) {\n console.info('submitScore function has been called', options);\n return Promise.resolve();\n }\n /**\n * * Method to display the Achievements view from Google Play SDK\n *\n * @returns Promise\n */\n async showAchievements() {\n return Promise.resolve();\n }\n /**\n * * Method to unlock an achievement\n *\n * @returns Promise\n */\n async unlockAchievement(options) {\n console.info('unlockAchievement function has been called', options);\n return Promise.resolve();\n }\n /**\n * * Method to increment the progress of an achievement\n *\n * @returns Promise\n */\n async incrementAchievementProgress(options) {\n console.info('incrementAchievementProgress function has been called', options);\n return Promise.resolve();\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,oBAAoB,GAAGA,mBAAc,CAAC,sBAAsB,EAAE;AACpE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,uBAAuB,EAAE,CAAC;AACzE,CAAC;;ACFM,MAAM,uBAAuB,SAASC,cAAS,CAAC;AACvD;AACA;AACA;AACA;AACA,IAAI,MAAM,MAAM,GAAG;AACnB,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AACjC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,eAAe,CAAC,OAAO,EAAE;AACnC,QAAQ,OAAO,CAAC,IAAI,CAAC,0CAA0C,EAAE,OAAO,CAAC,CAAC;AAC1E,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AACjC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;AAC/B,QAAQ,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,OAAO,CAAC,CAAC;AACtE,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AACjC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AACjC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,iBAAiB,CAAC,OAAO,EAAE;AACrC,QAAQ,OAAO,CAAC,IAAI,CAAC,4CAA4C,EAAE,OAAO,CAAC,CAAC;AAC5E,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AACjC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,4BAA4B,CAAC,OAAO,EAAE;AAChD,QAAQ,OAAO,CAAC,IAAI,CAAC,uDAAuD,EAAE,OAAO,CAAC,CAAC;AACvF,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AACjC,KAAK;AACL;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapacitorGameConnect = registerPlugin('CapacitorGameConnect', {\n web: () => import('./web').then(m => new m.CapacitorGameConnectWeb()),\n});\nexport * from './definitions';\nexport { CapacitorGameConnect };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorGameConnectWeb extends WebPlugin {\n /**\n * * Method to sign-in a user to Google Play Services\n * * TODO: migrate interface to a different file\n * * Add web support for signIn\n */\n async signIn() {\n return Promise.resolve({});\n }\n /**\n * Method to display the Leaderboards view from Google Play Services SDK\n *\n * @param leaderboardID as string\n */\n async showLeaderboard(options) {\n console.info('showLeaderboard function has been called', options);\n return Promise.resolve();\n }\n /**\n * * Method to submit a score to the Google Play Services SDK\n *\n * @returns Promise\n */\n async submitScore(options) {\n console.info('submitScore function has been called', options);\n return Promise.resolve();\n }\n /**\n * * Method to display the Achievements view from Google Play SDK\n *\n * @returns Promise\n */\n async showAchievements() {\n return Promise.resolve();\n }\n /**\n * * Method to unlock an achievement\n *\n * @returns Promise\n */\n async unlockAchievement(options) {\n console.info('unlockAchievement function has been called', options);\n return Promise.resolve();\n }\n /**\n * * Method to increment the progress of an achievement\n *\n * @returns Promise\n */\n async incrementAchievementProgress(options) {\n console.info('incrementAchievementProgress function has been called', options);\n return Promise.resolve();\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,oBAAoB,GAAGA,mBAAc,CAAC,sBAAsB,EAAE;AACpE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,uBAAuB,EAAE,CAAC;AACzE,CAAC;;ACFM,MAAM,uBAAuB,SAASC,cAAS,CAAC;AACvD;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,MAAM,GAAG;AACnB,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AACnC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,eAAe,CAAC,OAAO,EAAE;AACnC,QAAQ,OAAO,CAAC,IAAI,CAAC,0CAA0C,EAAE,OAAO,CAAC,CAAC;AAC1E,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AACjC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;AAC/B,QAAQ,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,OAAO,CAAC,CAAC;AACtE,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AACjC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AACjC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,iBAAiB,CAAC,OAAO,EAAE;AACrC,QAAQ,OAAO,CAAC,IAAI,CAAC,4CAA4C,EAAE,OAAO,CAAC,CAAC;AAC5E,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AACjC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,4BAA4B,CAAC,OAAO,EAAE;AAChD,QAAQ,OAAO,CAAC,IAAI,CAAC,uDAAuD,EAAE,OAAO,CAAC,CAAC;AACvF,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AACjC,KAAK;AACL;;;;;;;;;"} \ No newline at end of file diff --git a/dist/plugin.js b/dist/plugin.js index f6c2a6cf..551020af 100644 --- a/dist/plugin.js +++ b/dist/plugin.js @@ -8,10 +8,11 @@ var capacitorCapacitorGameConnect = (function (exports, core) { class CapacitorGameConnectWeb extends core.WebPlugin { /** * * Method to sign-in a user to Google Play Services - * + * * TODO: migrate interface to a different file + * * Add web support for signIn */ async signIn() { - return Promise.resolve(); + return Promise.resolve({}); } /** * Method to display the Leaderboards view from Google Play Services SDK diff --git a/dist/plugin.js.map b/dist/plugin.js.map index a745d461..51f5e56f 100644 --- a/dist/plugin.js.map +++ b/dist/plugin.js.map @@ -1 +1 @@ -{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapacitorGameConnect = registerPlugin('CapacitorGameConnect', {\n web: () => import('./web').then(m => new m.CapacitorGameConnectWeb()),\n});\nexport * from './definitions';\nexport { CapacitorGameConnect };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorGameConnectWeb extends WebPlugin {\n /**\n * * Method to sign-in a user to Google Play Services\n *\n */\n async signIn() {\n return Promise.resolve();\n }\n /**\n * Method to display the Leaderboards view from Google Play Services SDK\n *\n * @param leaderboardID as string\n */\n async showLeaderboard(options) {\n console.info('showLeaderboard function has been called', options);\n return Promise.resolve();\n }\n /**\n * * Method to submit a score to the Google Play Services SDK\n *\n * @returns Promise\n */\n async submitScore(options) {\n console.info('submitScore function has been called', options);\n return Promise.resolve();\n }\n /**\n * * Method to display the Achievements view from Google Play SDK\n *\n * @returns Promise\n */\n async showAchievements() {\n return Promise.resolve();\n }\n /**\n * * Method to unlock an achievement\n *\n * @returns Promise\n */\n async unlockAchievement(options) {\n console.info('unlockAchievement function has been called', options);\n return Promise.resolve();\n }\n /**\n * * Method to increment the progress of an achievement\n *\n * @returns Promise\n */\n async incrementAchievementProgress(options) {\n console.info('incrementAchievementProgress function has been called', options);\n return Promise.resolve();\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,oBAAoB,GAAGA,mBAAc,CAAC,sBAAsB,EAAE;IACpE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,uBAAuB,EAAE,CAAC;IACzE,CAAC;;ICFM,MAAM,uBAAuB,SAASC,cAAS,CAAC;IACvD;IACA;IACA;IACA;IACA,IAAI,MAAM,MAAM,GAAG;IACnB,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IACjC,KAAK;IACL;IACA;IACA;IACA;IACA;IACA,IAAI,MAAM,eAAe,CAAC,OAAO,EAAE;IACnC,QAAQ,OAAO,CAAC,IAAI,CAAC,0CAA0C,EAAE,OAAO,CAAC,CAAC;IAC1E,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IACjC,KAAK;IACL;IACA;IACA;IACA;IACA;IACA,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;IAC/B,QAAQ,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,OAAO,CAAC,CAAC;IACtE,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IACjC,KAAK;IACL;IACA;IACA;IACA;IACA;IACA,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IACjC,KAAK;IACL;IACA;IACA;IACA;IACA;IACA,IAAI,MAAM,iBAAiB,CAAC,OAAO,EAAE;IACrC,QAAQ,OAAO,CAAC,IAAI,CAAC,4CAA4C,EAAE,OAAO,CAAC,CAAC;IAC5E,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IACjC,KAAK;IACL;IACA;IACA;IACA;IACA;IACA,IAAI,MAAM,4BAA4B,CAAC,OAAO,EAAE;IAChD,QAAQ,OAAO,CAAC,IAAI,CAAC,uDAAuD,EAAE,OAAO,CAAC,CAAC;IACvF,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IACjC,KAAK;IACL;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapacitorGameConnect = registerPlugin('CapacitorGameConnect', {\n web: () => import('./web').then(m => new m.CapacitorGameConnectWeb()),\n});\nexport * from './definitions';\nexport { CapacitorGameConnect };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorGameConnectWeb extends WebPlugin {\n /**\n * * Method to sign-in a user to Google Play Services\n * * TODO: migrate interface to a different file\n * * Add web support for signIn\n */\n async signIn() {\n return Promise.resolve({});\n }\n /**\n * Method to display the Leaderboards view from Google Play Services SDK\n *\n * @param leaderboardID as string\n */\n async showLeaderboard(options) {\n console.info('showLeaderboard function has been called', options);\n return Promise.resolve();\n }\n /**\n * * Method to submit a score to the Google Play Services SDK\n *\n * @returns Promise\n */\n async submitScore(options) {\n console.info('submitScore function has been called', options);\n return Promise.resolve();\n }\n /**\n * * Method to display the Achievements view from Google Play SDK\n *\n * @returns Promise\n */\n async showAchievements() {\n return Promise.resolve();\n }\n /**\n * * Method to unlock an achievement\n *\n * @returns Promise\n */\n async unlockAchievement(options) {\n console.info('unlockAchievement function has been called', options);\n return Promise.resolve();\n }\n /**\n * * Method to increment the progress of an achievement\n *\n * @returns Promise\n */\n async incrementAchievementProgress(options) {\n console.info('incrementAchievementProgress function has been called', options);\n return Promise.resolve();\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,oBAAoB,GAAGA,mBAAc,CAAC,sBAAsB,EAAE;IACpE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,uBAAuB,EAAE,CAAC;IACzE,CAAC;;ICFM,MAAM,uBAAuB,SAASC,cAAS,CAAC;IACvD;IACA;IACA;IACA;IACA;IACA,IAAI,MAAM,MAAM,GAAG;IACnB,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACnC,KAAK;IACL;IACA;IACA;IACA;IACA;IACA,IAAI,MAAM,eAAe,CAAC,OAAO,EAAE;IACnC,QAAQ,OAAO,CAAC,IAAI,CAAC,0CAA0C,EAAE,OAAO,CAAC,CAAC;IAC1E,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IACjC,KAAK;IACL;IACA;IACA;IACA;IACA;IACA,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;IAC/B,QAAQ,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,OAAO,CAAC,CAAC;IACtE,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IACjC,KAAK;IACL;IACA;IACA;IACA;IACA;IACA,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IACjC,KAAK;IACL;IACA;IACA;IACA;IACA;IACA,IAAI,MAAM,iBAAiB,CAAC,OAAO,EAAE;IACrC,QAAQ,OAAO,CAAC,IAAI,CAAC,4CAA4C,EAAE,OAAO,CAAC,CAAC;IAC5E,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IACjC,KAAK;IACL;IACA;IACA;IACA;IACA;IACA,IAAI,MAAM,4BAA4B,CAAC,OAAO,EAAE;IAChD,QAAQ,OAAO,CAAC,IAAI,CAAC,uDAAuD,EAAE,OAAO,CAAC,CAAC;IACvF,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IACjC,KAAK;IACL;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 60d9c34b..c2b4e785 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -1,6 +1,6 @@ { "name": "@openforge/capacitor-game-connect", - "version": "1.0.0", + "version": "1.0.3", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package-lock.json b/package-lock.json index 82d09093..0962661a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@openforge/capacitor-game-connect", - "version": "1.0.0", + "version": "1.0.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@openforge/capacitor-game-connect", - "version": "1.0.0", + "version": "1.0.3", "license": "MIT", "devDependencies": { "@capacitor/android": "^4.0.0", diff --git a/src/web.ts b/src/web.ts index 2d8a5afb..938d79a9 100644 --- a/src/web.ts +++ b/src/web.ts @@ -2,16 +2,22 @@ import { WebPlugin } from '@capacitor/core'; import type { CapacitorGameConnectPlugin } from './definitions'; +export interface User { + player_id: string; + player_name: string; +} + export class CapacitorGameConnectWeb extends WebPlugin implements CapacitorGameConnectPlugin { /** * * Method to sign-in a user to Google Play Services - * + * * TODO: migrate interface to a different file + * * Add web support for signIn */ - async signIn(): Promise { - return Promise.resolve(); + async signIn(): Promise { + return Promise.resolve({} as User); } /**