@lcdp/api-react-rest-client 2.14.3-LDS-5027.18772558632 → 2.14.3-develop.18164509826

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.
Files changed (83) hide show
  1. package/invoice/src/apis/SearchInvoiceApi.d.ts +2 -2
  2. package/invoice/src/apis/SearchInvoiceApi.js +2 -2
  3. package/invoice/src/models/InvoiceType.d.ts +1 -0
  4. package/invoice/src/models/InvoiceType.js +1 -0
  5. package/notification/src/models/NotificationTypeId.d.ts +2 -1
  6. package/notification/src/models/NotificationTypeId.js +2 -1
  7. package/package.json +1 -1
  8. package/rfx/src/apis/index.d.ts +0 -1
  9. package/rfx/src/apis/index.js +0 -1
  10. package/rfx/src/models/index.d.ts +0 -1
  11. package/rfx/src/models/index.js +0 -1
  12. package/subscription/src/apis/ManageSubscriptionApi.d.ts +56 -0
  13. package/subscription/src/apis/ManageSubscriptionApi.js +315 -0
  14. package/subscription/src/apis/ManageSubscriptionPlanApi.d.ts +30 -0
  15. package/{rfx/src/apis/ManageRffApi.js → subscription/src/apis/ManageSubscriptionPlanApi.js} +39 -21
  16. package/subscription/src/apis/SearchSubscriptionApi.d.ts +53 -0
  17. package/subscription/src/apis/SearchSubscriptionApi.js +208 -0
  18. package/subscription/src/apis/SearchSubscriptionPlanApi.d.ts +49 -0
  19. package/subscription/src/apis/SearchSubscriptionPlanApi.js +249 -0
  20. package/subscription/src/apis/SearchSubscriptionPlanFeatureApi.d.ts +26 -0
  21. package/subscription/src/apis/{SearchSubscriptionsApi.js → SearchSubscriptionPlanFeatureApi.js} +13 -19
  22. package/subscription/src/apis/index.d.ts +5 -1
  23. package/subscription/src/apis/index.js +5 -1
  24. package/subscription/src/models/HttpLink.d.ts +31 -0
  25. package/subscription/src/models/HttpLink.js +47 -0
  26. package/subscription/src/models/PaginatedObject.d.ts +32 -0
  27. package/subscription/src/models/PaginatedObject.js +48 -0
  28. package/subscription/src/models/PaginatedSubscriptions.d.ts +39 -0
  29. package/subscription/src/models/PaginatedSubscriptions.js +51 -0
  30. package/subscription/src/models/PagingMetadata.d.ts +49 -0
  31. package/subscription/src/models/PagingMetadata.js +55 -0
  32. package/{chargebee-hook → subscription}/src/models/RestError.d.ts +1 -1
  33. package/{chargebee-hook → subscription}/src/models/RestError.js +1 -1
  34. package/subscription/src/models/SubscriberLink.d.ts +37 -0
  35. package/subscription/src/models/SubscriberLink.js +49 -0
  36. package/subscription/src/models/Subscription.d.ts +18 -23
  37. package/subscription/src/models/Subscription.js +19 -29
  38. package/subscription/src/models/SubscriptionCreationParameters.d.ts +44 -0
  39. package/subscription/src/models/SubscriptionCreationParameters.js +56 -0
  40. package/subscription/src/models/SubscriptionPlan.d.ts +69 -0
  41. package/subscription/src/models/SubscriptionPlan.js +59 -0
  42. package/subscription/src/models/SubscriptionPlanFeature.d.ts +44 -0
  43. package/subscription/src/models/SubscriptionPlanFeature.js +50 -0
  44. package/subscription/src/models/SubscriptionPlanFeatureId.d.ts +26 -0
  45. package/subscription/src/models/SubscriptionPlanFeatureId.js +49 -0
  46. package/subscription/src/models/SubscriptionPlanId.d.ts +25 -0
  47. package/subscription/src/models/SubscriptionPlanId.js +48 -0
  48. package/subscription/src/models/SubscriptionPlanLink.d.ts +38 -0
  49. package/subscription/src/models/SubscriptionPlanLink.js +50 -0
  50. package/subscription/src/models/SubscriptionPlanUpdateParameters.d.ts +62 -0
  51. package/subscription/src/models/SubscriptionPlanUpdateParameters.js +56 -0
  52. package/subscription/src/models/SubscriptionUpdateParameters.d.ts +62 -0
  53. package/subscription/src/models/SubscriptionUpdateParameters.js +57 -0
  54. package/subscription/src/models/index.d.ts +14 -1
  55. package/subscription/src/models/index.js +14 -1
  56. package/third-party/src/models/ThirdPartyLinkCreationParameters.d.ts +2 -5
  57. package/third-party/src/models/ThirdPartyLinkCreationParameters.js +2 -5
  58. package/user/src/models/NotificationTypeId.d.ts +2 -1
  59. package/user/src/models/NotificationTypeId.js +2 -1
  60. package/user/src/models/OffisanteStatus.d.ts +1 -3
  61. package/user/src/models/OffisanteStatus.js +2 -4
  62. package/user/src/models/User.d.ts +0 -8
  63. package/user/src/models/User.js +0 -2
  64. package/chargebee-hook/index.d.ts +0 -1
  65. package/chargebee-hook/index.js +0 -17
  66. package/chargebee-hook/src/apis/ChargebeeHookApi.d.ts +0 -31
  67. package/chargebee-hook/src/apis/ChargebeeHookApi.js +0 -134
  68. package/chargebee-hook/src/apis/index.d.ts +0 -1
  69. package/chargebee-hook/src/apis/index.js +0 -19
  70. package/chargebee-hook/src/index.d.ts +0 -3
  71. package/chargebee-hook/src/index.js +0 -21
  72. package/chargebee-hook/src/models/HookRequest.d.ts +0 -85
  73. package/chargebee-hook/src/models/HookRequest.js +0 -67
  74. package/chargebee-hook/src/models/index.d.ts +0 -2
  75. package/chargebee-hook/src/models/index.js +0 -20
  76. package/chargebee-hook/src/runtime.d.ts +0 -190
  77. package/chargebee-hook/src/runtime.js +0 -598
  78. package/rfx/src/apis/ManageRffApi.d.ts +0 -29
  79. package/rfx/src/models/RffCreationParameters.d.ts +0 -37
  80. package/rfx/src/models/RffCreationParameters.js +0 -51
  81. package/subscription/src/apis/SearchSubscriptionsApi.d.ts +0 -29
  82. package/subscription/src/models/SubscriptionStatus.d.ts +0 -39
  83. package/subscription/src/models/SubscriptionStatus.js +0 -62
