@lcdp/api-react-rest-client 2.5.5-develop.6796395304 → 2.5.5

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 (208) hide show
  1. package/auth/src/apis/AuthApi.js +35 -51
  2. package/auth/src/apis/ManageApiKeyApi.js +53 -77
  3. package/auth/src/apis/SearchApiKeyApi.js +36 -52
  4. package/auth/src/runtime.d.ts +2 -2
  5. package/auth/src/runtime.js +1 -1
  6. package/banking-operation/src/apis/ManageLevyApi.js +36 -52
  7. package/banking-operation/src/apis/ManageOrderPaymentApi.js +36 -52
  8. package/banking-operation/src/apis/SearchLevyApi.js +36 -52
  9. package/banking-operation/src/apis/SearchOrderPaymentApi.js +18 -26
  10. package/banking-operation/src/runtime.d.ts +2 -2
  11. package/banking-operation/src/runtime.js +1 -1
  12. package/catalog/src/apis/ManageProductInsightApi.js +53 -77
  13. package/catalog/src/apis/SearchProductInsightApi.js +36 -52
  14. package/catalog/src/runtime.d.ts +2 -2
  15. package/catalog/src/runtime.js +1 -1
  16. package/challenge/src/apis/ManageChallengesApi.js +18 -26
  17. package/challenge/src/runtime.d.ts +2 -2
  18. package/challenge/src/runtime.js +1 -1
  19. package/configuration/src/apis/ManageVariableApi.js +17 -25
  20. package/configuration/src/apis/ManageVatApi.js +35 -51
  21. package/configuration/src/apis/SearchVatApi.js +36 -52
  22. package/configuration/src/runtime.d.ts +2 -2
  23. package/configuration/src/runtime.js +1 -1
  24. package/content/src/apis/ManageContentApi.js +18 -26
  25. package/content/src/runtime.d.ts +2 -2
  26. package/content/src/runtime.js +1 -1
  27. package/factory/src/apis/ManageAssemblyApi.js +35 -53
  28. package/factory/src/apis/ManageAssemblyOperationApi.js +18 -26
  29. package/factory/src/apis/SearchAssemblyApi.js +72 -104
  30. package/factory/src/apis/SearchAssemblyLineApi.js +36 -52
  31. package/factory/src/apis/SearchAssemblyOperationApi.js +36 -52
  32. package/factory/src/runtime.d.ts +2 -2
  33. package/factory/src/runtime.js +1 -1
  34. package/favorite/src/apis/ManageFavoriteProductApi.js +71 -103
  35. package/favorite/src/runtime.d.ts +2 -2
  36. package/favorite/src/runtime.js +1 -1
  37. package/geo/src/apis/SearchCountryApi.js +18 -26
  38. package/geo/src/runtime.d.ts +2 -2
  39. package/geo/src/runtime.js +1 -1
  40. package/inventory/src/apis/ManageInventoryApi.js +86 -126
  41. package/inventory/src/apis/SearchInventoryApi.js +180 -260
  42. package/inventory/src/runtime.d.ts +2 -2
  43. package/inventory/src/runtime.js +1 -1
  44. package/invoice/src/apis/ManageInvoiceApi.js +36 -52
  45. package/invoice/src/apis/ManageInvoiceLineApi.js +35 -51
  46. package/invoice/src/apis/ManageInvoicesSummaryApi.js +17 -25
  47. package/invoice/src/apis/SearchInvoiceApi.js +36 -52
  48. package/invoice/src/apis/SearchInvoiceLineApi.js +18 -26
  49. package/invoice/src/apis/SearchOrderTallyApi.js +36 -52
  50. package/invoice/src/runtime.d.ts +2 -2
  51. package/invoice/src/runtime.js +1 -1
  52. package/laboratory/src/apis/ManageLaboratoryApi.js +18 -26
  53. package/laboratory/src/apis/SearchLaboratoryApi.js +36 -52
  54. package/laboratory/src/runtime.d.ts +2 -2
  55. package/laboratory/src/runtime.js +1 -1
  56. package/laboratory-store/src/apis/ManageLaboratoryStoreApi.js +36 -52
  57. package/laboratory-store/src/apis/ManageLaboratoryStoreImageApi.js +70 -106
  58. package/laboratory-store/src/apis/SearchLaboratoryStoreApi.js +36 -52
  59. package/laboratory-store/src/runtime.d.ts +2 -2
  60. package/laboratory-store/src/runtime.js +1 -1
  61. package/laboratory-store-log/src/apis/SearchLaboratoryStoreLogApi.js +18 -26
  62. package/laboratory-store-log/src/runtime.d.ts +2 -2
  63. package/laboratory-store-log/src/runtime.js +1 -1
  64. package/lexicon/src/apis/ManageLexiconApi.d.ts +2 -2
  65. package/lexicon/src/apis/ManageLexiconApi.js +37 -53
  66. package/lexicon/src/apis/SearchLexiconApi.js +72 -104
  67. package/lexicon/src/runtime.d.ts +2 -2
  68. package/lexicon/src/runtime.js +1 -1
  69. package/litigation/src/apis/ManageLitigationApi.js +17 -25
  70. package/litigation/src/runtime.d.ts +2 -2
  71. package/litigation/src/runtime.js +1 -1
  72. package/magic-cart/src/apis/ManageExpressOrderApi.js +18 -26
  73. package/magic-cart/src/runtime.d.ts +2 -2
  74. package/magic-cart/src/runtime.js +1 -1
  75. package/mandate/src/apis/ManageMandatesApi.js +71 -103
  76. package/mandate/src/runtime.d.ts +2 -2
  77. package/mandate/src/runtime.js +1 -1
  78. package/mangopay-hook/src/runtime.d.ts +2 -2
  79. package/mangopay-hook/src/runtime.js +1 -1
  80. package/message/src/apis/ManageMessageApi.js +87 -127
  81. package/message/src/apis/SearchMessageApi.js +54 -78
  82. package/message/src/runtime.d.ts +2 -2
  83. package/message/src/runtime.js +1 -1
  84. package/notification/src/apis/ManageNotificationApi.js +35 -51
  85. package/notification/src/apis/ManageNotificationTypeApi.js +53 -79
  86. package/notification/src/apis/SearchNotificationApi.js +36 -52
  87. package/notification/src/apis/SearchNotificationTypeApi.js +54 -78
  88. package/notification/src/runtime.d.ts +2 -2
  89. package/notification/src/runtime.js +1 -1
  90. package/order/src/apis/ManageMetaOrderApi.js +35 -51
  91. package/order/src/apis/ManageOrderApi.d.ts +2 -2
  92. package/order/src/apis/ManageOrderApi.js +159 -231
  93. package/order/src/apis/ManageOrderItemApi.js +88 -128
  94. package/order/src/apis/SearchOrderApi.d.ts +0 -2
  95. package/order/src/apis/SearchOrderApi.js +72 -106
  96. package/order/src/apis/SearchOrderItemApi.js +90 -130
  97. package/order/src/models/Reservation.d.ts +0 -6
  98. package/order/src/models/Reservation.js +0 -2
  99. package/order/src/runtime.d.ts +2 -2
  100. package/order/src/runtime.js +1 -1
  101. package/order-log/src/apis/SearchOrderLogApi.js +18 -26
  102. package/order-log/src/runtime.d.ts +2 -2
  103. package/order-log/src/runtime.js +1 -1
  104. package/outrage-message/src/apis/ManageOutrageMessageApi.js +53 -77
  105. package/outrage-message/src/apis/SearchOutrageMessageApi.js +36 -52
  106. package/outrage-message/src/runtime.d.ts +2 -2
  107. package/outrage-message/src/runtime.js +1 -1
  108. package/package.json +1 -1
  109. package/product/src/apis/ManageProductApi.js +36 -52
  110. package/product/src/apis/ManageProductImageApi.js +34 -52
  111. package/product/src/apis/ManageProductProscriptionApi.js +35 -51
  112. package/product/src/apis/SearchProductApi.js +36 -52
  113. package/product/src/apis/SearchProductImageApi.js +36 -52
  114. package/product/src/apis/SearchProductMetadataApi.js +72 -104
  115. package/product/src/apis/SearchProductProscriptionApi.js +18 -26
  116. package/product/src/runtime.d.ts +2 -2
  117. package/product/src/runtime.js +1 -1
  118. package/pub/src/apis/ManagePubApi.js +70 -102
  119. package/pub/src/apis/ManagePubImageApi.js +18 -28
  120. package/pub/src/apis/SearchPubApi.js +54 -78
  121. package/pub/src/runtime.d.ts +2 -2
  122. package/pub/src/runtime.js +1 -1
  123. package/recommendation/src/apis/SearchFavoriteProductRecommendationApi.js +18 -26
  124. package/recommendation/src/apis/SearchProductPriceRecommendationApi.js +18 -26
  125. package/recommendation/src/apis/SearchProductRecommendationApi.js +18 -26
  126. package/recommendation/src/runtime.d.ts +2 -2
  127. package/recommendation/src/runtime.js +1 -1
  128. package/rfx/src/apis/ManageRfiApi.js +17 -25
  129. package/rfx/src/apis/ManageRfilApi.js +17 -25
  130. package/rfx/src/apis/ManageRfoApi.js +17 -25
  131. package/rfx/src/apis/ManageRfoiApi.js +36 -52
  132. package/rfx/src/apis/SearchRfoiApi.js +18 -26
  133. package/rfx/src/runtime.d.ts +2 -2
  134. package/rfx/src/runtime.js +1 -1
  135. package/sale-offer/src/apis/ManageSaleOfferApi.d.ts +2 -2
  136. package/sale-offer/src/apis/ManageSaleOfferApi.js +107 -155
  137. package/sale-offer/src/apis/SearchSaleOfferApi.js +36 -52
  138. package/sale-offer/src/models/SaleOffer.d.ts +1 -1
  139. package/sale-offer/src/models/SaleOffer.js +1 -1
  140. package/sale-offer/src/models/SaleOfferCreationParameters.d.ts +2 -2
  141. package/sale-offer/src/models/SaleOfferCreationParameters.js +1 -1
  142. package/sale-offer/src/models/SaleOfferJournal.d.ts +1 -1
  143. package/sale-offer/src/models/SaleOfferJournal.js +3 -2
  144. package/sale-offer/src/models/SaleOfferNewVersionParameters.d.ts +1 -1
  145. package/sale-offer/src/models/SaleOfferNewVersionParameters.js +1 -1
  146. package/sale-offer/src/runtime.d.ts +2 -2
  147. package/sale-offer/src/runtime.js +1 -1
  148. package/sale-offer-log/src/apis/SearchSaleOfferLogApi.js +18 -26
  149. package/sale-offer-log/src/runtime.d.ts +2 -2
  150. package/sale-offer-log/src/runtime.js +1 -1
  151. package/servant/src/apis/ManageTaskApi.js +17 -25
  152. package/servant/src/apis/SearchServantApi.js +18 -26
  153. package/servant/src/runtime.d.ts +2 -2
  154. package/servant/src/runtime.js +1 -1
  155. package/shipment/src/apis/ManageOrderCarriageApi.js +18 -26
  156. package/shipment/src/apis/ManageShipmentApi.js +36 -52
  157. package/shipment/src/apis/SearchOrderCarriageApi.js +36 -52
  158. package/shipment/src/runtime.d.ts +2 -2
  159. package/shipment/src/runtime.js +1 -1
  160. package/shopping-cart/src/apis/ManageCartApi.js +36 -52
  161. package/shopping-cart/src/apis/ManageCartSubCartApi.js +53 -77
  162. package/shopping-cart/src/apis/ManageCartSubCartLineApi.js +88 -128
  163. package/shopping-cart/src/runtime.d.ts +2 -2
  164. package/shopping-cart/src/runtime.js +1 -1
  165. package/statistic/src/apis/SearchSaleOfferStatisticsApi.js +36 -52
  166. package/statistic/src/runtime.d.ts +2 -2
  167. package/statistic/src/runtime.js +1 -1
  168. package/subscription/src/apis/ManageSubscriptionApi.js +53 -77
  169. package/subscription/src/apis/ManageSubscriptionPlanApi.js +18 -26
  170. package/subscription/src/apis/SearchSubscriptionApi.js +18 -26
  171. package/subscription/src/apis/SearchSubscriptionPlanApi.js +36 -52
  172. package/subscription/src/apis/SearchSubscriptionPlanFeatureApi.js +18 -26
  173. package/subscription/src/runtime.d.ts +2 -2
  174. package/subscription/src/runtime.js +1 -1
  175. package/thread/src/apis/ManageThreadCommentApi.js +36 -52
  176. package/thread/src/apis/SearchThreadApi.js +18 -26
  177. package/thread/src/apis/SearchThreadCommentApi.js +18 -26
  178. package/thread/src/runtime.d.ts +2 -2
  179. package/thread/src/runtime.js +1 -1
  180. package/ubo/src/apis/ManageUboDeclarationApi.js +18 -26
  181. package/ubo/src/apis/SearchUboDeclarationApi.js +18 -26
  182. package/ubo/src/runtime.d.ts +2 -2
  183. package/ubo/src/runtime.js +1 -1
  184. package/user/src/apis/ManagePasswordApi.js +34 -50
  185. package/user/src/apis/ManageUserApi.js +121 -177
  186. package/user/src/apis/ManageUserBankAccountApi.js +36 -52
  187. package/user/src/apis/ManageUserDocumentApi.js +54 -82
  188. package/user/src/apis/ManageUserFavoriteLaboratoryStoreApi.js +68 -100
  189. package/user/src/apis/ManageUserRestrictionApi.js +136 -200
  190. package/user/src/apis/ManageUserRoleApi.js +18 -26
  191. package/user/src/apis/ManageUserRuleApi.js +35 -51
  192. package/user/src/apis/ManageUserSocialNetworksApi.js +36 -52
  193. package/user/src/apis/ManageUserTransportApi.js +18 -26
  194. package/user/src/apis/SearchUserApi.js +108 -156
  195. package/user/src/apis/SearchUserDocumentApi.js +124 -180
  196. package/user/src/apis/SearchUserFavoriteLaboratoryStoreApi.js +36 -52
  197. package/user/src/apis/SearchUserFeatureApi.js +18 -26
  198. package/user/src/apis/SearchUserRestrictionApi.js +72 -104
  199. package/user/src/apis/SearchUserRuleApi.js +18 -26
  200. package/user/src/apis/SearchUserSocialNetworksApi.js +36 -52
  201. package/user/src/apis/SearchUserTransportApi.js +36 -52
  202. package/user/src/runtime.d.ts +2 -2
  203. package/user/src/runtime.js +1 -1
  204. package/wish/src/apis/ManageWishApi.js +51 -75
  205. package/wish/src/apis/SearchProductEnthusiasmApi.js +18 -26
  206. package/wish/src/apis/SearchWishApi.js +36 -52
  207. package/wish/src/runtime.d.ts +2 -2
  208. package/wish/src/runtime.js +1 -1
