@vendasta/forms_microservice 0.16.0 → 0.18.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.
@@ -26,12 +26,21 @@ var FieldType;
26
26
  FieldType[FieldType["FIELD_TYPE_BUSINESS_SEARCH"] = 11] = "FIELD_TYPE_BUSINESS_SEARCH";
27
27
  FieldType[FieldType["FIELD_TYPE_TEXT_AREA"] = 12] = "FIELD_TYPE_TEXT_AREA";
28
28
  FieldType[FieldType["FIELD_TYPE_TAG"] = 13] = "FIELD_TYPE_TAG";
29
+ FieldType[FieldType["FIELD_TYPE_SECTION"] = 14] = "FIELD_TYPE_SECTION";
29
30
  })(FieldType || (FieldType = {}));
30
31
  var JsonSchemaLibrary;
31
32
  (function (JsonSchemaLibrary) {
32
33
  JsonSchemaLibrary[JsonSchemaLibrary["JSON_SCHEMA_LIBRARY_UNDEFINED"] = 0] = "JSON_SCHEMA_LIBRARY_UNDEFINED";
33
34
  JsonSchemaLibrary[JsonSchemaLibrary["JSON_SCHEMA_LIBRARY_JSONFORM"] = 1] = "JSON_SCHEMA_LIBRARY_JSONFORM";
34
35
  })(JsonSchemaLibrary || (JsonSchemaLibrary = {}));
36
+ var SectionAction;
37
+ (function (SectionAction) {
38
+ SectionAction[SectionAction["SECTION_ACTION_UNDEFINED"] = 0] = "SECTION_ACTION_UNDEFINED";
39
+ SectionAction[SectionAction["SECTION_ACTION_SUBMIT"] = 1] = "SECTION_ACTION_SUBMIT";
40
+ SectionAction[SectionAction["SECTION_ACTION_SUBMIT_CONDITION"] = 2] = "SECTION_ACTION_SUBMIT_CONDITION";
41
+ SectionAction[SectionAction["SECTION_ACTION_NEXT_PAGE"] = 3] = "SECTION_ACTION_NEXT_PAGE";
42
+ SectionAction[SectionAction["SECTION_ACTION_NEXT_APPEND"] = 4] = "SECTION_ACTION_NEXT_APPEND";
43
+ })(SectionAction || (SectionAction = {}));
35
44
 
36
45
  // *********************************
37
46
  // Code generated by sdkgen
@@ -108,6 +117,35 @@ function enumStringToValue(enumRef, value) {
108
117
  }
109
118
  return enumRef[value];
110
119
  }
