@lcdp/api-react-rest-client 2.14.3 → 2.14.4
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.
- package/chargebee-hook/index.d.ts +1 -0
- package/chargebee-hook/index.js +17 -0
- package/chargebee-hook/src/apis/ChargebeeHookApi.d.ts +31 -0
- package/chargebee-hook/src/apis/ChargebeeHookApi.js +134 -0
- package/chargebee-hook/src/apis/index.d.ts +1 -0
- package/chargebee-hook/src/apis/index.js +19 -0
- package/chargebee-hook/src/index.d.ts +3 -0
- package/chargebee-hook/src/index.js +21 -0
- package/chargebee-hook/src/models/HookRequest.d.ts +85 -0
- package/chargebee-hook/src/models/HookRequest.js +67 -0
- package/{subscription → chargebee-hook}/src/models/RestError.d.ts +1 -1
- package/{subscription → chargebee-hook}/src/models/RestError.js +1 -1
- package/chargebee-hook/src/models/index.d.ts +2 -0
- package/chargebee-hook/src/models/index.js +20 -0
- package/chargebee-hook/src/runtime.d.ts +190 -0
- package/chargebee-hook/src/runtime.js +598 -0
- package/invoice/src/apis/SearchInvoiceApi.d.ts +2 -2
- package/invoice/src/apis/SearchInvoiceApi.js +2 -2
- package/invoice/src/models/InvoiceType.d.ts +0 -1
- package/invoice/src/models/InvoiceType.js +0 -1
- package/notification/src/models/NotificationTypeId.d.ts +1 -2
- package/notification/src/models/NotificationTypeId.js +1 -2
- package/package.json +1 -1
- package/rfx/src/apis/ManageRffApi.d.ts +29 -0
- package/{subscription/src/apis/ManageSubscriptionPlanApi.js → rfx/src/apis/ManageRffApi.js} +21 -39
- package/rfx/src/apis/index.d.ts +1 -0
- package/rfx/src/apis/index.js +1 -0
- package/rfx/src/models/RffCreationParameters.d.ts +37 -0
- package/rfx/src/models/RffCreationParameters.js +51 -0
- package/rfx/src/models/index.d.ts +1 -0
- package/rfx/src/models/index.js +1 -0
- package/subscription/src/apis/SearchSubscriptionsApi.d.ts +29 -0
- package/subscription/src/apis/{SearchSubscriptionPlanFeatureApi.js → SearchSubscriptionsApi.js} +19 -13
- package/subscription/src/apis/index.d.ts +1 -5
- package/subscription/src/apis/index.js +1 -5
- package/subscription/src/models/Subscription.d.ts +23 -18
- package/subscription/src/models/Subscription.js +29 -19
- package/subscription/src/models/SubscriptionStatus.d.ts +39 -0
- package/subscription/src/models/SubscriptionStatus.js +62 -0
- package/subscription/src/models/index.d.ts +1 -14
- package/subscription/src/models/index.js +1 -14
- package/third-party/src/models/ThirdPartyLinkCreationParameters.d.ts +5 -2
- package/third-party/src/models/ThirdPartyLinkCreationParameters.js +5 -2
- package/user/src/models/NotificationTypeId.d.ts +1 -2
- package/user/src/models/NotificationTypeId.js +1 -2
- package/user/src/models/OffisanteStatus.d.ts +3 -1
- package/user/src/models/OffisanteStatus.js +4 -2
- package/user/src/models/User.d.ts +8 -0
- package/user/src/models/User.js +2 -0
- package/subscription/src/apis/ManageSubscriptionApi.d.ts +0 -56
- package/subscription/src/apis/ManageSubscriptionApi.js +0 -315
- package/subscription/src/apis/ManageSubscriptionPlanApi.d.ts +0 -30
- package/subscription/src/apis/SearchSubscriptionApi.d.ts +0 -53
- package/subscription/src/apis/SearchSubscriptionApi.js +0 -208
- package/subscription/src/apis/SearchSubscriptionPlanApi.d.ts +0 -49
- package/subscription/src/apis/SearchSubscriptionPlanApi.js +0 -249
- package/subscription/src/apis/SearchSubscriptionPlanFeatureApi.d.ts +0 -26
- package/subscription/src/models/HttpLink.d.ts +0 -31
- package/subscription/src/models/HttpLink.js +0 -47
- package/subscription/src/models/PaginatedObject.d.ts +0 -32
- package/subscription/src/models/PaginatedObject.js +0 -48
- package/subscription/src/models/PaginatedSubscriptions.d.ts +0 -39
- package/subscription/src/models/PaginatedSubscriptions.js +0 -51
- package/subscription/src/models/PagingMetadata.d.ts +0 -49
- package/subscription/src/models/PagingMetadata.js +0 -55
- package/subscription/src/models/SubscriberLink.d.ts +0 -37
- package/subscription/src/models/SubscriberLink.js +0 -49
- package/subscription/src/models/SubscriptionCreationParameters.d.ts +0 -44
- package/subscription/src/models/SubscriptionCreationParameters.js +0 -56
- package/subscription/src/models/SubscriptionPlan.d.ts +0 -69
- package/subscription/src/models/SubscriptionPlan.js +0 -59
- package/subscription/src/models/SubscriptionPlanFeature.d.ts +0 -44
- package/subscription/src/models/SubscriptionPlanFeature.js +0 -50
- package/subscription/src/models/SubscriptionPlanFeatureId.d.ts +0 -26
- package/subscription/src/models/SubscriptionPlanFeatureId.js +0 -49
- package/subscription/src/models/SubscriptionPlanId.d.ts +0 -25
- package/subscription/src/models/SubscriptionPlanId.js +0 -48
- package/subscription/src/models/SubscriptionPlanLink.d.ts +0 -38
- package/subscription/src/models/SubscriptionPlanLink.js +0 -50
- package/subscription/src/models/SubscriptionPlanUpdateParameters.d.ts +0 -62
- package/subscription/src/models/SubscriptionPlanUpdateParameters.js +0 -56
- package/subscription/src/models/SubscriptionUpdateParameters.d.ts +0 -62
- package/subscription/src/models/SubscriptionUpdateParameters.js +0 -57
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.SubscriptionStatusToJSON = exports.SubscriptionStatusFromJSONTyped = exports.SubscriptionStatusFromJSON = exports.instanceOfSubscriptionStatus = exports.SubscriptionStatus = void 0;
|
|
17
|
+
/**
|
|
18
|
+
* Status of the subscription
|
|
19
|
+
* - FUTURE: The subscription is scheduled to start at a future date.
|
|
20
|
+
* - IN_TRIAL: The subscription is in trial.
|
|
21
|
+
* - ACTIVE: The subscription is active and will be charged for automatically based on the items in it.
|
|
22
|
+
* - NON_RENEWING: The subscription will be canceled at the end of the current term.
|
|
23
|
+
* - PAUSED: The subscription is paused. The subscription will not renew while in this state.
|
|
24
|
+
* - CANCELLED: The subscription has been canceled and is no longer in service.
|
|
25
|
+
* - TRANSFERRED: The subscription has been transferred to another business entity within the organization.
|
|
26
|
+
* - _UNKNOWN: Indicates unexpected value for this enum.
|
|
27
|
+
*
|
|
28
|
+
* @export
|
|
29
|
+
*/
|
|
30
|
+
exports.SubscriptionStatus = {
|
|
31
|
+
FUTURE: 'FUTURE',
|
|
32
|
+
IN_TRIAL: 'IN_TRIAL',
|
|
33
|
+
ACTIVE: 'ACTIVE',
|
|
34
|
+
NON_RENEWING: 'NON_RENEWING',
|
|
35
|
+
PAUSED: 'PAUSED',
|
|
36
|
+
CANCELLED: 'CANCELLED',
|
|
37
|
+
TRANSFERRED: 'TRANSFERRED',
|
|
38
|
+
UNKNOWN: '_UNKNOWN'
|
|
39
|
+
};
|
|
40
|
+
function instanceOfSubscriptionStatus(value) {
|
|
41
|
+
for (var key in exports.SubscriptionStatus) {
|
|
42
|
+
if (Object.prototype.hasOwnProperty.call(exports.SubscriptionStatus, key)) {
|
|
43
|
+
if (exports.SubscriptionStatus[key] === value) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
exports.instanceOfSubscriptionStatus = instanceOfSubscriptionStatus;
|
|
51
|
+
function SubscriptionStatusFromJSON(json) {
|
|
52
|
+
return SubscriptionStatusFromJSONTyped(json, false);
|
|
53
|
+
}
|
|
54
|
+
exports.SubscriptionStatusFromJSON = SubscriptionStatusFromJSON;
|
|
55
|
+
function SubscriptionStatusFromJSONTyped(json, ignoreDiscriminator) {
|
|
56
|
+
return json;
|
|
57
|
+
}
|
|
58
|
+
exports.SubscriptionStatusFromJSONTyped = SubscriptionStatusFromJSONTyped;
|
|
59
|
+
function SubscriptionStatusToJSON(value) {
|
|
60
|
+
return value;
|
|
61
|
+
}
|
|
62
|
+
exports.SubscriptionStatusToJSON = SubscriptionStatusToJSON;
|
|
@@ -1,15 +1,2 @@
|
|
|
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 './
|
|
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';
|
|
2
|
+
export * from './SubscriptionStatus';
|
|
@@ -16,18 +16,5 @@ 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("./
|
|
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);
|
|
20
|
+
__exportStar(require("./SubscriptionStatus"), exports);
|
|
@@ -32,8 +32,11 @@ export interface ThirdPartyLinkCreationParameters {
|
|
|
32
32
|
* @export
|
|
33
33
|
*/
|
|
34
34
|
export declare const ThirdPartyLinkCreationParametersSlugEnum: {
|
|
35
|
-
readonly
|
|
36
|
-
readonly
|
|
35
|
+
readonly BADGES_PHARMACY_STATISTICS_DASHBOARD: "BADGES_PHARMACY_STATISTICS_DASHBOARD";
|
|
36
|
+
readonly BADGES_LABORATORY_STATISTICS_DASHBOARD: "BADGES_LABORATORY_STATISTICS_DASHBOARD";
|
|
37
|
+
readonly SUBSCRIPTIONS_PHARMAIDE_USER_PRICING_PAGE: "SUBSCRIPTIONS_PHARMAIDE_USER_PRICING_PAGE";
|
|
38
|
+
readonly SUBSCRIPTIONS_LOGISTIC_USER_PRICING_PAGE: "SUBSCRIPTIONS_LOGISTIC_USER_PRICING_PAGE";
|
|
39
|
+
readonly SUBSCRIPTIONS_USER_PORTAL: "SUBSCRIPTIONS_USER_PORTAL";
|
|
37
40
|
};
|
|
38
41
|
export declare type ThirdPartyLinkCreationParametersSlugEnum = typeof ThirdPartyLinkCreationParametersSlugEnum[keyof typeof ThirdPartyLinkCreationParametersSlugEnum];
|
|
39
42
|
/**
|
|
@@ -18,8 +18,11 @@ exports.ThirdPartyLinkCreationParametersToJSON = exports.ThirdPartyLinkCreationP
|
|
|
18
18
|
* @export
|
|
19
19
|
*/
|
|
20
20
|
exports.ThirdPartyLinkCreationParametersSlugEnum = {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
BADGES_PHARMACY_STATISTICS_DASHBOARD: 'BADGES_PHARMACY_STATISTICS_DASHBOARD',
|
|
22
|
+
BADGES_LABORATORY_STATISTICS_DASHBOARD: 'BADGES_LABORATORY_STATISTICS_DASHBOARD',
|
|
23
|
+
SUBSCRIPTIONS_PHARMAIDE_USER_PRICING_PAGE: 'SUBSCRIPTIONS_PHARMAIDE_USER_PRICING_PAGE',
|
|
24
|
+
SUBSCRIPTIONS_LOGISTIC_USER_PRICING_PAGE: 'SUBSCRIPTIONS_LOGISTIC_USER_PRICING_PAGE',
|
|
25
|
+
SUBSCRIPTIONS_USER_PORTAL: 'SUBSCRIPTIONS_USER_PORTAL'
|
|
23
26
|
};
|
|
24
27
|
/**
|
|
25
28
|
* Check if a given object implements the ThirdPartyLinkCreationParameters interface.
|
|
@@ -54,8 +54,7 @@ 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
|
|
58
|
-
readonly PHARMAIDE_SB_TEST_EXPIRATION: "PHARMAIDE_SB_TEST_EXPIRATION";
|
|
57
|
+
readonly OFFISANTE_SIGN_REQUEST: "OFFISANTE_SIGN_REQUEST";
|
|
59
58
|
readonly REQUEST_FOR_ORDER_INVOICE: "REQUEST_FOR_ORDER_INVOICE";
|
|
60
59
|
readonly CLIENT_BADGE_RECEIVED: "CLIENT_BADGE_RECEIVED";
|
|
61
60
|
readonly CLIENT_BADGE_LOST: "CLIENT_BADGE_LOST";
|
|
@@ -59,8 +59,7 @@ 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
|
-
|
|
63
|
-
PHARMAIDE_SB_TEST_EXPIRATION: 'PHARMAIDE_SB_TEST_EXPIRATION',
|
|
62
|
+
OFFISANTE_SIGN_REQUEST: 'OFFISANTE_SIGN_REQUEST',
|
|
64
63
|
REQUEST_FOR_ORDER_INVOICE: 'REQUEST_FOR_ORDER_INVOICE',
|
|
65
64
|
CLIENT_BADGE_RECEIVED: 'CLIENT_BADGE_RECEIVED',
|
|
66
65
|
CLIENT_BADGE_LOST: 'CLIENT_BADGE_LOST',
|
|
@@ -11,9 +11,10 @@
|
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
13
13
|
* Status of company in our system against Offisante system.
|
|
14
|
-
* SET : Offisante know this resource
|
|
14
|
+
* SET : Offisante know this resource but not yet its stock
|
|
15
15
|
* NOT_SET : Offisante do not know this resource
|
|
16
16
|
* IN_PROGRESS : Offisante is going to know this resource in the future
|
|
17
|
+
* ACTIVE : Offisante know this resource and its stock
|
|
17
18
|
*
|
|
18
19
|
* @export
|
|
19
20
|
*/
|
|
@@ -21,6 +22,7 @@ export declare const OffisanteStatus: {
|
|
|
21
22
|
readonly SET: "SET";
|
|
22
23
|
readonly NOT_SET: "NOT_SET";
|
|
23
24
|
readonly IN_PROGRESS: "IN_PROGRESS";
|
|
25
|
+
readonly ACTIVE: "ACTIVE";
|
|
24
26
|
};
|
|
25
27
|
export declare type OffisanteStatus = typeof OffisanteStatus[keyof typeof OffisanteStatus];
|
|
26
28
|
export declare function instanceOfOffisanteStatus(value: any): boolean;
|
|
@@ -16,16 +16,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
16
|
exports.OffisanteStatusToJSON = exports.OffisanteStatusFromJSONTyped = exports.OffisanteStatusFromJSON = exports.instanceOfOffisanteStatus = exports.OffisanteStatus = void 0;
|
|
17
17
|
/**
|
|
18
18
|
* Status of company in our system against Offisante system.
|
|
19
|
-
* SET : Offisante know this resource
|
|
19
|
+
* SET : Offisante know this resource but not yet its stock
|
|
20
20
|
* NOT_SET : Offisante do not know this resource
|
|
21
21
|
* IN_PROGRESS : Offisante is going to know this resource in the future
|
|
22
|
+
* ACTIVE : Offisante know this resource and its stock
|
|
22
23
|
*
|
|
23
24
|
* @export
|
|
24
25
|
*/
|
|
25
26
|
exports.OffisanteStatus = {
|
|
26
27
|
SET: 'SET',
|
|
27
28
|
NOT_SET: 'NOT_SET',
|
|
28
|
-
IN_PROGRESS: 'IN_PROGRESS'
|
|
29
|
+
IN_PROGRESS: 'IN_PROGRESS',
|
|
30
|
+
ACTIVE: 'ACTIVE'
|
|
29
31
|
};
|
|
30
32
|
function instanceOfOffisanteStatus(value) {
|
|
31
33
|
for (var key in exports.OffisanteStatus) {
|
|
@@ -57,6 +57,14 @@ export interface User {
|
|
|
57
57
|
* @memberof User
|
|
58
58
|
*/
|
|
59
59
|
role: UserRole;
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @type {{ [key: string]: string; }}
|
|
63
|
+
* @memberof User
|
|
64
|
+
*/
|
|
65
|
+
capabilities?: {
|
|
66
|
+
[key: string]: string;
|
|
67
|
+
};
|
|
60
68
|
/**
|
|
61
69
|
* True if the user have unpaid invoice
|
|
62
70
|
* @type {boolean}
|
package/user/src/models/User.js
CHANGED
|
@@ -69,6 +69,7 @@ function UserFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
69
69
|
'mangopayTarget': (json['mangopayTarget'] === null || json['mangopayTarget'] === undefined) ? json['mangopayTarget'] : (0, UserMangopayTarget_1.UserMangopayTargetFromJSON)(json['mangopayTarget']),
|
|
70
70
|
'chargebeeTarget': (json['chargebeeTarget'] === null || json['chargebeeTarget'] === undefined) ? json['chargebeeTarget'] : (0, UserChargebeeTarget_1.UserChargebeeTargetFromJSON)(json['chargebeeTarget']),
|
|
71
71
|
'role': (json['role'] === null || json['role'] === undefined) ? json['role'] : (0, UserRole_1.UserRoleFromJSON)(json['role']),
|
|
72
|
+
'capabilities': json['capabilities'],
|
|
72
73
|
'haveUnpaid': json['haveUnpaid'],
|
|
73
74
|
'holidayModeEnabled': json['holidayModeEnabled'],
|
|
74
75
|
'nickname': json['nickname'],
|
|
@@ -127,6 +128,7 @@ function UserToJSON(value) {
|
|
|
127
128
|
'mangopayTarget': (0, UserMangopayTarget_1.UserMangopayTargetToJSON)(value['mangopayTarget']),
|
|
128
129
|
'chargebeeTarget': (0, UserChargebeeTarget_1.UserChargebeeTargetToJSON)(value['chargebeeTarget']),
|
|
129
130
|
'role': (0, UserRole_1.UserRoleToJSON)(value['role']),
|
|
131
|
+
'capabilities': value['capabilities'],
|
|
130
132
|
'haveUnpaid': value['haveUnpaid'],
|
|
131
133
|
'holidayModeEnabled': value['holidayModeEnabled'],
|
|
132
134
|
'nickname': value['nickname'],
|
|
@@ -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
|
-
}
|
|
@@ -1,315 +0,0 @@
|
|
|
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;
|
|
@@ -1,30 +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 { 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
|
-
}
|