@esolve/ng-esolve-connect 0.22.0 → 0.22.1

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.
@@ -1,4 +1,4 @@
1
- import { EsolveStockItem } from '../../stock/classes/esolve-stock-item.model';
1
+ import { EsolveStockItem } from '../../stock';
2
2
  export declare class EsolveWishlistItem {
3
3
  id: number;
4
4
  qty: number;
@@ -1 +1,2 @@
1
1
  export * from './esolve-wishlist-item.model';
2
+ export * from './esolve-empty-wishlist-result.model';
@@ -1,16 +1,14 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
2
  import { Observable } from 'rxjs';
3
3
  import { EsolveConnectConfig } from '../esolve-connect.config';
4
- import { EsolveErrorHandlerService } from '../shared/errors/esolve-error-handler.service';
5
4
  import { EsolveResponseHandlerService } from '../shared/response';
6
- import { EsolveWishlistSetAction } from './types/esolve-wishlist-set-action.type';
7
- import { EsolveWishlistItemResponse } from './interfaces/esolve-wishlist-item-response.interface';
8
- import { EsolveWishlist } from './types/esolve-wishlist.type';
9
- import { EsolveCustomFields } from '../shared/custom-fields';
5
+ import { EsolveErrorHandlerService } from '../shared/errors';
10
6
  import { EsolveWishlistSetItem } from './interfaces';
11
- import { EsolveEmptyWishlistResult } from './classes/esolve-empty-wishlist-result.model';
7
+ import { EsolveWishlist, EsolveWishlistSetAction } from './types';
8
+ import { EsolveEmptyWishlistResult } from './classes';
9
+ import { EsolveWishlistItemResponse } from './interfaces';
12
10
  import * as i0 from "@angular/core";
13
- export declare class EsolveWishlistService<T extends EsolveCustomFields = EsolveCustomFields> {
11
+ export declare class EsolveWishlistService {
14
12
  private config;
15
13
  private http;
16
14
  private errorHandler;
@@ -48,6 +46,6 @@ export declare class EsolveWishlistService<T extends EsolveCustomFields = Esolve
48
46
  * @param params HTTP client parameters
49
47
  */
50
48
  private getWishlistRecords;
51
- static ɵfac: i0.ɵɵFactoryDeclaration<EsolveWishlistService<any>, never>;
52
- static ɵprov: i0.ɵɵInjectableDeclaration<EsolveWishlistService<any>>;
49
+ static ɵfac: i0.ɵɵFactoryDeclaration<EsolveWishlistService, never>;
50
+ static ɵprov: i0.ɵɵInjectableDeclaration<EsolveWishlistService>;
53
51
  }
@@ -1,4 +1,4 @@
1
- import { EsolveStockRecord } from '../../stock/interfaces/esolve-stock-record.interface';
1
+ import { EsolveStockRecord } from '../../stock';
2
2
  export interface EsolveWishlistItemRecord {
3
3
  id: number;
4
4
  qty: number;
@@ -1,4 +1,4 @@
1
- import { EsolveWishlistSetAction } from '../types/esolve-wishlist-set-action.type';
1
+ import { EsolveWishlistSetAction } from '../types';
2
2
  export interface EsolveWishlistSetItem {
3
3
  code: string;
4
4
  id?: number;
@@ -1,2 +1,2 @@
1
- import { EsolveWishlistItem } from '../classes/esolve-wishlist-item.model';
1
+ import { EsolveWishlistItem } from '../classes';
2
2
  export declare type EsolveWishlist = EsolveWishlistItem[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esolve/ng-esolve-connect",
3
- "version": "0.22.0",
3
+ "version": "0.22.1",
4
4
  "description": "An Angular library that speaks to an eSolve instance's API",
5
5
  "ng-add": {
6
6
  "save": "true"
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json",
3
+ "schematics": {
4
+ "ng-add": {
5
+ "description": "Add NG eSolve Connect to project",
6
+ "factory": "./ng-add/index#ngAdd"
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,2 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ export declare function ngAdd(): Rule;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ngAdd = void 0;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ const tasks_1 = require("@angular-devkit/schematics/tasks");
6
+ const change_1 = require("@schematics/angular/utility/change");
7
+ const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
8
+ const ts = require("typescript");
9
+ function ngAdd() {
10
+ return (tree, context) => {
11
+ context.logger.info('Adding library module to the app...');
12
+ const module_path = '/src/app/app.module.ts';
13
+ if (!tree.exists(module_path)) {
14
+ throw new schematics_1.SchematicsException(`The file '${module_path}' doesn't exist...`);
15
+ }
16
+ const recorder = tree.beginUpdate(module_path);
17
+ const text = tree.read(module_path);
18
+ if (text === null) {
19
+ throw new schematics_1.SchematicsException(`The file '${module_path}' doesn't exist...`);
20
+ }
21
+ const source = ts.createSourceFile(module_path, text.toString(), ts.ScriptTarget.Latest, true);
22
+ (0, change_1.applyToUpdateRecorder)(recorder, (0, ast_utils_1.addImportToModule)(source, module_path, 'NgEsolveConnectModule.forRoot()', '@esolve/ng-esolve-connect'));
23
+ tree.commitUpdate(recorder);
24
+ context.logger.info('Installing dependencies...');
25
+ context.addTask(new tasks_1.NodePackageInstallTask());
26
+ return tree;
27
+ };
28
+ }
29
+ exports.ngAdd = ngAdd;
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../projects/ng-esolve-connect/schematics/ng-add/index.ts"],"names":[],"mappings":";;;AAAA,2DAA+F;AAC/F,4DAA0E;AAE1E,+DAA2E;AAC3E,qEAA0E;AAE1E,iCAAiC;AAEjC,SAAgB,KAAK;IACjB,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC7C,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC;QAC3D,MAAM,WAAW,GAAG,wBAAwB,CAAC;QAE7C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE;YAC3B,MAAM,IAAI,gCAAmB,CAAC,aAAa,WAAW,oBAAoB,CAAC,CAAC;SAC/E;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAE/C,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAA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