@vendasta/forms_microservice 0.1.1 → 0.3.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.
@@ -28,6 +28,11 @@ var JsonSchemaLibrary;
28
28
  JsonSchemaLibrary[JsonSchemaLibrary["JSON_SCHEMA_LIBRARY_JSONFORM"] = 1] = "JSON_SCHEMA_LIBRARY_JSONFORM";
29
29
  })(JsonSchemaLibrary || (JsonSchemaLibrary = {}));
30
30
 
31
+ // *********************************
32
+ // Code generated by sdkgen
33
+ // DO NOT EDIT!.
34
+ //
35
+ // Enums Index.
31
36
  // *********************************
32
37
 
33
38
  function enumStringToValue$1(enumRef, value) {
@@ -155,7 +160,7 @@ class CreateFormSubmissionRequest {
155
160
  let m = new CreateFormSubmissionRequest();
156
161
  m = Object.assign(m, proto);
157
162
  if (proto.submission) {
158
- m.submission = FormSubmission.fromProto(proto.submission);
163
+ m.submission = UserFormSubmission.fromProto(proto.submission);
159
164
  }
160
165
  return m;
161
166
  }
@@ -442,34 +447,8 @@ class FormSubmission {
442
447
  static fromProto(proto) {
443
448
  let m = new FormSubmission();
444
449
  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
450
  if (proto.values) {
472
- m.values = proto.values.map(ListFormSubmissionResponseFormSubmissionSubmittedValue.fromProto);
451
+ m.values = proto.values.map(FormSubmissionSubmittedValue.fromProto);
473
452
  }
474
453
  if (proto.created) {
475
454
  m.created = new Date(proto.created);
@@ -582,6 +561,49 @@ class GetFormResponse {
582
561
  return toReturn;
583
562
  }
584
563
  }
564
+ class GetMultiFormSubmissionRequest {
565
+ static fromProto(proto) {
566
+ let m = new GetMultiFormSubmissionRequest();
567
+ m = Object.assign(m, proto);
568
+ return m;
569
+ }
570
+ constructor(kwargs) {
571
+ if (!kwargs) {
572
+ return;
573
+ }
574
+ Object.assign(this, kwargs);
575
+ }
576
+ toApiJson() {
577
+ const toReturn = {};
578
+ if (typeof this.formSubmissionIds !== 'undefined') {
579
+ toReturn['formSubmissionIds'] = this.formSubmissionIds;
580
+ }
581
+ return toReturn;
582
+ }
583
+ }
584
+ class GetMultiFormSubmissionResponse {
585
+ static fromProto(proto) {
586
+ let m = new GetMultiFormSubmissionResponse();
587
+ m = Object.assign(m, proto);
588
+ if (proto.submissions) {
589
+ m.submissions = proto.submissions.map(FormSubmission.fromProto);
590
+ }
591
+ return m;
592
+ }
593
+ constructor(kwargs) {
594
+ if (!kwargs) {
595
+ return;
596
+ }
597
+ Object.assign(this, kwargs);
598
+ }
599
+ toApiJson() {
600
+ const toReturn = {};
601
+ if (typeof this.submissions !== 'undefined' && this.submissions !== null) {
602
+ toReturn['submissions'] = 'toApiJson' in this.submissions ? this.submissions.toApiJson() : this.submissions;
603
+ }
604
+ return toReturn;
605
+ }
606
+ }
585
607
  class GetMultiFormVersionsListRequest {
586
608
  static fromProto(proto) {
587
609
  let m = new GetMultiFormVersionsListRequest();
@@ -702,7 +724,7 @@ class ListFormSubmissionResponse {
702
724
  let m = new ListFormSubmissionResponse();
703
725
  m = Object.assign(m, proto);
704
726
  if (proto.submissions) {
705
- m.submissions = proto.submissions.map(ListFormSubmissionResponseFormSubmission.fromProto);
727
+ m.submissions = proto.submissions.map(FormSubmission.fromProto);
706
728
  }
707
729
  if (proto.pagingMetadata) {
708
730
  m.pagingMetadata = PagedResponseMetadata.fromProto(proto.pagingMetadata);
@@ -1057,13 +1079,16 @@ class Styles {
1057
1079
  return toReturn;
1058
1080
  }
1059
1081
  }
1060
- class ListFormSubmissionResponseFormSubmissionSubmittedValue {
1082
+ class FormSubmissionSubmittedValue {
1061
1083
  static fromProto(proto) {
1062
- let m = new ListFormSubmissionResponseFormSubmissionSubmittedValue();
1084
+ let m = new FormSubmissionSubmittedValue();
1063
1085
  m = Object.assign(m, proto);
1064
1086
  if (proto.fieldValue) {
1065
1087
  m.fieldValue = FieldValue.fromProto(proto.fieldValue);
1066
1088
  }
1089
+ if (proto.fieldType) {
1090
+ m.fieldType = enumStringToValue(FieldType, proto.fieldType);
1091
+ }
1067
1092
  return m;
1068
1093
  }
1069
1094
  constructor(kwargs) {
@@ -1080,6 +1105,12 @@ class ListFormSubmissionResponseFormSubmissionSubmittedValue {
1080
1105
  if (typeof this.fieldValue !== 'undefined' && this.fieldValue !== null) {
1081
1106
  toReturn['fieldValue'] = 'toApiJson' in this.fieldValue ? this.fieldValue.toApiJson() : this.fieldValue;
1082
1107
  }
1108
+ if (typeof this.fieldType !== 'undefined') {
1109
+ toReturn['fieldType'] = this.fieldType;
1110
+ }
1111
+ if (typeof this.mappedToResource !== 'undefined') {
1112
+ toReturn['mappedToResource'] = this.mappedToResource;
1113
+ }
1083
1114
  return toReturn;
1084
1115
  }
1085
1116
  }
@@ -1167,6 +1198,32 @@ class UpdateFormResponse {
1167
1198
  return toReturn;
1168
1199
  }
1169
1200
  }
1201
+ class UserFormSubmission {
1202
+ static fromProto(proto) {
1203
+ let m = new UserFormSubmission();
1204
+ m = Object.assign(m, proto);
1205
+ return m;
1206
+ }
1207
+ constructor(kwargs) {
1208
+ if (!kwargs) {
1209
+ return;
1210
+ }
1211
+ Object.assign(this, kwargs);
1212
+ }
1213
+ toApiJson() {
1214
+ const toReturn = {};
1215
+ if (typeof this.formId !== 'undefined') {
1216
+ toReturn['formId'] = this.formId;
1217
+ }
1218
+ if (typeof this.version !== 'undefined') {
1219
+ toReturn['version'] = this.version;
1220
+ }
1221
+ if (typeof this.values !== 'undefined') {
1222
+ toReturn['values'] = this.values;
1223
+ }
1224
+ return toReturn;
1225
+ }
1226
+ }
1170
1227
  class ValidationError {
1171
1228
  static fromProto(proto) {
1172
1229
  let m = new ValidationError();
@@ -1214,6 +1271,11 @@ class GetMultiFormVersionsListResponseVersions {
1214
1271
  }
1215
1272
  }
1216
1273
 
1274
+ // *********************************
1275
+ // Code generated by sdkgen
1276
+ // DO NOT EDIT!.
1277
+ //
1278
+ // Objects Index.
1217
1279
  // *********************************
1218
1280
 
1219
1281
  const environment = (window ? window['environment'] : 'prod') ?? 'prod';
@@ -1232,13 +1294,18 @@ class HostService {
1232
1294
  return 'https://' + this.host;
1233
1295
  }
1234
1296
  }
1235
- HostService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: HostService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1236
- HostService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: HostService, providedIn: 'root' });
1237
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: HostService, decorators: [{
1297
+ HostService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HostService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1298
+ HostService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HostService, providedIn: 'root' });
1299
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HostService, decorators: [{
1238
1300
  type: Injectable,
1239
1301
  args: [{ providedIn: 'root' }]
1240
1302
  }] });
1241
1303
 
1304
+ // *********************************
1305
+ // Code generated by sdkgen
1306
+ // DO NOT EDIT!.
1307
+ //
1308
+ // API Service.
1242
1309
  // *********************************
1243
1310
  class FormSubmissionApiService {
1244
1311
  constructor(http, hostService) {
@@ -1264,14 +1331,24 @@ class FormSubmissionApiService {
1264
1331
  return this.http.post(this._host + "/forms.v1.FormSubmissionService/ListFormSubmission", request.toApiJson(), this.apiOptions())
1265
1332
  .pipe(map(resp => ListFormSubmissionResponse.fromProto(resp)));
1266
1333
  }
1334
+ getMultiFormSubmission(r) {
1335
+ const request = (r.toApiJson) ? r : new GetMultiFormSubmissionRequest(r);
1336
+ return this.http.post(this._host + "/forms.v1.FormSubmissionService/GetMultiFormSubmission", request.toApiJson(), this.apiOptions())
1337
+ .pipe(map(resp => GetMultiFormSubmissionResponse.fromProto(resp)));
1338
+ }
1267
1339
  }
1268
- 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
- FormSubmissionApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: FormSubmissionApiService, providedIn: 'root' });
1270
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: FormSubmissionApiService, decorators: [{
1340
+ FormSubmissionApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormSubmissionApiService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
1341
+ FormSubmissionApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormSubmissionApiService, providedIn: 'root' });
1342
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormSubmissionApiService, decorators: [{
1271
1343
  type: Injectable,
1272
1344
  args: [{ providedIn: 'root' }]
1273
1345
  }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: HostService }]; } });
