@lcdp/api-react-rest-client 2.14.3-LDS-4747-chargebee.18197926017 → 2.14.3-LDS-4747-chargebee.18225761899

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 (46) hide show
  1. package/package.json +1 -1
  2. package/subscription/src/apis/SearchSubscriptionsApi.d.ts +29 -0
  3. package/subscription/src/apis/{SearchSubscriptionPlanFeatureApi.js → SearchSubscriptionsApi.js} +19 -13
  4. package/subscription/src/apis/index.d.ts +1 -5
  5. package/subscription/src/apis/index.js +1 -5
  6. package/subscription/src/models/Subscription.d.ts +6 -38
  7. package/subscription/src/models/Subscription.js +6 -19
  8. package/subscription/src/models/index.d.ts +0 -14
  9. package/subscription/src/models/index.js +0 -14
  10. package/subscription/src/apis/ManageSubscriptionApi.d.ts +0 -56
  11. package/subscription/src/apis/ManageSubscriptionApi.js +0 -315
  12. package/subscription/src/apis/ManageSubscriptionPlanApi.d.ts +0 -30
  13. package/subscription/src/apis/ManageSubscriptionPlanApi.js +0 -164
  14. package/subscription/src/apis/SearchSubscriptionApi.d.ts +0 -53
  15. package/subscription/src/apis/SearchSubscriptionApi.js +0 -208
  16. package/subscription/src/apis/SearchSubscriptionPlanApi.d.ts +0 -49
  17. package/subscription/src/apis/SearchSubscriptionPlanApi.js +0 -249
  18. package/subscription/src/apis/SearchSubscriptionPlanFeatureApi.d.ts +0 -26
  19. package/subscription/src/models/HttpLink.d.ts +0 -31
  20. package/subscription/src/models/HttpLink.js +0 -47
  21. package/subscription/src/models/PaginatedObject.d.ts +0 -32
  22. package/subscription/src/models/PaginatedObject.js +0 -48
  23. package/subscription/src/models/PaginatedSubscriptions.d.ts +0 -39
  24. package/subscription/src/models/PaginatedSubscriptions.js +0 -51
  25. package/subscription/src/models/PagingMetadata.d.ts +0 -49
  26. package/subscription/src/models/PagingMetadata.js +0 -55
  27. package/subscription/src/models/RestError.d.ts +0 -103
  28. package/subscription/src/models/RestError.js +0 -113
  29. package/subscription/src/models/SubscriberLink.d.ts +0 -37
  30. package/subscription/src/models/SubscriberLink.js +0 -49
  31. package/subscription/src/models/SubscriptionCreationParameters.d.ts +0 -44
  32. package/subscription/src/models/SubscriptionCreationParameters.js +0 -56
  33. package/subscription/src/models/SubscriptionPlan.d.ts +0 -69
  34. package/subscription/src/models/SubscriptionPlan.js +0 -59
  35. package/subscription/src/models/SubscriptionPlanFeature.d.ts +0 -44
  36. package/subscription/src/models/SubscriptionPlanFeature.js +0 -50
  37. package/subscription/src/models/SubscriptionPlanFeatureId.d.ts +0 -26
  38. package/subscription/src/models/SubscriptionPlanFeatureId.js +0 -49
  39. package/subscription/src/models/SubscriptionPlanId.d.ts +0 -25
  40. package/subscription/src/models/SubscriptionPlanId.js +0 -48
  41. package/subscription/src/models/SubscriptionPlanLink.d.ts +0 -38
  42. package/subscription/src/models/SubscriptionPlanLink.js +0 -50
  43. package/subscription/src/models/SubscriptionPlanUpdateParameters.d.ts +0 -62
  44. package/subscription/src/models/SubscriptionPlanUpdateParameters.js +0 -56
  45. package/subscription/src/models/SubscriptionUpdateParameters.d.ts +0 -62
  46. package/subscription/src/models/SubscriptionUpdateParameters.js +0 -57
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lcdp/api-react-rest-client",
3
- "version": "2.14.3-LDS-4747-chargebee.18197926017",
3
+ "version": "2.14.3-LDS-4747-chargebee.18225761899",
4
4
  "scripts": {
5
5
  "build": "tsc"
6
6
  },