120
+ class ActionParameters {
121
+ static fromProto(proto) {
122
+ let m = new ActionParameters();
123
+ m = Object.assign(m, proto);
124
+ if (proto.submitConditionParams) {
125
+ m.submitConditionParams = SubmitConditionParameters.fromProto(proto.submitConditionParams);
126
+ }
127
+ if (proto.nextParameters) {
128
+ m.nextParameters = NextParameters.fromProto(proto.nextParameters);
129
+ }
130
+ return m;
131
+ }
132
+ constructor(kwargs) {
133
+ if (!kwargs) {
134
+ return;
135
+ }
136
+ Object.assign(this, kwargs);
137
+ }
138
+ toApiJson() {
139
+ const toReturn = {};
140
+ if (typeof this.submitConditionParams !== 'undefined' && this.submitConditionParams !== null) {
141
+ toReturn['submitConditionParams'] = 'toApiJson' in this.submitConditionParams ? this.submitConditionParams.toApiJson() : this.submitConditionParams;
142
+ }
143
+ if (typeof this.nextParameters !== 'undefined' && this.nextParameters !== null) {
144
+ toReturn['nextParameters'] = 'toApiJson' in this.nextParameters ? this.nextParameters.toApiJson() : this.nextParameters;
145
+ }
146
+ return toReturn;
147
+ }
148
+ }
111
149
  class CreateFormRequest {
112
150
  static fromProto(proto) {
113
151
  let m = new CreateFormRequest();
@@ -206,6 +244,29 @@ class CreateFormSubmissionResponse {
206
244
  return toReturn;
207
245
  }
208
246
  }
247
+ class RenderFormResponseDefaultValues {
248
+ static fromProto(proto) {
249
+ let m = new RenderFormResponseDefaultValues();
250
+ m = Object.assign(m, proto);
251
+ return m;
252
+ }
253
+ constructor(kwargs) {
254
+ if (!kwargs) {
255
+ return;
256
+ }
257
+ Object.assign(this, kwargs);
258
+ }
259
+ toApiJson() {
260
+ const toReturn = {};
261
+ if (typeof this.fieldId !== 'undefined') {
262
+ toReturn['fieldId'] = this.fieldId;
263
+ }
264
+ if (typeof this.jsonValue !== 'undefined') {
265
+ toReturn['jsonValue'] = this.jsonValue;
266
+ }
267
+ return toReturn;
268
+ }
269
+ }
209
270
  class DeleteFormRequest {
210
271
  static fromProto(proto) {
211
272
  let m = new DeleteFormRequest();
@@ -239,6 +300,9 @@ class FormConfigField {
239
300
  if (proto.defaultValue) {
240
301
  m.defaultValue = FieldValue.fromProto(proto.defaultValue);
241
302
  }
303
+ if (proto.sectionConfig) {
304
+ m.sectionConfig = SectionConfig.fromProto(proto.sectionConfig);
305
+ }
242
306
  return m;
243
307
  }
244
308
  constructor(kwargs) {
@@ -273,6 +337,9 @@ class FormConfigField {
273
337
  if (typeof this.defaultPhoneIsoCountryCode !== 'undefined') {
274
338
  toReturn['defaultPhoneIsoCountryCode'] = this.defaultPhoneIsoCountryCode;
275
339
  }
340
+ if (typeof this.sectionConfig !== 'undefined' && this.sectionConfig !== null) {
341
+ toReturn['sectionConfig'] = 'toApiJson' in this.sectionConfig ? this.sectionConfig.toApiJson() : this.sectionConfig;
342
+ }
276
343
  return toReturn;
277
344
  }
278
345
  }
@@ -957,6 +1024,26 @@ class MappedField {
957
1024
  return toReturn;
958
1025
  }
959
1026
  }
1027
+ class NextParameters {
1028
+ static fromProto(proto) {
1029
+ let m = new NextParameters();
1030
+ m = Object.assign(m, proto);
1031
+ return m;
1032
+ }
1033
+ constructor(kwargs) {
1034
+ if (!kwargs) {
1035
+ return;
1036
+ }
1037
+ Object.assign(this, kwargs);
1038
+ }
1039
+ toApiJson() {
1040
+ const toReturn = {};
1041
+ if (typeof this.nextSectionId !== 'undefined') {
1042
+ toReturn['nextSectionId'] = this.nextSectionId;
1043
+ }
1044
+ return toReturn;
1045
+ }
1046
+ }
960
1047
  class RenderFormResponsePreFillByUrlQueryParameter {
961
1048
  static fromProto(proto) {
962
1049
  let m = new RenderFormResponsePreFillByUrlQueryParameter();
@@ -1032,6 +1119,49 @@ class PreviewFormResponse {
1032
1119
  return toReturn;
1033
1120
  }
1034
1121
  }
1122
+ class RecoverFormRequest {
1123
+ static fromProto(proto) {
1124
+ let m = new RecoverFormRequest();
1125
+ m = Object.assign(m, proto);
1126
+ return m;
1127
+ }
1128
+ constructor(kwargs) {
1129
+ if (!kwargs) {
1130
+ return;
1131
+ }
1132
+ Object.assign(this, kwargs);
1133
+ }
1134
+ toApiJson() {
1135
+ const toReturn = {};
1136
+ if (typeof this.formId !== 'undefined') {
1137
+ toReturn['formId'] = this.formId;
1138
+ }
1139
+ return toReturn;
1140
+ }
1141
+ }
1142
+ class RecoverFormResponse {
1143
+ static fromProto(proto) {
1144
+ let m = new RecoverFormResponse();
1145
+ m = Object.assign(m, proto);
1146
+ return m;
1147
+ }
1148
+ constructor(kwargs) {
1149
+ if (!kwargs) {
1150
+ return;
1151
+ }
1152
+ Object.assign(this, kwargs);
1153
+ }
1154
+ toApiJson() {
1155
+ const toReturn = {};
1156
+ if (typeof this.formId !== 'undefined') {
1157
+ toReturn['formId'] = this.formId;
1158
+ }
1159
+ if (typeof this.version !== 'undefined') {
1160
+ toReturn['version'] = this.version;
1161
+ }
1162
+ return toReturn;
1163
+ }
1164
+ }
1035
1165
  class RenderFormRequest {
1036
1166
  static fromProto(proto) {
1037
1167
  let m = new RenderFormRequest();
@@ -1068,6 +1198,9 @@ class RenderFormResponse {
1068
1198
  if (proto.fieldQueryParams) {
1069
1199
  m.fieldQueryParams = proto.fieldQueryParams.map(RenderFormResponsePreFillByUrlQueryParameter.fromProto);
1070
1200
  }
1201
+ if (proto.defaultValues) {
1202
+ m.defaultValues = proto.defaultValues.map(RenderFormResponseDefaultValues.fromProto);
1203
+ }
1071
1204
  return m;
1072
1205
  }
1073
1206
  constructor(kwargs) {
@@ -1093,6 +1226,9 @@ class RenderFormResponse {
1093
1226
  if (typeof this.recaptchaSiteKey !== 'undefined') {
1094
1227
  toReturn['recaptchaSiteKey'] = this.recaptchaSiteKey;
1095
1228
  }
1229
+ if (typeof this.defaultValues !== 'undefined' && this.defaultValues !== null) {
1230
+ toReturn['defaultValues'] = 'toApiJson' in this.defaultValues ? this.defaultValues.toApiJson() : this.defaultValues;
1231
+ }
1096
1232
  return toReturn;
1097
1233
  }
1098
1234
  }
@@ -1125,6 +1261,38 @@ class FormConfigFieldSchema {
1125
1261
  return toReturn;
1126
1262
  }
1127
1263
  }
1264
+ class SectionConfig {
1265
+ static fromProto(proto) {
1266
+ let m = new SectionConfig();
1267
+ m = Object.assign(m, proto);
1268
+ if (proto.buttonAction) {
1269
+ m.buttonAction = enumStringToValue(SectionAction, proto.buttonAction);
1270
+ }
1271
+ if (proto.actionParameters) {
1272
+ m.actionParameters = ActionParameters.fromProto(proto.actionParameters);
1273
+ }
1274
+ return m;
1275
+ }
1276
+ constructor(kwargs) {
1277
+ if (!kwargs) {
1278
+ return;
1279
+ }
1280
+ Object.assign(this, kwargs);
1281
+ }
1282
+ toApiJson() {
1283
+ const toReturn = {};
1284
+ if (typeof this.buttonLabel !== 'undefined') {
1285
+ toReturn['buttonLabel'] = this.buttonLabel;
1286
+ }
1287
+ if (typeof this.buttonAction !== 'undefined') {
1288
+ toReturn['buttonAction'] = this.buttonAction;
1289
+ }
1290
+ if (typeof this.actionParameters !== 'undefined' && this.actionParameters !== null) {
1291
+ toReturn['actionParameters'] = 'toApiJson' in this.actionParameters ? this.actionParameters.toApiJson() : this.actionParameters;
1292
+ }
1293
+ return toReturn;
1294
+ }
1295
+ }
1128
1296
  class StringList {
1129
1297
  static fromProto(proto) {
1130
1298
  let m = new StringList();
@@ -1189,6 +1357,53 @@ class Styles {
1189
1357
  if (typeof this.onPrimaryColor !== 'undefined') {
1190
1358
  toReturn['onPrimaryColor'] = this.onPrimaryColor;
1191
1359
  }
1360
+ if (typeof this.customCss !== 'undefined') {
1361
+ toReturn['customCss'] = this.customCss;
1362
+ }
1363
+ return toReturn;
1364
+ }
1365
+ }
1366
+ class SubmitConditionParameters {
1367
+ static fromProto(proto) {
1368
+ let m = new SubmitConditionParameters();
1369
+ m = Object.assign(m, proto);
1370
+ if (proto.onConditionFailure) {
1371
+ m.onConditionFailure = enumStringToValue(SectionAction, proto.onConditionFailure);
1372
+ }
1373
+ if (proto.onConditionFailureParameters) {
1374
+ m.onConditionFailureParameters = ActionParameters.fromProto(proto.onConditionFailureParameters);
1375
+ }
1376
+ return m;
1377
+ }
1378
+ constructor(kwargs) {
1379
+ if (!kwargs) {
1380
+ return;
1381
+ }
1382
+ Object.assign(this, kwargs);
1383
+ }
1384
+ toApiJson() {
1385
+ const toReturn = {};
1386
+ if (typeof this.fieldId !== 'undefined') {
1387
+ toReturn['fieldId'] = this.fieldId;
1388
+ }
1389
+ if (typeof this.noValue !== 'undefined') {
1390
+ toReturn['noValue'] = this.noValue;
1391
+ }
1392
+ if (typeof this.anyValue !== 'undefined') {
1393
+ toReturn['anyValue'] = this.anyValue;
1394
+ }
1395
+ if (typeof this.isValue !== 'undefined') {
1396
+ toReturn['isValue'] = this.isValue;
1397
+ }
1398
+ if (typeof this.isNotValue !== 'undefined') {
1399
+ toReturn['isNotValue'] = this.isNotValue;
1400
+ }
1401
+ if (typeof this.onConditionFailure !== 'undefined') {
1402
+ toReturn['onConditionFailure'] = this.onConditionFailure;
1403
+ }
1404
+ if (typeof this.onConditionFailureParameters !== 'undefined' && this.onConditionFailureParameters !== null) {
1405
+ toReturn['onConditionFailureParameters'] = 'toApiJson' in this.onConditionFailureParameters ? this.onConditionFailureParameters.toApiJson() : this.onConditionFailureParameters;
1406
+ }
1192
1407
  return toReturn;
1193
1408
  }
1194
1409
  }
@@ -1557,6 +1772,11 @@ class FormsApiService {
1557
1772
  return this.http.post(this._host + "/forms.v1.Forms/ListMappedFieldSchema", request.toApiJson(), this.apiOptions())
1558
1773
  .pipe(map(resp => ListMappedFieldSchemaResponse.fromProto(resp)));
1559
1774
  }
1775
+ recoverForm(r) {
1776
+ const request = (r.toApiJson) ? r : new RecoverFormRequest(r);
1777
+ return this.http.post(this._host + "/forms.v1.Forms/RecoverForm", request.toApiJson(), this.apiOptions())
1778
+ .pipe(map(resp => RecoverFormResponse.fromProto(resp)));
1779
+ }
1560
1780
  }
1561
1781
  FormsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormsApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1562
1782
  FormsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormsApiService, providedIn: 'root' });
@@ -1610,5 +1830,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1610
1830
  * Generated bundle index. Do not edit.
1611
1831
  */
1612
1832
 
1613
- export { CreateFormRequest, CreateFormResponse, CreateFormSubmissionRequest, CreateFormSubmissionResponse, DeleteFormRequest, FieldOption, FieldType, FieldValue, FormConfig, FormConfigField, FormConfigFieldSchema, 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, ListMappedFieldSchemaRequest, ListMappedFieldSchemaResponse, MappedField, PagedRequestOptions, PagedResponseMetadata, PreviewFormRequest, PreviewFormResponse, RenderFormRequest, RenderFormResponse, RenderFormResponsePreFillByUrlQueryParameter, StringList, Styles, SystemDefined, UnmappedField, UpdateFormRequest, UpdateFormResponse, UserFormSubmission, ValidationError };
1833
+ export { ActionParameters, CreateFormRequest, CreateFormResponse, CreateFormSubmissionRequest, CreateFormSubmissionResponse, DeleteFormRequest, FieldOption, FieldType, FieldValue, FormConfig, FormConfigField, FormConfigFieldSchema, 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, ListMappedFieldSchemaRequest, ListMappedFieldSchemaResponse, MappedField, NextParameters, PagedRequestOptions, PagedResponseMetadata, PreviewFormRequest, PreviewFormResponse, RecoverFormRequest, RecoverFormResponse, RenderFormRequest, RenderFormResponse, RenderFormResponseDefaultValues, RenderFormResponsePreFillByUrlQueryParameter, SectionAction, SectionConfig, StringList, Styles, SubmitConditionParameters, SystemDefined, UnmappedField, UpdateFormRequest, UpdateFormResponse, UserFormSubmission, ValidationError };
1614
1834
  //# sourceMappingURL=vendasta-forms_microservice.mjs.map