@digitalpersona/services
Version:
DigitalPersona Web Access Services
3 lines (2 loc) • 12.1 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@digitalpersona/core")):"function"==typeof define&&define.amd?define(["exports","@digitalpersona/core"],e):e(((t=t||self).dp=t.dp||{},t.dp.services=t.dp.services||{}),t.dp.core)}(this,function(t,e){"use strict";var n;(n=t.VarType||(t.VarType={}))[n.Boolean=1]="Boolean",n[n.Integer=2]="Integer",n[n.String=3]="String",n[n.Blob=4]="Blob";var r,o,i=function(){return function(e){this.values=e,this.type=t.VarType.Boolean}}(),u=function(){return function(e){this.values=e,this.type=t.VarType.Integer}}(),s=function(){return function(e){this.values=e,this.type=t.VarType.String}}(),c=function(){return function(e){this.values=e,this.type=t.VarType.Blob}}();(r=t.AttributeAction||(t.AttributeAction={}))[r.Clear=1]="Clear",r[r.Update=2]="Update",r[r.Append=3]="Append",r[r.Delete=4]="Delete",(o=t.ResourceActions||(t.ResourceActions={}))[o.Read=0]="Read",o[o.Write=1]="Write",o[o.Delete=2]="Delete";var l=function(t,e){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function p(t,e){function n(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var a,d=function(){return(d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},f=function(t){function e(e,n){var r=this.constructor,o=t.call(this,n)||this;return o.code=e,Object.setPrototypeOf(o,r.prototype),o}return p(e,t),e.fromServiceFault=function(t){return new e(t.error_code,t.description)},e.prototype.isHttpError=function(){return this.code>=400&&this.code<600},e}(Error);(a=t.DatabaseType||(t.DatabaseType={})).AD="AD",a.LDS="ADLDS";var h,y=function(){return function(){}}();(h=t.AuthenticationStatus||(t.AuthenticationStatus={}))[h.Error=0]="Error",h[h.Continue=1]="Continue",h[h.Completed=2]="Completed";var A,U=function(){function t(t,e){this.defaultRequest={cache:"no-cache",mode:"cors",headers:{"Content-Type":"application/json;charset=utf-8",Accept:"application/json"}},this.endpointUrl=t,this.defaultRequest=e||this.defaultRequest}return t.handleResponse=function(e){return e.ok?e.json():t.handleError(e)},t.handleError=function(t){if(404===t.status)return t.json().then(function(e){throw e?new f(e.error_code,e.description):new f(t.status,t.statusText)});throw new f(t.status,t.statusText)},t.prototype.get=function(n,r,o){return fetch(e.Url.create(this.endpointUrl,n,r),d(d(d({},this.defaultRequest),o),{method:"GET"})).then(t.handleResponse)},t.prototype.post=function(n,r,o,i){return fetch(e.Url.create(this.endpointUrl,n,r),d(d(d(d({},this.defaultRequest),i),{method:"POST"}),o?{body:JSON.stringify(o)}:{})).then(t.handleResponse)},t.prototype.put=function(n,r,o,i){return fetch(e.Url.create(this.endpointUrl,n,r),d(d(d(d({},this.defaultRequest),i),{method:"PUT"}),o?{body:JSON.stringify(o)}:{})).then(t.handleResponse)},t.prototype.del=function(n,r,o,i){return fetch(e.Url.create(this.endpointUrl,n,r),d(d(d(d({},this.defaultRequest),i),{method:"DELETE"}),o?{body:JSON.stringify(o)}:{})).then(t.handleResponse)},t.prototype.ping=function(t){return void 0===t&&(t="Ping"),fetch(e.Url.create(this.endpointUrl,t),d(d({},this.defaultRequest),{method:"GET"})).then(function(t){return t.ok}).catch(function(t){return!1})},t}(),S=function(){function t(t){this.endpoint=new U(t)}return t.prototype.Ping=function(){return this.endpoint.ping()},t}(),m=function(t){function n(e){return t.call(this,e)||this}return p(n,t),n.prototype.GetUserCredentials=function(t){return this.endpoint.get("GetUserCredentials",{user:t.name,type:t.type}).then(function(t){return t.GetUserCredentialsResult})},n.prototype.GetEnrollmentData=function(t,e){return this.endpoint.get("GetEnrollmentData",{user:t.name,type:t.type,cred_id:e}).then(function(t){return t.GetEnrollmentDataResult})},n.prototype.Identify=function(t){return this.endpoint.post("IdentifyUser",null,{credential:t}).then(function(t){return new e.Ticket(t.IdentifyUserResult.jwt)})},n.prototype.Authenticate=function(t,n){return t instanceof e.Ticket?this.endpoint.post("AuthenticateUserTicket",null,{ticket:t,credential:n}).then(function(t){return new e.Ticket(t.AuthenticateUserTicketResult.jwt)}):this.endpoint.post("AuthenticateUser",null,{user:t,credential:n}).then(function(t){return new e.Ticket(t.AuthenticateUserResult.jwt)})},n.prototype.CustomAction=function(t,e,n,r){return this.endpoint.post("CustomAction",null,{actionId:t,ticket:e,user:n,credential:r}).then(function(t){return t.CustomActionResult})},n.prototype.CreateAuthentication=function(t,n){return t instanceof e.Ticket?this.endpoint.post("CreateTicketAuthentication",null,{ticket:t,credentialId:n}).then(function(t){return t.CreateTicketAuthenticationResult}):this.endpoint.post("CreateUserAuthentication",null,{user:t,credentialId:n}).then(function(t){return t.CreateUserAuthenticationResult})},n.prototype.ContinueAuthentication=function(t,e){return this.endpoint.post("ContinueAuthentication",null,{authId:t,authData:e}).then(function(t){return t.ContinueAuthenticationResult})},n.prototype.DestroyAuthentication=function(t){return this.endpoint.del("DestroyAuthentication",null,{authId:t})},n}(S),C=function(){return function(t,e,n){this.name=t,this.db=e,this.attr=n}}(),R=function(t){function e(e){return t.call(this,e)||this}return p(e,t),e.prototype.GetConfiguredClaims=function(t){return this.endpoint.post("GetConfiguredClaims",null,{ticket:t}).then(function(t){return t.GetConfiguredClaimsResult.ticket})},e.prototype.GetClaims=function(t,e){return this.endpoint.post("GetClaims",null,{ticket:t,request:e}).then(function(t){return t.GetClaimsResult.ticket})},e}(S),g=function(t){function e(e){return t.call(this,e)||this}return p(e,t),e.prototype.GetUserCredentials=function(t){return this.endpoint.get("GetUserCredentials",{user:t.name,type:t.type}).then(function(t){return t.GetUserCredentialsResult})},e.prototype.GetEnrollmentData=function(t,e){return this.endpoint.get("GetEnrollmentData",{user:t.name,type:t.type,cred_id:e}).then(function(t){return t.GetEnrollmentDataResult})},e.prototype.CreateUser=function(t,e,n){return this.endpoint.put("CreateUser",null,{secOfficer:t,user:e,password:n})},e.prototype.DeleteUser=function(t,e){return this.endpoint.del("DeleteUser",null,{secOfficer:t,user:e})},e.prototype.EnrollUserCredentials=function(t,e,n){return this.endpoint.put("EnrollUserCredentials",null,{secOfficer:t,owner:e,credential:n})},e.prototype.DeleteUserCredentials=function(t,e,n){return this.endpoint.del("DeleteUserCredentials",null,{secOfficer:t,owner:e,credential:n})},e.prototype.EnrollAltusUserCredentials=function(t,e,n){return this.endpoint.put("EnrollAltusUserCredentials",null,{secOfficer:t,user:e,credential:n})},e.prototype.DeleteAltusUserCredentials=function(t,e,n){return this.endpoint.del("DeleteAltusUserCredentials",null,{secOfficer:t,user:e,credential:n})},e.prototype.GetUserAttribute=function(t,e,n){return this.endpoint.post("GetUserAttribute",null,{ticket:t,user:e,attributeName:n}).then(function(t){return{name:n,data:t.GetUserAttributeResult}})},e.prototype.PutUserAttribute=function(t,e,n,r){return this.endpoint.put("PutUserAttribute",null,{ticket:t,user:e,action:r,attributeName:n.name,attributeData:n.data})},e.prototype.UnlockUser=function(t,e){return this.endpoint.post("UnlockUser",null,{user:t,credential:e})},e.prototype.CustomAction=function(t,e,n,r){return this.endpoint.post("CustomAction",null,{ticket:t,user:e,credential:n,actionId:r}).then(function(t){return t.CustomActionResult})},e.prototype.IsEnrollmentAllowed=function(t,e,n){return this.endpoint.post("IsEnrollmentAllowed",null,{secOfficer:t,user:e,credentialId:n})},e}(S),D=function(){return function(){}}();(A=t.TriggerName||(t.TriggerName={})).Behavior="behavior",A.IP="ip",A.Device="device",A.AltusInstalled="altusInstalled",A.Computer="computer",A.Domain="domain",A.User="user",A.InsideFirewall="insideFirewall",A.RemoteSession="remoteSession";var v,k,G,w,T,P,I=function(t){function e(e){return t.call(this,e)||this}return p(e,t),e.prototype.GetPolicyInfo=function(t,e,n,r){return this.endpoint.post("GetPolicyInfo",null,{user:t,resourceUri:e,action:n,info:r}).then(function(t){return t.GetPolicyInfoResult})},e}(S),b=function(t){function e(e){return t.call(this,e)||this}return p(e,t),e.prototype.GetAuthPolicy=function(t,e,n){return this.endpoint.get("GetAuthPolicy",{user:t.name,type:t.type,secretName:e,action:n}).then(function(t){return t.GetAuthPolicyResult})},e.prototype.DoesSecretExist=function(t,e){return this.endpoint.get("DoesSecretExist",{user:t.name,type:t.type,secretName:e}).then(function(t){return t.DoesSecretExistResult})},e.prototype.ReadSecret=function(t,e){return this.endpoint.post("ReadSecret",null,{ticket:t,secretName:e}).then(function(t){return t.ReadSecretResult})},e.prototype.WriteSecret=function(t,e,n){return this.endpoint.put("WriteSecret",null,{ticket:t,secretName:e,secretData:n})},e.prototype.DeleteSecret=function(t,e){return this.endpoint.del("DeleteSecret",null,{ticket:t,secretName:e})},e}(S);(v=t.LicenseType||(t.LicenseType={}))[v.ADUser=1]="ADUser",v[v.LDSUser=2]="LDSUser",(k=t.SearchScope||(t.SearchScope={}))[k.Base=0]="Base",k[k.OneLevel=1]="OneLevel",k[k.Subtree=2]="Subtree",(G=t.ServerSettingType||(t.ServerSettingType={}))[G.Unknown=0]="Unknown",G[G.Admin=1]="Admin",G[G.Public=2]="Public",(w=t.ServerSettings||(t.ServerSettings={}))[w.LockoutThreshold=0]="LockoutThreshold",w[w.LockoutDuration=1]="LockoutDuration",w[w.LockoutReset=2]="LockoutReset",(T=t.UACFlags||(t.UACFlags={}))[T.RevertToWindows=1]="RevertToWindows",T[T.PasswordNotAllowed=2]="PasswordNotAllowed",T[T.PinRequired=4]="PinRequired",T[T.FingerprintRequired=8]="FingerprintRequired",T[T.FingerprintOnly=16]="FingerprintOnly",T[T.OtpAndPwd=64]="OtpAndPwd",T[T.OtpAndFingerprint=128]="OtpAndFingerprint",(P=t.UserAccountType||(t.UserAccountType={}))[P.Unknown=0]="Unknown",P[P.Local=1]="Local",P[P.ActiveDirectory=2]="ActiveDirectory",P[P.ADLDS=3]="ADLDS";var E=function(t){function e(e){return t.call(this,e)||this}return p(e,t),e.prototype.ExecuteSearch=function(t,e){return this.endpoint.post("ExecuteSearch",null,d({ticket:t},e)).then(function(t){return JSON.parse(t.ExecuteSearchResult)})},e.prototype.PSKCImport=function(t,e,n,r,o){return this.endpoint.post("PSKCImport",null,{ticket:t,PSKCData:e,PSKCFileName:n,password:r,sharedKey:o}).then(function(t){return t.PSKCImportResult})},e.prototype.GetServerSettings=function(t,e,n){return this.endpoint.post("GetServerSettings",null,{ticket:t,user:e,settings:n}).then(function(t){return t.GetServerSettingsResult})},e.prototype.SetServerSettings=function(t,e,n){return this.endpoint.put("SetServerSettings",null,{ticket:t,type:e,settings:n})},e.prototype.GetLicenseInfo=function(t){return this.endpoint.get("GetLicenseInfo",{type:t}).then(function(t){return t.GetLicenseInfoResult})},e.prototype.GetUserRecoveryPassword=function(t,e,n){return this.endpoint.post("GetUserRecoveryPassword",null,{ticket:t,user:e,encryptedPwd:n}).then(function(t){return t.GetUserRecoveryPasswordResult})},e.prototype.AdminDeleteUserCredentials=function(t,e,n){return this.endpoint.del("AdminDeleteUserCredentials",null,{ticket:t,user:e,credentials:n})},e.prototype.GetUserInfo=function(t,e){return this.endpoint.post("GetUserInfo",null,{ticket:t,user:e}).then(function(t){return t.GetUserInfoResult})},e.prototype.UnlockUserAccount=function(t,e){return this.endpoint.put("UnlockUserAccount",null,{ticket:t,user:e})},e.prototype.SetUserAccountControl=function(t,e,n){return this.endpoint.put("SetUserAccountControl",null,{ticket:t,user:e,control:n})},e}(S);t.AdminService=E,t.AuthService=m,t.AuthenticationData=y,t.ClaimRequest=C,t.ClaimsService=R,t.ContextualInfo=D,t.EnrollService=g,t.PolicyService=I,t.SecretService=b,t.ServiceError=f,t.VarBlob=c,t.VarBool=i,t.VarInt=u,t.VarString=s,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=index.umd.min.js.map