@openmrs/angularjs-openmrs-api
Advanced tools
Comparing version 0.5.5 to 0.5.6
@@ -472,3 +472,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
@@ -500,43 +500,39 @@ | ||
function openmrsTranslateProvider($translateProvider) { | ||
var initialized = false; | ||
function init() { | ||
if (!initialized) { | ||
var contextPath; | ||
if (typeof OPENMRS_CONTEXT_PATH === 'undefined') { | ||
contextPath = 'openmrs'; | ||
} else { | ||
contextPath = OPENMRS_CONTEXT_PATH; | ||
} | ||
function init() { | ||
var contextPath; | ||
if (typeof OPENMRS_CONTEXT_PATH === 'undefined') { | ||
contextPath = 'openmrs'; | ||
} else { | ||
contextPath = OPENMRS_CONTEXT_PATH; | ||
} | ||
$translateProvider.fallbackLanguage('en').preferredLanguage('en').useUrlLoader('/' + contextPath + '/module/uicommons/messages/messages.json').useSanitizeValueStrategy('escape') // see http://angular-translate.github.io/docs/#/guide/19_security | ||
.forceAsyncReload(true); // this line is what allows use to merge the list of statistically-defined locations with those loaded via URL, see https://angular-translate.github.io/docs/#/guide/12_asynchronous-loading | ||
initialized = true; | ||
$translateProvider.fallbackLanguage('en').preferredLanguage('en').useUrlLoader('/' + contextPath + '/module/uicommons/messages/messages.json').useSanitizeValueStrategy('escape') // see http://angular-translate.github.io/docs/#/guide/19_security | ||
.forceAsyncReload(true); // this line is what allows use to merge the list of statistically-defined locations with those loaded via URL, see https://angular-translate.github.io/docs/#/guide/12_asynchronous-loading | ||
} | ||
} | ||
return { | ||
addTranslations: addTranslations, | ||
$get: ['$translate', provideOpenmrsTranslate] | ||
}; | ||
function addTranslations(key, newMessages) { | ||
init(); | ||
var oldMessages = $translateProvider.translations(key); | ||
if (!angular.isDefined(oldMessages)) { | ||
oldMessages = {}; | ||
} | ||
$translateProvider.translations(key, angular.extend(oldMessages, newMessages)); | ||
} | ||
function provideOpenmrsTranslate($translate) { | ||
return { | ||
changeLanguage: changeLanguage | ||
addTranslations: addTranslations, | ||
$get: ['$translate', provideOpenmrsTranslate] | ||
}; | ||
function changeLanguage(key) { | ||
$translate.use(key); | ||
function addTranslations(key, newMessages) { | ||
var oldMessages = $translateProvider.translations(key); | ||
if (!angular.isDefined(oldMessages)) { | ||
oldMessages = {}; | ||
} | ||
$translateProvider.translations(key, angular.extend(oldMessages, newMessages)); | ||
} | ||
} | ||
function provideOpenmrsTranslate($translate) { | ||
return { | ||
changeLanguage: changeLanguage | ||
}; | ||
function changeLanguage(key) { | ||
$translate.use(key); | ||
} | ||
} | ||
} | ||
@@ -543,0 +539,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("angular"),require("angular-resource"),require("angular-translate"),require("angular-translate-loader-url")):"function"==typeof define&&define.amd?define("angularjs-openmrs-api",["angular","angular-resource","angular-translate","angular-translate-loader-url"],n):"object"==typeof exports?exports["angularjs-openmrs-api"]=n(require("angular"),require("angular-resource"),require("angular-translate"),require("angular-translate-loader-url")):e["angularjs-openmrs-api"]=n(e.angular,e["angular-resource"],e["angular-translate"],e["angular-translate-loader-url"])}(this,function(e,n,r,t){return function(e){function n(t){if(r[t])return r[t].exports;var u=r[t]={i:t,l:!1,exports:{}};return e[t].call(u.exports,u,u.exports,n),u.l=!0,u.exports}var r={};return n.m=e,n.c=r,n.i=function(e){return e},n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=3)}([function(e,n){e.exports=require("angular")},function(e,n,r){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}function u(e){function n(){return r}var r={};return{getConfig:n}}function a(e,n,r){return{responseError:function(t){if(!r.getConfig.test&&(401===t.status||403===t.status)&&n.confirm("The operation cannot be completed, because you are no longer logged in. Do you want to go to login page?")){var u=n.location.href;u=u.replace("#","_HASHTAG_"),u=u.slice(u.indexOf("/openmrs"));var a;if(d.default.isDefined(r.getConfig().href))a=r.getConfig().href;else{var o=n.location.pathname;o=i(o),a=o}var a=a+"/login.htm?redirect_url="+u;n.location.href=a}return e.reject(t)}}}function o(e){e.interceptors.push("authInterceptor"),e.defaults.headers.common["Disable-WWW-Authenticate"]="true"}function i(e){return e.substring(0,e.indexOf("/owa/"))}function s(e,n,r,t,u){function a(){function e(){var e=n.location.pathname;a.href=i(e),o.resolve(a)}var a=u.getConfig(),o=t.defer();return d.default.isUndefined(a.href)?r.get("manifest.webapp").then(function(n){n.data.activities.openmrs.testConfig?(a.href=n.data.activities.openmrs.testConfig.href,a.test=!0,r.defaults.headers.common["Disable-WWW-Authenticate"]=!1,r.defaults.withCredentials=!0,o.resolve(a)):e()},e):o.resolve(a),o.promise}function o(e){var r=e;r=n.location.pathname,r=r.substring(0,r.indexOf(e)),r.endsWith("/")&&(r=r.substring(0,r.length-1)),u.getConfig().href=r}function s(n){var r=t.defer();return a().then(function(t){var u,a;if(d.default.isString(n)){n={resource:n,url:"/"+n}}if(n.unnatural)u=n.params,a=t.href+"/ws/rest/v1"+n.url+"/:uuid";else{var o=d.default.copy(l.defaultConfig);u=d.default.extend(o,n.params),a=t.href+"/ws/rest/v1"+n.url+"/:uuid"}var i=n.actions||l.extraActions;l[n.resource]=e(a,u,i),r.resolve(l[n.resource])}),r.promise}var l={defaultConfig:{uuid:"@uuid"},add:s,getOpenmrsContextConfig:a,setBaseAppPath:o};return l}function l(){function e(e,n){return["openmrsRest",function(r){return r.list(e,n)}]}function n(e,n){return["openmrsRest",function(r){return r.get(e,n)}]}function r(e,n,r){function t(){var n=r.defer();return e.getOpenmrsContextConfig().then(function(e){n.resolve(e.href)}),n.promise}function u(n){e.setBaseAppPath(n)}function a(r,t){return e.add(r).then(function(e){return e.get(t).$promise.then(function(e){return new f(e,n)})})}function o(e,n){return n=x(n,"full"),a(e,n)}function i(e,n){return n=x(n,"ref"),a(e,n)}function s(n,r){return e.add(n).then(function(e){return e.get(r).$promise.then(function(e){return e})})}function l(e,n){return n=x(n,"full"),s(e,n)}function c(e,n){return n=x(n,"ref"),s(e,n)}function p(n,r){return e.add(n).then(function(e){return e.save(r).$promise.then(function(e){return e})})}function g(n,r){return e.add(n).then(function(e){return e.save({uuid:r.uuid},r).$promise.then(function(e){return e})})}function m(n,r,t){return e.add(n).then(function(e){return e.remove({uuid:r.uuid,reason:t}).$promise.then(function(e){return e})})}function h(n,r){return e.add(n).then(function(e){return e.save({uuid:r.uuid},{retired:!1}).$promise.then(function(e){return e})})}function v(n,r){var t={uuid:r.uuid};return null==t?t={purge:!0}:d.default.extend(t,{purge:!0}),e.add(n).then(function(e){return e.remove(t).$promise.then(function(e){return e})})}function x(e,n){return null==e?{v:n}:d.default.extend(e,{v:n})}return{list:a,listFull:o,listRef:i,get:s,getFull:l,getRef:c,create:p,update:g,remove:m,retire:m,unretire:h,purge:v,getServerUrl:t,setBaseAppPath:u}}return{list:e,get:n,$get:["openmrsApi","$document","$q",function(e,n,t){return r(e,n,t)}]}}function f(e,n){function r(){return null!=o}function t(){return null!=i}function u(e){var r=n[0].createElement("a");r.href=e;var t=r.search.slice(1).split("&"),u={};return t.forEach(function(e){""!==e&&(e=e.split("="),u[e[0]]=decodeURIComponent(e[1]||""))}),u}var a=e.results,o=null,i=null;return function(){if(null!=e.links)for(var n=0;n<e.links.length;n++){var r=e.links[n];"next"===r.rel?o=u(r.uri):"prev"===r.rel&&(i=u(r.uri))}}(),{results:a,hasNext:r,nextQuery:o,hasPrevious:t,previousQuery:i}}Object.defineProperty(n,"__esModule",{value:!0});var c=r(0),d=t(c),p=r(4);t(p);n.default=d.default.module("angularjs-openmrs-api-rest",["ngResource"]).factory("openmrsContext",u).factory("openmrsApi",s).factory("authInterceptor",a).config(o).provider("openmrsRest",l).name,u.$inject=["$window"],a.$inject=["$q","$window","openmrsContext"],o.$inject=["$httpProvider"],s.$inject=["$resource","$window","$http","$q","openmrsContext"]},function(e,n,r){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}function u(e){function n(){if(!u){var n;n="undefined"==typeof OPENMRS_CONTEXT_PATH?"openmrs":OPENMRS_CONTEXT_PATH,e.fallbackLanguage("en").preferredLanguage("en").useUrlLoader("/"+n+"/module/uicommons/messages/messages.json").useSanitizeValueStrategy("escape").forceAsyncReload(!0),u=!0}}function r(r,t){n();var u=e.translations(r);angular.isDefined(u)||(u={}),e.translations(r,angular.extend(u,t))}function t(e){function n(n){e.use(n)}return{changeLanguage:n}}var u=!1;return{addTranslations:r,$get:["$translate",t]}}Object.defineProperty(n,"__esModule",{value:!0});var a=r(5),o=(t(a),r(6));t(o);n.default=angular.module("angularjs-openmrs-api-translate",["pascalprecht.translate"]).provider("openmrsTranslate",u).name,u.$inject=["$translateProvider"]},function(e,n,r){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var u=r(0),a=t(u),o=r(1),i=t(o),s=r(2),l=t(s);n.default=a.default.module("angularjs-openmrs-api",[i.default,l.default]).name},function(e,n){e.exports=require("angular-resource")},function(e,n){e.exports=require("angular-translate")},function(e,n){e.exports=require("angular-translate-loader-url")}])}); | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("angular"),require("angular-resource"),require("angular-translate"),require("angular-translate-loader-url")):"function"==typeof define&&define.amd?define("angularjs-openmrs-api",["angular","angular-resource","angular-translate","angular-translate-loader-url"],n):"object"==typeof exports?exports["angularjs-openmrs-api"]=n(require("angular"),require("angular-resource"),require("angular-translate"),require("angular-translate-loader-url")):e["angularjs-openmrs-api"]=n(e.angular,e["angular-resource"],e["angular-translate"],e["angular-translate-loader-url"])}(this,function(e,n,r,t){return function(e){function n(t){if(r[t])return r[t].exports;var u=r[t]={i:t,l:!1,exports:{}};return e[t].call(u.exports,u,u.exports,n),u.l=!0,u.exports}var r={};return n.m=e,n.c=r,n.i=function(e){return e},n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=3)}([function(e,n){e.exports=require("angular")},function(e,n,r){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}function u(e){function n(){return r}var r={};return{getConfig:n}}function a(e,n,r){return{responseError:function(t){if(!r.getConfig.test&&(401===t.status||403===t.status)&&n.confirm("The operation cannot be completed, because you are no longer logged in. Do you want to go to login page?")){var u=n.location.href;u=u.replace("#","_HASHTAG_"),u=u.slice(u.indexOf("/openmrs"));var a;if(d.default.isDefined(r.getConfig().href))a=r.getConfig().href;else{var o=n.location.pathname;o=i(o),a=o}var a=a+"/login.htm?redirect_url="+u;n.location.href=a}return e.reject(t)}}}function o(e){e.interceptors.push("authInterceptor"),e.defaults.headers.common["Disable-WWW-Authenticate"]="true"}function i(e){return e.substring(0,e.indexOf("/owa/"))}function s(e,n,r,t,u){function a(){function e(){var e=n.location.pathname;a.href=i(e),o.resolve(a)}var a=u.getConfig(),o=t.defer();return d.default.isUndefined(a.href)?r.get("manifest.webapp").then(function(n){n.data.activities.openmrs.testConfig?(a.href=n.data.activities.openmrs.testConfig.href,a.test=!0,r.defaults.headers.common["Disable-WWW-Authenticate"]=!1,r.defaults.withCredentials=!0,o.resolve(a)):e()},e):o.resolve(a),o.promise}function o(e){var r=e;r=n.location.pathname,r=r.substring(0,r.indexOf(e)),r.endsWith("/")&&(r=r.substring(0,r.length-1)),u.getConfig().href=r}function s(n){var r=t.defer();return a().then(function(t){var u,a;if(d.default.isString(n)){n={resource:n,url:"/"+n}}if(n.unnatural)u=n.params,a=t.href+"/ws/rest/v1"+n.url+"/:uuid";else{var o=d.default.copy(l.defaultConfig);u=d.default.extend(o,n.params),a=t.href+"/ws/rest/v1"+n.url+"/:uuid"}var i=n.actions||l.extraActions;l[n.resource]=e(a,u,i),r.resolve(l[n.resource])}),r.promise}var l={defaultConfig:{uuid:"@uuid"},add:s,getOpenmrsContextConfig:a,setBaseAppPath:o};return l}function l(){function e(e,n){return["openmrsRest",function(r){return r.list(e,n)}]}function n(e,n){return["openmrsRest",function(r){return r.get(e,n)}]}function r(e,n,r){function t(){var n=r.defer();return e.getOpenmrsContextConfig().then(function(e){n.resolve(e.href)}),n.promise}function u(n){e.setBaseAppPath(n)}function a(r,t){return e.add(r).then(function(e){return e.get(t).$promise.then(function(e){return new f(e,n)})})}function o(e,n){return n=x(n,"full"),a(e,n)}function i(e,n){return n=x(n,"ref"),a(e,n)}function s(n,r){return e.add(n).then(function(e){return e.get(r).$promise.then(function(e){return e})})}function l(e,n){return n=x(n,"full"),s(e,n)}function c(e,n){return n=x(n,"ref"),s(e,n)}function p(n,r){return e.add(n).then(function(e){return e.save(r).$promise.then(function(e){return e})})}function g(n,r){return e.add(n).then(function(e){return e.save({uuid:r.uuid},r).$promise.then(function(e){return e})})}function m(n,r,t){return e.add(n).then(function(e){return e.remove({uuid:r.uuid,reason:t}).$promise.then(function(e){return e})})}function h(n,r){return e.add(n).then(function(e){return e.save({uuid:r.uuid},{retired:!1}).$promise.then(function(e){return e})})}function v(n,r){var t={uuid:r.uuid};return null==t?t={purge:!0}:d.default.extend(t,{purge:!0}),e.add(n).then(function(e){return e.remove(t).$promise.then(function(e){return e})})}function x(e,n){return null==e?{v:n}:d.default.extend(e,{v:n})}return{list:a,listFull:o,listRef:i,get:s,getFull:l,getRef:c,create:p,update:g,remove:m,retire:m,unretire:h,purge:v,getServerUrl:t,setBaseAppPath:u}}return{list:e,get:n,$get:["openmrsApi","$document","$q",function(e,n,t){return r(e,n,t)}]}}function f(e,n){function r(){return null!=o}function t(){return null!=i}function u(e){var r=n[0].createElement("a");r.href=e;var t=r.search.slice(1).split("&"),u={};return t.forEach(function(e){""!==e&&(e=e.split("="),u[e[0]]=decodeURIComponent(e[1]||""))}),u}var a=e.results,o=null,i=null;return function(){if(null!=e.links)for(var n=0;n<e.links.length;n++){var r=e.links[n];"next"===r.rel?o=u(r.uri):"prev"===r.rel&&(i=u(r.uri))}}(),{results:a,hasNext:r,nextQuery:o,hasPrevious:t,previousQuery:i}}Object.defineProperty(n,"__esModule",{value:!0});var c=r(0),d=t(c),p=r(4);t(p);n.default=d.default.module("angularjs-openmrs-api-rest",["ngResource"]).factory("openmrsContext",u).factory("openmrsApi",s).factory("authInterceptor",a).config(o).provider("openmrsRest",l).name,u.$inject=["$window"],a.$inject=["$q","$window","openmrsContext"],o.$inject=["$httpProvider"],s.$inject=["$resource","$window","$http","$q","openmrsContext"]},function(e,n,r){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}function u(e){function n(n,r){var t=e.translations(n);angular.isDefined(t)||(t={}),e.translations(n,angular.extend(t,r))}function r(e){function n(n){e.use(n)}return{changeLanguage:n}}return function(){var n;n="undefined"==typeof OPENMRS_CONTEXT_PATH?"openmrs":OPENMRS_CONTEXT_PATH,e.fallbackLanguage("en").preferredLanguage("en").useUrlLoader("/"+n+"/module/uicommons/messages/messages.json").useSanitizeValueStrategy("escape").forceAsyncReload(!0)}(),{addTranslations:n,$get:["$translate",r]}}Object.defineProperty(n,"__esModule",{value:!0});var a=r(5),o=(t(a),r(6));t(o);n.default=angular.module("angularjs-openmrs-api-translate",["pascalprecht.translate"]).provider("openmrsTranslate",u).name,u.$inject=["$translateProvider"]},function(e,n,r){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var u=r(0),a=t(u),o=r(1),i=t(o),s=r(2),l=t(s);n.default=a.default.module("angularjs-openmrs-api",[i.default,l.default]).name},function(e,n){e.exports=require("angular-resource")},function(e,n){e.exports=require("angular-translate")},function(e,n){e.exports=require("angular-translate-loader-url")}])}); | ||
//# sourceMappingURL=index.min.js.map |
{ | ||
"name": "@openmrs/angularjs-openmrs-api", | ||
"version": "0.5.5", | ||
"version": "0.5.6", | ||
"description": "AngularJS (1.x) library for OpenMRS API", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
106193
531