@vendasta/forms_microservice 0.0.11 → 0.0.12

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.
@@ -271,6 +271,9 @@ class FormConfigField {
271
271
  if (proto.default) {
272
272
  m.default = FormConfigFieldDefault.fromProto(proto.default);
273
273
  }
274
+ if (proto.defaultValue) {
275
+ m.defaultValue = FieldValue.fromProto(proto.defaultValue);
276
+ }
274
277
  return m;
275
278
  }
276
279
  toApiJson() {
@@ -290,6 +293,53 @@ class FormConfigField {
290
293
  if (typeof this.hidden !== 'undefined') {
291
294
  toReturn['hidden'] = this.hidden;
292
295
  }
296
+ if (typeof this.defaultValue !== 'undefined' && this.defaultValue !== null) {
297
+ toReturn['defaultValue'] = 'toApiJson' in this.defaultValue ? this.defaultValue.toApiJson() : this.defaultValue;
298
+ }
299
+ return toReturn;
300
+ }
301
+ }
302
+ class FieldValue {
303
+ constructor(kwargs) {
304
+ if (!kwargs) {
305
+ return;
306
+ }
307
+ Object.assign(this, kwargs);
308
+ }
309
+ static fromProto(proto) {
310
+ let m = new FieldValue();
311
+ m = Object.assign(m, proto);
312
+ if (proto.integer) {
313
+ m.integer = parseInt(proto.integer, 10);
314
+ }
315
+ if (proto.currency) {
316
+ m.currency = parseInt(proto.currency, 10);
317
+ }
318
+ return m;
319
+ }
320
+ toApiJson() {
321
+ const toReturn = {};
322
+ if (typeof this.invalid !== 'undefined') {
323
+ toReturn['invalid'] = this.invalid;
324
+ }
325
+ if (typeof this.integer !== 'undefined') {
326
+ toReturn['integer'] = this.integer;
327
+ }
328
+ if (typeof this.string !== 'undefined') {
329
+ toReturn['string'] = this.string;
330
+ }
331
+ if (typeof this.date !== 'undefined') {
332
+ toReturn['date'] = this.date;
333
+ }
334
+ if (typeof this.dropdown !== 'undefined') {
335
+ toReturn['dropdown'] = this.dropdown;
336
+ }
337
+ if (typeof this.currency !== 'undefined') {
338
+ toReturn['currency'] = this.currency;
339
+ }
340
+ if (typeof this.boolean !== 'undefined') {
341
+ toReturn['boolean'] = this.boolean;
342
+ }
293
343
  return toReturn;
294
344
  }
295
345
  }
@@ -369,6 +419,29 @@ class FormConfig {
369
419
  return toReturn;
370
420
  }
371
421
  }
