@vendasta/forms_microservice 0.1.1 → 0.2.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.
@@ -155,7 +155,7 @@ class CreateFormSubmissionRequest {
155
155
  let m = new CreateFormSubmissionRequest();
156
156
  m = Object.assign(m, proto);
157
157
  if (proto.submission) {
158
- m.submission = FormSubmission.fromProto(proto.submission);
158
+ m.submission = UserFormSubmission.fromProto(proto.submission);
159
159
  }
160
160
  return m;
161
161
  }
@@ -442,34 +442,8 @@ class FormSubmission {
442
442
  static fromProto(proto) {
443
443
  let m = new FormSubmission();
444
444
  m = Object.assign(m, proto);
445
- return m;
446
- }
447
- constructor(kwargs) {
448
- if (!kwargs) {
449
- return;
450
- }
451
- Object.assign(this, kwargs);
452
- }
453
- toApiJson() {
454
- const toReturn = {};
455
- if (typeof this.formId !== 'undefined') {
456
- toReturn['formId'] = this.formId;
457
- }
458
- if (typeof this.version !== 'undefined') {
459
- toReturn['version'] = this.version;
460
- }
461
- if (typeof this.values !== 'undefined') {
462
- toReturn['values'] = this.values;
463
- }
464
- return toReturn;
465
- }
466
- }
467
- class ListFormSubmissionResponseFormSubmission {
468
- static fromProto(proto) {
469
- let m = new ListFormSubmissionResponseFormSubmission();
470
- m = Object.assign(m, proto);
471
445
  if (proto.values) {
472
- m.values = proto.values.map(ListFormSubmissionResponseFormSubmissionSubmittedValue.fromProto);
446
+ m.values = proto.values.map(FormSubmissionSubmittedValue.fromProto);
473
447
  }
474
448
  if (proto.created) {
475
449
  m.created = new Date(proto.created);
@@ -582,6 +556,49 @@ class GetFormResponse {
582
556
  return toReturn;
583
557
  }
584
558
  }
559
+ class GetMultiFormSubmissionRequest {
560
+ static fromProto(proto) {
561
+ let m = new GetMultiFormSubmissionRequest();
562
+ m = Object.assign(m, proto);
563
+ return m;
564
+ }
565
+ constructor(kwargs) {
566
+ if (!kwargs) {
567
+ return;
568
+ }
569
+ Object.assign(this, kwargs);
570
+ }
571
+ toApiJson() {
572
+ const toReturn = {};
573
+ if (typeof this.formSubmissionIds !== 'undefined') {
574
+ toReturn['formSubmissionIds'] = this.formSubmissionIds;
575
+ }
576
+ return toReturn;
577
+ }
578
+ }
579
+ class GetMultiFormSubmissionResponse {
580
+ static fromProto(proto) {
581
+ let m = new GetMultiFormSubmissionResponse();
582
+ m = Object.assign(m, proto);
583
+ if (proto.submissions) {
584
+ m.submissions = proto.submissions.map(FormSubmission.fromProto);
585
+ }
586
+ return m;
587
+ }
588
+ constructor(kwargs) {
589
+ if (!kwargs) {
590
+ return;
591
+ }
592
+ Object.assign(this, kwargs);
593
+ }
594
+ toApiJson() {
595
+ const toReturn = {};
596
+ if (typeof this.submissions !== 'undefined' && this.submissions !== null) {
597
+ toReturn['submissions'] = 'toApiJson' in this.submissions ? this.submissions.toApiJson() : this.submissions;
598
+ }
599
+ return toReturn;
600
+ }
601
+ }
585
602
  class GetMultiFormVersionsListRequest {
586
603
  static fromProto(proto) {
587
604
  let m = new GetMultiFormVersionsListRequest();
@@ -702,7 +719,7 @@ class ListFormSubmissionResponse {
702
719
  let m = new ListFormSubmissionResponse();
703
720
  m = Object.assign(m, proto);
704
721
  if (proto.submissions) {
705
- m.submissions = proto.submissions.map(ListFormSubmissionResponseFormSubmission.fromProto);
722
+ m.submissions = proto.submissions.map(FormSubmission.fromProto);
706
723
  }
707
724
  if (proto.pagingMetadata) {
708
725
  m.pagingMetadata = PagedResponseMetadata.fromProto(proto.pagingMetadata);
@@ -1057,13 +1074,16 @@ class Styles {
1057
1074
  return toReturn;
1058
1075
  }
1059
1076
  }
1060
- class ListFormSubmissionResponseFormSubmissionSubmittedValue {
1077
+ class FormSubmissionSubmittedValue {
1061
1078
  static fromProto(proto) {
1062
- let m = new ListFormSubmissionResponseFormSubmissionSubmittedValue();
1079
+ let m = new FormSubmissionSubmittedValue();
1063
1080
  m = Object.assign(m, proto);
1064
1081
  if (proto.fieldValue) {
1065
1082
  m.fieldValue = FieldValue.fromProto(proto.fieldValue);
1066
1083
  }
1084
+ if (proto.fieldType) {
1085
+ m.fieldType = enumStringToValue(FieldType, proto.fieldType);
1086
+ }
1067
1087
  return m;
1068
1088
  }
1069
1089
  constructor(kwargs) {
@@ -1080,6 +1100,12 @@ class ListFormSubmissionResponseFormSubmissionSubmittedValue {
1080
1100
  if (typeof this.fieldValue !== 'undefined' && this.fieldValue !== null) {
1081
1101
  toReturn['fieldValue'] = 'toApiJson' in this.fieldValue ? this.fieldValue.toApiJson() : this.fieldValue;
1082
1102
  }
1103
+ if (typeof this.fieldType !== 'undefined') {
1104
+ toReturn['fieldType'] = this.fieldType;
1105
+ }
1106
+ if (typeof this.mappedToResource !== 'undefined') {
1107
+ toReturn['mappedToResource'] = this.mappedToResource;
1108
+ }
1083
1109
  return toReturn;
1084
1110
  }
1085
1111
  }
@@ -1167,6 +1193,32 @@ class UpdateFormResponse {
1167
1193
  return toReturn;
1168
1194
  }
1169
1195
  }
1196
+ class UserFormSubmission {
1197
+ static fromProto(proto) {
1198
+ let m = new UserFormSubmission();
1199
+ m = Object.assign(m, proto);
1200
+ return m;
1201
+ }
1202
+ constructor(kwargs) {
1203
+ if (!kwargs) {
1204
+ return;
1205
+ }
1206
+ Object.assign(this, kwargs);
1207
+ }
1208
+ toApiJson() {
1209
+ const toReturn = {};
1210
+ if (typeof this.formId !== 'undefined') {
1211
+ toReturn['formId'] = this.formId;
1212
+ }
1213
+ if (typeof this.version !== 'undefined') {
1214
+ toReturn['version'] = this.version;
1215
+ }
1216
+ if (typeof this.values !== 'undefined') {
1217
+ toReturn['values'] = this.values;
1218
+ }
1219
+ return toReturn;
1220
+ }
1221
+ }
1170
1222
  class ValidationError {
1171
1223
  static fromProto(proto) {
1172
1224
  let m = new ValidationError();
@@ -1264,6 +1316,11 @@ class FormSubmissionApiService {
1264
1316
  return this.http.post(this._host + "/forms.v1.FormSubmissionService/ListFormSubmission", request.toApiJson(), this.apiOptions())
1265
1317
  .pipe(map(resp => ListFormSubmissionResponse.fromProto(resp)));
1266
1318
  }
1319
+ getMultiFormSubmission(r) {
1320
+ const request = (r.toApiJson) ? r : new GetMultiFormSubmissionRequest(r);
1321
+ return this.http.post(this._host + "/forms.v1.FormSubmissionService/GetMultiFormSubmission", request.toApiJson(), this.apiOptions())
1322
+ .pipe(map(resp => GetMultiFormSubmissionResponse.fromProto(resp)));
1323
+ }
1267
1324
  }
1268
1325
  FormSubmissionApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: FormSubmissionApiService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
1269
1326
  FormSubmissionApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: FormSubmissionApiService, providedIn: 'root' });
@@ -1383,5 +1440,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImpor
1383
1440
  * Generated bundle index. Do not edit.
1384
1441
  */
1385
1442
 
1386
- export { CreateFormRequest, CreateFormResponse, CreateFormSubmissionRequest, CreateFormSubmissionResponse, DeleteFormRequest, FieldType, FieldValue, FormConfig, FormConfigField, FormConfigFieldMappedField, FormConfigFieldOption, FormConfigFieldSchema, FormConfigFieldUnmappedField, FormSubmission, FormSubmissionApiService, FormSubmissionsExportService, FormsApiService, GetEmbedCodeRequest, GetEmbedCodeResponse, GetFormRequest, GetFormResponse, GetMultiFormVersionsListRequest, GetMultiFormVersionsListResponse, GetMultiFormVersionsListResponseVersions, GetMultiRequest, GetMultiRequestFormConfigIdentifier, GetMultiResponse, HostService, JsonSchemaLibrary, ListFormSubmissionRequest, ListFormSubmissionResponse, ListFormSubmissionResponseFormSubmission, ListFormSubmissionResponseFormSubmissionSubmittedValue, ListFormsRequest, ListFormsRequestFilters, ListFormsResponse, ListFormsResponseFormRow, PagedRequestOptions, PagedResponseMetadata, PreviewFormRequest, PreviewFormResponse, RenderFormRequest, RenderFormResponse, RenderFormResponsePreFillByUrlQueryParameter, Styles, UpdateFormRequest, UpdateFormResponse, ValidationError };
1443
+ export { CreateFormRequest, CreateFormResponse, CreateFormSubmissionRequest, CreateFormSubmissionResponse, DeleteFormRequest, FieldType, FieldValue, FormConfig, FormConfigField, FormConfigFieldMappedField, FormConfigFieldOption, FormConfigFieldSchema, FormConfigFieldUnmappedField, FormSubmission, FormSubmissionApiService, FormSubmissionSubmittedValue, FormSubmissionsExportService, FormsApiService, GetEmbedCodeRequest, GetEmbedCodeResponse, GetFormRequest, GetFormResponse, GetMultiFormSubmissionRequest, GetMultiFormSubmissionResponse, GetMultiFormVersionsListRequest, GetMultiFormVersionsListResponse, GetMultiFormVersionsListResponseVersions, GetMultiRequest, GetMultiRequestFormConfigIdentifier, GetMultiResponse, HostService, JsonSchemaLibrary, ListFormSubmissionRequest, ListFormSubmissionResponse, ListFormsRequest, ListFormsRequestFilters, ListFormsResponse, ListFormsResponseFormRow, PagedRequestOptions, PagedResponseMetadata, PreviewFormRequest, PreviewFormResponse, RenderFormRequest, RenderFormResponse, RenderFormResponsePreFillByUrlQueryParameter, Styles, UpdateFormRequest, UpdateFormResponse, UserFormSubmission, ValidationError };
1387
1444
  //# sourceMappingURL=vendasta-forms_microservice.mjs.map