@smartsoft001/google 2.148.0 → 2.149.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "name": "@smartsoft001/google",
3
- "version": "2.148.0",
3
+ "version": "2.149.0",
4
+ "type": "commonjs",
5
+ "main": "./src/index.js",
6
+ "typings": "./src/index.d.ts",
4
7
  "publishConfig": {
5
8
  "access": "public"
6
9
  },
@@ -14,5 +17,6 @@
14
17
  "bugs": {
15
18
  "url": "https://github.com/emiljuchnikowski/smartsoft/issues"
16
19
  },
17
- "homepage": "https://github.com/emiljuchnikowski/smartsoft#readme"
20
+ "homepage": "https://github.com/emiljuchnikowski/smartsoft#readme",
21
+ "types": "./src/index.d.ts"
18
22
  }
package/src/index.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./lib/google.service"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/shared/google/src/index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GoogleService = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const axios_1 = require("@nestjs/axios");
7
+ let GoogleService = class GoogleService {
8
+ http;
9
+ constructor(http) {
10
+ this.http = http;
11
+ }
12
+ async getUserId(token) {
13
+ const { data } = await this.http
14
+ .get('https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=' + token)
15
+ .toPromise();
16
+ return data.user_id;
17
+ }
18
+ async getData(token) {
19
+ const { data } = await this.http
20
+ .get('https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=' + token)
21
+ .toPromise();
22
+ return {
23
+ id: data.user_id,
24
+ email: data.email,
25
+ };
26
+ }
27
+ };
28
+ exports.GoogleService = GoogleService;
29
+ exports.GoogleService = GoogleService = tslib_1.__decorate([
30
+ (0, common_1.Injectable)(),
31
+ tslib_1.__metadata("design:paramtypes", [axios_1.HttpService])
32
+ ], GoogleService);
33
+ //# sourceMappingURL=google.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google.service.js","sourceRoot":"","sources":["../../../../../../packages/shared/google/src/lib/google.service.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAC5C,yCAA4C;AAGrC,IAAM,aAAa,GAAnB,MAAM,aAAa;IACJ;IAApB,YAAoB,IAAiB;QAAjB,SAAI,GAAJ,IAAI,CAAa;IAAG,CAAC;IAEzC,KAAK,CAAC,SAAS,CAAC,KAAa;QAC3B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI;aAC7B,GAAG,CACF,8DAA8D,GAAG,KAAK,CACvE;aACA,SAAS,EAAE,CAAC;QAEf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,KAAa;QACzB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI;aAC7B,GAAG,CACF,8DAA8D,GAAG,KAAK,CACvE;aACA,SAAS,EAAE,CAAC;QAEf,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,OAAO;YAChB,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;IACJ,CAAC;CACF,CAAA;AAzBY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;6CAEe,mBAAW;GAD1B,aAAa,CAyBzB"}
package/test-setup.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=test-setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-setup.js","sourceRoot":"","sources":["../../../../packages/shared/google/test-setup.ts"],"names":[],"mappings":""}
package/index.js DELETED
@@ -1,40 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __decorateClass = (decorators, target, key, kind) => {
4
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
- if (decorator = decorators[i])
7
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
- if (kind && result) __defProp(target, key, result);
9
- return result;
10
- };
11
-
12
- // packages/shared/google/src/lib/google.service.ts
13
- import { Injectable } from "@nestjs/common";
14
- var GoogleService = class {
15
- constructor(http) {
16
- this.http = http;
17
- }
18
- http;
19
- async getUserId(token) {
20
- const { data } = await this.http.get(
21
- "https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=" + token
22
- ).toPromise();
23
- return data.user_id;
24
- }
25
- async getData(token) {
26
- const { data } = await this.http.get(
27
- "https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=" + token
28
- ).toPromise();
29
- return {
30
- id: data.user_id,
31
- email: data.email
32
- };
33
- }
34
- };
35
- GoogleService = __decorateClass([
36
- Injectable()
37
- ], GoogleService);
38
- export {
39
- GoogleService
40
- };