@@ -0,0 +1,29 @@
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 } from '../models/index';
14
+ export interface GetSubscriptionsRequest {
15
+ ownerIdEq: number;
16
+ }
17
+ /**
18
+ *
19
+ */
20
+ export declare class SearchSubscriptionsApi extends runtime.BaseAPI {
21
+ /**
22
+ * Get subscriptions
23
+ */
24
+ getSubscriptionsRaw(requestParameters: GetSubscriptionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Subscription> | runtime.BlobWithMeta>>;
25
+ /**
26
+ * Get subscriptions
27
+ */
28
+ getSubscriptions(requestParameters: GetSubscriptionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Subscription> | runtime.BlobWithMeta>;
29
+ }
@@ -64,27 +64,33 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
64
64
  }
65
65
  };
66
66
  Object.defineProperty(exports, "__esModule", { value: true });
67
- exports.SearchSubscriptionPlanFeatureApi = void 0;
67
+ exports.SearchSubscriptionsApi = void 0;
68
68
  var runtime = require("../runtime");
69
69
  var index_1 = require("../models/index");
70
70
  /**
71
71
  *
72
72
  */
73
- var SearchSubscriptionPlanFeatureApi = /** @class */ (function (_super) {
74
- __extends(SearchSubscriptionPlanFeatureApi, _super);
75
- function SearchSubscriptionPlanFeatureApi() {
73
+ var SearchSubscriptionsApi = /** @class */ (function (_super) {
74
+ __extends(SearchSubscriptionsApi, _super);
75
+ function SearchSubscriptionsApi() {
76
76
  return _super !== null && _super.apply(this, arguments) || this;
77
77
  }
78
78
  /**
79
- * Get all subscription plan features
79
+ * Get subscriptions
80
80
  */
81
- SearchSubscriptionPlanFeatureApi.prototype.getSubscriptionPlanFeaturesRaw = function (initOverrides) {
81
+ SearchSubscriptionsApi.prototype.getSubscriptionsRaw = function (requestParameters, initOverrides) {
82
82
  return __awaiter(this, void 0, void 0, function () {
83
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['ownerIdEq'] == null) {
88
+ throw new runtime.RequiredError('ownerIdEq', 'Required parameter "ownerIdEq" was null or undefined when calling getSubscriptions().');
89
+ }
87
90
  queryParameters = {};
91
+ if (requestParameters['ownerIdEq'] != null) {
92
+ queryParameters['ownerId[eq]'] = requestParameters['ownerIdEq'];
93
+ }
88
94
  headerParameters = {};
89
95
  if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
90
96
  _a = headerParameters;
@@ -106,7 +112,7 @@ var SearchSubscriptionPlanFeatureApi = /** @class */ (function (_super) {
106
112
  case 4:
107
113
  _c.trys.push([4, 6, , 7]);
108
114
  return [4 /*yield*/, this.request({
109
- path: "/subscriptions/plans/features",
115
+ path: "/subscriptions",
110
116
  method: 'GET',
111
117
  headers: headerParameters,
112
118
  query: queryParameters,
@@ -115,7 +121,7 @@ var SearchSubscriptionPlanFeatureApi = /** @class */ (function (_super) {
115
121
  response = _c.sent();
116
122
  contentType = response.headers.get("content-type");
117
123
  if (contentType && contentType.indexOf("application/json") !== -1) {
118
- return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.SubscriptionPlanFeatureFromJSON); })];
124
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.SubscriptionFromJSON); })];
119
125
  }
120
126
  else if (contentType && contentType.indexOf("text/plain") !== -1) {
121
127
  return [2 /*return*/, new runtime.TextApiResponse(response)];
@@ -135,14 +141,14 @@ var SearchSubscriptionPlanFeatureApi = /** @class */ (function (_super) {
135
141
  });
136
142
  };
137
143
  /**
138
- * Get all subscription plan features
144
+ * Get subscriptions
139
145
  */
140
- SearchSubscriptionPlanFeatureApi.prototype.getSubscriptionPlanFeatures = function (initOverrides) {
146
+ SearchSubscriptionsApi.prototype.getSubscriptions = function (requestParameters, initOverrides) {
141
147
  return __awaiter(this, void 0, void 0, function () {
142
148
  var response;
143
149
  return __generator(this, function (_a) {
144
150
  switch (_a.label) {
145
- case 0: return [4 /*yield*/, this.getSubscriptionPlanFeaturesRaw(initOverrides)];
151
+ case 0: return [4 /*yield*/, this.getSubscriptionsRaw(requestParameters, initOverrides)];
146
152
  case 1:
147
153
  response = _a.sent();
148
154
  return [4 /*yield*/, response.value()];
@@ -151,6 +157,6 @@ var SearchSubscriptionPlanFeatureApi = /** @class */ (function (_super) {
151
157
  });
152
158
  });
153
159
  };
154
- return SearchSubscriptionPlanFeatureApi;
160
+ return SearchSubscriptionsApi;
155
161
  }(runtime.BaseAPI));
156
- exports.SearchSubscriptionPlanFeatureApi = SearchSubscriptionPlanFeatureApi;
162
+ exports.SearchSubscriptionsApi = SearchSubscriptionsApi;
@@ -1,5 +1 @@
1
- export * from './ManageSubscriptionApi';
2
- export * from './ManageSubscriptionPlanApi';
3
- export * from './SearchSubscriptionApi';
4
- export * from './SearchSubscriptionPlanApi';
5
- export * from './SearchSubscriptionPlanFeatureApi';
1
+ export * from './SearchSubscriptionsApi';
@@ -16,8 +16,4 @@ 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("./ManageSubscriptionApi"), exports);
20
- __exportStar(require("./ManageSubscriptionPlanApi"), exports);
21
- __exportStar(require("./SearchSubscriptionApi"), exports);
22
- __exportStar(require("./SearchSubscriptionPlanApi"), exports);
23
- __exportStar(require("./SearchSubscriptionPlanFeatureApi"), exports);
19
+ __exportStar(require("./SearchSubscriptionsApi"), exports);
@@ -9,8 +9,6 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { SubscriberLink } from './SubscriberLink';
13
- import type { SubscriptionPlanLink } from './SubscriptionPlanLink';
14
12
  /**
15
13
  *
16
14
  * @export
@@ -19,52 +17,22 @@ import type { SubscriptionPlanLink } from './SubscriptionPlanLink';
19
17
  export interface Subscription {
20
18
  /**
21
19
  *
22
- * @type {number}
20
+ * @type {string}
23
21
  * @memberof Subscription
24
22
  */
25
- id?: number;
23
+ family?: string;
26
24
  /**
27
25
  *
28
- * @type {SubscriberLink}
26
+ * @type {string}
29
27
  * @memberof Subscription
30
28
  */
31
- subscriber?: SubscriberLink;
29
+ name?: string;
32
30
  /**
33
31
  *
34
- * @type {SubscriptionPlanLink}
32
+ * @type {string}
35
33
  * @memberof Subscription
36
34
  */
37
- plan?: SubscriptionPlanLink;
38
- /**
39
- *
40
- * @type {number}
41
- * @memberof Subscription
42
- */
43
- billingPrice?: number;
44
- /**
45
- * Date since when the subscription is active. Ex : 12-02-2025 means that subscription is active from this date (INCLUDED)
46
- * @type {Date}
47
- * @memberof Subscription
48
- */
49
- validFrom?: Date;
50
- /**
51
- * Date until when the subscription is active. Ex : 12-02-2025 means that subscription is active until this date (EXCLUDED)
52
- * @type {Date}
53
- * @memberof Subscription
54
- */
55
- validTo?: Date | null;
56
- /**
57
- *
58
- * @type {Date}
59
- * @memberof Subscription
60
- */
61
- nextBillingDate?: Date | null;
62
- /**
63
- * True if this subscription is a trial, False if not
64
- * @type {boolean}
65
- * @memberof Subscription
66
- */
67
- isTrial?: boolean;
35
+ status?: string;
68
36
  }
69
37
  /**
70
38
  * Check if a given object implements the Subscription interface.
@@ -14,9 +14,6 @@
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.SubscriptionToJSON = exports.SubscriptionFromJSONTyped = exports.SubscriptionFromJSON = exports.instanceOfSubscription = void 0;
17
- var runtime_1 = require("../runtime");
18
- var SubscriberLink_1 = require("./SubscriberLink");
19
- var SubscriptionPlanLink_1 = require("./SubscriptionPlanLink");
20
17
  /**
21
18
  * Check if a given object implements the Subscription interface.
22
19
  */
@@ -33,14 +30,9 @@ function SubscriptionFromJSONTyped(json, ignoreDiscriminator) {
33
30
  return json;
34
31
  }
35
32
  return {
36
- 'id': json['id'],
37
- 'subscriber': (json['subscriber'] === null || json['subscriber'] === undefined) ? json['subscriber'] : (0, SubscriberLink_1.SubscriberLinkFromJSON)(json['subscriber']),
38
- 'plan': (json['plan'] === null || json['plan'] === undefined) ? json['plan'] : (0, SubscriptionPlanLink_1.SubscriptionPlanLinkFromJSON)(json['plan']),
39
- 'billingPrice': json['billingPrice'],
40
- 'validFrom': (json['validFrom'] === null || json['validFrom'] === undefined) ? json['validFrom'] : new Date(json['validFrom']),
41
- 'validTo': (json['validTo'] === null || json['validTo'] === undefined) ? json['validTo'] : new Date(json['validTo']),
42
- 'nextBillingDate': (json['nextBillingDate'] === null || json['nextBillingDate'] === undefined) ? json['nextBillingDate'] : new Date(json['nextBillingDate']),
43
- 'isTrial': json['isTrial'],
33
+ 'family': json['family'],
34
+ 'name': json['name'],
35
+ 'status': json['status'],
44
36
  };
45
37
  }
46
38
  exports.SubscriptionFromJSONTyped = SubscriptionFromJSONTyped;
@@ -49,14 +41,9 @@ function SubscriptionToJSON(value) {
49
41
  return value;
50
42
  }
51
43
  return {
52
- 'id': value['id'],
53
- 'subscriber': (0, SubscriberLink_1.SubscriberLinkToJSON)(value['subscriber']),
54
- 'plan': (0, SubscriptionPlanLink_1.SubscriptionPlanLinkToJSON)(value['plan']),
55
- 'billingPrice': value['billingPrice'],
56
- 'validFrom': (value['validFrom'] === null || value['validFrom'] === undefined) ? value['validFrom'] : (0, runtime_1.toDateISOString)(value['validFrom']),
57
- 'validTo': (value['validTo'] === null || value['validTo'] === undefined) ? value['validTo'] : (0, runtime_1.toDateISOString)(value['validTo']),
58
- 'nextBillingDate': (value['nextBillingDate'] === null || value['nextBillingDate'] === undefined) ? value['nextBillingDate'] : (0, runtime_1.toDateISOString)(value['nextBillingDate']),
59
- 'isTrial': value['isTrial'],
44
+ 'family': value['family'],
45
+ 'name': value['name'],
46
+ 'status': value['status'],
60
47
  };
61
48
  }
62
49
  exports.SubscriptionToJSON = SubscriptionToJSON;
@@ -1,15 +1 @@
1
- export * from './HttpLink';
2
- export * from './PaginatedObject';
3
- export * from './PaginatedSubscriptions';
4
- export * from './PagingMetadata';
5
- export * from './RestError';
6
- export * from './SubscriberLink';
7
1
  export * from './Subscription';
8
- export * from './SubscriptionCreationParameters';
9
- export * from './SubscriptionPlan';
10
- export * from './SubscriptionPlanFeature';
11
- export * from './SubscriptionPlanFeatureId';
12
- export * from './SubscriptionPlanId';
13
- export * from './SubscriptionPlanLink';
14
- export * from './SubscriptionPlanUpdateParameters';
15
- export * from './SubscriptionUpdateParameters';
@@ -16,18 +16,4 @@ 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("./HttpLink"), exports);
20
- __exportStar(require("./PaginatedObject"), exports);
21
- __exportStar(require("./PaginatedSubscriptions"), exports);
22
- __exportStar(require("./PagingMetadata"), exports);
23
- __exportStar(require("./RestError"), exports);
24
- __exportStar(require("./SubscriberLink"), exports);
25
19
  __exportStar(require("./Subscription"), exports);
26
- __exportStar(require("./SubscriptionCreationParameters"), exports);
27
- __exportStar(require("./SubscriptionPlan"), exports);
28
- __exportStar(require("./SubscriptionPlanFeature"), exports);
29
- __exportStar(require("./SubscriptionPlanFeatureId"), exports);
30
- __exportStar(require("./SubscriptionPlanId"), exports);
31
- __exportStar(require("./SubscriptionPlanLink"), exports);
32
- __exportStar(require("./SubscriptionPlanUpdateParameters"), exports);
33
- __exportStar(require("./SubscriptionUpdateParameters"), exports);
@@ -1,56 +0,0 @@
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
- }