422
+ class GetMultiRequestFormConfigIdentifier {
423
+ constructor(kwargs) {
424
+ if (!kwargs) {
425
+ return;
426
+ }
427
+ Object.assign(this, kwargs);
428
+ }
429
+ static fromProto(proto) {
430
+ let m = new GetMultiRequestFormConfigIdentifier();
431
+ m = Object.assign(m, proto);
432
+ return m;
433
+ }
434
+ toApiJson() {
435
+ const toReturn = {};
436
+ if (typeof this.formId !== 'undefined') {
437
+ toReturn['formId'] = this.formId;
438
+ }
439
+ if (typeof this.version !== 'undefined') {
440
+ toReturn['version'] = this.version;
441
+ }
442
+ return toReturn;
443
+ }
444
+ }
372
445
  class ListFormsResponseFormRow {
373
446
  constructor(kwargs) {
374
447
  if (!kwargs) {
@@ -424,6 +497,32 @@ class FormSubmission {
424
497
  return toReturn;
425
498
  }
426
499
  }
500
+ class ListFormSubmissionResponseFormSubmission {
501
+ constructor(kwargs) {
502
+ if (!kwargs) {
503
+ return;
504
+ }
505
+ Object.assign(this, kwargs);
506
+ }
507
+ static fromProto(proto) {
508
+ let m = new ListFormSubmissionResponseFormSubmission();
509
+ m = Object.assign(m, proto);
510
+ if (proto.values) {
511
+ m.values = proto.values.map(ListFormSubmissionResponseFormSubmissionSubmittedValue.fromProto);
512
+ }
513
+ return m;
514
+ }
515
+ toApiJson() {
516
+ const toReturn = {};
517
+ if (typeof this.formSubmissionId !== 'undefined') {
518
+ toReturn['formSubmissionId'] = this.formSubmissionId;
519
+ }
520
+ if (typeof this.values !== 'undefined' && this.values !== null) {
521
+ toReturn['values'] = 'toApiJson' in this.values ? this.values.toApiJson() : this.values;
522
+ }
523
+ return toReturn;
524
+ }
525
+ }
427
526
  class GetEmbedCodeRequest {
428
527
  constructor(kwargs) {
429
528
  if (!kwargs) {
@@ -507,6 +606,153 @@ class GetFormResponse {
507
606
  return toReturn;
508
607
  }
509
608
  }
609
+ class GetMultiFormVersionsListRequest {
610
+ constructor(kwargs) {
611
+ if (!kwargs) {
612
+ return;
613
+ }
614
+ Object.assign(this, kwargs);
615
+ }
616
+ static fromProto(proto) {
617
+ let m = new GetMultiFormVersionsListRequest();
618
+ m = Object.assign(m, proto);
619
+ return m;
620
+ }
621
+ toApiJson() {
622
+ const toReturn = {};
623
+ if (typeof this.formIds !== 'undefined') {
624
+ toReturn['formIds'] = this.formIds;
625
+ }
626
+ return toReturn;
627
+ }
628
+ }
629
+ class GetMultiFormVersionsListResponse {
630
+ constructor(kwargs) {
631
+ if (!kwargs) {
632
+ return;
633
+ }
634
+ Object.assign(this, kwargs);
635
+ }
636
+ static fromProto(proto) {
637
+ let m = new GetMultiFormVersionsListResponse();
638
+ m = Object.assign(m, proto);
639
+ if (proto.versions) {
640
+ m.versions = proto.versions.map(GetMultiFormVersionsListResponseVersions.fromProto);
641
+ }
642
+ return m;
643
+ }
644
+ toApiJson() {
645
+ const toReturn = {};
646
+ if (typeof this.versions !== 'undefined' && this.versions !== null) {
647
+ toReturn['versions'] = 'toApiJson' in this.versions ? this.versions.toApiJson() : this.versions;
648
+ }
649
+ return toReturn;
650
+ }
651
+ }
652
+ class GetMultiRequest {
653
+ constructor(kwargs) {
654
+ if (!kwargs) {
655
+ return;
656
+ }
657
+ Object.assign(this, kwargs);
658
+ }
659
+ static fromProto(proto) {
660
+ let m = new GetMultiRequest();
661
+ m = Object.assign(m, proto);
662
+ if (proto.formConfigIdentifiers) {
663
+ m.formConfigIdentifiers = proto.formConfigIdentifiers.map(GetMultiRequestFormConfigIdentifier.fromProto);
664
+ }
665
+ return m;
666
+ }
667
+ toApiJson() {
668
+ const toReturn = {};
669
+ if (typeof this.formConfigIdentifiers !== 'undefined' && this.formConfigIdentifiers !== null) {
670
+ toReturn['formConfigIdentifiers'] = 'toApiJson' in this.formConfigIdentifiers ? this.formConfigIdentifiers.toApiJson() : this.formConfigIdentifiers;
671
+ }
672
+ return toReturn;
673
+ }
674
+ }
675
+ class GetMultiResponse {
676
+ constructor(kwargs) {
677
+ if (!kwargs) {
678
+ return;
679
+ }
680
+ Object.assign(this, kwargs);
681
+ }
682
+ static fromProto(proto) {
683
+ let m = new GetMultiResponse();
684
+ m = Object.assign(m, proto);
685
+ if (proto.formConfigs) {
686
+ m.formConfigs = proto.formConfigs.map(FormConfig.fromProto);
687
+ }
688
+ return m;
689
+ }
690
+ toApiJson() {
691
+ const toReturn = {};
692
+ if (typeof this.formConfigs !== 'undefined' && this.formConfigs !== null) {
693
+ toReturn['formConfigs'] = 'toApiJson' in this.formConfigs ? this.formConfigs.toApiJson() : this.formConfigs;
694
+ }
695
+ return toReturn;
696
+ }
697
+ }
698
+ class ListFormSubmissionRequest {
699
+ constructor(kwargs) {
700
+ if (!kwargs) {
701
+ return;
702
+ }
703
+ Object.assign(this, kwargs);
704
+ }
705
+ static fromProto(proto) {
706
+ let m = new ListFormSubmissionRequest();
707
+ m = Object.assign(m, proto);
708
+ if (proto.pagingOptions) {
709
+ m.pagingOptions = PagedRequestOptions.fromProto(proto.pagingOptions);
710
+ }
711
+ return m;
712
+ }
713
+ toApiJson() {
714
+ const toReturn = {};
715
+ if (typeof this.formId !== 'undefined') {
716
+ toReturn['formId'] = this.formId;
717
+ }
718
+ if (typeof this.version !== 'undefined') {
719
+ toReturn['version'] = this.version;
720
+ }
721
+ if (typeof this.pagingOptions !== 'undefined' && this.pagingOptions !== null) {
722
+ toReturn['pagingOptions'] = 'toApiJson' in this.pagingOptions ? this.pagingOptions.toApiJson() : this.pagingOptions;
723
+ }
724
+ return toReturn;
725
+ }
726
+ }
727
+ class ListFormSubmissionResponse {
728
+ constructor(kwargs) {
729
+ if (!kwargs) {
730
+ return;
731
+ }
732
+ Object.assign(this, kwargs);
733
+ }
734
+ static fromProto(proto) {
735
+ let m = new ListFormSubmissionResponse();
736
+ m = Object.assign(m, proto);
737
+ if (proto.submissions) {
738
+ m.submissions = proto.submissions.map(ListFormSubmissionResponseFormSubmission.fromProto);
739
+ }
740
+ if (proto.pagingMetadata) {
741
+ m.pagingMetadata = PagedResponseMetadata.fromProto(proto.pagingMetadata);
742
+ }
743
+ return m;
744
+ }
745
+ toApiJson() {
746
+ const toReturn = {};
747
+ if (typeof this.submissions !== 'undefined' && this.submissions !== null) {
748
+ toReturn['submissions'] = 'toApiJson' in this.submissions ? this.submissions.toApiJson() : this.submissions;
749
+ }
750
+ if (typeof this.pagingMetadata !== 'undefined' && this.pagingMetadata !== null) {
751
+ toReturn['pagingMetadata'] = 'toApiJson' in this.pagingMetadata ? this.pagingMetadata.toApiJson() : this.pagingMetadata;
752
+ }
753
+ return toReturn;
754
+ }
755
+ }
510
756
  class ListFormsRequest {
511
757
  constructor(kwargs) {
512
758
  if (!kwargs) {
@@ -736,6 +982,32 @@ class Styles {
736
982
  return toReturn;
737
983
  }
738
984
  }
985
+ class ListFormSubmissionResponseFormSubmissionSubmittedValue {
986
+ constructor(kwargs) {
987
+ if (!kwargs) {
988
+ return;
989
+ }
990
+ Object.assign(this, kwargs);
991
+ }
992
+ static fromProto(proto) {
993
+ let m = new ListFormSubmissionResponseFormSubmissionSubmittedValue();
994
+ m = Object.assign(m, proto);
995
+ if (proto.fieldValue) {
996
+ m.fieldValue = FieldValue.fromProto(proto.fieldValue);
997
+ }
998
+ return m;
999
+ }
1000
+ toApiJson() {
1001
+ const toReturn = {};
1002
+ if (typeof this.fieldId !== 'undefined') {
1003
+ toReturn['fieldId'] = this.fieldId;
1004
+ }
1005
+ if (typeof this.fieldValue !== 'undefined' && this.fieldValue !== null) {
1006
+ toReturn['fieldValue'] = 'toApiJson' in this.fieldValue ? this.fieldValue.toApiJson() : this.fieldValue;
1007
+ }
1008
+ return toReturn;
1009
+ }
1010
+ }
739
1011
  class FormConfigFieldUnmappedField {
740
1012
  constructor(kwargs) {
741
1013
  if (!kwargs) {
@@ -814,6 +1086,29 @@ class UpdateFormResponse {
814
1086
  return toReturn;
815
1087
  }
816
1088
  }
1089
+ class GetMultiFormVersionsListResponseVersions {
1090
+ constructor(kwargs) {
1091
+ if (!kwargs) {
1092
+ return;
1093
+ }
1094
+ Object.assign(this, kwargs);
1095
+ }
1096
+ static fromProto(proto) {
1097
+ let m = new GetMultiFormVersionsListResponseVersions();
1098
+ m = Object.assign(m, proto);
1099
+ return m;
1100
+ }
1101
+ toApiJson() {
1102
+ const toReturn = {};
1103
+ if (typeof this.formId !== 'undefined') {
1104
+ toReturn['formId'] = this.formId;
1105
+ }
1106
+ if (typeof this.version !== 'undefined') {
1107
+ toReturn['version'] = this.version;
1108
+ }
1109
+ return toReturn;
1110
+ }
1111
+ }
817
1112
 
818
1113
  // *********************************
819
1114
 
@@ -859,6 +1154,11 @@ class FormSubmissionApiService {
859
1154
  const request = (r.toApiJson) ? r : new CreateFormSubmissionRequest(r);
860
1155
  return this.http.post(this._host + "/forms.v1.FormSubmissionService/CreateFormSubmission", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
861
1156
  }
1157
+ listFormSubmission(r) {
1158
+ const request = (r.toApiJson) ? r : new ListFormSubmissionRequest(r);
1159
+ return this.http.post(this._host + "/forms.v1.FormSubmissionService/ListFormSubmission", request.toApiJson(), this.apiOptions())
1160
+ .pipe(map(resp => ListFormSubmissionResponse.fromProto(resp)));
1161
+ }
862
1162
  }
863
1163
  FormSubmissionApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: FormSubmissionApiService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
864
1164
  FormSubmissionApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: FormSubmissionApiService, providedIn: 'root' });
@@ -892,6 +1192,16 @@ class FormsApiService {
892
1192
  return this.http.post(this._host + "/forms.v1.Forms/GetForm", request.toApiJson(), this.apiOptions())
893
1193
  .pipe(map(resp => GetFormResponse.fromProto(resp)));
894
1194
  }
1195
+ getMultiFormVersionsList(r) {
1196
+ const request = (r.toApiJson) ? r : new GetMultiFormVersionsListRequest(r);
1197
+ return this.http.post(this._host + "/forms.v1.Forms/GetMultiFormVersionsList", request.toApiJson(), this.apiOptions())
1198
+ .pipe(map(resp => GetMultiFormVersionsListResponse.fromProto(resp)));
1199
+ }
1200
+ getMulti(r) {
1201
+ const request = (r.toApiJson) ? r : new GetMultiRequest(r);
1202
+ return this.http.post(this._host + "/forms.v1.Forms/GetMulti", request.toApiJson(), this.apiOptions())
1203
+ .pipe(map(resp => GetMultiResponse.fromProto(resp)));
1204
+ }
895
1205
  createForm(r) {
896
1206
  const request = (r.toApiJson) ? r : new CreateFormRequest(r);
897
1207
  return this.http.post(this._host + "/forms.v1.Forms/CreateForm", request.toApiJson(), this.apiOptions())
@@ -937,5 +1247,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImpor
937
1247
  * Generated bundle index. Do not edit.
938
1248
  */
939
1249
 
940
- export { CreateFormRequest, CreateFormResponse, CreateFormSubmissionRequest, DeleteFormRequest, FieldType, FormConfig, FormConfigField, FormConfigFieldDefault, FormConfigFieldSchema, FormConfigFieldUnmappedField, FormConfigFieldUnmappedFieldDropdownOption, FormSubmission, FormSubmissionApiService, FormsApiService, GetEmbedCodeRequest, GetEmbedCodeResponse, GetFormRequest, GetFormResponse, HostService, JsonSchemaLibrary, ListFormsRequest, ListFormsRequestFilters, ListFormsResponse, ListFormsResponseFormRow, PagedRequestOptions, PagedResponseMetadata, PreviewFormRequest, PreviewFormResponse, RenderFormRequest, RenderFormResponse, Styles, UpdateFormRequest, UpdateFormResponse };
1250
+ export { CreateFormRequest, CreateFormResponse, CreateFormSubmissionRequest, DeleteFormRequest, FieldType, FieldValue, FormConfig, FormConfigField, FormConfigFieldDefault, FormConfigFieldSchema, FormConfigFieldUnmappedField, FormConfigFieldUnmappedFieldDropdownOption, FormSubmission, FormSubmissionApiService, 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, Styles, UpdateFormRequest, UpdateFormResponse };
941
1251
  //# sourceMappingURL=vendasta-forms_microservice.mjs.map