@@ -38,12 +38,12 @@ export declare class SearchInvoiceApi extends runtime.BaseAPI {
38
38
  */
39
39
  getInvoice(requestParameters: GetInvoiceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.BlobWithMeta>;
40
40
  /**
41
- * Allow to get invoices. Currently, invoiceType supported values : - SERVICE - EXTERNAL
41
+ * Allow to get invoices. Currently, invoiceType supported values : - SERVICE - SUBSCRIPTION - EXTERNAL
42
42
  * Get invoices for service
43
43
  */
44
44
  getInvoicesRaw(requestParameters: GetInvoicesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedInvoices | runtime.BlobWithMeta>>;
45
45
  /**
46
- * Allow to get invoices. Currently, invoiceType supported values : - SERVICE - EXTERNAL
46
+ * Allow to get invoices. Currently, invoiceType supported values : - SERVICE - SUBSCRIPTION - EXTERNAL
47
47
  * Get invoices for service
48
48
  */
49
49
  getInvoices(requestParameters: GetInvoicesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedInvoices | runtime.BlobWithMeta>;
@@ -163,7 +163,7 @@ var SearchInvoiceApi = /** @class */ (function (_super) {
163
163
  });
164
164
  };
165
165
  /**
166
- * Allow to get invoices. Currently, invoiceType supported values : - SERVICE - EXTERNAL
166
+ * Allow to get invoices. Currently, invoiceType supported values : - SERVICE - SUBSCRIPTION - EXTERNAL
167
167
  * Get invoices for service
168
168
  */
169
169
  SearchInvoiceApi.prototype.getInvoicesRaw = function (requestParameters, initOverrides) {
@@ -247,7 +247,7 @@ var SearchInvoiceApi = /** @class */ (function (_super) {
247
247
  });
248
248
  };
249
249
  /**
250
- * Allow to get invoices. Currently, invoiceType supported values : - SERVICE - EXTERNAL
250
+ * Allow to get invoices. Currently, invoiceType supported values : - SERVICE - SUBSCRIPTION - EXTERNAL
251
251
  * Get invoices for service
252
252
  */
253
253
  SearchInvoiceApi.prototype.getInvoices = function (requestParameters, initOverrides) {
@@ -18,6 +18,7 @@ export declare const InvoiceType: {
18
18
  readonly COMMISSION_SELLER: "COMMISSION_SELLER";
19
19
  readonly COMMISSION_CREDIT_NOTE_BUYER: "COMMISSION_CREDIT_NOTE_BUYER";
20
20
  readonly COMMISSION_CREDIT_NOTE_SELLER: "COMMISSION_CREDIT_NOTE_SELLER";
21
+ readonly SUBSCRIPTION: "SUBSCRIPTION";
21
22
  readonly SERVICE: "SERVICE";
22
23
  readonly ORDER_BUYER: "ORDER_BUYER";
23
24
  readonly ORDER_SELLER: "ORDER_SELLER";
@@ -23,6 +23,7 @@ exports.InvoiceType = {
23
23
  COMMISSION_SELLER: 'COMMISSION_SELLER',
24
24
  COMMISSION_CREDIT_NOTE_BUYER: 'COMMISSION_CREDIT_NOTE_BUYER',
25
25
  COMMISSION_CREDIT_NOTE_SELLER: 'COMMISSION_CREDIT_NOTE_SELLER',
26
+ SUBSCRIPTION: 'SUBSCRIPTION',
26
27
  SERVICE: 'SERVICE',
27
28
  ORDER_BUYER: 'ORDER_BUYER',
28
29
  ORDER_SELLER: 'ORDER_SELLER',
@@ -54,7 +54,8 @@ export declare const NotificationTypeId: {
54
54
  readonly ORDER_LABORATORY_DAILY_MAIL: "ORDER_LABORATORY_DAILY_MAIL";
55
55
  readonly ORDER_VALIDATED_BUYER: "ORDER_VALIDATED_BUYER";
56
56
  readonly ORDER_VALIDATED_SELLER: "ORDER_VALIDATED_SELLER";
57
- readonly OFFISANTE_SIGN_REQUEST: "OFFISANTE_SIGN_REQUEST";
57
+ readonly PHARMAIDE_FIRST_SUBSCRIPTION: "PHARMAIDE_FIRST_SUBSCRIPTION";
58
+ readonly PHARMAIDE_SB_TEST_EXPIRATION: "PHARMAIDE_SB_TEST_EXPIRATION";
58
59
  readonly REQUEST_FOR_ORDER_INVOICE: "REQUEST_FOR_ORDER_INVOICE";
59
60
  readonly CLIENT_BADGE_RECEIVED: "CLIENT_BADGE_RECEIVED";
60
61
  readonly CLIENT_BADGE_LOST: "CLIENT_BADGE_LOST";
@@ -59,7 +59,8 @@ exports.NotificationTypeId = {
59
59
  ORDER_LABORATORY_DAILY_MAIL: 'ORDER_LABORATORY_DAILY_MAIL',
60
60
  ORDER_VALIDATED_BUYER: 'ORDER_VALIDATED_BUYER',
61
61
  ORDER_VALIDATED_SELLER: 'ORDER_VALIDATED_SELLER',
62
- OFFISANTE_SIGN_REQUEST: 'OFFISANTE_SIGN_REQUEST',
62
+ PHARMAIDE_FIRST_SUBSCRIPTION: 'PHARMAIDE_FIRST_SUBSCRIPTION',
63
+ PHARMAIDE_SB_TEST_EXPIRATION: 'PHARMAIDE_SB_TEST_EXPIRATION',
63
64
  REQUEST_FOR_ORDER_INVOICE: 'REQUEST_FOR_ORDER_INVOICE',
64
65
  CLIENT_BADGE_RECEIVED: 'CLIENT_BADGE_RECEIVED',
65
66
  CLIENT_BADGE_LOST: 'CLIENT_BADGE_LOST',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lcdp/api-react-rest-client",
3
- "version": "2.14.3-LDS-5027.18772558632",
3
+ "version": "2.14.3-develop.18164509826",
4
4
  "scripts": {
5
5
  "build": "tsc"
6
6
  },
@@ -1,4 +1,3 @@
1
- export * from './ManageRffApi';
2
1
  export * from './ManageRfiApi';
3
2
  export * from './ManageRfilApi';
4
3
  export * from './ManageRfoiApi';
@@ -16,7 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  /* tslint:disable */
18
18
  /* eslint-disable */
19
- __exportStar(require("./ManageRffApi"), exports);
20
19
  __exportStar(require("./ManageRfiApi"), exports);
21
20
  __exportStar(require("./ManageRfilApi"), exports);
22
21
  __exportStar(require("./ManageRfoiApi"), exports);
@@ -4,7 +4,6 @@ export * from './PaginatedObject';
4
4
  export * from './PaginatedRfois';
5
5
  export * from './PagingMetadata';
6
6
  export * from './RestError';
7
- export * from './RffCreationParameters';
8
7
  export * from './RfiCreationParameters';
9
8
  export * from './RfilCreationParameters';
10
9
  export * from './RfoCreationParameters';
@@ -22,7 +22,6 @@ __exportStar(require("./PaginatedObject"), exports);
22
22
  __exportStar(require("./PaginatedRfois"), exports);
23
23
  __exportStar(require("./PagingMetadata"), exports);
24
24
  __exportStar(require("./RestError"), exports);
25
- __exportStar(require("./RffCreationParameters"), exports);
26
25
  __exportStar(require("./RfiCreationParameters"), exports);
27
26
  __exportStar(require("./RfilCreationParameters"), exports);
28
27
  __exportStar(require("./RfoCreationParameters"), exports);
@@ -0,0 +1,56 @@
1
+ /**
2
+ * lcdp-monolith-service
3
+ * This is the REST API of LCDP products
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: contact@lecomptoirdespharmacies.fr
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { Subscription, SubscriptionCreationParameters, SubscriptionUpdateParameters } from '../models/index';
14
+ export interface CreateSubscriptionRequest {
15
+ subscriptionCreationParameters: SubscriptionCreationParameters;
16
+ }
17
+ export interface DeleteSubscriptionRequest {
18
+ subscriptionId: number;
19
+ }
20
+ export interface UpdateSubscriptionRequest {
21
+ subscriptionId: number;
22
+ subscriptionUpdateParameters: SubscriptionUpdateParameters;
23
+ }
24
+ /**
25
+ *
26
+ */
27
+ export declare class ManageSubscriptionApi extends runtime.BaseAPI {
28
+ /**
29
+ * Create subscription for a specific user. This operation is useful to change current plan of user. Note : - Upgrade user plan is immediate - Downgrade user plan wait termination of current subscription # Preconditions : - If plan \'price\' > 0, client \'mandate\' of id \'clientId\' should exists. - If user have offisante status \'NOT_SET\' : - User email is filled - User firstname is filled - User lastname is filled - User company SIRET is filled - User Company CIP is filled - User Company finess is filled - User Company management software is filled - User Company location type is filled - User Company group is filled # Limitations : - \'isTrial\' can only be true if no subscription on the user yet or executor is ADMINISTRATOR
30
+ * Subscribe to a plan
31
+ */
32
+ createSubscriptionRaw(requestParameters: CreateSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Subscription | runtime.BlobWithMeta>>;
33
+ /**
34
+ * Create subscription for a specific user. This operation is useful to change current plan of user. Note : - Upgrade user plan is immediate - Downgrade user plan wait termination of current subscription # Preconditions : - If plan \'price\' > 0, client \'mandate\' of id \'clientId\' should exists. - If user have offisante status \'NOT_SET\' : - User email is filled - User firstname is filled - User lastname is filled - User company SIRET is filled - User Company CIP is filled - User Company finess is filled - User Company management software is filled - User Company location type is filled - User Company group is filled # Limitations : - \'isTrial\' can only be true if no subscription on the user yet or executor is ADMINISTRATOR
35
+ * Subscribe to a plan
36
+ */
37
+ createSubscription(requestParameters: CreateSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Subscription | runtime.BlobWithMeta>;
38
+ /**
39
+ * Unsubscribe user from subscription
40
+ */
41
+ deleteSubscriptionRaw(requestParameters: DeleteSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
42
+ /**
43
+ * Unsubscribe user from subscription
44
+ */
45
+ deleteSubscription(requestParameters: DeleteSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
46
+ /**
47
+ * # Preconditions : - You are the subscriber or ADMINISTRATOR - \'nextBillingDate\' > \'validFrom\' - \'nextBillingDate\' <= \'validTo\' - \'validTo\' > \'validFrom\' # Limitations (Subscriber) : - Can only update current subscription - Can only update \'validTo\' or set \'isTrial\' false # How to \"Extend trial period\" : - Delete next subscription - Update current subscription : - billingPrice = 0 - validTo = Any date to set trial end date - isTrial = true # How to \"Unsubscribe immediately\" : (Warning : No billing will occured) - Delete next subscription - Update current subscription : - validTo = TODAY - nextBillingDate = null - isTrial = false # How to \"Unsubscribe at subscription end\" : - Delete next subscription - Update current subscription : - validTo = subscription.validTo || subscription.nextBillingDate || TODAY - isTrial = false
48
+ * Update user subscription
49
+ */
50
+ updateSubscriptionRaw(requestParameters: UpdateSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Subscription | runtime.BlobWithMeta>>;
51
+ /**
52
+ * # Preconditions : - You are the subscriber or ADMINISTRATOR - \'nextBillingDate\' > \'validFrom\' - \'nextBillingDate\' <= \'validTo\' - \'validTo\' > \'validFrom\' # Limitations (Subscriber) : - Can only update current subscription - Can only update \'validTo\' or set \'isTrial\' false # How to \"Extend trial period\" : - Delete next subscription - Update current subscription : - billingPrice = 0 - validTo = Any date to set trial end date - isTrial = true # How to \"Unsubscribe immediately\" : (Warning : No billing will occured) - Delete next subscription - Update current subscription : - validTo = TODAY - nextBillingDate = null - isTrial = false # How to \"Unsubscribe at subscription end\" : - Delete next subscription - Update current subscription : - validTo = subscription.validTo || subscription.nextBillingDate || TODAY - isTrial = false
53
+ * Update user subscription
54
+ */
55
+ updateSubscription(requestParameters: UpdateSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Subscription | runtime.BlobWithMeta>;
56
+ }
@@ -0,0 +1,315 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * lcdp-monolith-service
6
+ * This is the REST API of LCDP products
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: contact@lecomptoirdespharmacies.fr
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __extends = (this && this.__extends) || (function () {
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
22
+ return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
30
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
31
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
32
+ return new (P || (P = Promise))(function (resolve, reject) {
33
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
34
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
35
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
36
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
37
+ });
38
+ };
39
+ var __generator = (this && this.__generator) || function (thisArg, body) {
40
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
41
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
42
+ function verb(n) { return function (v) { return step([n, v]); }; }
43
+ function step(op) {
44
+ if (f) throw new TypeError("Generator is already executing.");
45
+ while (_) try {
46
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
47
+ if (y = 0, t) op = [op[0] & 2, t.value];
48
+ switch (op[0]) {
49
+ case 0: case 1: t = op; break;
50
+ case 4: _.label++; return { value: op[1], done: false };
51
+ case 5: _.label++; y = op[1]; op = [0]; continue;
52
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
53
+ default:
54
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
55
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
56
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
57
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
58
+ if (t[2]) _.ops.pop();
59
+ _.trys.pop(); continue;
60
+ }
61
+ op = body.call(thisArg, _);
62
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
63
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
64
+ }
65
+ };
66
+ Object.defineProperty(exports, "__esModule", { value: true });
67
+ exports.ManageSubscriptionApi = void 0;
68
+ var runtime = require("../runtime");
69
+ var index_1 = require("../models/index");
70
+ /**
71
+ *
72
+ */
73
+ var ManageSubscriptionApi = /** @class */ (function (_super) {
74
+ __extends(ManageSubscriptionApi, _super);
75
+ function ManageSubscriptionApi() {
76
+ return _super !== null && _super.apply(this, arguments) || this;
77
+ }
78
+ /**
79
+ * Create subscription for a specific user. This operation is useful to change current plan of user. Note : - Upgrade user plan is immediate - Downgrade user plan wait termination of current subscription # Preconditions : - If plan \'price\' > 0, client \'mandate\' of id \'clientId\' should exists. - If user have offisante status \'NOT_SET\' : - User email is filled - User firstname is filled - User lastname is filled - User company SIRET is filled - User Company CIP is filled - User Company finess is filled - User Company management software is filled - User Company location type is filled - User Company group is filled # Limitations : - \'isTrial\' can only be true if no subscription on the user yet or executor is ADMINISTRATOR
80
+ * Subscribe to a plan
81
+ */
82
+ ManageSubscriptionApi.prototype.createSubscriptionRaw = function (requestParameters, initOverrides) {
83
+ return __awaiter(this, void 0, void 0, function () {
84
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_1;
85
+ return __generator(this, function (_c) {
86
+ switch (_c.label) {
87
+ case 0:
88
+ if (requestParameters['subscriptionCreationParameters'] == null) {
89
+ throw new runtime.RequiredError('subscriptionCreationParameters', 'Required parameter "subscriptionCreationParameters" was null or undefined when calling createSubscription().');
90
+ }
91
+ queryParameters = {};
92
+ headerParameters = {};
93
+ headerParameters['Content-Type'] = 'application/json';
94
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
95
+ _a = headerParameters;
96
+ _b = "x-api-key";
97
+ return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
98
+ case 1:
99
+ _a[_b] = _c.sent(); // apiKeyAuth authentication
100
+ _c.label = 2;
101
+ case 2:
102
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
103
+ token = this.configuration.accessToken;
104
+ return [4 /*yield*/, token("bearerAuth", [])];
105
+ case 3:
106
+ tokenString = _c.sent();
107
+ if (tokenString) {
108
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
109
+ }
110
+ _c.label = 4;
111
+ case 4:
112
+ _c.trys.push([4, 6, , 7]);
113
+ return [4 /*yield*/, this.request({
114
+ path: "/subscriptions",
115
+ method: 'POST',
116
+ headers: headerParameters,
117
+ query: queryParameters,
118
+ body: (0, index_1.SubscriptionCreationParametersToJSON)(requestParameters['subscriptionCreationParameters']),
119
+ }, initOverrides)];
120
+ case 5:
121
+ response = _c.sent();
122
+ contentType = response.headers.get("content-type");
123
+ if (contentType && contentType.indexOf("application/json") !== -1) {
124
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.SubscriptionFromJSON)(jsonValue); })];
125
+ }
126
+ else if (contentType && contentType.indexOf("text/plain") !== -1) {
127
+ return [2 /*return*/, new runtime.TextApiResponse(response)];
128
+ }
129
+ else {
130
+ // TODO : Better handling of others application types
131
+ return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
132
+ }
133
+ return [3 /*break*/, 7];
134
+ case 6:
135
+ response_1 = _c.sent();
136
+ console.debug(response_1);
137
+ throw response_1;
138
+ case 7: return [2 /*return*/];
139
+ }
140
+ });
141
+ });
142
+ };
143
+ /**
144
+ * Create subscription for a specific user. This operation is useful to change current plan of user. Note : - Upgrade user plan is immediate - Downgrade user plan wait termination of current subscription # Preconditions : - If plan \'price\' > 0, client \'mandate\' of id \'clientId\' should exists. - If user have offisante status \'NOT_SET\' : - User email is filled - User firstname is filled - User lastname is filled - User company SIRET is filled - User Company CIP is filled - User Company finess is filled - User Company management software is filled - User Company location type is filled - User Company group is filled # Limitations : - \'isTrial\' can only be true if no subscription on the user yet or executor is ADMINISTRATOR
145
+ * Subscribe to a plan
146
+ */
147
+ ManageSubscriptionApi.prototype.createSubscription = function (requestParameters, initOverrides) {
148
+ return __awaiter(this, void 0, void 0, function () {
149
+ var response;
150
+ return __generator(this, function (_a) {
151
+ switch (_a.label) {
152
+ case 0: return [4 /*yield*/, this.createSubscriptionRaw(requestParameters, initOverrides)];
153
+ case 1:
154
+ response = _a.sent();
155
+ return [4 /*yield*/, response.value()];
156
+ case 2: return [2 /*return*/, _a.sent()];
157
+ }
158
+ });
159
+ });
160
+ };
161
+ /**
162
+ * Unsubscribe user from subscription
163
+ */
164
+ ManageSubscriptionApi.prototype.deleteSubscriptionRaw = function (requestParameters, initOverrides) {
165
+ return __awaiter(this, void 0, void 0, function () {
166
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_2;
167
+ return __generator(this, function (_c) {
168
+ switch (_c.label) {
169
+ case 0:
170
+ if (requestParameters['subscriptionId'] == null) {
171
+ throw new runtime.RequiredError('subscriptionId', 'Required parameter "subscriptionId" was null or undefined when calling deleteSubscription().');
172
+ }
173
+ queryParameters = {};
174
+ headerParameters = {};
175
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
176
+ _a = headerParameters;
177
+ _b = "x-api-key";
178
+ return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
179
+ case 1:
180
+ _a[_b] = _c.sent(); // apiKeyAuth authentication
181
+ _c.label = 2;
182
+ case 2:
183
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
184
+ token = this.configuration.accessToken;
185
+ return [4 /*yield*/, token("bearerAuth", [])];
186
+ case 3:
187
+ tokenString = _c.sent();
188
+ if (tokenString) {
189
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
190
+ }
191
+ _c.label = 4;
192
+ case 4:
193
+ _c.trys.push([4, 6, , 7]);
194
+ return [4 /*yield*/, this.request({
195
+ path: "/subscriptions/{subscriptionId}".replace("{".concat("subscriptionId", "}"), encodeURIComponent(String(requestParameters['subscriptionId']))),
196
+ method: 'DELETE',
197
+ headers: headerParameters,
198
+ query: queryParameters,
199
+ }, initOverrides)];
200
+ case 5:
201
+ response = _c.sent();
202
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
203
+ case 6:
204
+ response_2 = _c.sent();
205
+ console.debug(response_2);
206
+ throw response_2;
207
+ case 7: return [2 /*return*/];
208
+ }
209
+ });
210
+ });
211
+ };
212
+ /**
213
+ * Unsubscribe user from subscription
214
+ */
215
+ ManageSubscriptionApi.prototype.deleteSubscription = function (requestParameters, initOverrides) {
216
+ return __awaiter(this, void 0, void 0, function () {
217
+ return __generator(this, function (_a) {
218
+ switch (_a.label) {
219
+ case 0: return [4 /*yield*/, this.deleteSubscriptionRaw(requestParameters, initOverrides)];
220
+ case 1:
221
+ _a.sent();
222
+ return [2 /*return*/];
223
+ }
224
+ });
225
+ });
226
+ };
227
+ /**
228
+ * # Preconditions : - You are the subscriber or ADMINISTRATOR - \'nextBillingDate\' > \'validFrom\' - \'nextBillingDate\' <= \'validTo\' - \'validTo\' > \'validFrom\' # Limitations (Subscriber) : - Can only update current subscription - Can only update \'validTo\' or set \'isTrial\' false # How to \"Extend trial period\" : - Delete next subscription - Update current subscription : - billingPrice = 0 - validTo = Any date to set trial end date - isTrial = true # How to \"Unsubscribe immediately\" : (Warning : No billing will occured) - Delete next subscription - Update current subscription : - validTo = TODAY - nextBillingDate = null - isTrial = false # How to \"Unsubscribe at subscription end\" : - Delete next subscription - Update current subscription : - validTo = subscription.validTo || subscription.nextBillingDate || TODAY - isTrial = false
229
+ * Update user subscription
230
+ */
231
+ ManageSubscriptionApi.prototype.updateSubscriptionRaw = function (requestParameters, initOverrides) {
232
+ return __awaiter(this, void 0, void 0, function () {
233
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_3;
234
+ return __generator(this, function (_c) {
235
+ switch (_c.label) {
236
+ case 0:
237
+ if (requestParameters['subscriptionId'] == null) {
238
+ throw new runtime.RequiredError('subscriptionId', 'Required parameter "subscriptionId" was null or undefined when calling updateSubscription().');
239
+ }
240
+ if (requestParameters['subscriptionUpdateParameters'] == null) {
241
+ throw new runtime.RequiredError('subscriptionUpdateParameters', 'Required parameter "subscriptionUpdateParameters" was null or undefined when calling updateSubscription().');
242
+ }
243
+ queryParameters = {};
244
+ headerParameters = {};
245
+ headerParameters['Content-Type'] = 'application/merge-patch+json';
246
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
247
+ _a = headerParameters;
248
+ _b = "x-api-key";
249
+ return [4 /*yield*/, this.configuration.apiKey("x-api-key")];
250
+ case 1:
251
+ _a[_b] = _c.sent(); // apiKeyAuth authentication
252
+ _c.label = 2;
253
+ case 2:
254
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
255
+ token = this.configuration.accessToken;
256
+ return [4 /*yield*/, token("bearerAuth", [])];
257
+ case 3:
258
+ tokenString = _c.sent();
259
+ if (tokenString) {
260
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
261
+ }
262
+ _c.label = 4;
263
+ case 4:
264
+ _c.trys.push([4, 6, , 7]);
265
+ return [4 /*yield*/, this.request({
266
+ path: "/subscriptions/{subscriptionId}".replace("{".concat("subscriptionId", "}"), encodeURIComponent(String(requestParameters['subscriptionId']))),
267
+ method: 'PATCH',
268
+ headers: headerParameters,
269
+ query: queryParameters,
270
+ body: (0, index_1.SubscriptionUpdateParametersToJSON)(requestParameters['subscriptionUpdateParameters']),
271
+ }, initOverrides)];
272
+ case 5:
273
+ response = _c.sent();
274
+ contentType = response.headers.get("content-type");
275
+ if (contentType && contentType.indexOf("application/json") !== -1) {
276
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.SubscriptionFromJSON)(jsonValue); })];
277
+ }
278
+ else if (contentType && contentType.indexOf("text/plain") !== -1) {
279
+ return [2 /*return*/, new runtime.TextApiResponse(response)];
280
+ }
281
+ else {
282
+ // TODO : Better handling of others application types
283
+ return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
284
+ }
285
+ return [3 /*break*/, 7];
286
+ case 6:
287
+ response_3 = _c.sent();
288
+ console.debug(response_3);
289
+ throw response_3;
290
+ case 7: return [2 /*return*/];
291
+ }
292
+ });
293
+ });
294
+ };
295
+ /**
296
+ * # Preconditions : - You are the subscriber or ADMINISTRATOR - \'nextBillingDate\' > \'validFrom\' - \'nextBillingDate\' <= \'validTo\' - \'validTo\' > \'validFrom\' # Limitations (Subscriber) : - Can only update current subscription - Can only update \'validTo\' or set \'isTrial\' false # How to \"Extend trial period\" : - Delete next subscription - Update current subscription : - billingPrice = 0 - validTo = Any date to set trial end date - isTrial = true # How to \"Unsubscribe immediately\" : (Warning : No billing will occured) - Delete next subscription - Update current subscription : - validTo = TODAY - nextBillingDate = null - isTrial = false # How to \"Unsubscribe at subscription end\" : - Delete next subscription - Update current subscription : - validTo = subscription.validTo || subscription.nextBillingDate || TODAY - isTrial = false
297
+ * Update user subscription
298
+ */
299
+ ManageSubscriptionApi.prototype.updateSubscription = function (requestParameters, initOverrides) {
300
+ return __awaiter(this, void 0, void 0, function () {
301
+ var response;
302
+ return __generator(this, function (_a) {
303
+ switch (_a.label) {
304
+ case 0: return [4 /*yield*/, this.updateSubscriptionRaw(requestParameters, initOverrides)];
305
+ case 1:
306
+ response = _a.sent();
307
+ return [4 /*yield*/, response.value()];
308
+ case 2: return [2 /*return*/, _a.sent()];
309
+ }
310
+ });
311
+ });
312
+ };
313
+ return ManageSubscriptionApi;
314
+ }(runtime.BaseAPI));
315
+ exports.ManageSubscriptionApi = ManageSubscriptionApi;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * lcdp-monolith-service
3
+ * This is the REST API of LCDP products
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: contact@lecomptoirdespharmacies.fr
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { SubscriptionPlan, SubscriptionPlanId, SubscriptionPlanUpdateParameters } from '../models/index';
14
+ export interface UpdateSubscriptionPlanRequest {
15
+ subscriptionPlanId: SubscriptionPlanId;
16
+ subscriptionPlanUpdateParameters: SubscriptionPlanUpdateParameters;
17
+ }
18
+ /**
19
+ *
20
+ */
21
+ export declare class ManageSubscriptionPlanApi extends runtime.BaseAPI {
22
+ /**
23
+ * Update subscription plan
24
+ */
25
+ updateSubscriptionPlanRaw(requestParameters: UpdateSubscriptionPlanRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SubscriptionPlan | runtime.BlobWithMeta>>;
26
+ /**
27
+ * Update subscription plan
28
+ */
29
+ updateSubscriptionPlan(requestParameters: UpdateSubscriptionPlanRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SubscriptionPlan | runtime.BlobWithMeta>;
30
+ }
@@ -3,7 +3,7 @@
3
3
  /* eslint-disable */
4
4
  /**
5
5
  * lcdp-monolith-service
6
- * This is the REST API of RFx (Request For X)
6
+ * This is the REST API of LCDP products
7
7
  *
8
8
  * The version of the OpenAPI document: 1.0.0
9
9
  * Contact: contact@lecomptoirdespharmacies.fr
@@ -64,29 +64,35 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
64
64
  }
65
65
  };
66
66
  Object.defineProperty(exports, "__esModule", { value: true });
67
- exports.ManageRffApi = void 0;
67
+ exports.ManageSubscriptionPlanApi = void 0;
68
68
  var runtime = require("../runtime");
69
69
  var index_1 = require("../models/index");
70
70
  /**
71
71
  *
72
72
  */
73
- var ManageRffApi = /** @class */ (function (_super) {
74
- __extends(ManageRffApi, _super);
75
- function ManageRffApi() {
73
+ var ManageSubscriptionPlanApi = /** @class */ (function (_super) {
74
+ __extends(ManageSubscriptionPlanApi, _super);
75
+ function ManageSubscriptionPlanApi() {
76
76
  return _super !== null && _super.apply(this, arguments) || this;
77
77
  }
78
78
  /**
79
- * Create request for feature
79
+ * Update subscription plan
80
80
  */
81
- ManageRffApi.prototype.createRffRaw = function (requestParameters, initOverrides) {
81
+ ManageSubscriptionPlanApi.prototype.updateSubscriptionPlanRaw = function (requestParameters, initOverrides) {
82
82
  return __awaiter(this, void 0, void 0, function () {
83
- var queryParameters, headerParameters, _a, _b, token, tokenString, response, response_1;
83
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response, contentType, response_1;
84
84
  return __generator(this, function (_c) {
85
85
  switch (_c.label) {
86
86
  case 0:
87
+ if (requestParameters['subscriptionPlanId'] == null) {
88
+ throw new runtime.RequiredError('subscriptionPlanId', 'Required parameter "subscriptionPlanId" was null or undefined when calling updateSubscriptionPlan().');
89
+ }
90
+ if (requestParameters['subscriptionPlanUpdateParameters'] == null) {
91
+ throw new runtime.RequiredError('subscriptionPlanUpdateParameters', 'Required parameter "subscriptionPlanUpdateParameters" was null or undefined when calling updateSubscriptionPlan().');
92
+ }
87
93
  queryParameters = {};
88
94
  headerParameters = {};
89
- headerParameters['Content-Type'] = 'application/json';
95
+ headerParameters['Content-Type'] = 'application/merge-patch+json';
90
96
  if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
91
97
  _a = headerParameters;
92
98
  _b = "x-api-key";
@@ -107,15 +113,26 @@ var ManageRffApi = /** @class */ (function (_super) {
107
113
  case 4:
108
114
  _c.trys.push([4, 6, , 7]);
109
115
  return [4 /*yield*/, this.request({
110
- path: "/rffs",
111
- method: 'POST',
116
+ path: "/subscriptions/plans/{subscriptionPlanId}".replace("{".concat("subscriptionPlanId", "}"), encodeURIComponent(String(requestParameters['subscriptionPlanId']))),
117
+ method: 'PATCH',
112
118
  headers: headerParameters,
113
119
  query: queryParameters,
114
- body: (0, index_1.RffCreationParametersToJSON)(requestParameters['rffCreationParameters']),
120
+ body: (0, index_1.SubscriptionPlanUpdateParametersToJSON)(requestParameters['subscriptionPlanUpdateParameters']),
115
121
  }, initOverrides)];
116
122
  case 5:
117
123
  response = _c.sent();
118
- return [2 /*return*/, new runtime.VoidApiResponse(response)];
124
+ contentType = response.headers.get("content-type");
125
+ if (contentType && contentType.indexOf("application/json") !== -1) {
126
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.SubscriptionPlanFromJSON)(jsonValue); })];
127
+ }
128
+ else if (contentType && contentType.indexOf("text/plain") !== -1) {
129
+ return [2 /*return*/, new runtime.TextApiResponse(response)];
130
+ }
131
+ else {
132
+ // TODO : Better handling of others application types
133
+ return [2 /*return*/, new runtime.BlobWithMetaApiResponse(response)];
134
+ }
135
+ return [3 /*break*/, 7];
119
136
  case 6:
120
137
  response_1 = _c.sent();
121
138
  console.debug(response_1);
@@ -126,21 +143,22 @@ var ManageRffApi = /** @class */ (function (_super) {
126
143
  });
127
144
  };
128
145
  /**
129
- * Create request for feature
146
+ * Update subscription plan
130
147
  */
131
- ManageRffApi.prototype.createRff = function (requestParameters, initOverrides) {
132
- if (requestParameters === void 0) { requestParameters = {}; }
148
+ ManageSubscriptionPlanApi.prototype.updateSubscriptionPlan = function (requestParameters, initOverrides) {
133
149
  return __awaiter(this, void 0, void 0, function () {
150
+ var response;
134
151
  return __generator(this, function (_a) {
135
152
  switch (_a.label) {
136
- case 0: return [4 /*yield*/, this.createRffRaw(requestParameters, initOverrides)];
153
+ case 0: return [4 /*yield*/, this.updateSubscriptionPlanRaw(requestParameters, initOverrides)];
137
154
  case 1:
138
- _a.sent();
139
- return [2 /*return*/];
155
+ response = _a.sent();
156
+ return [4 /*yield*/, response.value()];
157
+ case 2: return [2 /*return*/, _a.sent()];
140
158
  }
141
159
  });
142
160
  });
143
161
  };
144
- return ManageRffApi;
162
+ return ManageSubscriptionPlanApi;
145
163
  }(runtime.BaseAPI));
146
- exports.ManageRffApi = ManageRffApi;
164
+ exports.ManageSubscriptionPlanApi = ManageSubscriptionPlanApi;