@veloceapps/api 8.0.0-11 → 8.0.0-13

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.
@@ -2777,6 +2777,69 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
2777
2777
  type: Injectable
2778
2778
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2779
2779
 
2780
+ class PromotionsApiService {
2781
+ constructor(baseHttpService) {
2782
+ this.baseHttpService = baseHttpService;
2783
+ this.serviceUrl = '/admin/promotion';
2784
+ this.fetchAll$ = () => {
2785
+ return this.baseHttpService.api({ url: this.serviceUrl });
2786
+ };
2787
+ this.fetchOne$ = (id) => {
2788
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2789
+ };
2790
+ this.remove$ = (id) => {
2791
+ return this.baseHttpService.api({
2792
+ url: `${this.serviceUrl}/${id}`,
2793
+ method: 'delete',
2794
+ });
2795
+ };
2796
+ this.restore$ = (id) => {
2797
+ return this.baseHttpService.api({
2798
+ method: 'patch',
2799
+ url: `${this.serviceUrl}/${id}/restore`,
2800
+ });
2801
+ };
2802
+ this.duplicate$ = (body) => {
2803
+ return this.baseHttpService
2804
+ .api({
2805
+ url: `${this.serviceUrl}/${body.id}/clone`,
2806
+ method: 'post',
2807
+ body,
2808
+ })
2809
+ .pipe(map$1(response => response.clonedRecordId));
2810
+ };
2811
+ }
2812
+ search$(expression, skip, count) {
2813
+ let params = new HttpParams();
2814
+ if (typeof skip === 'number') {
2815
+ params = params.set('skip', '' + skip);
2816
+ }
2817
+ if (typeof count === 'number') {
2818
+ params = params.set('count', '' + count);
2819
+ }
2820
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2821
+ }
2822
+ create$(body) {
2823
+ return this.baseHttpService.api({
2824
+ url: `${this.serviceUrl}`,
2825
+ method: 'post',
2826
+ body,
2827
+ });
2828
+ }
2829
+ update$(body) {
2830
+ return this.baseHttpService.api({
2831
+ url: `${this.serviceUrl}/${body.id}`,
2832
+ method: 'put',
2833
+ body,
2834
+ });
2835
+ }
2836
+ }
2837
+ PromotionsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PromotionsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2838
+ PromotionsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PromotionsApiService });
2839
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PromotionsApiService, decorators: [{
2840
+ type: Injectable
2841
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2842
+
2780
2843
  class ApiModule {
2781
2844
  }
2782
2845
  ApiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ApiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
@@ -2817,6 +2880,7 @@ ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.
2817
2880
  StatefulConfigurationApiService,
2818
2881
  RebateProgramApiService,
2819
2882
  RebateTypeApiService,
2883
+ PromotionsApiService,
2820
2884
  ], imports: [HttpClientModule] });
2821
2885
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ApiModule, decorators: [{
2822
2886
  type: NgModule,
@@ -2858,6 +2922,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
2858
2922
  StatefulConfigurationApiService,
2859
2923
  RebateProgramApiService,
2860
2924
  RebateTypeApiService,
2925
+ PromotionsApiService,
2861
2926
  ],
2862
2927
  }]
2863
2928
  }] });
@@ -2866,5 +2931,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
2866
2931
  * Generated bundle index. Do not edit.
2867
2932
  */
2868
2933
 
2869
- export { AccountApiService, ApiModule, CatalogAdminApiService, CatalogApiService, ConfigurationApiService, ConfigurationSettingsApiService, ContextApiService, DeltaApiService, DocumentAttachmentApiService, DocumentTemplatesApiService, EndpointsApiService, FlowsApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OffersApiService, OrgInfoApiService, PicklistsApiService, PriceApiService, ProceduresApiService, ProductApiService, ProductModelApiService, QuoteApiService, RampApiService, RebateProgramApiService, RebateTypeApiService, RuleGroupsApiService, RulesApiService, SalesforceApiService, ScriptsApiService, ShoppingCartSettingsApiService, StatefulConfigurationApiService, UIDefinitionsApiService, UITemplatesApiService, VeloceObjectsApiService };
2934
+ export { AccountApiService, ApiModule, CatalogAdminApiService, CatalogApiService, ConfigurationApiService, ConfigurationSettingsApiService, ContextApiService, DeltaApiService, DocumentAttachmentApiService, DocumentTemplatesApiService, EndpointsApiService, FlowsApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OffersApiService, OrgInfoApiService, PicklistsApiService, PriceApiService, ProceduresApiService, ProductApiService, ProductModelApiService, PromotionsApiService, QuoteApiService, RampApiService, RebateProgramApiService, RebateTypeApiService, RuleGroupsApiService, RulesApiService, SalesforceApiService, ScriptsApiService, ShoppingCartSettingsApiService, StatefulConfigurationApiService, UIDefinitionsApiService, UITemplatesApiService, VeloceObjectsApiService };
2870
2935
  //# sourceMappingURL=veloceapps-api.mjs.map