@vendasta/forms_microservice 0.0.10 → 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.
@@ -20,11 +20,11 @@ var FieldType;
20
20
  FieldType[FieldType["FIELD_TYPE_CURRENCY"] = 5] = "FIELD_TYPE_CURRENCY";
21
21
  FieldType[FieldType["FIELD_TYPE_BOOLEAN"] = 6] = "FIELD_TYPE_BOOLEAN";
22
22
  })(FieldType || (FieldType = {}));
23
- var RenderFormRequestJsonSchemaLibrary;
24
- (function (RenderFormRequestJsonSchemaLibrary) {
25
- RenderFormRequestJsonSchemaLibrary[RenderFormRequestJsonSchemaLibrary["RENDER_FORM_REQUEST_JSON_SCHEMA_LIBRARY_UNDEFINED"] = 0] = "RENDER_FORM_REQUEST_JSON_SCHEMA_LIBRARY_UNDEFINED";
26
- RenderFormRequestJsonSchemaLibrary[RenderFormRequestJsonSchemaLibrary["RENDER_FORM_REQUEST_JSON_SCHEMA_LIBRARY_JSONFORM"] = 1] = "RENDER_FORM_REQUEST_JSON_SCHEMA_LIBRARY_JSONFORM";
27
- })(RenderFormRequestJsonSchemaLibrary || (RenderFormRequestJsonSchemaLibrary = {}));
23
+ var JsonSchemaLibrary;
24
+ (function (JsonSchemaLibrary) {
25
+ JsonSchemaLibrary[JsonSchemaLibrary["JSON_SCHEMA_LIBRARY_UNDEFINED"] = 0] = "JSON_SCHEMA_LIBRARY_UNDEFINED";
26
+ JsonSchemaLibrary[JsonSchemaLibrary["JSON_SCHEMA_LIBRARY_JSONFORM"] = 1] = "JSON_SCHEMA_LIBRARY_JSONFORM";
27
+ })(JsonSchemaLibrary || (JsonSchemaLibrary = {}));
28
28
 
29
29
  // *********************************
30
30
 
@@ -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
  }
@@ -366,6 +416,32 @@ class FormConfig {
366
416
  if (typeof this.updated !== 'undefined' && this.updated !== null) {
367
417
  toReturn['updated'] = 'toApiJson' in this.updated ? this.updated.toApiJson() : this.updated;
368
418
  }
419
+ if (typeof this.mostRecent !== 'undefined') {
420
+ toReturn['mostRecent'] = this.mostRecent;
421
+ }
422
+ return toReturn;
423
+ }
424
+ }
425
+ class GetMultiRequestFormConfigIdentifier {
426
+ constructor(kwargs) {
427
+ if (!kwargs) {
428
+ return;
429
+ }
430
+ Object.assign(this, kwargs);
431
+ }
432
+ static fromProto(proto) {
433
+ let m = new GetMultiRequestFormConfigIdentifier();
434
+ m = Object.assign(m, proto);
435
+ return m;
436
+ }
437
+ toApiJson() {
438
+ const toReturn = {};
439
+ if (typeof this.formId !== 'undefined') {
440
+ toReturn['formId'] = this.formId;
441
+ }
442
+ if (typeof this.version !== 'undefined') {
443
+ toReturn['version'] = this.version;
444
+ }
369
445
  return toReturn;
370
446
  }
371
447
  }
@@ -424,6 +500,35 @@ class FormSubmission {
424
500
  return toReturn;
425
501
  }
426
502
  }
