@vendasta/forms_microservice 0.0.11 → 0.0.14

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.
@@ -165,50 +165,6 @@ class CreateFormSubmissionRequest {
165
165
  return toReturn;
166
166
  }
167
167
  }
168
- class FormConfigFieldDefault {
169
- constructor(kwargs) {
170
- if (!kwargs) {
171
- return;
172
- }
173
- Object.assign(this, kwargs);
174
- }
175
- static fromProto(proto) {
176
- let m = new FormConfigFieldDefault();
177
- m = Object.assign(m, proto);
178
- if (proto.integer) {
179
- m.integer = parseInt(proto.integer, 10);
180
- }
181
- if (proto.currency) {
182
- m.currency = parseInt(proto.currency, 10);
183
- }
184
- return m;
185
- }
186
- toApiJson() {
187
- const toReturn = {};
188
- if (typeof this.invalid !== 'undefined') {
189
- toReturn['invalid'] = this.invalid;
190
- }
191
- if (typeof this.integer !== 'undefined') {
192
- toReturn['integer'] = this.integer;
193
- }
194
- if (typeof this.string !== 'undefined') {
195
- toReturn['string'] = this.string;
196
- }
197
- if (typeof this.date !== 'undefined') {
198
- toReturn['date'] = this.date;
199
- }
200
- if (typeof this.dropdown !== 'undefined') {
201
- toReturn['dropdown'] = this.dropdown;
202
- }
203
- if (typeof this.currency !== 'undefined') {
204
- toReturn['currency'] = this.currency;
205
- }
206
- if (typeof this.boolean !== 'undefined') {
207
- toReturn['boolean'] = this.boolean;
208
- }
209
- return toReturn;
210
- }
211
- }
212
168
  class DeleteFormRequest {
213
169
  constructor(kwargs) {
214
170
  if (!kwargs) {
@@ -268,8 +224,8 @@ class FormConfigField {
268
224
  if (proto.schema) {
269
225
  m.schema = FormConfigFieldSchema.fromProto(proto.schema);
270
226
  }
271
- if (proto.default) {
272
- m.default = FormConfigFieldDefault.fromProto(proto.default);
227
+ if (proto.defaultValue) {
228
+ m.defaultValue = FieldValue.fromProto(proto.defaultValue);
273
229
  }
274
230
  return m;
275
231
  }
@@ -281,15 +237,59 @@ class FormConfigField {
281
237
  if (typeof this.label !== 'undefined') {
282
238
  toReturn['label'] = this.label;
283
239
  }
284
- if (typeof this.default !== 'undefined' && this.default !== null) {
285
- toReturn['default'] = 'toApiJson' in this.default ? this.default.toApiJson() : this.default;
286
- }
287
240
  if (typeof this.required !== 'undefined') {
288
241
  toReturn['required'] = this.required;
289
242
  }
290
243
  if (typeof this.hidden !== 'undefined') {
291
244
  toReturn['hidden'] = this.hidden;
292
245
  }
246
+ if (typeof this.defaultValue !== 'undefined' && this.defaultValue !== null) {
247
+ toReturn['defaultValue'] = 'toApiJson' in this.defaultValue ? this.defaultValue.toApiJson() : this.defaultValue;
248
+ }
249
+ return toReturn;
250
+ }
251
+ }
252
+ class FieldValue {
253
+ constructor(kwargs) {
254
+ if (!kwargs) {
255
+ return;
256
+ }
257
+ Object.assign(this, kwargs);
258
+ }
259
+ static fromProto(proto) {
260
+ let m = new FieldValue();
261
+ m = Object.assign(m, proto);
262
+ if (proto.integer) {
263
+ m.integer = parseInt(proto.integer, 10);
264
+ }
265
+ if (proto.currency) {
266
+ m.currency = parseInt(proto.currency, 10);
267
+ }
268
+ return m;
269
+ }
270
+ toApiJson() {
271
+ const toReturn = {};
272
+ if (typeof this.invalid !== 'undefined') {
273
+ toReturn['invalid'] = this.invalid;
274
+ }
275
+ if (typeof this.integer !== 'undefined') {
276
+ toReturn['integer'] = this.integer;
277
+ }
278
+ if (typeof this.string !== 'undefined') {
279
+ toReturn['string'] = this.string;
280
+ }
281
+ if (typeof this.date !== 'undefined') {
282
+ toReturn['date'] = this.date;
283
+ }
284
+ if (typeof this.dropdown !== 'undefined') {
285
+ toReturn['dropdown'] = this.dropdown;
286
+ }
287
+ if (typeof this.currency !== 'undefined') {
288
+ toReturn['currency'] = this.currency;
289
+ }
290
+ if (typeof this.boolean !== 'undefined') {
291
+ toReturn['boolean'] = this.boolean;
292
+ }
293
293
  return toReturn;
294
294
  }
295
295
  }
@@ -366,6 +366,32 @@ class FormConfig {
366
366
  if (typeof this.updated !== 'undefined' && this.updated !== null) {
367
367
  toReturn['updated'] = 'toApiJson' in this.updated ? this.updated.toApiJson() : this.updated;
368
368
  }
369
+ if (typeof this.mostRecent !== 'undefined') {
370
+ toReturn['mostRecent'] = this.mostRecent;
371
+ }
372
+ return toReturn;
373
+ }
374
+ }
375
+ class GetMultiRequestFormConfigIdentifier {
376
+ constructor(kwargs) {
377
+ if (!kwargs) {
378
+ return;
379
+ }
380
+ Object.assign(this, kwargs);
381
+ }
382
+ static fromProto(proto) {
383
+ let m = new GetMultiRequestFormConfigIdentifier();
384
+ m = Object.assign(m, proto);
385
+ return m;
386
+ }
387
+ toApiJson() {
388
+ const toReturn = {};
389
+ if (typeof this.formId !== 'undefined') {
390
+ toReturn['formId'] = this.formId;
391
+ }
392
+ if (typeof this.version !== 'undefined') {
393
+ toReturn['version'] = this.version;
394
+ }
369
395
  return toReturn;
370
396
  }
371
397
  }
@@ -424,6 +450,35 @@ class FormSubmission {
424
450
  return toReturn;
425
451
  }
426
452
  }
453
+ class ListFormSubmissionResponseFormSubmission {
454
+ constructor(kwargs) {
455
+ if (!kwargs) {
456
+ return;
457
+ }
458
+ Object.assign(this, kwargs);
459
+ }
460
+ static fromProto(proto) {
461
+ let m = new ListFormSubmissionResponseFormSubmission();
462
+ m = Object.assign(m, proto);
463
+ if (proto.values) {
464
+ m.values = proto.values.map(ListFormSubmissionResponseFormSubmissionSubmittedValue.fromProto);
465
+ }
466
+ return m;
467
+ }
468
+ toApiJson() {
469
+ const toReturn = {};
470
+ if (typeof this.formSubmissionId !== 'undefined') {
471
+ toReturn['formSubmissionId'] = this.formSubmissionId;
472
+ }
473
+ if (typeof this.formVersion !== 'undefined') {
474
+ toReturn['formVersion'] = this.formVersion;
475
+ }
476
+ if (typeof this.values !== 'undefined' && this.values !== null) {
477
+ toReturn['values'] = 'toApiJson' in this.values ? this.values.toApiJson() : this.values;
478
+ }
479
+ return toReturn;
480
+ }
481
+ }
427
482
  class GetEmbedCodeRequest {
428
483
  constructor(kwargs) {
429
484
  if (!kwargs) {
@@ -507,6 +562,150 @@ class GetFormResponse {
507
562
  return toReturn;
508
563
  }
509
564
  }
565
+ class GetMultiFormVersionsListRequest {
566
+ constructor(kwargs) {
567
+ if (!kwargs) {
568
+ return;
569
+ }
570
+ Object.assign(this, kwargs);
571
+ }
572
+ static fromProto(proto) {
573
+ let m = new GetMultiFormVersionsListRequest();
574
+ m = Object.assign(m, proto);
575
+ return m;
576
+ }
577
+ toApiJson() {
578
+ const toReturn = {};
579
+ if (typeof this.formIds !== 'undefined') {
580
+ toReturn['formIds'] = this.formIds;
581
+ }
582
+ return toReturn;
583
+ }
584
+ }
585
+ class GetMultiFormVersionsListResponse {
586
+ constructor(kwargs) {
587
+ if (!kwargs) {
588
+ return;
589
+ }
590
+ Object.assign(this, kwargs);
591
+ }
592
+ static fromProto(proto) {
593
+ let m = new GetMultiFormVersionsListResponse();
594
+ m = Object.assign(m, proto);
595
+ if (proto.versions) {
596
+ m.versions = proto.versions.map(GetMultiFormVersionsListResponseVersions.fromProto);
597
+ }
598
+ return m;
599
+ }
600
+ toApiJson() {
601
+ const toReturn = {};
602
+ if (typeof this.versions !== 'undefined' && this.versions !== null) {
603
+ toReturn['versions'] = 'toApiJson' in this.versions ? this.versions.toApiJson() : this.versions;
604
+ }
605
+ return toReturn;
606
+ }
607
+ }
608
+ class GetMultiRequest {
609
+ constructor(kwargs) {
610
+ if (!kwargs) {
611
+ return;
612
+ }
613
+ Object.assign(this, kwargs);
614
+ }
615
+ static fromProto(proto) {
616
+ let m = new GetMultiRequest();
617
+ m = Object.assign(m, proto);
618
+ if (proto.formConfigIdentifiers) {
619
+ m.formConfigIdentifiers = proto.formConfigIdentifiers.map(GetMultiRequestFormConfigIdentifier.fromProto);
620
+ }
621
+ return m;
622
+ }
623
+ toApiJson() {
624
+ const toReturn = {};
625
+ if (typeof this.formConfigIdentifiers !== 'undefined' && this.formConfigIdentifiers !== null) {
626
+ toReturn['formConfigIdentifiers'] = 'toApiJson' in this.formConfigIdentifiers ? this.formConfigIdentifiers.toApiJson() : this.formConfigIdentifiers;
627
+ }
628
+ return toReturn;
629
+ }
630
+ }
631
+ class GetMultiResponse {
632
+ constructor(kwargs) {
633
+ if (!kwargs) {
634
+ return;
635
+ }
636
+ Object.assign(this, kwargs);
637
+ }
638
+ static fromProto(proto) {
639
+ let m = new GetMultiResponse();
640
+ m = Object.assign(m, proto);
641
+ if (proto.formConfigs) {
642
+ m.formConfigs = proto.formConfigs.map(FormConfig.fromProto);
643
+ }
644
+ return m;
645
+ }
646
+ toApiJson() {
647
+ const toReturn = {};
648
+ if (typeof this.formConfigs !== 'undefined' && this.formConfigs !== null) {
649
+ toReturn['formConfigs'] = 'toApiJson' in this.formConfigs ? this.formConfigs.toApiJson() : this.formConfigs;
650
+ }
651
+ return toReturn;
652
+ }
653
+ }
654
+ class ListFormSubmissionRequest {
655
+ constructor(kwargs) {
656
+ if (!kwargs) {
657
+ return;
658
+ }
659
+ Object.assign(this, kwargs);
660
+ }
661
+ static fromProto(proto) {
662
+ let m = new ListFormSubmissionRequest();
663
+ m = Object.assign(m, proto);
664
+ if (proto.pagingOptions) {
665
+ m.pagingOptions = PagedRequestOptions.fromProto(proto.pagingOptions);
666
+ }
667
+ return m;
668
+ }
669
+ toApiJson() {
670
+ const toReturn = {};
671
+ if (typeof this.formId !== 'undefined') {
672
+ toReturn['formId'] = this.formId;
673
+ }
674
+ if (typeof this.pagingOptions !== 'undefined' && this.pagingOptions !== null) {
675
+ toReturn['pagingOptions'] = 'toApiJson' in this.pagingOptions ? this.pagingOptions.toApiJson() : this.pagingOptions;
676
+ }
677
+ return toReturn;
678
+ }
679
+ }
680
+ class ListFormSubmissionResponse {
681
+ constructor(kwargs) {
682
+ if (!kwargs) {
683
+ return;
684
+ }
685
+ Object.assign(this, kwargs);
686
+ }
687
+ static fromProto(proto) {
688
+ let m = new ListFormSubmissionResponse();
689
+ m = Object.assign(m, proto);
690
+ if (proto.submissions) {
691
+ m.submissions = proto.submissions.map(ListFormSubmissionResponseFormSubmission.fromProto);
692
+ }
693
+ if (proto.pagingMetadata) {
694
+ m.pagingMetadata = PagedResponseMetadata.fromProto(proto.pagingMetadata);
695
+ }
696
+ return m;
697
+ }
698
+ toApiJson() {
699
+ const toReturn = {};
700
+ if (typeof this.submissions !== 'undefined' && this.submissions !== null) {
701
+ toReturn['submissions'] = 'toApiJson' in this.submissions ? this.submissions.toApiJson() : this.submissions;
702
+ }
703
+ if (typeof this.pagingMetadata !== 'undefined' && this.pagingMetadata !== null) {
704
+ toReturn['pagingMetadata'] = 'toApiJson' in this.pagingMetadata ? this.pagingMetadata.toApiJson() : this.pagingMetadata;
705
+ }
706
+ return toReturn;
707
+ }
708
+ }
510
709
  class ListFormsRequest {
511
710
  constructor(kwargs) {
512
711
  if (!kwargs) {
@@ -736,6 +935,32 @@ class Styles {
736
935
  return toReturn;
737
936
  }
738
937
  }
938
+ class ListFormSubmissionResponseFormSubmissionSubmittedValue {
939
+ constructor(kwargs) {
940
+ if (!kwargs) {
941
+ return;
942
+ }
943
+ Object.assign(this, kwargs);
944
+ }
945
+ static fromProto(proto) {
946
+ let m = new ListFormSubmissionResponseFormSubmissionSubmittedValue();
947
+ m = Object.assign(m, proto);
948
+ if (proto.fieldValue) {
949
+ m.fieldValue = FieldValue.fromProto(proto.fieldValue);
950
+ }
951
+ return m;
952
+ }
953
+ toApiJson() {
954
+ const toReturn = {};
955
+ if (typeof this.fieldId !== 'undefined') {
956
+ toReturn['fieldId'] = this.fieldId;
957
+ }
958
+ if (typeof this.fieldValue !== 'undefined' && this.fieldValue !== null) {
959
+ toReturn['fieldValue'] = 'toApiJson' in this.fieldValue ? this.fieldValue.toApiJson() : this.fieldValue;
960
+ }
961
+ return toReturn;
962
+ }
963
+ }
739
964
  class FormConfigFieldUnmappedField {
740
965
  constructor(kwargs) {
741
966
  if (!kwargs) {
@@ -814,6 +1039,29 @@ class UpdateFormResponse {
814
1039
  return toReturn;
815
1040
  }
816
1041
  }
1042
+ class GetMultiFormVersionsListResponseVersions {
1043
+ constructor(kwargs) {
1044
+ if (!kwargs) {
1045
+ return;
1046
+ }
1047
+ Object.assign(this, kwargs);
1048
+ }
1049
+ static fromProto(proto) {
1050
+ let m = new GetMultiFormVersionsListResponseVersions();
1051
+ m = Object.assign(m, proto);
1052
+ return m;
1053
+ }
1054
+ toApiJson() {
1055
+ const toReturn = {};
1056
+ if (typeof this.formId !== 'undefined') {
1057
+ toReturn['formId'] = this.formId;
1058
+ }
1059
+ if (typeof this.versions !== 'undefined') {
1060
+ toReturn['versions'] = this.versions;
1061
+ }
1062
+ return toReturn;
1063
+ }
1064
+ }
817
1065
 
818
1066
  // *********************************
819
1067
 
@@ -859,6 +1107,11 @@ class FormSubmissionApiService {
859
1107
  const request = (r.toApiJson) ? r : new CreateFormSubmissionRequest(r);
860
1108
  return this.http.post(this._host + "/forms.v1.FormSubmissionService/CreateFormSubmission", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
861
1109
  }
1110
+ listFormSubmission(r) {
1111
+ const request = (r.toApiJson) ? r : new ListFormSubmissionRequest(r);
1112
+ return this.http.post(this._host + "/forms.v1.FormSubmissionService/ListFormSubmission", request.toApiJson(), this.apiOptions())
1113
+ .pipe(map(resp => ListFormSubmissionResponse.fromProto(resp)));
1114
+ }
862
1115
  }
863
1116
  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
1117
  FormSubmissionApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: FormSubmissionApiService, providedIn: 'root' });
@@ -892,6 +1145,16 @@ class FormsApiService {
892
1145
  return this.http.post(this._host + "/forms.v1.Forms/GetForm", request.toApiJson(), this.apiOptions())
893
1146
  .pipe(map(resp => GetFormResponse.fromProto(resp)));
894
1147
  }
1148
+ getMultiFormVersionsList(r) {
1149
+ const request = (r.toApiJson) ? r : new GetMultiFormVersionsListRequest(r);
1150
+ return this.http.post(this._host + "/forms.v1.Forms/GetMultiFormVersionsList", request.toApiJson(), this.apiOptions())
1151
+ .pipe(map(resp => GetMultiFormVersionsListResponse.fromProto(resp)));
1152
+ }
1153
+ getMulti(r) {
1154
+ const request = (r.toApiJson) ? r : new GetMultiRequest(r);
1155
+ return this.http.post(this._host + "/forms.v1.Forms/GetMulti", request.toApiJson(), this.apiOptions())
1156
+ .pipe(map(resp => GetMultiResponse.fromProto(resp)));
1157
+ }
895
1158
  createForm(r) {
896
1159
  const request = (r.toApiJson) ? r : new CreateFormRequest(r);
897
1160
  return this.http.post(this._host + "/forms.v1.Forms/CreateForm", request.toApiJson(), this.apiOptions())
@@ -937,5 +1200,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImpor
937
1200
  * Generated bundle index. Do not edit.
938
1201
  */
939
1202
 
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 };
1203
+ export { CreateFormRequest, CreateFormResponse, CreateFormSubmissionRequest, DeleteFormRequest, FieldType, FieldValue, FormConfig, FormConfigField, 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
1204
  //# sourceMappingURL=vendasta-forms_microservice.mjs.map