@experteam-mx/ngx-services 20.1.9 → 20.1.11
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.
|
@@ -4378,6 +4378,113 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
4378
4378
|
}]
|
|
4379
4379
|
}] });
|
|
4380
4380
|
|
|
4381
|
+
class ApiSurveysService {
|
|
4382
|
+
environments = inject(ENVIRONMENT_TOKEN);
|
|
4383
|
+
http = inject(HttpClient);
|
|
4384
|
+
/**
|
|
4385
|
+
* Base URL for surveys API endpoints.
|
|
4386
|
+
* @returns The configured surveys API URL or an empty string.
|
|
4387
|
+
*/
|
|
4388
|
+
get url() {
|
|
4389
|
+
return this.environments.apiSurveysUrl ?? '';
|
|
4390
|
+
}
|
|
4391
|
+
/**
|
|
4392
|
+
* Retrieves surveys list based on query parameters.
|
|
4393
|
+
* @param params Query parameters used to filter, paginate, or sort surveys.
|
|
4394
|
+
* @returns Observable stream with surveys response data.
|
|
4395
|
+
*/
|
|
4396
|
+
getSurveys(params) {
|
|
4397
|
+
return this.http.get(`${this.url}/surveys`, { params })
|
|
4398
|
+
.pipe(map(({ data }) => data));
|
|
4399
|
+
}
|
|
4400
|
+
/**
|
|
4401
|
+
* Creates a new survey.
|
|
4402
|
+
* @param body Survey payload to create.
|
|
4403
|
+
* @returns Observable stream with created survey data.
|
|
4404
|
+
*/
|
|
4405
|
+
postSurvey(body) {
|
|
4406
|
+
return this.http.post(`${this.url}/surveys`, body)
|
|
4407
|
+
.pipe(map(({ data }) => data));
|
|
4408
|
+
}
|
|
4409
|
+
/**
|
|
4410
|
+
* Replaces an existing survey by id.
|
|
4411
|
+
* @param id Survey identifier.
|
|
4412
|
+
* @param body Survey payload used to replace the resource.
|
|
4413
|
+
* @returns Observable stream with updated survey data.
|
|
4414
|
+
*/
|
|
4415
|
+
putSurvey(id, body) {
|
|
4416
|
+
return this.http.put(`${this.url}/surveys/${id}`, body)
|
|
4417
|
+
.pipe(map(({ data }) => data));
|
|
4418
|
+
}
|
|
4419
|
+
/**
|
|
4420
|
+
* Partially updates an existing survey by id.
|
|
4421
|
+
* @param id Survey identifier.
|
|
4422
|
+
* @param body Partial survey payload with fields to update.
|
|
4423
|
+
* @returns Observable stream with updated survey data.
|
|
4424
|
+
*/
|
|
4425
|
+
patchSurvey(id, body) {
|
|
4426
|
+
return this.http.patch(`${this.url}/surveys/${id}`, body)
|
|
4427
|
+
.pipe(map(({ data }) => data));
|
|
4428
|
+
}
|
|
4429
|
+
/**
|
|
4430
|
+
* Retrieves the questions for a survey.
|
|
4431
|
+
* @param id Survey identifier.
|
|
4432
|
+
* @param params Query parameters used to filter, paginate, or sort questions.
|
|
4433
|
+
* @returns Observable stream with survey questions response data.
|
|
4434
|
+
*/
|
|
4435
|
+
getSurveyQuestions(id, params) {
|
|
4436
|
+
return this.http.get(`${this.url}/surveys/${id}/questions`, { params })
|
|
4437
|
+
.pipe(map(({ data }) => data));
|
|
4438
|
+
}
|
|
4439
|
+
/**
|
|
4440
|
+
* Creates a new question for a survey.
|
|
4441
|
+
* @param surveyId Parent survey identifier.
|
|
4442
|
+
* @param body Survey question payload to create.
|
|
4443
|
+
* @returns Observable stream with created survey question data.
|
|
4444
|
+
*/
|
|
4445
|
+
postSurveyQuestion(surveyId, body) {
|
|
4446
|
+
return this.http.post(`${this.url}/surveys/${surveyId}/questions`, body)
|
|
4447
|
+
.pipe(map(({ data }) => data));
|
|
4448
|
+
}
|
|
4449
|
+
/**
|
|
4450
|
+
* Replaces an existing survey question by id.
|
|
4451
|
+
* @param questionId Survey question identifier.
|
|
4452
|
+
* @param body Survey question payload used to replace the resource.
|
|
4453
|
+
* @returns Observable stream with updated survey question data.
|
|
4454
|
+
*/
|
|
4455
|
+
putSurveyQuestion(questionId, body) {
|
|
4456
|
+
return this.http.put(`${this.url}/questions/${questionId}`, body)
|
|
4457
|
+
.pipe(map(({ data }) => data));
|
|
4458
|
+
}
|
|
4459
|
+
/**
|
|
4460
|
+
* Partially updates an existing survey question by id.
|
|
4461
|
+
* @param questionId Survey question identifier.
|
|
4462
|
+
* @param body Partial survey question payload with fields to update.
|
|
4463
|
+
* @returns Observable stream with updated survey question data.
|
|
4464
|
+
*/
|
|
4465
|
+
patchSurveyQuestion(questionId, body) {
|
|
4466
|
+
return this.http.patch(`${this.url}/questions/${questionId}`, body)
|
|
4467
|
+
.pipe(map(({ data }) => data));
|
|
4468
|
+
}
|
|
4469
|
+
/**
|
|
4470
|
+
* Retrieves the available question types.
|
|
4471
|
+
* @param params Query parameters used to filter, paginate, or sort question types.
|
|
4472
|
+
* @returns Observable stream with question types response data.
|
|
4473
|
+
*/
|
|
4474
|
+
getQuestionTypes(params) {
|
|
4475
|
+
return this.http.get(`${this.url}/question-types`, { params })
|
|
4476
|
+
.pipe(map(({ data }) => data));
|
|
4477
|
+
}
|
|
4478
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ApiSurveysService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4479
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ApiSurveysService, providedIn: 'root' });
|
|
4480
|
+
}
|
|
4481
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ApiSurveysService, decorators: [{
|
|
4482
|
+
type: Injectable,
|
|
4483
|
+
args: [{
|
|
4484
|
+
providedIn: 'root'
|
|
4485
|
+
}]
|
|
4486
|
+
}] });
|
|
4487
|
+
|
|
4381
4488
|
var ViewSectionOption;
|
|
4382
4489
|
(function (ViewSectionOption) {
|
|
4383
4490
|
ViewSectionOption["SHIPMENT"] = "shipment";
|
|
@@ -4831,5 +4938,5 @@ const xmlHeaders = (format = 'object') => {
|
|
|
4831
4938
|
* Generated bundle index. Do not edit.
|
|
4832
4939
|
*/
|
|
4833
4940
|
|
|
4834
|
-
export { AlphaNumeric, ApiBillingDOService, ApiBillingGtService, ApiBillingMxService, ApiBillingPaService, ApiBillingSvService, ApiCashOperationsService, ApiCatalogsService, ApiCompaniesService, ApiCompositionService, ApiCustomsService, ApiDiscountsService, ApiEToolsAutoBillingService, ApiEventsService, ApiExternalOperationsService, ApiInventoriesService, ApiInvoicesService, ApiNotificationsService, ApiOpenItemsService, ApiQuoteService, ApiReportsService, ApiSecurityService, ApiServicesService, ApiShipmentsService, ApiSuppliesService, CryptoService, DefaultValueType, ENVIRONMENT_TOKEN, Event, NgxServicesModule, OperationModuleStatus, ViewSectionOption, WebSocketsService, apiHeadersInterceptor, apiKeyInterceptor, apiTokenInterceptor, base64PdfToUrl, downloadBase64Pdf, httpCachingInterceptor, httpParams, pdfHeaders, provideNgxServices, queryString, xmlHeaders };
|
|
4941
|
+
export { AlphaNumeric, ApiBillingDOService, ApiBillingGtService, ApiBillingMxService, ApiBillingPaService, ApiBillingSvService, ApiCashOperationsService, ApiCatalogsService, ApiCompaniesService, ApiCompositionService, ApiCustomsService, ApiDiscountsService, ApiEToolsAutoBillingService, ApiEventsService, ApiExternalOperationsService, ApiInventoriesService, ApiInvoicesService, ApiNotificationsService, ApiOpenItemsService, ApiQuoteService, ApiReportsService, ApiSecurityService, ApiServicesService, ApiShipmentsService, ApiSuppliesService, ApiSurveysService, CryptoService, DefaultValueType, ENVIRONMENT_TOKEN, Event, NgxServicesModule, OperationModuleStatus, ViewSectionOption, WebSocketsService, apiHeadersInterceptor, apiKeyInterceptor, apiTokenInterceptor, base64PdfToUrl, downloadBase64Pdf, httpCachingInterceptor, httpParams, pdfHeaders, provideNgxServices, queryString, xmlHeaders };
|
|
4835
4942
|
//# sourceMappingURL=experteam-mx-ngx-services.mjs.map
|