@vendasta/forms_microservice 0.1.0 → 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.
- package/esm2020/lib/_internal/form-submission.api.service.mjs +7 -2
- package/esm2020/lib/_internal/interfaces/api.interface.mjs +1 -1
- package/esm2020/lib/_internal/interfaces/index.mjs +1 -1
- package/esm2020/lib/_internal/objects/api.mjs +161 -33
- package/esm2020/lib/_internal/objects/index.mjs +2 -2
- package/fesm2015/vendasta-forms_microservice.mjs +166 -33
- package/fesm2015/vendasta-forms_microservice.mjs.map +1 -1
- package/fesm2020/vendasta-forms_microservice.mjs +166 -33
- package/fesm2020/vendasta-forms_microservice.mjs.map +1 -1
- package/lib/_internal/form-submission.api.service.d.ts +3 -2
- package/lib/_internal/interfaces/api.interface.d.ts +33 -12
- package/lib/_internal/interfaces/index.d.ts +1 -1
- package/lib/_internal/objects/api.d.ts +52 -19
- package/lib/_internal/objects/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -125,6 +125,9 @@ class CreateFormResponse {
|
|
|
125
125
|
static fromProto(proto) {
|
|
126
126
|
let m = new CreateFormResponse();
|
|
127
127
|
m = Object.assign(m, proto);
|
|
128
|
+
if (proto.errors) {
|
|
129
|
+
m.errors = proto.errors.map(ValidationError.fromProto);
|
|
130
|
+
}
|
|
128
131
|
return m;
|
|
129
132
|
}
|
|
130
133
|
constructor(kwargs) {
|
|
@@ -141,6 +144,9 @@ class CreateFormResponse {
|
|
|
141
144
|
if (typeof this.version !== 'undefined') {
|
|
142
145
|
toReturn['version'] = this.version;
|
|
143
146
|
}
|
|
147
|
+
if (typeof this.errors !== 'undefined' && this.errors !== null) {
|
|
148
|
+
toReturn['errors'] = 'toApiJson' in this.errors ? this.errors.toApiJson() : this.errors;
|
|
149
|
+
}
|
|
144
150
|
return toReturn;
|
|
145
151
|
}
|
|
146
152
|
}
|
|
@@ -149,7 +155,7 @@ class CreateFormSubmissionRequest {
|
|
|
149
155
|
let m = new CreateFormSubmissionRequest();
|
|
150
156
|
m = Object.assign(m, proto);
|
|
151
157
|
if (proto.submission) {
|
|
152
|
-
m.submission =
|
|
158
|
+
m.submission = UserFormSubmission.fromProto(proto.submission);
|
|
153
159
|
}
|
|
154
160
|
return m;
|
|
155
161
|
}
|
|
@@ -432,12 +438,12 @@ class ListFormsResponseFormRow {
|
|
|
432
438
|
return toReturn;
|
|
433
439
|
}
|
|
434
440
|
}
|
|
435
|
-
class
|
|
441
|
+
class FormSubmission {
|
|
436
442
|
static fromProto(proto) {
|
|
437
|
-
let m = new
|
|
443
|
+
let m = new FormSubmission();
|
|
438
444
|
m = Object.assign(m, proto);
|
|
439
445
|
if (proto.values) {
|
|
440
|
-
m.values = proto.values.map(
|
|
446
|
+
m.values = proto.values.map(FormSubmissionSubmittedValue.fromProto);
|
|
441
447
|
}
|
|
442
448
|
if (proto.created) {
|
|
443
449
|
m.created = new Date(proto.created);
|
|
@@ -467,9 +473,9 @@ class ListFormSubmissionResponseFormSubmission {
|
|
|
467
473
|
return toReturn;
|
|
468
474
|
}
|
|
469
475
|
}
|
|
470
|
-
class
|
|
476
|
+
class GetEmbedCodeRequest {
|
|
471
477
|
static fromProto(proto) {
|
|
472
|
-
let m = new
|
|
478
|
+
let m = new GetEmbedCodeRequest();
|
|
473
479
|
m = Object.assign(m, proto);
|
|
474
480
|
return m;
|
|
475
481
|
}
|
|
@@ -484,18 +490,32 @@ class FormSubmission {
|
|
|
484
490
|
if (typeof this.formId !== 'undefined') {
|
|
485
491
|
toReturn['formId'] = this.formId;
|
|
486
492
|
}
|
|
487
|
-
|
|
488
|
-
|
|
493
|
+
return toReturn;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
class GetEmbedCodeResponse {
|
|
497
|
+
static fromProto(proto) {
|
|
498
|
+
let m = new GetEmbedCodeResponse();
|
|
499
|
+
m = Object.assign(m, proto);
|
|
500
|
+
return m;
|
|
501
|
+
}
|
|
502
|
+
constructor(kwargs) {
|
|
503
|
+
if (!kwargs) {
|
|
504
|
+
return;
|
|
489
505
|
}
|
|
490
|
-
|
|
491
|
-
|
|
506
|
+
Object.assign(this, kwargs);
|
|
507
|
+
}
|
|
508
|
+
toApiJson() {
|
|
509
|
+
const toReturn = {};
|
|
510
|
+
if (typeof this.embedCode !== 'undefined') {
|
|
511
|
+
toReturn['embedCode'] = this.embedCode;
|
|
492
512
|
}
|
|
493
513
|
return toReturn;
|
|
494
514
|
}
|
|
495
515
|
}
|
|
496
|
-
class
|
|
516
|
+
class GetFormRequest {
|
|
497
517
|
static fromProto(proto) {
|
|
498
|
-
let m = new
|
|
518
|
+
let m = new GetFormRequest();
|
|
499
519
|
m = Object.assign(m, proto);
|
|
500
520
|
return m;
|
|
501
521
|
}
|
|
@@ -513,10 +533,13 @@ class GetEmbedCodeRequest {
|
|
|
513
533
|
return toReturn;
|
|
514
534
|
}
|
|
515
535
|
}
|
|
516
|
-
class
|
|
536
|
+
class GetFormResponse {
|
|
517
537
|
static fromProto(proto) {
|
|
518
|
-
let m = new
|
|
538
|
+
let m = new GetFormResponse();
|
|
519
539
|
m = Object.assign(m, proto);
|
|
540
|
+
if (proto.formConfig) {
|
|
541
|
+
m.formConfig = FormConfig.fromProto(proto.formConfig);
|
|
542
|
+
}
|
|
520
543
|
return m;
|
|
521
544
|
}
|
|
522
545
|
constructor(kwargs) {
|
|
@@ -527,15 +550,15 @@ class GetEmbedCodeResponse {
|
|
|
527
550
|
}
|
|
528
551
|
toApiJson() {
|
|
529
552
|
const toReturn = {};
|
|
530
|
-
if (typeof this.
|
|
531
|
-
toReturn['
|
|
553
|
+
if (typeof this.formConfig !== 'undefined' && this.formConfig !== null) {
|
|
554
|
+
toReturn['formConfig'] = 'toApiJson' in this.formConfig ? this.formConfig.toApiJson() : this.formConfig;
|
|
532
555
|
}
|
|
533
556
|
return toReturn;
|
|
534
557
|
}
|
|
535
558
|
}
|
|
536
|
-
class
|
|
559
|
+
class GetMultiFormSubmissionRequest {
|
|
537
560
|
static fromProto(proto) {
|
|
538
|
-
let m = new
|
|
561
|
+
let m = new GetMultiFormSubmissionRequest();
|
|
539
562
|
m = Object.assign(m, proto);
|
|
540
563
|
return m;
|
|
541
564
|
}
|
|
@@ -547,18 +570,18 @@ class GetFormRequest {
|
|
|
547
570
|
}
|
|
548
571
|
toApiJson() {
|
|
549
572
|
const toReturn = {};
|
|
550
|
-
if (typeof this.
|
|
551
|
-
toReturn['
|
|
573
|
+
if (typeof this.formSubmissionIds !== 'undefined') {
|
|
574
|
+
toReturn['formSubmissionIds'] = this.formSubmissionIds;
|
|
552
575
|
}
|
|
553
576
|
return toReturn;
|
|
554
577
|
}
|
|
555
578
|
}
|
|
556
|
-
class
|
|
579
|
+
class GetMultiFormSubmissionResponse {
|
|
557
580
|
static fromProto(proto) {
|
|
558
|
-
let m = new
|
|
581
|
+
let m = new GetMultiFormSubmissionResponse();
|
|
559
582
|
m = Object.assign(m, proto);
|
|
560
|
-
if (proto.
|
|
561
|
-
m.
|
|
583
|
+
if (proto.submissions) {
|
|
584
|
+
m.submissions = proto.submissions.map(FormSubmission.fromProto);
|
|
562
585
|
}
|
|
563
586
|
return m;
|
|
564
587
|
}
|
|
@@ -570,8 +593,8 @@ class GetFormResponse {
|
|
|
570
593
|
}
|
|
571
594
|
toApiJson() {
|
|
572
595
|
const toReturn = {};
|
|
573
|
-
if (typeof this.
|
|
574
|
-
toReturn['
|
|
596
|
+
if (typeof this.submissions !== 'undefined' && this.submissions !== null) {
|
|
597
|
+
toReturn['submissions'] = 'toApiJson' in this.submissions ? this.submissions.toApiJson() : this.submissions;
|
|
575
598
|
}
|
|
576
599
|
return toReturn;
|
|
577
600
|
}
|
|
@@ -696,7 +719,7 @@ class ListFormSubmissionResponse {
|
|
|
696
719
|
let m = new ListFormSubmissionResponse();
|
|
697
720
|
m = Object.assign(m, proto);
|
|
698
721
|
if (proto.submissions) {
|
|
699
|
-
m.submissions = proto.submissions.map(
|
|
722
|
+
m.submissions = proto.submissions.map(FormSubmission.fromProto);
|
|
700
723
|
}
|
|
701
724
|
if (proto.pagingMetadata) {
|
|
702
725
|
m.pagingMetadata = PagedResponseMetadata.fromProto(proto.pagingMetadata);
|
|
@@ -778,9 +801,44 @@ class ListFormsResponse {
|
|
|
778
801
|
return toReturn;
|
|
779
802
|
}
|
|
780
803
|
}
|
|
781
|
-
class
|
|
804
|
+
class FormConfigFieldMappedField {
|
|
782
805
|
static fromProto(proto) {
|
|
783
|
-
let m = new
|
|
806
|
+
let m = new FormConfigFieldMappedField();
|
|
807
|
+
m = Object.assign(m, proto);
|
|
808
|
+
if (proto.type) {
|
|
809
|
+
m.type = enumStringToValue(FieldType, proto.type);
|
|
810
|
+
}
|
|
811
|
+
if (proto.options) {
|
|
812
|
+
m.options = proto.options.map(FormConfigFieldOption.fromProto);
|
|
813
|
+
}
|
|
814
|
+
return m;
|
|
815
|
+
}
|
|
816
|
+
constructor(kwargs) {
|
|
817
|
+
if (!kwargs) {
|
|
818
|
+
return;
|
|
819
|
+
}
|
|
820
|
+
Object.assign(this, kwargs);
|
|
821
|
+
}
|
|
822
|
+
toApiJson() {
|
|
823
|
+
const toReturn = {};
|
|
824
|
+
if (typeof this.id !== 'undefined') {
|
|
825
|
+
toReturn['id'] = this.id;
|
|
826
|
+
}
|
|
827
|
+
if (typeof this.type !== 'undefined') {
|
|
828
|
+
toReturn['type'] = this.type;
|
|
829
|
+
}
|
|
830
|
+
if (typeof this.options !== 'undefined' && this.options !== null) {
|
|
831
|
+
toReturn['options'] = 'toApiJson' in this.options ? this.options.toApiJson() : this.options;
|
|
832
|
+
}
|
|
833
|
+
if (typeof this.mappedTo !== 'undefined') {
|
|
834
|
+
toReturn['mappedTo'] = this.mappedTo;
|
|
835
|
+
}
|
|
836
|
+
return toReturn;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
class FormConfigFieldOption {
|
|
840
|
+
static fromProto(proto) {
|
|
841
|
+
let m = new FormConfigFieldOption();
|
|
784
842
|
m = Object.assign(m, proto);
|
|
785
843
|
return m;
|
|
786
844
|
}
|
|
@@ -947,6 +1005,9 @@ class FormConfigFieldSchema {
|
|
|
947
1005
|
if (proto.unmappedField) {
|
|
948
1006
|
m.unmappedField = FormConfigFieldUnmappedField.fromProto(proto.unmappedField);
|
|
949
1007
|
}
|
|
1008
|
+
if (proto.mappedField) {
|
|
1009
|
+
m.mappedField = FormConfigFieldMappedField.fromProto(proto.mappedField);
|
|
1010
|
+
}
|
|
950
1011
|
return m;
|
|
951
1012
|
}
|
|
952
1013
|
constructor(kwargs) {
|
|
@@ -960,6 +1021,9 @@ class FormConfigFieldSchema {
|
|
|
960
1021
|
if (typeof this.unmappedField !== 'undefined' && this.unmappedField !== null) {
|
|
961
1022
|
toReturn['unmappedField'] = 'toApiJson' in this.unmappedField ? this.unmappedField.toApiJson() : this.unmappedField;
|
|
962
1023
|
}
|
|
1024
|
+
if (typeof this.mappedField !== 'undefined' && this.mappedField !== null) {
|
|
1025
|
+
toReturn['mappedField'] = 'toApiJson' in this.mappedField ? this.mappedField.toApiJson() : this.mappedField;
|
|
1026
|
+
}
|
|
963
1027
|
return toReturn;
|
|
964
1028
|
}
|
|
965
1029
|
}
|
|
@@ -1010,13 +1074,16 @@ class Styles {
|
|
|
1010
1074
|
return toReturn;
|
|
1011
1075
|
}
|
|
1012
1076
|
}
|
|
1013
|
-
class
|
|
1077
|
+
class FormSubmissionSubmittedValue {
|
|
1014
1078
|
static fromProto(proto) {
|
|
1015
|
-
let m = new
|
|
1079
|
+
let m = new FormSubmissionSubmittedValue();
|
|
1016
1080
|
m = Object.assign(m, proto);
|
|
1017
1081
|
if (proto.fieldValue) {
|
|
1018
1082
|
m.fieldValue = FieldValue.fromProto(proto.fieldValue);
|
|
1019
1083
|
}
|
|
1084
|
+
if (proto.fieldType) {
|
|
1085
|
+
m.fieldType = enumStringToValue(FieldType, proto.fieldType);
|
|
1086
|
+
}
|
|
1020
1087
|
return m;
|
|
1021
1088
|
}
|
|
1022
1089
|
constructor(kwargs) {
|
|
@@ -1033,6 +1100,12 @@ class ListFormSubmissionResponseFormSubmissionSubmittedValue {
|
|
|
1033
1100
|
if (typeof this.fieldValue !== 'undefined' && this.fieldValue !== null) {
|
|
1034
1101
|
toReturn['fieldValue'] = 'toApiJson' in this.fieldValue ? this.fieldValue.toApiJson() : this.fieldValue;
|
|
1035
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
|
+
}
|
|
1036
1109
|
return toReturn;
|
|
1037
1110
|
}
|
|
1038
1111
|
}
|
|
@@ -1044,7 +1117,7 @@ class FormConfigFieldUnmappedField {
|
|
|
1044
1117
|
m.type = enumStringToValue(FieldType, proto.type);
|
|
1045
1118
|
}
|
|
1046
1119
|
if (proto.options) {
|
|
1047
|
-
m.options = proto.options.map(
|
|
1120
|
+
m.options = proto.options.map(FormConfigFieldOption.fromProto);
|
|
1048
1121
|
}
|
|
1049
1122
|
return m;
|
|
1050
1123
|
}
|
|
@@ -1098,6 +1171,32 @@ class UpdateFormResponse {
|
|
|
1098
1171
|
static fromProto(proto) {
|
|
1099
1172
|
let m = new UpdateFormResponse();
|
|
1100
1173
|
m = Object.assign(m, proto);
|
|
1174
|
+
if (proto.errors) {
|
|
1175
|
+
m.errors = proto.errors.map(ValidationError.fromProto);
|
|
1176
|
+
}
|
|
1177
|
+
return m;
|
|
1178
|
+
}
|
|
1179
|
+
constructor(kwargs) {
|
|
1180
|
+
if (!kwargs) {
|
|
1181
|
+
return;
|
|
1182
|
+
}
|
|
1183
|
+
Object.assign(this, kwargs);
|
|
1184
|
+
}
|
|
1185
|
+
toApiJson() {
|
|
1186
|
+
const toReturn = {};
|
|
1187
|
+
if (typeof this.version !== 'undefined') {
|
|
1188
|
+
toReturn['version'] = this.version;
|
|
1189
|
+
}
|
|
1190
|
+
if (typeof this.errors !== 'undefined' && this.errors !== null) {
|
|
1191
|
+
toReturn['errors'] = 'toApiJson' in this.errors ? this.errors.toApiJson() : this.errors;
|
|
1192
|
+
}
|
|
1193
|
+
return toReturn;
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
class UserFormSubmission {
|
|
1197
|
+
static fromProto(proto) {
|
|
1198
|
+
let m = new UserFormSubmission();
|
|
1199
|
+
m = Object.assign(m, proto);
|
|
1101
1200
|
return m;
|
|
1102
1201
|
}
|
|
1103
1202
|
constructor(kwargs) {
|
|
@@ -1108,9 +1207,38 @@ class UpdateFormResponse {
|
|
|
1108
1207
|
}
|
|
1109
1208
|
toApiJson() {
|
|
1110
1209
|
const toReturn = {};
|
|
1210
|
+
if (typeof this.formId !== 'undefined') {
|
|
1211
|
+
toReturn['formId'] = this.formId;
|
|
1212
|
+
}
|
|
1111
1213
|
if (typeof this.version !== 'undefined') {
|
|
1112
1214
|
toReturn['version'] = this.version;
|
|
1113
1215
|
}
|
|
1216
|
+
if (typeof this.values !== 'undefined') {
|
|
1217
|
+
toReturn['values'] = this.values;
|
|
1218
|
+
}
|
|
1219
|
+
return toReturn;
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
class ValidationError {
|
|
1223
|
+
static fromProto(proto) {
|
|
1224
|
+
let m = new ValidationError();
|
|
1225
|
+
m = Object.assign(m, proto);
|
|
1226
|
+
return m;
|
|
1227
|
+
}
|
|
1228
|
+
constructor(kwargs) {
|
|
1229
|
+
if (!kwargs) {
|
|
1230
|
+
return;
|
|
1231
|
+
}
|
|
1232
|
+
Object.assign(this, kwargs);
|
|
1233
|
+
}
|
|
1234
|
+
toApiJson() {
|
|
1235
|
+
const toReturn = {};
|
|
1236
|
+
if (typeof this.ruleId !== 'undefined') {
|
|
1237
|
+
toReturn['ruleId'] = this.ruleId;
|
|
1238
|
+
}
|
|
1239
|
+
if (typeof this.message !== 'undefined') {
|
|
1240
|
+
toReturn['message'] = this.message;
|
|
1241
|
+
}
|
|
1114
1242
|
return toReturn;
|
|
1115
1243
|
}
|
|
1116
1244
|
}
|
|
@@ -1188,6 +1316,11 @@ class FormSubmissionApiService {
|
|
|
1188
1316
|
return this.http.post(this._host + "/forms.v1.FormSubmissionService/ListFormSubmission", request.toApiJson(), this.apiOptions())
|
|
1189
1317
|
.pipe(map(resp => ListFormSubmissionResponse.fromProto(resp)));
|
|
1190
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
|
+
}
|
|
1191
1324
|
}
|
|
1192
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 });
|
|
1193
1326
|
FormSubmissionApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: FormSubmissionApiService, providedIn: 'root' });
|
|
@@ -1307,5 +1440,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImpor
|
|
|
1307
1440
|
* Generated bundle index. Do not edit.
|
|
1308
1441
|
*/
|
|
1309
1442
|
|
|
1310
|
-
export { CreateFormRequest, CreateFormResponse, CreateFormSubmissionRequest, CreateFormSubmissionResponse, DeleteFormRequest, FieldType, FieldValue, FormConfig, FormConfigField, FormConfigFieldSchema, FormConfigFieldUnmappedField,
|
|
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 };
|
|
1311
1444
|
//# sourceMappingURL=vendasta-forms_microservice.mjs.map
|