Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
feat(*): added paths for Agora ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
FredericEspiau authored and antleblanc committed Nov 26, 2018
1 parent aaadfc4 commit 84f75fc
Show file tree
Hide file tree
Showing 21 changed files with 814 additions and 41 deletions.
426 changes: 412 additions & 14 deletions dist/ovh-api-services.js

Large diffs are not rendered by default.

23 changes: 10 additions & 13 deletions dist/ovh-api-services.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/hosting/web/ssl/hosting-web-ssl.v6.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ angular.module("ovh-api-services").service("OvhApiHostingWebSslV6", function ($r
var interceptor = {
response: function (response) {
cache.removeAll();
return response;

return response.data;
}
};

Expand Down
10 changes: 10 additions & 0 deletions src/msServices/account/account.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
angular
.module("ovh-api-services")
.service("OvhApiMsServicesAccount", function ($injector) {

return {
v6: function () {
return $injector.get("OvhApiMsServicesAccountV6");
}
};
});
23 changes: 23 additions & 0 deletions src/msServices/account/account.v6.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
angular
.module("ovh-api-services")
.service("OvhApiMsServicesAccountV6", function ($resource, $cacheFactory) {

var cache = $cacheFactory("OvhApiMsServicesAccountV6");

var resource = $resource("/msServices/:serviceName/account/:userPrincipalName", {
serviceName: "@serviceName",
userPrincipalName: "@userPrincipalName"
}, {
getExchange: { method: "GET", cache: cache, isArray: false, url: "/msServices/:serviceName/account/:userPrincipalName/exchange" }
});

resource.resetAllCache = function () {
resource.resetCache();
};

resource.resetCache = function () {
cache.removeAll();
};

return resource;
});
10 changes: 10 additions & 0 deletions src/msServices/exchange/exchange.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
angular
.module("ovh-api-services")
.service("OvhApiMsServicesExchange", function ($injector) {

return {
v6: function () {
return $injector.get("OvhApiMsServicesExchangeV6");
}
};
});
40 changes: 40 additions & 0 deletions src/msServices/exchange/exchange.v6.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
angular
.module("ovh-api-services")
.service("OvhApiMsServicesExchangeV6", function ($resource, $cacheFactory) {

var cache = $cacheFactory("OvhApiMsServicesExchangeV6");

var interceptor = {
response: function (response) {
cache.removeAll();

return response.data;
}
};

var resource = $resource("/msServices/:serviceName/exchange", {
serviceName: "@serviceName"
}, {
get: { method: "GET", cache: cache, isArray: false },
edit: { method: "PUT", cache: cache, isArray: false, interceptor: interceptor },
doesServiceUseAgora: {
url: "/msServices/:serviceName/exchange/billingMigrated ",
method: "GET",
cache: cache,
isArray: false,
transformResponse: function (response, headers, status) {
return status === 200 ? { serviceUsesAgora: ("" + response).toUpperCase() === "TRUE" } : response;
}
}
});

resource.resetAllCache = function () {
resource.resetCache();
};

resource.resetCache = function () {
cache.removeAll();
};

return resource;
});
16 changes: 16 additions & 0 deletions src/msServices/msServices.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
angular
.module("ovh-api-services")
.service("OvhApiMsServices", function ($injector) {

return {
Account: function () {
return $injector.get("OvhApiMsServicesAccount");
},
Exchange: function () {
return $injector.get("OvhApiMsServicesExchange");
},
Sharepoint: function () {
return $injector.get("OvhApiMsServicesSharepoint");
}
};
});
39 changes: 39 additions & 0 deletions src/msServices/msServices.service.v6.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
angular
.module("ovh-api-services")
.service("OvhApiMsServicesV6", function ($resource, $cacheFactory) {
"use strict";

var cache = $cacheFactory("OvhApiMsServicesV6");
var queryCache = $cacheFactory("OvhApiMsServicesV6Query");

var interceptor = {
response: function (response) {
cache.remove(response.config.url);
queryCache.removeAll();
return response.resource;
}
};

var resource = $resource("/msServices/:serviceName", {
serviceName: "@serviceName"
}, {
query: { method: "GET", cache: cache, isArray: true, url: "/msServices" },
get: { method: "GET", cache: cache, isArray: false },
edit: { method: "PUT", cache: cache, isArray: false, interceptor: interceptor }
});

resource.resetCache = function () {
cache.removeAll();
};

resource.resetQueryCache = function () {
queryCache.removeAll();
};

resource.resetAllCache = function () {
this.resetCache();
this.resetQueryCache();
};

return resource;
});
10 changes: 10 additions & 0 deletions src/msServices/sharepoint/sharepoint.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
angular
.module("ovh-api-services")
.service("OvhApiMsServicesSharepoint", function ($injector) {

return {
v6: function () {
return $injector.get("OvhApiMsServicesSharepointV6");
}
};
});
31 changes: 31 additions & 0 deletions src/msServices/sharepoint/sharepoint.v6.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
angular
.module("ovh-api-services")
.service("OvhApiMsServicesSharepointV6", function ($resource, $cacheFactory) {

var cache = $cacheFactory("OvhApiMsServicesSharepointV6");

var interceptor = {
response: function (response) {
cache.removeAll();
return response.data;
}
};

var resource = $resource("/msServices/:serviceName/sharepoint", {
serviceName: "@serviceName"
}, {
get: { method: "GET", cache: cache, isArray: false },
edit: { method: "PUT", cache: cache, isArray: false, interceptor: interceptor },
doesServiceUseAgora: { url: "/msServices/:serviceName/sharepoint/billingMigrated ", method: "GET", cache: cache, isArray: false }
});

resource.resetAllCache = function () {
resource.resetCache();
};

resource.resetCache = function () {
cache.removeAll();
};

return resource;
});
8 changes: 7 additions & 1 deletion src/order/cart/product/order-cart-product.v6.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ angular.module("ovh-api-services").service("OvhApiOrderCartProductV6", function
productName: "@productName"
}, {
get: { method: "GET", cache: cache, isArray: true },
getOptions: {
url: "/order/cart/:cartId/:productName/options",
method: "GET",
cache: cache,
isArray: true
},
post: { method: "POST", interceptor: interceptor },
postOption: {
postOptions: {
url: "/order/cart/:cartId/:productName/options",
method: "POST",
interceptor: interceptor }
Expand Down
11 changes: 11 additions & 0 deletions src/order/cartServiceOption/cartServiceOption.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
angular.module("ovh-api-services").service("OvhApiOrderCartServiceOption", function ($injector) {
"use strict";
return {
Microsoft: function () {
return $injector.get("OvhApiOrderCartServiceOptionMicrosoft");
},
MicrosoftExchange: function () {
return $injector.get("OvhApiOrderCartServiceOptionMicrosoftExchange");
}
};
});
8 changes: 8 additions & 0 deletions src/order/cartServiceOption/microsoft/microsoft.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
angular.module("ovh-api-services").service("OvhApiOrderCartServiceOptionMicrosoft", function ($injector) {
"use strict";
return {
v6: function () {
return $injector.get("OvhApiOrderCartServiceOptionMicrosoftV6");
}
};
});
50 changes: 50 additions & 0 deletions src/order/cartServiceOption/microsoft/microsoft.v6.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
angular
.module("ovh-api-services")
.service("OvhApiOrderCartServiceOptionMicrosoftV6", function ($resource, $cacheFactory) {
"use strict";

var queryCache = $cacheFactory("OvhApiOrderCartServiceOptionMicrosoftV6Query");
var cache = $cacheFactory("OvhApiOrderCartServiceOptionMicrosoftV6");

var interceptor = {
response: function (response) {
cache.remove(response.config.url);
queryCache.removeAll();
return response.data;
}
};

var resource = $resource("/order/cartServiceOption/microsoft/:serviceName", {
serviceName: "@serviceName"
}, {
get: { method: "GET", isArray: true, cache: cache },
getAvailableServices: { method: "GET", isArray: true, cache: cache, url: "/order/cartServiceOption/microsoft" },
post: {
method: "POST",
cache: queryCache,
interceptor: interceptor,
params: {
cartId: "@cartId",
duration: "@duration",
planCode: "@planCode",
pricingMode: "@pricingMode",
quantity: "@quantity"
}
}
});

resource.resetAllCache = function () {
resource.resetCache();
resource.resetQueryCache();
};

resource.resetCache = function () {
cache.removeAll();
};

resource.resetQueryCache = function () {
queryCache.removeAll();
};

return resource;
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
angular.module("ovh-api-services").service("OvhApiOrderCartServiceOptionMicrosoftExchange", function ($injector) {
"use strict";
return {
v6: function () {
return $injector.get("OvhApiOrderCartServiceOptionMicrosoftExchangeV6");
}
};
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
angular
.module("ovh-api-services")
.service("OvhApiOrderCartServiceOptionMicrosoftExchangeV6", function ($resource, $cacheFactory) {
"use strict";

var queryCache = $cacheFactory("OvhApiOrderCartServiceOptionMicrosoftExchangeV6Query");
var cache = $cacheFactory("OvhApiOrderCartServiceOptionMicrosoftExchangeV6");

var interceptor = {
response: function (response) {
cache.remove(response.config.url);
queryCache.removeAll();
return response.data;
}
};

var resource = $resource("/order/cartServiceOption/microsoftExchange/:serviceName", {
serviceName: "@serviceName"
}, {
getAvailableOffers: { method: "GET", isArray: true, cache: cache },
getServices: { method: "GET", isArray: true, cache: cache, url: "/order/cartServiceOption/microsoftExchange" },
orderOptions: {
method: "POST",
cache: queryCache,
interceptor: interceptor,
params: {
cartId: "@cartId",
duration: "@duration",
planCode: "@planCode",
pricingMode: "@pricingMode",
quantity: "@quantity"
}
}
});

resource.resetAllCache = function () {
resource.resetCache();
resource.resetQueryCache();
};

resource.resetCache = function () {
cache.removeAll();
};

resource.resetQueryCache = function () {
queryCache.removeAll();
};

return resource;
});
30 changes: 18 additions & 12 deletions src/order/order.service.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
angular.module("ovh-api-services").service("OvhApiOrder", function ($injector) {
"use strict";
return {
Router: function () {
return $injector.get("OvhApiOrderRouter");
Cart: function () {
return $injector.get("OvhApiOrderCart");
},
License: function () {
return $injector.get("OvhApiOrderLicense");
},
Vrack: function () {
return $injector.get("OvhApiOrderVrack");
CartServiceOption: function () {
return $injector.get("OvhApiOrderCartServiceOption");
},
DedicatedNasha: function () {
return $injector.get("OvhApiOrderDedicatedNasha");
},
Telephony: function () {
return $injector.get("OvhApiOrderTelephony");
},
Freefax: function () {
return $injector.get("OvhApiOrderFreefax");
},
License: function () {
return $injector.get("OvhApiOrderLicense");
},
Router: function () {
return $injector.get("OvhApiOrderRouter");
},
Sms: function () {
return $injector.get("OvhApiOrderSms");
},
Cart: function () {
return $injector.get("OvhApiOrderCart");
Telephony: function () {
return $injector.get("OvhApiOrderTelephony");
},
Vrack: function () {
return $injector.get("OvhApiOrderVrack");
},
Upgrade: function () {
return $injector.get("OvhApiOrderUpgrade");
},
v6: function () {
return $injector.get("OvhApiOrderV6");
Expand Down
Loading

0 comments on commit 84f75fc

Please sign in to comment.