@vendasta/forms_microservice 0.7.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.
@@ -271,6 +271,29 @@ class FormConfigField {
271
271
  return toReturn;
272
272
  }
273
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
+ }
274
297
  class FieldValue {
275
298
  static fromProto(proto) {
276
299
  let m = new FieldValue();
@@ -809,18 +832,12 @@ class ListFormsResponse {
809
832
  return toReturn;
810
833
  }
811
834
  }
812
- class FormConfigFieldMappedField {
835
+ class ListMappedFieldSchemaRequest {
813
836
  static fromProto(proto) {
814
- let m = new FormConfigFieldMappedField();
837
+ let m = new ListMappedFieldSchemaRequest();
815
838
  m = Object.assign(m, proto);
816
- if (proto.type) {
817
- m.type = enumStringToValue(FieldType, proto.type);
818
- }
819
- if (proto.options) {
820
- m.options = proto.options.map(FormConfigFieldOption.fromProto);
821
- }
822
- if (proto.systemDefined) {
823
- m.systemDefined = FormConfigFieldSystemDefined.fromProto(proto.systemDefined);
839
+ if (proto.pagingOptions) {
840
+ m.pagingOptions = PagedRequestOptions.fromProto(proto.pagingOptions);
824
841
  }
825
842
  return m;
826
843
  }
@@ -832,28 +849,63 @@ class FormConfigFieldMappedField {
832
849
  }
833
850
  toApiJson() {
834
851
  const toReturn = {};
835
- if (typeof this.id !== 'undefined') {
836
- toReturn['id'] = this.id;
852
+ if (typeof this.namespace !== 'undefined') {
853
+ toReturn['namespace'] = this.namespace;
837
854
  }
838
- if (typeof this.type !== 'undefined') {
839
- toReturn['type'] = this.type;
855
+ if (typeof this.crmObjectType !== 'undefined') {
856
+ toReturn['crmObjectType'] = this.crmObjectType;
840
857
  }
841
- if (typeof this.options !== 'undefined' && this.options !== null) {
842
- toReturn['options'] = 'toApiJson' in this.options ? this.options.toApiJson() : this.options;
858
+ if (typeof this.crmObjectSubtype !== 'undefined') {
859
+ toReturn['crmObjectSubtype'] = this.crmObjectSubtype;
843
860
  }
844
- if (typeof this.mappedTo !== 'undefined') {
845
- 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;
846
863
  }
847
- if (typeof this.systemDefined !== 'undefined' && this.systemDefined !== null) {
848
- 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;
849
892
  }
850
893
  return toReturn;
851
894
  }
852
895
  }
853
- class FormConfigFieldOption {
896
+ class MappedField {
854
897
  static fromProto(proto) {
855
- let m = new FormConfigFieldOption();
898
+ let m = new MappedField();
856
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
+ }
857
909
  return m;
858
910
  }
859
911
  constructor(kwargs) {
@@ -864,11 +916,20 @@ class FormConfigFieldOption {
864
916
  }
865
917
  toApiJson() {
866
918
  const toReturn = {};
867
- if (typeof this.value !== 'undefined') {
868
- toReturn['value'] = this.value;
919
+ if (typeof this.id !== 'undefined') {
920
+ toReturn['id'] = this.id;
869
921
  }
870
- if (typeof this.label !== 'undefined') {
871
- 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;
872
933
  }
873
934
  return toReturn;
874
935
  }
@@ -1017,10 +1078,10 @@ class FormConfigFieldSchema {
1017
1078
  let m = new FormConfigFieldSchema();
1018
1079
  m = Object.assign(m, proto);
1019
1080
  if (proto.unmappedField) {
1020
- m.unmappedField = FormConfigFieldUnmappedField.fromProto(proto.unmappedField);
1081
+ m.unmappedField = UnmappedField.fromProto(proto.unmappedField);
1021
1082
  }
1022
1083
  if (proto.mappedField) {
1023
- m.mappedField = FormConfigFieldMappedField.fromProto(proto.mappedField);
1084
+ m.mappedField = MappedField.fromProto(proto.mappedField);
1024
1085
  }
1025
1086
  return m;
1026
1087
  }
@@ -1123,9 +1184,9 @@ class FormSubmissionSubmittedValue {
1123
1184
  return toReturn;
1124
1185
  }
1125
1186
  }
1126
- class FormConfigFieldSystemDefined {
1187
+ class SystemDefined {
1127
1188
  static fromProto(proto) {
1128
- let m = new FormConfigFieldSystemDefined();
1189
+ let m = new SystemDefined();
1129
1190
  m = Object.assign(m, proto);
1130
1191
  return m;
1131
1192
  }
@@ -1143,15 +1204,15 @@ class FormConfigFieldSystemDefined {
1143
1204
  return toReturn;
1144
1205
  }
1145
1206
  }
1146
- class FormConfigFieldUnmappedField {
1207
+ class UnmappedField {
1147
1208
  static fromProto(proto) {
1148
- let m = new FormConfigFieldUnmappedField();
1209
+ let m = new UnmappedField();
1149
1210
  m = Object.assign(m, proto);
1150
1211
  if (proto.type) {
1151
1212
  m.type = enumStringToValue(FieldType, proto.type);
1152
1213
  }
1153
1214
  if (proto.options) {
1154
- m.options = proto.options.map(FormConfigFieldOption.fromProto);
1215
+ m.options = proto.options.map(FieldOption.fromProto);
1155
1216
  }
1156
1217
  return m;
1157
1218
  }
@@ -1442,6 +1503,11 @@ class FormsApiService {
1442
1503
  return this.http.post(this._host + "/forms.v1.Forms/PreviewForm", request.toApiJson(), this.apiOptions())
1443
1504
  .pipe(map(resp => PreviewFormResponse.fromProto(resp)));
1444
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
+ }
1445
1511
  }
1446
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 });
1447
1513
  FormsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FormsApiService, providedIn: 'root' });
@@ -1495,5 +1561,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1495
1561
  * Generated bundle index. Do not edit.
1496
1562
  */
1497
1563
 
1498
- 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 };
1499
1565
  //# sourceMappingURL=vendasta-forms_microservice.mjs.map