503
+ class ListFormSubmissionResponseFormSubmission {
504
+ constructor(kwargs) {
505
+ if (!kwargs) {
506
+ return;
507
+ }
508
+ Object.assign(this, kwargs);
509
+ }
510
+ static fromProto(proto) {
511
+ let m = new ListFormSubmissionResponseFormSubmission();
512
+ m = Object.assign(m, proto);
513
+ if (proto.values) {
514
+ m.values = proto.values.map(ListFormSubmissionResponseFormSubmissionSubmittedValue.fromProto);
515
+ }
516
+ return m;
517
+ }
518
+ toApiJson() {
519
+ const toReturn = {};
520
+ if (typeof this.formSubmissionId !== 'undefined') {
521
+ toReturn['formSubmissionId'] = this.formSubmissionId;
522
+ }
523
+ if (typeof this.formVersion !== 'undefined') {
524
+ toReturn['formVersion'] = this.formVersion;
525
+ }
526
+ if (typeof this.values !== 'undefined' && this.values !== null) {
527
+ toReturn['values'] = 'toApiJson' in this.values ? this.values.toApiJson() : this.values;
528
+ }
529
+ return toReturn;
530
+ }
531
+ }
427
532
  class GetEmbedCodeRequest {
428
533
  constructor(kwargs) {
429
534
  if (!kwargs) {
@@ -507,6 +612,150 @@ class GetFormResponse {
507
612
  return toReturn;
508
613
  }
509
614
  }
615
+ class GetMultiFormVersionsListRequest {
616
+ constructor(kwargs) {
617
+ if (!kwargs) {
618
+ return;
619
+ }
620
+ Object.assign(this, kwargs);
621
+ }
622
+ static fromProto(proto) {
623
+ let m = new GetMultiFormVersionsListRequest();
624
+ m = Object.assign(m, proto);
625
+ return m;
626
+ }
627
+ toApiJson() {
628
+ const toReturn = {};
629
+ if (typeof this.formIds !== 'undefined') {
630
+ toReturn['formIds'] = this.formIds;
631
+ }
632
+ return toReturn;
633
+ }
634
+ }
635
+ class GetMultiFormVersionsListResponse {
636
+ constructor(kwargs) {
637
+ if (!kwargs) {
638
+ return;
639
+ }
640
+ Object.assign(this, kwargs);
641
+ }
642
+ static fromProto(proto) {
643
+ let m = new GetMultiFormVersionsListResponse();
644
+ m = Object.assign(m, proto);
645
+ if (proto.versions) {
646
+ m.versions = proto.versions.map(GetMultiFormVersionsListResponseVersions.fromProto);
647
+ }
648
+ return m;
649
+ }
650
+ toApiJson() {
651
+ const toReturn = {};
652
+ if (typeof this.versions !== 'undefined' && this.versions !== null) {
653
+ toReturn['versions'] = 'toApiJson' in this.versions ? this.versions.toApiJson() : this.versions;
654
+ }
655
+ return toReturn;
656
+ }
657
+ }
658
+ class GetMultiRequest {
659
+ constructor(kwargs) {
660
+ if (!kwargs) {
661
+ return;
662
+ }
663
+ Object.assign(this, kwargs);
664
+ }
665
+ static fromProto(proto) {
666
+ let m = new GetMultiRequest();
667
+ m = Object.assign(m, proto);
668
+ if (proto.formConfigIdentifiers) {
669
+ m.formConfigIdentifiers = proto.formConfigIdentifiers.map(GetMultiRequestFormConfigIdentifier.fromProto);
670
+ }
671
+ return m;
672
+ }
673
+ toApiJson() {
674
+ const toReturn = {};
675
+ if (typeof this.formConfigIdentifiers !== 'undefined' && this.formConfigIdentifiers !== null) {
676
+ toReturn['formConfigIdentifiers'] = 'toApiJson' in this.formConfigIdentifiers ? this.formConfigIdentifiers.toApiJson() : this.formConfigIdentifiers;
677
+ }
678
+ return toReturn;
679
+ }
680
+ }
681
+ class GetMultiResponse {
682
+ constructor(kwargs) {
683
+ if (!kwargs) {
684
+ return;
685
+ }
686
+ Object.assign(this, kwargs);
687
+ }
688
+ static fromProto(proto) {
689
+ let m = new GetMultiResponse();
690
+ m = Object.assign(m, proto);
691
+ if (proto.formConfigs) {
692
+ m.formConfigs = proto.formConfigs.map(FormConfig.fromProto);
693
+ }
694
+ return m;
695
+ }
696
+ toApiJson() {
697
+ const toReturn = {};
698
+ if (typeof this.formConfigs !== 'undefined' && this.formConfigs !== null) {
699
+ toReturn['formConfigs'] = 'toApiJson' in this.formConfigs ? this.formConfigs.toApiJson() : this.formConfigs;
700
+ }
701
+ return toReturn;
702
+ }
703
+ }
704
+ class ListFormSubmissionRequest {
705
+ constructor(kwargs) {
706
+ if (!kwargs) {
707
+ return;
708
+ }
709
+ Object.assign(this, kwargs);
710
+ }
711
+ static fromProto(proto) {
712
+ let m = new ListFormSubmissionRequest();
713
+ m = Object.assign(m, proto);
714
+ if (proto.pagingOptions) {
715
+ m.pagingOptions = PagedRequestOptions.fromProto(proto.pagingOptions);
716
+ }
717
+ return m;
718
+ }
719
+ toApiJson() {
720
+ const toReturn = {};
721
+ if (typeof this.formId !== 'undefined') {
722
+ toReturn['formId'] = this.formId;
723
+ }
724
+ if (typeof this.pagingOptions !== 'undefined' && this.pagingOptions !== null) {
725
+ toReturn['pagingOptions'] = 'toApiJson' in this.pagingOptions ? this.pagingOptions.toApiJson() : this.pagingOptions;
726
+ }
727
+ return toReturn;
728
+ }
729
+ }
730
+ class ListFormSubmissionResponse {
731
+ constructor(kwargs) {
732
+ if (!kwargs) {
733
+ return;
734
+ }
735
+ Object.assign(this, kwargs);
736
+ }
737
+ static fromProto(proto) {
738
+ let m = new ListFormSubmissionResponse();
739
+ m = Object.assign(m, proto);
740
+ if (proto.submissions) {
741
+ m.submissions = proto.submissions.map(ListFormSubmissionResponseFormSubmission.fromProto);
742
+ }
743
+ if (proto.pagingMetadata) {
744
+ m.pagingMetadata = PagedResponseMetadata.fromProto(proto.pagingMetadata);
745
+ }
746
+ return m;
747
+ }
748
+ toApiJson() {
749
+ const toReturn = {};
750
+ if (typeof this.submissions !== 'undefined' && this.submissions !== null) {
751
+ toReturn['submissions'] = 'toApiJson' in this.submissions ? this.submissions.toApiJson() : this.submissions;
752
+ }
753
+ if (typeof this.pagingMetadata !== 'undefined' && this.pagingMetadata !== null) {
754
+ toReturn['pagingMetadata'] = 'toApiJson' in this.pagingMetadata ? this.pagingMetadata.toApiJson() : this.pagingMetadata;
755
+ }
756
+ return toReturn;
757
+ }
758
+ }
510
759
  class ListFormsRequest {
511
760
  constructor(kwargs) {
512
761
  if (!kwargs) {
@@ -565,6 +814,58 @@ class ListFormsResponse {
565
814
  return toReturn;
566
815
  }
567
816
  }
817
+ class PreviewFormRequest {
818
+ constructor(kwargs) {
819
+ if (!kwargs) {
820
+ return;
821
+ }
822
+ Object.assign(this, kwargs);
823
+ }
824
+ static fromProto(proto) {
825
+ let m = new PreviewFormRequest();
826
+ m = Object.assign(m, proto);
827
+ if (proto.formConfig) {
828
+ m.formConfig = FormConfig.fromProto(proto.formConfig);
829
+ }
830
+ if (proto.library) {
831
+ m.library = enumStringToValue(JsonSchemaLibrary, proto.library);
832
+ }
833
+ return m;
834
+ }
835
+ toApiJson() {
836
+ const toReturn = {};
837
+ if (typeof this.formConfig !== 'undefined' && this.formConfig !== null) {
838
+ toReturn['formConfig'] = 'toApiJson' in this.formConfig ? this.formConfig.toApiJson() : this.formConfig;
839
+ }
840
+ if (typeof this.library !== 'undefined') {
841
+ toReturn['library'] = this.library;
842
+ }
843
+ return toReturn;
844
+ }
845
+ }
846
+ class PreviewFormResponse {
847
+ constructor(kwargs) {
848
+ if (!kwargs) {
849
+ return;
850
+ }
851
+ Object.assign(this, kwargs);
852
+ }
853
+ static fromProto(proto) {
854
+ let m = new PreviewFormResponse();
855
+ m = Object.assign(m, proto);
856
+ return m;
857
+ }
858
+ toApiJson() {
859
+ const toReturn = {};
860
+ if (typeof this.jsonSchema !== 'undefined') {
861
+ toReturn['jsonSchema'] = this.jsonSchema;
862
+ }
863
+ if (typeof this.jsonUiSchema !== 'undefined') {
864
+ toReturn['jsonUiSchema'] = this.jsonUiSchema;
865
+ }
866
+ return toReturn;
867
+ }
868
+ }
568
869
  class RenderFormRequest {
569
870
  constructor(kwargs) {
570
871
  if (!kwargs) {
@@ -576,7 +877,7 @@ class RenderFormRequest {
576
877
  let m = new RenderFormRequest();
577
878
  m = Object.assign(m, proto);
578
879
  if (proto.library) {
579
- m.library = enumStringToValue(RenderFormRequestJsonSchemaLibrary, proto.library);
880
+ m.library = enumStringToValue(JsonSchemaLibrary, proto.library);
580
881
  }
581
882
  return m;
582
883
  }
@@ -684,6 +985,32 @@ class Styles {
684
985
  return toReturn;
685
986
  }
686
987
  }
988
+ class ListFormSubmissionResponseFormSubmissionSubmittedValue {
989
+ constructor(kwargs) {
990
+ if (!kwargs) {
991
+ return;
992
+ }
993
+ Object.assign(this, kwargs);
994
+ }
995
+ static fromProto(proto) {
996
+ let m = new ListFormSubmissionResponseFormSubmissionSubmittedValue();
997
+ m = Object.assign(m, proto);
998
+ if (proto.fieldValue) {
999
+ m.fieldValue = FieldValue.fromProto(proto.fieldValue);
1000
+ }
1001
+ return m;
1002
+ }
1003
+ toApiJson() {
1004
+ const toReturn = {};
1005
+ if (typeof this.fieldId !== 'undefined') {
1006
+ toReturn['fieldId'] = this.fieldId;
1007
+ }
1008
+ if (typeof this.fieldValue !== 'undefined' && this.fieldValue !== null) {
1009
+ toReturn['fieldValue'] = 'toApiJson' in this.fieldValue ? this.fieldValue.toApiJson() : this.fieldValue;
1010
+ }
1011
+ return toReturn;
1012
+ }
1013
+ }
687
1014
  class FormConfigFieldUnmappedField {
688
1015
  constructor(kwargs) {
689
1016
  if (!kwargs) {
@@ -762,6 +1089,29 @@ class UpdateFormResponse {
762
1089
  return toReturn;
763
1090
  }
764
1091
  }
1092
+ class GetMultiFormVersionsListResponseVersions {
1093
+ constructor(kwargs) {
1094
+ if (!kwargs) {
1095
+ return;
1096
+ }
1097
+ Object.assign(this, kwargs);
1098
+ }
1099
+ static fromProto(proto) {
1100
+ let m = new GetMultiFormVersionsListResponseVersions();
1101
+ m = Object.assign(m, proto);
1102
+ return m;
1103
+ }
1104
+ toApiJson() {
1105
+ const toReturn = {};
1106
+ if (typeof this.formId !== 'undefined') {
1107
+ toReturn['formId'] = this.formId;
1108
+ }
1109
+ if (typeof this.versions !== 'undefined') {
1110
+ toReturn['versions'] = this.versions;
1111
+ }
1112
+ return toReturn;
1113
+ }
1114
+ }
765
1115
 
766
1116
  // *********************************
767
1117
 
@@ -807,6 +1157,11 @@ class FormSubmissionApiService {
807
1157
  const request = (r.toApiJson) ? r : new CreateFormSubmissionRequest(r);
808
1158
  return this.http.post(this._host + "/forms.v1.FormSubmissionService/CreateFormSubmission", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
809
1159
  }
1160
+ listFormSubmission(r) {
1161
+ const request = (r.toApiJson) ? r : new ListFormSubmissionRequest(r);
1162
+ return this.http.post(this._host + "/forms.v1.FormSubmissionService/ListFormSubmission", request.toApiJson(), this.apiOptions())
1163
+ .pipe(map(resp => ListFormSubmissionResponse.fromProto(resp)));
1164
+ }
810
1165
  }
811
1166
  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 });
812
1167
  FormSubmissionApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: FormSubmissionApiService, providedIn: 'root' });
@@ -840,6 +1195,16 @@ class FormsApiService {
840
1195
  return this.http.post(this._host + "/forms.v1.Forms/GetForm", request.toApiJson(), this.apiOptions())
841
1196
  .pipe(map(resp => GetFormResponse.fromProto(resp)));
842
1197
  }
1198
+ getMultiFormVersionsList(r) {
1199
+ const request = (r.toApiJson) ? r : new GetMultiFormVersionsListRequest(r);
1200
+ return this.http.post(this._host + "/forms.v1.Forms/GetMultiFormVersionsList", request.toApiJson(), this.apiOptions())
1201
+ .pipe(map(resp => GetMultiFormVersionsListResponse.fromProto(resp)));
1202
+ }
1203
+ getMulti(r) {
1204
+ const request = (r.toApiJson) ? r : new GetMultiRequest(r);
1205
+ return this.http.post(this._host + "/forms.v1.Forms/GetMulti", request.toApiJson(), this.apiOptions())
1206
+ .pipe(map(resp => GetMultiResponse.fromProto(resp)));
1207
+ }
843
1208
  createForm(r) {
844
1209
  const request = (r.toApiJson) ? r : new CreateFormRequest(r);
845
1210
  return this.http.post(this._host + "/forms.v1.Forms/CreateForm", request.toApiJson(), this.apiOptions())
@@ -864,6 +1229,11 @@ class FormsApiService {
864
1229
  const request = (r.toApiJson) ? r : new DeleteFormRequest(r);
865
1230
  return this.http.post(this._host + "/forms.v1.Forms/DeleteForm", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
866
1231
  }
1232
+ previewForm(r) {
1233
+ const request = (r.toApiJson) ? r : new PreviewFormRequest(r);
1234
+ return this.http.post(this._host + "/forms.v1.Forms/PreviewForm", request.toApiJson(), this.apiOptions())
1235
+ .pipe(map(resp => PreviewFormResponse.fromProto(resp)));
1236
+ }
867
1237
  }
868
1238
  FormsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: FormsApiService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
869
1239
  FormsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: FormsApiService, providedIn: 'root' });
@@ -880,5 +1250,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImpor
880
1250
  * Generated bundle index. Do not edit.
881
1251
  */
882
1252
 
883
- export { CreateFormRequest, CreateFormResponse, CreateFormSubmissionRequest, DeleteFormRequest, FieldType, FormConfig, FormConfigField, FormConfigFieldDefault, FormConfigFieldSchema, FormConfigFieldUnmappedField, FormConfigFieldUnmappedFieldDropdownOption, FormSubmission, FormSubmissionApiService, FormsApiService, GetEmbedCodeRequest, GetEmbedCodeResponse, GetFormRequest, GetFormResponse, HostService, ListFormsRequest, ListFormsRequestFilters, ListFormsResponse, ListFormsResponseFormRow, PagedRequestOptions, PagedResponseMetadata, RenderFormRequest, RenderFormRequestJsonSchemaLibrary, RenderFormResponse, Styles, UpdateFormRequest, UpdateFormResponse };
1253
+ 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 };
884
1254
  //# sourceMappingURL=vendasta-forms_microservice.mjs.map