@vendasta/forms_microservice 0.6.0 → 0.8.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.
@@ -23,6 +23,7 @@ var FieldType;
23
23
  FieldType[FieldType["FIELD_TYPE_RICH_TEXT_ELEMENT"] = 8] = "FIELD_TYPE_RICH_TEXT_ELEMENT";
24
24
  FieldType[FieldType["FIELD_TYPE_EMAIL"] = 9] = "FIELD_TYPE_EMAIL";
25
25
  FieldType[FieldType["FIELD_TYPE_PHONE"] = 10] = "FIELD_TYPE_PHONE";
26
+ FieldType[FieldType["FIELD_TYPE_BUSINESS_SEARCH"] = 11] = "FIELD_TYPE_BUSINESS_SEARCH";
26
27
  })(FieldType || (FieldType = {}));
27
28
  var JsonSchemaLibrary;
28
29
  (function (JsonSchemaLibrary) {
@@ -270,6 +271,29 @@ class FormConfigField {
270
271
  return toReturn;
271
272
  }
272
273
  }
274
+ class FieldOption {
275
+ static fromProto(proto) {
276
+ let m = new FieldOption();
277
+ m = Object.assign(m, proto);
278
+ return m;
279
+ }
280
+ constructor(kwargs) {
281
+ if (!kwargs) {
282
+ return;
283
+ }
284
+ Object.assign(this, kwargs);
285
+ }
286
+ toApiJson() {
287
+ const toReturn = {};
288
+ if (typeof this.value !== 'undefined') {
289
+ toReturn['value'] = this.value;
290
+ }
291
+ if (typeof this.label !== 'undefined') {
292
+ toReturn['label'] = this.label;
293
+ }
294
+ return toReturn;
295
+ }
296
+ }
273
297
  class FieldValue {
274
298
  static fromProto(proto) {
275
299
  let m = new FieldValue();
@@ -808,18 +832,12 @@ class ListFormsResponse {
808
832
  return toReturn;
809
833
  }
810
834
  }
811
- class FormConfigFieldMappedField {
835
+ class ListMappedFieldSchemaRequest {
812
836
  static fromProto(proto) {
813
- let m = new FormConfigFieldMappedField();
837
+ let m = new ListMappedFieldSchemaRequest();
814
838
  m = Object.assign(m, proto);
815
- if (proto.type) {
816
- m.type = enumStringToValue(FieldType, proto.type);
817
- }
818
- if (proto.options) {
819
- m.options = proto.options.map(FormConfigFieldOption.fromProto);
820
- }
821
- if (proto.systemDefined) {
822
- m.systemDefined = FormConfigFieldSystemDefined.fromProto(proto.systemDefined);
839
+ if (proto.pagingOptions) {
840
+ m.pagingOptions = PagedRequestOptions.fromProto(proto.pagingOptions);
823
841
  }
824
842
  return m;
825
843
  }
@@ -831,28 +849,63 @@ class FormConfigFieldMappedField {
831
849
  }
832
850
  toApiJson() {
833
851
  const toReturn = {};
834
- if (typeof this.id !== 'undefined') {
835
- toReturn['id'] = this.id;
852
+ if (typeof this.namespace !== 'undefined') {
853
+ toReturn['namespace'] = this.namespace;
836
854
  }
837
- if (typeof this.type !== 'undefined') {
838
- toReturn['type'] = this.type;
855
+ if (typeof this.crmObjectType !== 'undefined') {
856
+ toReturn['crmObjectType'] = this.crmObjectType;
839
857
  }
840
- if (typeof this.options !== 'undefined' && this.options !== null) {
841
- toReturn['options'] = 'toApiJson' in this.options ? this.options.toApiJson() : this.options;
858
+ if (typeof this.crmObjectSubtype !== 'undefined') {
859
+ toReturn['crmObjectSubtype'] = this.crmObjectSubtype;
842
860
  }
843
- if (typeof this.mappedTo !== 'undefined') {
844
- toReturn['mappedTo'] = this.mappedTo;
861
+ if (typeof this.pagingOptions !== 'undefined' && this.pagingOptions !== null) {
862
+ toReturn['pagingOptions'] = 'toApiJson' in this.pagingOptions ? this.pagingOptions.toApiJson() : this.pagingOptions;
845
863
  }
846
- if (typeof this.systemDefined !== 'undefined' && this.systemDefined !== null) {
847
- toReturn['systemDefined'] = 'toApiJson' in this.systemDefined ? this.systemDefined.toApiJson() : this.systemDefined;
864
+ return toReturn;
865
+ }
866
+ }
867
+ class ListMappedFieldSchemaResponse {
868
+ static fromProto(proto) {
869
+ let m = new ListMappedFieldSchemaResponse();
870
+ m = Object.assign(m, proto);
871
+ if (proto.fieldSchemas) {
872
+ m.fieldSchemas = proto.fieldSchemas.map(MappedField.fromProto);
873
+ }
874
+ if (proto.pagingMetadata) {
875
+ m.pagingMetadata = PagedResponseMetadata.fromProto(proto.pagingMetadata);
876
+ }
877
+ return m;
878
+ }
879
+ constructor(kwargs) {
880
+ if (!kwargs) {
881
+ return;
882
+ }
883
+ Object.assign(this, kwargs);
884
+ }
885
+ toApiJson() {
886
+ const toReturn = {};
887
+ if (typeof this.fieldSchemas !== 'undefined' && this.fieldSchemas !== null) {
888
+ toReturn['fieldSchemas'] = 'toApiJson' in this.fieldSchemas ? this.fieldSchemas.toApiJson() : this.fieldSchemas;
889
+ }
890
+ if (typeof this.pagingMetadata !== 'undefined' && this.pagingMetadata !== null) {
891
+ toReturn['pagingMetadata'] = 'toApiJson' in this.pagingMetadata ? this.pagingMetadata.toApiJson() : this.pagingMetadata;
848
892
  }
849
893
  return toReturn;
850
894
  }
851
895
  }
852
- class FormConfigFieldOption {
896
+ class MappedField {
853
897
  static fromProto(proto) {
854
- let m = new FormConfigFieldOption();
898
+ let m = new MappedField();
855
899
  m = Object.assign(m, proto);
900
+ if (proto.type) {
901
+ m.type = enumStringToValue(FieldType, proto.type);
902
+ }
903
+ if (proto.options) {
904
+ m.options = proto.options.map(FieldOption.fromProto);
905
+ }
906
+ if (proto.systemDefined) {
907
+ m.systemDefined = SystemDefined.fromProto(proto.systemDefined);
908
+ }
856
909
  return m;
857
910
  }
858
911
  constructor(kwargs) {
@@ -863,11 +916,20 @@ class FormConfigFieldOption {
863
916
  }
864
917
  toApiJson() {
865
918
  const toReturn = {};
866
- if (typeof this.value !== 'undefined') {
867
- toReturn['value'] = this.value;
919
+ if (typeof this.id !== 'undefined') {
920
+ toReturn['id'] = this.id;
868
921
  }
869
- if (typeof this.label !== 'undefined') {
870
- toReturn['label'] = this.label;
922
+ if (typeof this.type !== 'undefined') {
923
+ toReturn['type'] = this.type;
924
+ }
925
+ if (typeof this.options !== 'undefined' && this.options !== null) {
926
+ toReturn['options'] = 'toApiJson' in this.options ? this.options.toApiJson() : this.options;
927
+ }
928
+ if (typeof this.mappedTo !== 'undefined') {
929
+ toReturn['mappedTo'] = this.mappedTo;
930
+ }
931
+ if (typeof this.systemDefined !== 'undefined' && this.systemDefined !== null) {
932
+ toReturn['systemDefined'] = 'toApiJson' in this.systemDefined ? this.systemDefined.toApiJson() : this.systemDefined;
871
933
  }
872
934
  return toReturn;
873
935
  }
@@ -1016,10 +1078,10 @@ class FormConfigFieldSchema {
1016
1078
  let m = new FormConfigFieldSchema();
1017
1079
  m = Object.assign(m, proto);
1018
1080
  if (proto.unmappedField) {
1019
- m.unmappedField = FormConfigFieldUnmappedField.fromProto(proto.unmappedField);
1081
+ m.unmappedField = UnmappedField.fromProto(proto.unmappedField);
1020
1082
  }
1021
1083
  if (proto.mappedField) {
1022
- m.mappedField = FormConfigFieldMappedField.fromProto(proto.mappedField);
1084
+ m.mappedField = MappedField.fromProto(proto.mappedField);
1023
1085
  }
1024
1086
  return m;
1025
1087
  }
@@ -1122,9 +1184,9 @@ class FormSubmissionSubmittedValue {
1122
1184
  return toReturn;
1123
1185
  }
1124
1186
  }
1125
- class FormConfigFieldSystemDefined {
1187
+ class SystemDefined {
1126
1188
  static fromProto(proto) {
1127
- let m = new FormConfigFieldSystemDefined();
1189
+ let m = new SystemDefined();
1128
1190
  m = Object.assign(m, proto);
1129
1191
  return m;
1130
1192
  }
@@ -1142,15 +1204,15 @@ class FormConfigFieldSystemDefined {
1142
1204
  return toReturn;
1143
1205
  }
1144
1206
  }
1145
- class FormConfigFieldUnmappedField {
1207
+ class UnmappedField {
1146
1208
  static fromProto(proto) {
1147
- let m = new FormConfigFieldUnmappedField();
1209
+ let m = new UnmappedField();
1148
1210
  m = Object.assign(m, proto);
1149
1211
  if (proto.type) {
1150
1212
  m.type = enumStringToValue(FieldType, proto.type);
1151
1213
  }
1152
1214
  if (proto.options) {
1153
- m.options = proto.options.map(FormConfigFieldOption.fromProto);
1215
+ m.options = proto.options.map(FieldOption.fromProto);
1154
1216
  }
1155
1217
  return m;
1156
1218
  }
@@ -1441,6 +1503,11 @@ class FormsApiService {
1441
1503
  return this.http.post(this._host + "/forms.v1.Forms/PreviewForm", request.toApiJson(), this.apiOptions())
1442
1504
  .pipe(map(resp => PreviewFormResponse.fromProto(resp)));
1443
1505
  }
1506
+ listMappedFieldSchema(r) {
1507
+ const request = (r.toApiJson) ? r : new ListMappedFieldSchemaRequest(r);
1508
+ return this.http.post(this._host + "/forms.v1.Forms/ListMappedFieldSchema", request.toApiJson(), this.apiOptions())
1509
+ .pipe(map(resp => ListMappedFieldSchemaResponse.fromProto(resp)));
1510
+ }
1444
1511
  }
1445
1512
  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 });
1446
1513
  FormsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormsApiService, providedIn: 'root' });
@@ -1494,5 +1561,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1494
1561
  * Generated bundle index. Do not edit.
1495
1562
  */
1496
1563
 
1497
- export { CreateFormRequest, CreateFormResponse, CreateFormSubmissionRequest, CreateFormSubmissionResponse, DeleteFormRequest, FieldType, FieldValue, FormConfig, FormConfigField, FormConfigFieldMappedField, FormConfigFieldOption, FormConfigFieldSchema, FormConfigFieldSystemDefined, 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 };
1564
+ 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, Styles, SystemDefined, UnmappedField, UpdateFormRequest, UpdateFormResponse, UserFormSubmission, ValidationError };
1498
1565
  //# sourceMappingURL=vendasta-forms_microservice.mjs.map