1274
1346
 
1347
+ // *********************************
1348
+ // Code generated by sdkgen
1349
+ // DO NOT EDIT!.
1350
+ //
1351
+ // API Service.
1275
1352
  // *********************************
1276
1353
  class FormsApiService {
1277
1354
  constructor(http, hostService) {
@@ -1337,14 +1414,19 @@ class FormsApiService {
1337
1414
  .pipe(map(resp => PreviewFormResponse.fromProto(resp)));
1338
1415
  }
1339
1416
  }
1340
- FormsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: FormsApiService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
1341
- FormsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: FormsApiService, providedIn: 'root' });
1342
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: FormsApiService, decorators: [{
1417
+ FormsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormsApiService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
1418
+ FormsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormsApiService, providedIn: 'root' });
1419
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormsApiService, decorators: [{
1343
1420
  type: Injectable,
1344
1421
  args: [{ providedIn: 'root' }]
1345
1422
  }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: HostService }]; } });
1346
1423
 
1347
1424
  // *********************************
1425
+ // Code generated by sdkgen
1426
+ // DO NOT EDIT!.
1427
+ //
1428
+ // Index.
1429
+ // *********************************
1348
1430
 
1349
1431
  class FormSubmissionsExportService {
1350
1432
  constructor(http, hostService) {
@@ -1370,18 +1452,19 @@ class FormSubmissionsExportService {
1370
1452
  }));
1371
1453
  }
1372
1454
  }
1373
- FormSubmissionsExportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: FormSubmissionsExportService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
1374
- FormSubmissionsExportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: FormSubmissionsExportService, providedIn: 'root' });
1375
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: FormSubmissionsExportService, decorators: [{
1455
+ FormSubmissionsExportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormSubmissionsExportService, deps: [{ token: i1.HttpClient }, { token: HostService }], target: i0.ɵɵFactoryTarget.Injectable });
1456
+ FormSubmissionsExportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormSubmissionsExportService, providedIn: 'root' });
1457
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormSubmissionsExportService, decorators: [{
1376
1458
  type: Injectable,
1377
1459
  args: [{ providedIn: 'root' }]
1378
1460
  }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: HostService }]; } });
1379
1461
 
1380
1462
  // MANUALLY CREATED FILE
1463
+ // Don't delete this by mistake when you update the SDK with mscli!
1381
1464
 
1382
1465
  /**
1383
1466
  * Generated bundle index. Do not edit.
1384
1467
  */
1385
1468
 
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 };
1469
+ 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
1470
  //# sourceMappingURL=vendasta-forms_microservice.mjs.map