@clxmedia/credstore-client 1.0.1 → 1.0.4

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/README.md CHANGED
@@ -1,40 +1,18 @@
1
1
  <h1 align="center"></h1>
2
2
 
3
- <div align="center">
4
- <a href="http://nestjs.com/" target="_blank">
5
- <img src="https://nestjs.com/img/logo_text.svg" width="150" alt="Nest Logo" />
6
- </a>
7
- </div>
8
-
9
- <h3 align="center">NestJS npm Package Starter</h3>
10
-
11
- <div align="center">
12
- <a href="https://nestjs.com" target="_blank">
13
- <img src="https://img.shields.io/badge/built%20with-NestJs-red.svg" alt="Built with NestJS">
14
- </a>
15
- </div>
3
+ <h3 align="center">CLXperience CredStore Client</h3>
16
4
 
17
5
  ### Installation
18
6
 
19
- 1. Clone the repo
20
- 2. Run npm/yarn install
21
-
22
- ```bash
23
- cd nestjs-package-starter
24
- npm install
25
- ```
7
+ TODO
26
8
 
27
9
  ## Change Log
28
10
 
29
11
  See [Changelog](CHANGELOG.md) for more information.
30
12
 
31
- ## Contributing
32
-
33
- Contributions welcome! See [Contributing](CONTRIBUTING.md).
34
-
35
13
  ## Author
36
14
 
37
- **John Biundo (Y Prospect on [Discord](https://discord.gg/G7Qnnhy))**
15
+ **Brandon Thompson**
38
16
 
39
17
  ## License
40
18
 
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './client';
1
+ export { CredStoreClient } from './client';
package/dist/index.js CHANGED
@@ -1,17 +1,5 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./client"), exports);
3
+ exports.CredStoreClient = void 0;
4
+ var client_1 = require("./client");
5
+ Object.defineProperty(exports, "CredStoreClient", { enumerable: true, get: function () { return client_1.CredStoreClient; } });
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@clxmedia/credstore-client",
3
- "version": "1.0.1",
3
+ "version": "1.0.4",
4
4
  "description": "CLXperience CredStore Client",
5
5
  "author": "Brandon Thompson <brandont@clxmedia.com>",
6
6
  "license": "MIT",
7
7
  "readmeFilename": "README.md",
8
- "main": "dist/test.js",
8
+ "main": "dist/client.js",
9
+ "typings": "dist/client.d.ts",
9
10
  "files": [
10
11
  "dist/**/*",
11
12
  "*.md"
package/dist/service.d.ts DELETED
@@ -1,11 +0,0 @@
1
- import { HttpService } from '@nestjs/axios';
2
- export declare class CredStoreClientService {
3
- private readonly httpService;
4
- constructor(httpService: HttpService);
5
- fetchUpdatedCredential(guid: string, master_id: number): Promise<any>;
6
- createCredential(master_id: number, provider: string, credData: any, name?: string): Promise<any>;
7
- updateCredential(guid: string, data: any): Promise<any>;
8
- patchData(url: string, data: any): Promise<any>;
9
- postData(url: string, data: any): Promise<any>;
10
- fetchData(url: string): Promise<any>;
11
- }
package/dist/service.js DELETED
@@ -1,81 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.CredStoreClientService = void 0;
13
- const rxjs_1 = require("rxjs");
14
- class CredStoreClientService {
15
- constructor(httpService) {
16
- this.httpService = httpService;
17
- }
18
- fetchUpdatedCredential(guid, master_id) {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- return yield this.fetchData(`credentials/${master_id}/${guid}`);
21
- });
22
- }
23
- createCredential(master_id, provider, credData, name) {
24
- return __awaiter(this, void 0, void 0, function* () {
25
- const data = {
26
- provider,
27
- name,
28
- payload: credData
29
- };
30
- return yield this.postData(`credentials/${master_id}`, data);
31
- });
32
- }
33
- updateCredential(guid, data) {
34
- return __awaiter(this, void 0, void 0, function* () {
35
- return yield this.patchData(`credentials/${guid}`, data);
36
- });
37
- }
38
- patchData(url, data) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- const apiServer = 'this.configService.get<string>(ConfigKeys.credstore.api_server)';
41
- const apiKey = 'this.configService.get<string>(ConfigKeys.xperience.admin_key)';
42
- const config = {
43
- headers: { 'x-credstore-admin-key': apiKey },
44
- };
45
- const requestUrl = `${apiServer}/${url}`;
46
- const response = yield (0, rxjs_1.lastValueFrom)(this.httpService.patch(requestUrl, data, config).pipe((0, rxjs_1.map)((response) => {
47
- return response.data;
48
- })));
49
- return response;
50
- });
51
- }
52
- postData(url, data) {
53
- return __awaiter(this, void 0, void 0, function* () {
54
- const apiServer = 'this.configService.get<string>(ConfigKeys.credstore.api_server)';
55
- const apiKey = 'this.configService.get<string>(ConfigKeys.xperience.admin_key)';
56
- const config = {
57
- headers: { 'x-credstore-admin-key': apiKey },
58
- };
59
- const requestUrl = `${apiServer}/${url}`;
60
- const response = yield (0, rxjs_1.lastValueFrom)(this.httpService.post(requestUrl, data, config).pipe((0, rxjs_1.map)((response) => {
61
- return response.data;
62
- })));
63
- return response;
64
- });
65
- }
66
- fetchData(url) {
67
- return __awaiter(this, void 0, void 0, function* () {
68
- const apiServer = 'this.configService.get<string>(ConfigKeys.credstore.api_server)';
69
- const apiKey = 'this.configService.get<string>(ConfigKeys.xperience.admin_key)';
70
- const config = {
71
- headers: { 'x-credstore-admin-key': apiKey },
72
- };
73
- const requestUrl = `${apiServer}/${url}`;
74
- const response = yield (0, rxjs_1.lastValueFrom)(this.httpService.get(requestUrl, config).pipe((0, rxjs_1.map)((response) => {
75
- return response.data;
76
- })));
77
- return response;
78
- });
79
- }
80
- }
81
- exports.CredStoreClientService = CredStoreClientService;
package/dist/test.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare function getHello(): string;
package/dist/test.js DELETED
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getHello = void 0;
4
- function getHello() {
5
- return 'Hello from the new package!';
6
- }
7
- exports.getHello = getHello;