var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var Unibase; (function (Unibase) { let Platform; (function (Platform) { let Forms; (function (Forms) { let Managers; (function (Managers) { class FormManager extends Platform.Core.BaseManager { getControls() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/getcontrols'; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } refreshFormJson(FormId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/refreshformsjson/formid/' + FormId; return yield this.dataHelper().postAsync(url, null).then(function (response) { return response; }); }); } refreshAllFormJson() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/refreshallformsjson/np'; return yield this.dataHelper().postAsync(url, null).then(function (response) { return response; }); }); } getControlsByAppId(InstalledAppId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/controls/installedappid/' + InstalledAppId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getControl(ControlId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/controls/' + ControlId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getActionProvider(actionprovidertype) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/getformaction/actionprovidertype/' + actionprovidertype; return yield this.dataHelper().getAsync(url).then(function (response) { response.result = JSON.parse(response.result); return response; }); }); } getAllFormActionProviders() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/getallformactionproviders'; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } refreshControls() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/refreshcontrols/np'; return yield this.dataHelper().postAsync(url, "{}").then(function (response) { return response.message; }); }); } saveControl(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/controls'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { return response; }); }); } getControlProperties(ControlId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/controlproperties/controlid/' + ControlId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } loadControlsByDataTypeId(DataTypeId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/controls/datatypeid/' + DataTypeId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getSections(FormId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/sections/formid/' + FormId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } loadAppForms(InstalledAppId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/get/installedappid/' + InstalledAppId; var forms; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getFormsByAppId(FormId, InstalledAppId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/get/formid/' + FormId + '/installedappid/' + InstalledAppId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getForms() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/get'; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getFormData(FormId, PkId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/get/formid/' + FormId + '/pkid/' + PkId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getForm(FormId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/get/formid/' + FormId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getFormbyUniqueId(FormUniqueId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/getform/formuniqueid/' + FormUniqueId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } saveForm(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/saveasnewform'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { return response; }); }); } refreshForms() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/refreshforms/np'; return yield this.dataHelper().postAsync(url, "{}").then(function (response) { return response.message; }); }); } refreshAutocompletes() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/executedeleteprocedures/np'; return yield this.dataHelper().postAsync(url, "{}").then(function (response) { return response.message; }); }); } refreshAllForms() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/refreshallforms/formid/0'; return yield this.dataHelper().postAsync(url, null).then(function (response) { return response.message; }); }); } duplicateForm(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/DuplicateForm'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } exportForm(FormId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/exportform/' + FormId; return yield this.dataHelper().getAsync(url).then(function (response) { return response; }); }); } getSubFormsByParentForm(ParentFormId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/getsubformsbyparent/' + ParentFormId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getFormProperty(FormPropertyId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/formproperty/' + FormPropertyId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getFormProperties(FormId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/formproperties/formid/' + FormId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } deleteFormProperty(DocPropertyId, FormId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/formproperties/docpropertyid/' + DocPropertyId + '/formid/' + FormId; return yield this.dataHelper().postAsync(url, null).then(function (response) { return response; }); }); } getFormRoleByAppConfiguration(AppConfigurationId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/formroles/appconfigurationid/' + AppConfigurationId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null && response.result != "") response.result = JSON.parse(response.result); return response; }); }); } getFormRoles(AppConfigurationId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/getformrolesbyconfigid/configurationid/' + AppConfigurationId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getFormRolesConfiguration(AppConfigurationId, FormId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/getformrolesconfiguration/appconfigurationid/' + AppConfigurationId + '/formid/' + FormId + '/roleid/' + 0; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getFormRolesByInstalledAppId(Installedappid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/getappforms/installedappid/' + Installedappid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getFormRolesByFormId(FormId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/formroles/formid/' + FormId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } dynamicAutoComplete(DocPropertyId, ColumnName, Value, Formpropertyid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/autocomplete/docpropertyid/' + DocPropertyId + '/columnname/' + ColumnName + '/value/' + Value + '/formpropertyid/' + Formpropertyid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } dynamicselect2(DocPropertyId, ColumnName, Value, Formpropertyid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/select2/docpropertyid/' + DocPropertyId + '/columnname/' + ColumnName + '/value/' + Value + '/formpropertyid/' + Formpropertyid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getselect2data(formpropertyId, Idcoulmn) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/getselect2databyidcolumn/formpropertyid/' + formpropertyId + '/idcolumn/' + Idcoulmn; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } dynamicMultiSelectList(DocPropertyId, Ids, columnname, Value, search, Pagesize, PageIndex, FormId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/GetDynamicMultiSelectLists/docpropertyid/' + DocPropertyId + '/ids/' + Ids + '/columnname/' + columnname + '/value/' + Value + '/search/' + search + '/pagesize/' + Pagesize + '/pageindex/' + PageIndex + '/formid/' + FormId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); Unibase.Forms.Controls.multiselectlist.Instance().count = response.result.Count; return response.result.Data; }); }); } dynamicDropDown(DropDownColumnId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/dynamicdropdowncolumns/dropdowncolumnid/' + DropDownColumnId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } dynamicCheckBoxReportData(CheckBoxColumnId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/dynamiccheckboxreportdata/checkboxcolumnid/' + CheckBoxColumnId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getDropDown(drpDwnColumnId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/dropdowncolumns/' + drpDwnColumnId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getDropDownColumns(DocPropertyId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/dropdowncolumns/docpropertyid/' + DocPropertyId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } deleteOptionForControl(DropDownColumnId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/dropdowncolumns/' + DropDownColumnId; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getCheckBoxColumns(DocPropertyId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/checkboxcolumns/docpropertyid/' + DocPropertyId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } deleteOptionForCheckboxControl(CheckBoxColumnId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/deleteOptionForCheckboxControl/' + CheckBoxColumnId; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } dynamicSave(FormId, postData) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/savedynform/' + FormId; return yield this.dataHelper().postAsync(url, postData).then(function (response) { return response; }); }); } saveFormValidation(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/formvalidations'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { return response; }); }); } deleteFormValidation(formvalidationid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/formvalidation/formvalidationid/' + formvalidationid; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getFormValidation(FormValidationId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/formvalidation/' + FormValidationId; return yield this.dataHelper().getAsync(url).then(function (response) { response.result = JSON.parse(response.result); return response; }); }); } getActionProviders(FormId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/getactionproviders/formid/' + FormId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getFormActionProviderById(FormActionProviderId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/getformactionproviderbyid/formactionproviderid/' + FormActionProviderId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } saveDefaultSaveSetting(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/platform/forms/savedefaultsavesetting'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { return response; }); }); } refreshActionProviders() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/refreshactionproviders/np'; return yield this.dataHelper().postAsync(url, "{}").then(function (response) { return response.message; }); }); } getFormsAutoComplete(term, authtoken) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/getformsautocomplete/term/' + term + '/authtoken/' + authtoken; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } dynamicDelete(Id, AppConfigId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/DynamicDelete/id/' + Id + '/appconfigid/' + AppConfigId; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getFormByAppConfiguration(AppConfigurationId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/getformbyappconfiguration/AppConfigurationId/' + AppConfigurationId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getScanPropertyData(Formpropertyid, Text, Column, Value) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/scanproperty/formpropertyid/' + Formpropertyid + '/text/' + Text + '/columnname/' + Column + '/value/' + Value; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != null && response.result != "") { response.result = JSON.parse(response.result); } return response; }); }); } getAutocompleteSelectedData(DocPropertyId, IdColumnValue, FormPropertyId, FormId) { return __awaiter(this, void 0, void 0, function* () { var url = _appsettings.server_url() + '/apis/v4/unibase/platform/forms/createnewsaveddata/docpropertyid/' + DocPropertyId + '/idcolumnvalue/' + IdColumnValue + '/formpropertyid/' + FormPropertyId + '/formid/' + FormId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } updateImagePickerData() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/updateimagepickerdata/np'; return yield this.dataHelper().postAsync(url, "{}").then(function (response) { return response.message; }); }); } updateLock(InstalledAppId, FromDate, ToDate, IsLock) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/updatelocktable/installedappid/' + Number(InstalledAppId) + '/fromdate/' + FromDate + '/todate/' + ToDate + '/islock/' + IsLock; return yield this.dataHelper().postAsync(url, null).then(function (response) { return response; }); }); } static Instance() { if (this._instance === undefined) this._instance = new FormManager(); return this._instance; } } Managers.FormManager = FormManager; })(Managers = Forms.Managers || (Forms.Managers = {})); })(Forms = Platform.Forms || (Platform.Forms = {})); })(Platform = Unibase.Platform || (Unibase.Platform = {})); })(Unibase || (Unibase = {}));