@@ -81,9 +81,9 @@ var SearchRfoiApi = /** @class */ (function (_super) {
81
81
  */
82
82
  SearchRfoiApi.prototype.getRfoisRaw = function (requestParameters) {
83
83
  return __awaiter(this, void 0, void 0, function () {
84
- var queryParameters, headerParameters, token, tokenString, _a, response, contentType, response_1;
85
- return __generator(this, function (_b) {
86
- switch (_b.label) {
84
+ var queryParameters, headerParameters, token, tokenString, response, contentType, response_1;
85
+ return __generator(this, function (_a) {
86
+ switch (_a.label) {
87
87
  case 0:
88
88
  queryParameters = {};
89
89
  if (requestParameters.idEq) {
@@ -111,32 +111,24 @@ var SearchRfoiApi = /** @class */ (function (_super) {
111
111
  if (this.configuration && this.configuration.apiKey) {
112
112
  headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // apiKeyAuth authentication
113
113
  }
114
- if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
115
- token = this.configuration.accessToken;
116
- if (!(typeof token === 'function')) return [3 /*break*/, 2];
117
- return [4 /*yield*/, token("bearerAuth", [])];
118
- case 1:
119
- _a = _b.sent();
120
- return [3 /*break*/, 3];
121
- case 2:
122
- _a = token;
123
- _b.label = 3;
124
- case 3:
125
- tokenString = _a;
126
- if (tokenString) {
127
- headerParameters["Authorization"] = "Bearer ".concat(tokenString);
114
+ if (this.configuration && this.configuration.accessToken) {
115
+ token = this.configuration.accessToken;
116
+ tokenString = typeof token === 'function' ? token("bearerAuth", []) : token;
117
+ if (tokenString) {
118
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
119
+ }
128
120
  }
129
- _b.label = 4;
130
- case 4:
131
- _b.trys.push([4, 6, , 7]);
121
+ _a.label = 1;
122
+ case 1:
123
+ _a.trys.push([1, 3, , 4]);
132
124
  return [4 /*yield*/, this.request({
133
125
  path: "/rfois",
134
126
  method: 'GET',
135
127
  headers: headerParameters,
136
128
  query: queryParameters,
137
129
  })];
138
- case 5:
139
- response = _b.sent();
130
+ case 2:
131
+ response = _a.sent();
140
132
  contentType = response.headers.get("content-type");
141
133
  if (contentType && contentType.indexOf("application/json") !== -1) {
142
134
  return [2 /*return*/, new runtime_1.JSONApiResponse(response, function (jsonValue) { return (0, models_1.PaginatedRfoisFromJSON)(jsonValue); })];
@@ -148,12 +140,12 @@ var SearchRfoiApi = /** @class */ (function (_super) {
148
140
  // TODO : Better handling of others application types
149
141
  return [2 /*return*/, new runtime_1.BlobWithMetaApiResponse(response)];
150
142
  }
151
- return [3 /*break*/, 7];
152
- case 6:
153
- response_1 = _b.sent();
143
+ return [3 /*break*/, 4];
144
+ case 3:
145
+ response_1 = _a.sent();
154
146
  console.debug(response_1);
155
147
  throw response_1;
156
- case 7: return [2 /*return*/];
148
+ case 4: return [2 /*return*/];
157
149
  }
158
150
  });
159
151
  });
@@ -49,7 +49,7 @@ export interface ConfigurationParameters {
49
49
  username?: string;
50
50
  password?: string;
51
51
  apiKey?: string | ((name: string) => string);
52
- accessToken?: string | ((name?: string, scopes?: string[]) => Promise<string>);
52
+ accessToken?: string | ((name?: string, scopes?: string[]) => string);
53
53
  headers?: HTTPHeaders;
54
54
  credentials?: RequestCredentials;
55
55
  referrerPolicy?: ReferrerPolicy;
@@ -64,7 +64,7 @@ export declare class Configuration {
64
64
  get username(): string | undefined;
65
65
  get password(): string | undefined;
66
66
  get apiKey(): ((name: string) => string) | undefined;
67
- get accessToken(): ((name: string, scopes?: string[]) => Promise<string>) | undefined;
67
+ get accessToken(): ((name: string, scopes?: string[]) => string) | undefined;
68
68
  get headers(): HTTPHeaders | undefined;
69
69
  get credentials(): RequestCredentials | undefined;
70
70
  get referrerPolicy(): ReferrerPolicy | undefined;
@@ -291,7 +291,7 @@ var Configuration = /** @class */ (function () {
291
291
  get: function () {
292
292
  var accessToken = this.configuration.accessToken;
293
293
  if (accessToken) {
294
- return typeof accessToken === 'function' ? accessToken : function () { return Promise.resolve(accessToken); };
294
+ return typeof accessToken === 'function' ? accessToken : function () { return accessToken; };
295
295
  }
296
296
  return undefined;
297
297
  },
@@ -43,12 +43,12 @@ export interface UpdateSaleOffersRequest {
43
43
  */
44
44
  export declare class ManageSaleOfferApi extends BaseAPI {
45
45
  /**
46
- * Create a new sale offer. WARNING : There is some special restrictions according the user that create sale offer # All : - Owner should have a valid mangopay mandate - Unit price should be lower than product unitPrice - For unitary sale offer, minimalQuantity should be lower than stock remainingQuantity # Pharmacy : - Can only create UNITARY sale offer - Sale offer should have at least one item in quantity - Can not set images on sale offers - Can not create sale offers without stock - Can create sale offer only for legal allowed products - Batch should be auhtorized by ANSM/DGCCRF - Lapsing date of stock must be after REQUIRED_LAPSING_MONTHS months # Laboratory : - Can not create a sale offer on a product that already have an existing non-disabled sale offer - Can create sale offer without lapsing - Can create sale offer without remaining quantity
46
+ * Create a new sale offer. WARNING : There is some special restrictions according the user that create sale offer # All : - Owner should have a valid mangopay mandate - Unit price should be lower than product unitPrice # Pharmacy : - Can only create UNITARY sale offer - Sale offer should have at least one item in quantity - Can not set images on sale offers - Can not create sale offers without stock - Can create sale offer only for legal allowed products - Batch should be auhtorized by ANSM/DGCCRF - Lapsing date of stock must be after REQUIRED_LAPSING_MONTHS months # Laboratory : - Can not create a sale offer on a product that already have an existing non-disabled sale offer - Can create sale offer without lapsing - Can create sale offer without remaining quantity
47
47
  * Create a new sale offer
48
48
  */
49
49
  createSaleOfferRaw(requestParameters: CreateSaleOfferRequest): Promise<ApiResponse<SaleOffer | BlobWithMeta>>;
50
50
  /**
51
- * Create a new sale offer. WARNING : There is some special restrictions according the user that create sale offer # All : - Owner should have a valid mangopay mandate - Unit price should be lower than product unitPrice - For unitary sale offer, minimalQuantity should be lower than stock remainingQuantity # Pharmacy : - Can only create UNITARY sale offer - Sale offer should have at least one item in quantity - Can not set images on sale offers - Can not create sale offers without stock - Can create sale offer only for legal allowed products - Batch should be auhtorized by ANSM/DGCCRF - Lapsing date of stock must be after REQUIRED_LAPSING_MONTHS months # Laboratory : - Can not create a sale offer on a product that already have an existing non-disabled sale offer - Can create sale offer without lapsing - Can create sale offer without remaining quantity
51
+ * Create a new sale offer. WARNING : There is some special restrictions according the user that create sale offer # All : - Owner should have a valid mangopay mandate - Unit price should be lower than product unitPrice # Pharmacy : - Can only create UNITARY sale offer - Sale offer should have at least one item in quantity - Can not set images on sale offers - Can not create sale offers without stock - Can create sale offer only for legal allowed products - Batch should be auhtorized by ANSM/DGCCRF - Lapsing date of stock must be after REQUIRED_LAPSING_MONTHS months # Laboratory : - Can not create a sale offer on a product that already have an existing non-disabled sale offer - Can create sale offer without lapsing - Can create sale offer without remaining quantity
52
52
  * Create a new sale offer
53
53
  */
54
54
  createSaleOffer(requestParameters: CreateSaleOfferRequest): Promise<SaleOffer | BlobWithMeta>;
@@ -76,14 +76,14 @@ var ManageSaleOfferApi = /** @class */ (function (_super) {
76
76
  return _super !== null && _super.apply(this, arguments) || this;
77
77
  }
78
78
  /**
79
- * Create a new sale offer. WARNING : There is some special restrictions according the user that create sale offer # All : - Owner should have a valid mangopay mandate - Unit price should be lower than product unitPrice - For unitary sale offer, minimalQuantity should be lower than stock remainingQuantity # Pharmacy : - Can only create UNITARY sale offer - Sale offer should have at least one item in quantity - Can not set images on sale offers - Can not create sale offers without stock - Can create sale offer only for legal allowed products - Batch should be auhtorized by ANSM/DGCCRF - Lapsing date of stock must be after REQUIRED_LAPSING_MONTHS months # Laboratory : - Can not create a sale offer on a product that already have an existing non-disabled sale offer - Can create sale offer without lapsing - Can create sale offer without remaining quantity
79
+ * Create a new sale offer. WARNING : There is some special restrictions according the user that create sale offer # All : - Owner should have a valid mangopay mandate - Unit price should be lower than product unitPrice # Pharmacy : - Can only create UNITARY sale offer - Sale offer should have at least one item in quantity - Can not set images on sale offers - Can not create sale offers without stock - Can create sale offer only for legal allowed products - Batch should be auhtorized by ANSM/DGCCRF - Lapsing date of stock must be after REQUIRED_LAPSING_MONTHS months # Laboratory : - Can not create a sale offer on a product that already have an existing non-disabled sale offer - Can create sale offer without lapsing - Can create sale offer without remaining quantity
80
80
  * Create a new sale offer
81
81
  */
82
82
  ManageSaleOfferApi.prototype.createSaleOfferRaw = function (requestParameters) {
83
83
  return __awaiter(this, void 0, void 0, function () {
84
- var queryParameters, headerParameters, token, tokenString, _a, response, contentType, response_1;
85
- return __generator(this, function (_b) {
86
- switch (_b.label) {
84
+ var queryParameters, headerParameters, token, tokenString, response, contentType, response_1;
85
+ return __generator(this, function (_a) {
86
+ switch (_a.label) {
87
87
  case 0:
88
88
  queryParameters = {};
89
89
  if (requestParameters.from !== undefined) {
@@ -94,24 +94,16 @@ var ManageSaleOfferApi = /** @class */ (function (_super) {
94
94
  if (this.configuration && this.configuration.apiKey) {
95
95
  headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // apiKeyAuth authentication
96
96
  }
97
- if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
98
- token = this.configuration.accessToken;
99
- if (!(typeof token === 'function')) return [3 /*break*/, 2];
100
- return [4 /*yield*/, token("bearerAuth", [])];
101
- case 1:
102
- _a = _b.sent();
103
- return [3 /*break*/, 3];
104
- case 2:
105
- _a = token;
106
- _b.label = 3;
107
- case 3:
108
- tokenString = _a;
109
- if (tokenString) {
110
- headerParameters["Authorization"] = "Bearer ".concat(tokenString);
97
+ if (this.configuration && this.configuration.accessToken) {
98
+ token = this.configuration.accessToken;
99
+ tokenString = typeof token === 'function' ? token("bearerAuth", []) : token;
100
+ if (tokenString) {
101
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
102
+ }
111
103
  }
112
- _b.label = 4;
113
- case 4:
114
- _b.trys.push([4, 6, , 7]);
104
+ _a.label = 1;
105
+ case 1:
106
+ _a.trys.push([1, 3, , 4]);
115
107
  return [4 /*yield*/, this.request({
116
108
  path: "/sale-offers",
117
109
  method: 'POST',
@@ -119,8 +111,8 @@ var ManageSaleOfferApi = /** @class */ (function (_super) {
119
111
  query: queryParameters,
120
112
  body: (0, models_1.SaleOfferCreationParametersToJSON)(requestParameters.saleOfferCreationParameters),
121
113
  })];
122
- case 5:
123
- response = _b.sent();
114
+ case 2:
115
+ response = _a.sent();
124
116
  contentType = response.headers.get("content-type");
125
117
  if (contentType && contentType.indexOf("application/json") !== -1) {
126
118
  return [2 /*return*/, new runtime_1.JSONApiResponse(response, function (jsonValue) { return (0, models_1.SaleOfferFromJSON)(jsonValue); })];
@@ -132,18 +124,18 @@ var ManageSaleOfferApi = /** @class */ (function (_super) {
132
124
  // TODO : Better handling of others application types
133
125
  return [2 /*return*/, new runtime_1.BlobWithMetaApiResponse(response)];
134
126
  }
135
- return [3 /*break*/, 7];
136
- case 6:
137
- response_1 = _b.sent();
127
+ return [3 /*break*/, 4];
128
+ case 3:
129
+ response_1 = _a.sent();
138
130
  console.debug(response_1);
139
131
  throw response_1;
140
- case 7: return [2 /*return*/];
132
+ case 4: return [2 /*return*/];
141
133
  }
142
134
  });
143
135
  });
144
136
  };
145
137
  /**
146
- * Create a new sale offer. WARNING : There is some special restrictions according the user that create sale offer # All : - Owner should have a valid mangopay mandate - Unit price should be lower than product unitPrice - For unitary sale offer, minimalQuantity should be lower than stock remainingQuantity # Pharmacy : - Can only create UNITARY sale offer - Sale offer should have at least one item in quantity - Can not set images on sale offers - Can not create sale offers without stock - Can create sale offer only for legal allowed products - Batch should be auhtorized by ANSM/DGCCRF - Lapsing date of stock must be after REQUIRED_LAPSING_MONTHS months # Laboratory : - Can not create a sale offer on a product that already have an existing non-disabled sale offer - Can create sale offer without lapsing - Can create sale offer without remaining quantity
138
+ * Create a new sale offer. WARNING : There is some special restrictions according the user that create sale offer # All : - Owner should have a valid mangopay mandate - Unit price should be lower than product unitPrice # Pharmacy : - Can only create UNITARY sale offer - Sale offer should have at least one item in quantity - Can not set images on sale offers - Can not create sale offers without stock - Can create sale offer only for legal allowed products - Batch should be auhtorized by ANSM/DGCCRF - Lapsing date of stock must be after REQUIRED_LAPSING_MONTHS months # Laboratory : - Can not create a sale offer on a product that already have an existing non-disabled sale offer - Can create sale offer without lapsing - Can create sale offer without remaining quantity
147
139
  * Create a new sale offer
148
140
  */
149
141
  ManageSaleOfferApi.prototype.createSaleOffer = function (requestParameters) {
@@ -166,9 +158,9 @@ var ManageSaleOfferApi = /** @class */ (function (_super) {
166
158
  */
167
159
  ManageSaleOfferApi.prototype.createSaleOfferVersionRaw = function (requestParameters) {
168
160
  return __awaiter(this, void 0, void 0, function () {
169
- var queryParameters, headerParameters, token, tokenString, _a, response, contentType, response_2;
170
- return __generator(this, function (_b) {
171
- switch (_b.label) {
161
+ var queryParameters, headerParameters, token, tokenString, response, contentType, response_2;
162
+ return __generator(this, function (_a) {
163
+ switch (_a.label) {
172
164
  case 0:
173
165
  if (requestParameters.saleOfferReference === null || requestParameters.saleOfferReference === undefined) {
174
166
  throw new runtime_1.RequiredError('saleOfferReference', 'Required parameter requestParameters.saleOfferReference was null or undefined when calling createSaleOfferVersion.');
@@ -182,24 +174,16 @@ var ManageSaleOfferApi = /** @class */ (function (_super) {
182
174
  if (this.configuration && this.configuration.apiKey) {
183
175
  headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // apiKeyAuth authentication
184
176
  }
185
- if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
186
- token = this.configuration.accessToken;
187
- if (!(typeof token === 'function')) return [3 /*break*/, 2];
188
- return [4 /*yield*/, token("bearerAuth", [])];
189
- case 1:
190
- _a = _b.sent();
191
- return [3 /*break*/, 3];
192
- case 2:
193
- _a = token;
194
- _b.label = 3;
195
- case 3:
196
- tokenString = _a;
197
- if (tokenString) {
198
- headerParameters["Authorization"] = "Bearer ".concat(tokenString);
177
+ if (this.configuration && this.configuration.accessToken) {
178
+ token = this.configuration.accessToken;
179
+ tokenString = typeof token === 'function' ? token("bearerAuth", []) : token;
180
+ if (tokenString) {
181
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
182
+ }
199
183
  }
200
- _b.label = 4;
201
- case 4:
202
- _b.trys.push([4, 6, , 7]);
184
+ _a.label = 1;
185
+ case 1:
186
+ _a.trys.push([1, 3, , 4]);
203
187
  return [4 /*yield*/, this.request({
204
188
  path: "/sale-offers/{saleOfferReference}/versions".replace("{".concat("saleOfferReference", "}"), encodeURIComponent(String(requestParameters.saleOfferReference))),
205
189
  method: 'POST',
@@ -207,8 +191,8 @@ var ManageSaleOfferApi = /** @class */ (function (_super) {
207
191
  query: queryParameters,
208
192
  body: (0, models_1.SaleOfferNewVersionParametersToJSON)(requestParameters.saleOfferNewVersionParameters),
209
193
  })];
210
- case 5:
211
- response = _b.sent();
194
+ case 2:
195
+ response = _a.sent();
212
196
  contentType = response.headers.get("content-type");
213
197
  if (contentType && contentType.indexOf("application/json") !== -1) {
214
198
  return [2 /*return*/, new runtime_1.JSONApiResponse(response, function (jsonValue) { return (0, models_1.SaleOfferFromJSON)(jsonValue); })];
@@ -220,12 +204,12 @@ var ManageSaleOfferApi = /** @class */ (function (_super) {
220
204
  // TODO : Better handling of others application types
221
205
  return [2 /*return*/, new runtime_1.BlobWithMetaApiResponse(response)];
222
206
  }
223
- return [3 /*break*/, 7];
224
- case 6:
225
- response_2 = _b.sent();
207
+ return [3 /*break*/, 4];
208
+ case 3:
209
+ response_2 = _a.sent();
226
210
  console.debug(response_2);
227
211
  throw response_2;
228
- case 7: return [2 /*return*/];
212
+ case 4: return [2 /*return*/];
229
213
  }
230
214
  });
231
215
  });
@@ -253,9 +237,9 @@ var ManageSaleOfferApi = /** @class */ (function (_super) {
253
237
  */
254
238
  ManageSaleOfferApi.prototype.deleteSaleOfferRaw = function (requestParameters) {
255
239
  return __awaiter(this, void 0, void 0, function () {
256
- var queryParameters, headerParameters, token, tokenString, _a, response, response_3;
257
- return __generator(this, function (_b) {
258
- switch (_b.label) {
240
+ var queryParameters, headerParameters, token, tokenString, response, response_3;
241
+ return __generator(this, function (_a) {
242
+ switch (_a.label) {
259
243
  case 0:
260
244
  if (requestParameters.saleOfferReference === null || requestParameters.saleOfferReference === undefined) {
261
245
  throw new runtime_1.RequiredError('saleOfferReference', 'Required parameter requestParameters.saleOfferReference was null or undefined when calling deleteSaleOffer.');
@@ -265,38 +249,30 @@ var ManageSaleOfferApi = /** @class */ (function (_super) {
265
249
  if (this.configuration && this.configuration.apiKey) {
266
250
  headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // apiKeyAuth authentication
267
251
  }
268
- if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
269
- token = this.configuration.accessToken;
270
- if (!(typeof token === 'function')) return [3 /*break*/, 2];
271
- return [4 /*yield*/, token("bearerAuth", [])];
272
- case 1:
273
- _a = _b.sent();
274
- return [3 /*break*/, 3];
275
- case 2:
276
- _a = token;
277
- _b.label = 3;
278
- case 3:
279
- tokenString = _a;
280
- if (tokenString) {
281
- headerParameters["Authorization"] = "Bearer ".concat(tokenString);
252
+ if (this.configuration && this.configuration.accessToken) {
253
+ token = this.configuration.accessToken;
254
+ tokenString = typeof token === 'function' ? token("bearerAuth", []) : token;
255
+ if (tokenString) {
256
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
257
+ }
282
258
  }
283
- _b.label = 4;
284
- case 4:
285
- _b.trys.push([4, 6, , 7]);
259
+ _a.label = 1;
260
+ case 1:
261
+ _a.trys.push([1, 3, , 4]);
286
262
  return [4 /*yield*/, this.request({
287
263
  path: "/sale-offers/{saleOfferReference}".replace("{".concat("saleOfferReference", "}"), encodeURIComponent(String(requestParameters.saleOfferReference))),
288
264
  method: 'DELETE',
289
265
  headers: headerParameters,
290
266
  query: queryParameters,
291
267
  })];
292
- case 5:
293
- response = _b.sent();
268
+ case 2:
269
+ response = _a.sent();
294
270
  return [2 /*return*/, new runtime_1.VoidApiResponse(response)];
295
- case 6:
296
- response_3 = _b.sent();
271
+ case 3:
272
+ response_3 = _a.sent();
297
273
  console.debug(response_3);
298
274
  throw response_3;
299
- case 7: return [2 /*return*/];
275
+ case 4: return [2 /*return*/];
300
276
  }
301
277
  });
302
278
  });
@@ -322,9 +298,9 @@ var ManageSaleOfferApi = /** @class */ (function (_super) {
322
298
  */
323
299
  ManageSaleOfferApi.prototype.deleteSaleOffersRaw = function (requestParameters) {
324
300
  return __awaiter(this, void 0, void 0, function () {
325
- var queryParameters, headerParameters, token, tokenString, _a, response, response_4;
326
- return __generator(this, function (_b) {
327
- switch (_b.label) {
301
+ var queryParameters, headerParameters, token, tokenString, response, response_4;
302
+ return __generator(this, function (_a) {
303
+ switch (_a.label) {
328
304
  case 0:
329
305
  queryParameters = {};
330
306
  if (requestParameters.oEq) {
@@ -346,38 +322,30 @@ var ManageSaleOfferApi = /** @class */ (function (_super) {
346
322
  if (this.configuration && this.configuration.apiKey) {
347
323
  headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // apiKeyAuth authentication
348
324
  }
349
- if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
350
- token = this.configuration.accessToken;
351
- if (!(typeof token === 'function')) return [3 /*break*/, 2];
352
- return [4 /*yield*/, token("bearerAuth", [])];
353
- case 1:
354
- _a = _b.sent();
355
- return [3 /*break*/, 3];
356
- case 2:
357
- _a = token;
358
- _b.label = 3;
359
- case 3:
360
- tokenString = _a;
361
- if (tokenString) {
362
- headerParameters["Authorization"] = "Bearer ".concat(tokenString);
325
+ if (this.configuration && this.configuration.accessToken) {
326
+ token = this.configuration.accessToken;
327
+ tokenString = typeof token === 'function' ? token("bearerAuth", []) : token;
328
+ if (tokenString) {
329
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
330
+ }
363
331
  }
364
- _b.label = 4;
365
- case 4:
366
- _b.trys.push([4, 6, , 7]);
332
+ _a.label = 1;
333
+ case 1:
334
+ _a.trys.push([1, 3, , 4]);
367
335
  return [4 /*yield*/, this.request({
368
336
  path: "/sale-offers",
369
337
  method: 'DELETE',
370
338
  headers: headerParameters,
371
339
  query: queryParameters,
372
340
  })];
373
- case 5:
374
- response = _b.sent();
341
+ case 2:
342
+ response = _a.sent();
375
343
  return [2 /*return*/, new runtime_1.VoidApiResponse(response)];
376
- case 6:
377
- response_4 = _b.sent();
344
+ case 3:
345
+ response_4 = _a.sent();
378
346
  console.debug(response_4);
379
347
  throw response_4;
380
- case 7: return [2 /*return*/];
348
+ case 4: return [2 /*return*/];
381
349
  }
382
350
  });
383
351
  });
@@ -403,9 +371,9 @@ var ManageSaleOfferApi = /** @class */ (function (_super) {
403
371
  */
404
372
  ManageSaleOfferApi.prototype.updateSaleOfferRaw = function (requestParameters) {
405
373
  return __awaiter(this, void 0, void 0, function () {
406
- var queryParameters, headerParameters, token, tokenString, _a, response, contentType, response_5;
407
- return __generator(this, function (_b) {
408
- switch (_b.label) {
374
+ var queryParameters, headerParameters, token, tokenString, response, contentType, response_5;
375
+ return __generator(this, function (_a) {
376
+ switch (_a.label) {
409
377
  case 0:
410
378
  if (requestParameters.saleOfferReference === null || requestParameters.saleOfferReference === undefined) {
411
379
  throw new runtime_1.RequiredError('saleOfferReference', 'Required parameter requestParameters.saleOfferReference was null or undefined when calling updateSaleOffer.');
@@ -419,24 +387,16 @@ var ManageSaleOfferApi = /** @class */ (function (_super) {
419
387
  if (this.configuration && this.configuration.apiKey) {
420
388
  headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // apiKeyAuth authentication
421
389
  }
422
- if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
423
- token = this.configuration.accessToken;
424
- if (!(typeof token === 'function')) return [3 /*break*/, 2];
425
- return [4 /*yield*/, token("bearerAuth", [])];
426
- case 1:
427
- _a = _b.sent();
428
- return [3 /*break*/, 3];
429
- case 2:
430
- _a = token;
431
- _b.label = 3;
432
- case 3:
433
- tokenString = _a;
434
- if (tokenString) {
435
- headerParameters["Authorization"] = "Bearer ".concat(tokenString);
390
+ if (this.configuration && this.configuration.accessToken) {
391
+ token = this.configuration.accessToken;
392
+ tokenString = typeof token === 'function' ? token("bearerAuth", []) : token;
393
+ if (tokenString) {
394
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
395
+ }
436
396
  }
437
- _b.label = 4;
438
- case 4:
439
- _b.trys.push([4, 6, , 7]);
397
+ _a.label = 1;
398
+ case 1:
399
+ _a.trys.push([1, 3, , 4]);
440
400
  return [4 /*yield*/, this.request({
441
401
  path: "/sale-offers/{saleOfferReference}".replace("{".concat("saleOfferReference", "}"), encodeURIComponent(String(requestParameters.saleOfferReference))),
442
402
  method: 'PATCH',
@@ -444,8 +404,8 @@ var ManageSaleOfferApi = /** @class */ (function (_super) {
444
404
  query: queryParameters,
445
405
  body: (0, models_1.SaleOfferUpdateParametersToJSON)(requestParameters.saleOfferUpdateParameters),
446
406
  })];
447
- case 5:
448
- response = _b.sent();
407
+ case 2:
408
+ response = _a.sent();
449
409
  contentType = response.headers.get("content-type");
450
410
  if (contentType && contentType.indexOf("application/json") !== -1) {
451
411
  return [2 /*return*/, new runtime_1.JSONApiResponse(response, function (jsonValue) { return (0, models_1.SaleOfferFromJSON)(jsonValue); })];
@@ -457,12 +417,12 @@ var ManageSaleOfferApi = /** @class */ (function (_super) {
457
417
  // TODO : Better handling of others application types
458
418
  return [2 /*return*/, new runtime_1.BlobWithMetaApiResponse(response)];
459
419
  }
460
- return [3 /*break*/, 7];
461
- case 6:
462
- response_5 = _b.sent();
420
+ return [3 /*break*/, 4];
421
+ case 3:
422
+ response_5 = _a.sent();
463
423
  console.debug(response_5);
464
424
  throw response_5;
465
- case 7: return [2 /*return*/];
425
+ case 4: return [2 /*return*/];
466
426
  }
467
427
  });
468
428
  });
@@ -489,9 +449,9 @@ var ManageSaleOfferApi = /** @class */ (function (_super) {
489
449
  */
490
450
  ManageSaleOfferApi.prototype.updateSaleOffersRaw = function (requestParameters) {
491
451
  return __awaiter(this, void 0, void 0, function () {
492
- var queryParameters, headerParameters, token, tokenString, _a, response, response_6;
493
- return __generator(this, function (_b) {
494
- switch (_b.label) {
452
+ var queryParameters, headerParameters, token, tokenString, response, response_6;
453
+ return __generator(this, function (_a) {
454
+ switch (_a.label) {
495
455
  case 0:
496
456
  if (requestParameters.saleOfferUpdateParameters === null || requestParameters.saleOfferUpdateParameters === undefined) {
497
457
  throw new runtime_1.RequiredError('saleOfferUpdateParameters', 'Required parameter requestParameters.saleOfferUpdateParameters was null or undefined when calling updateSaleOffers.');
@@ -508,24 +468,16 @@ var ManageSaleOfferApi = /** @class */ (function (_super) {
508
468
  if (this.configuration && this.configuration.apiKey) {
509
469
  headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // apiKeyAuth authentication
510
470
  }
511
- if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
512
- token = this.configuration.accessToken;
513
- if (!(typeof token === 'function')) return [3 /*break*/, 2];
514
- return [4 /*yield*/, token("bearerAuth", [])];
515
- case 1:
516
- _a = _b.sent();
517
- return [3 /*break*/, 3];
518
- case 2:
519
- _a = token;
520
- _b.label = 3;
521
- case 3:
522
- tokenString = _a;
523
- if (tokenString) {
524
- headerParameters["Authorization"] = "Bearer ".concat(tokenString);
471
+ if (this.configuration && this.configuration.accessToken) {
472
+ token = this.configuration.accessToken;
473
+ tokenString = typeof token === 'function' ? token("bearerAuth", []) : token;
474
+ if (tokenString) {
475
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
476
+ }
525
477
  }
526
- _b.label = 4;
527
- case 4:
528
- _b.trys.push([4, 6, , 7]);
478
+ _a.label = 1;
479
+ case 1:
480
+ _a.trys.push([1, 3, , 4]);
529
481
  return [4 /*yield*/, this.request({
530
482
  path: "/sale-offers",
531
483
  method: 'PATCH',
@@ -533,14 +485,14 @@ var ManageSaleOfferApi = /** @class */ (function (_super) {
533
485
  query: queryParameters,
534
486
  body: (0, models_1.SaleOfferUpdateParametersToJSON)(requestParameters.saleOfferUpdateParameters),
535
487
  })];
536
- case 5:
537
- response = _b.sent();
488
+ case 2:
489
+ response = _a.sent();
538
490
  return [2 /*return*/, new runtime_1.VoidApiResponse(response)];
539
- case 6:
540
- response_6 = _b.sent();
491
+ case 3:
492
+ response_6 = _a.sent();
541
493
  console.debug(response_6);
542
494
  throw response_6;
543
- case 7: return [2 /*return*/];
495
+ case 4: return [2 /*return*/];
544
496
  }
545
497
  });
546
498
  });