@cinerino/sdk 3.144.0-alpha.1 → 3.144.1

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 (193) hide show
  1. package/example/playground/public/lib/bundle.js +29 -18
  2. package/example/src/chevre/assetTransaction/processPayMGTicket.ts +0 -4
  3. package/example/src/chevre/assetTransaction/processPayMovieTicket.ts +0 -4
  4. package/example/src/transaction/processPlaceOrderByMovieTicket.ts +0 -1
  5. package/example/src/transaction/processPlaceOrderByMovieTicket4COA.ts +0 -1
  6. package/example/src/transaction/processPlaceOrderByPaymentCard.ts +1 -8
  7. package/example/src/transaction/searchEventOffers.ts +66 -0
  8. package/lib/abstract/auth/authClient.d.ts +14 -0
  9. package/lib/abstract/auth/authClient.js +76 -0
  10. package/lib/abstract/chevre/account.d.ts +80 -0
  11. package/lib/abstract/chevre/account.js +170 -0
  12. package/lib/abstract/chevre/accountTitle.d.ts +79 -0
  13. package/lib/abstract/chevre/accountTitle.js +335 -0
  14. package/lib/abstract/chevre/accountTransaction.d.ts +18 -0
  15. package/lib/abstract/chevre/accountTransaction.js +95 -0
  16. package/lib/abstract/chevre/accountingReport.d.ts +11 -0
  17. package/lib/abstract/chevre/accountingReport.js +95 -0
  18. package/lib/abstract/chevre/action.d.ts +16 -0
  19. package/lib/abstract/chevre/action.js +111 -0
  20. package/lib/abstract/chevre/additionalProperty.d.ts +27 -0
  21. package/lib/abstract/chevre/additionalProperty.js +162 -0
  22. package/lib/abstract/chevre/aggregation.d.ts +26 -0
  23. package/lib/abstract/chevre/aggregation.js +92 -0
  24. package/lib/abstract/chevre/assetTransaction/cancelReservation.d.ts +25 -0
  25. package/lib/abstract/chevre/assetTransaction/cancelReservation.js +146 -0
  26. package/lib/abstract/chevre/assetTransaction/moneyTransfer.d.ts +54 -0
  27. package/lib/abstract/chevre/assetTransaction/moneyTransfer.js +152 -0
  28. package/lib/abstract/chevre/assetTransaction/pay.d.ts +44 -0
  29. package/lib/abstract/chevre/assetTransaction/pay.js +211 -0
  30. package/lib/abstract/chevre/assetTransaction/refund.d.ts +22 -0
  31. package/lib/abstract/chevre/assetTransaction/refund.js +131 -0
  32. package/lib/abstract/chevre/assetTransaction/registerService.d.ts +22 -0
  33. package/lib/abstract/chevre/assetTransaction/registerService.js +131 -0
  34. package/lib/abstract/chevre/assetTransaction/reserve.d.ts +23 -0
  35. package/lib/abstract/chevre/assetTransaction/reserve.js +148 -0
  36. package/lib/abstract/chevre/assetTransaction.d.ts +11 -0
  37. package/lib/abstract/chevre/assetTransaction.js +95 -0
  38. package/lib/abstract/chevre/authorization.d.ts +23 -0
  39. package/lib/abstract/chevre/authorization.js +114 -0
  40. package/lib/abstract/chevre/award.d.ts +30 -0
  41. package/lib/abstract/chevre/award.js +105 -0
  42. package/lib/abstract/chevre/categoryCode.d.ts +24 -0
  43. package/lib/abstract/chevre/categoryCode.js +162 -0
  44. package/lib/abstract/chevre/comment.d.ts +17 -0
  45. package/lib/abstract/chevre/comment.js +114 -0
  46. package/lib/abstract/chevre/creativeWork.d.ts +18 -0
  47. package/lib/abstract/chevre/creativeWork.js +156 -0
  48. package/lib/abstract/chevre/customer.d.ts +34 -0
  49. package/lib/abstract/chevre/customer.js +172 -0
  50. package/lib/abstract/chevre/emailMessage.d.ts +53 -0
  51. package/lib/abstract/chevre/emailMessage.js +172 -0
  52. package/lib/abstract/chevre/event/factory.d.ts +2 -0
  53. package/lib/abstract/chevre/event/factory.js +2 -0
  54. package/lib/abstract/chevre/event.d.ts +82 -0
  55. package/lib/abstract/chevre/event.js +280 -0
  56. package/lib/abstract/chevre/iam.d.ts +91 -0
  57. package/lib/abstract/chevre/iam.js +321 -0
  58. package/lib/abstract/chevre/me.d.ts +18 -0
  59. package/lib/abstract/chevre/me.js +95 -0
  60. package/lib/abstract/chevre/merchantReturnPolicy.d.ts +16 -0
  61. package/lib/abstract/chevre/merchantReturnPolicy.js +156 -0
  62. package/lib/abstract/chevre/offer.d.ts +181 -0
  63. package/lib/abstract/chevre/offer.js +353 -0
  64. package/lib/abstract/chevre/offerCatalog.d.ts +60 -0
  65. package/lib/abstract/chevre/offerCatalog.js +201 -0
  66. package/lib/abstract/chevre/order/factory.d.ts +27 -0
  67. package/lib/abstract/chevre/order/factory.js +2 -0
  68. package/lib/abstract/chevre/order.d.ts +178 -0
  69. package/lib/abstract/chevre/order.js +391 -0
  70. package/lib/abstract/chevre/orderNumber.d.ts +12 -0
  71. package/lib/abstract/chevre/orderNumber.js +86 -0
  72. package/lib/abstract/chevre/ownershipInfo.d.ts +20 -0
  73. package/lib/abstract/chevre/ownershipInfo.js +95 -0
  74. package/lib/abstract/chevre/payment/factory.d.ts +23 -0
  75. package/lib/abstract/chevre/payment/factory.js +2 -0
  76. package/lib/abstract/chevre/payment.d.ts +75 -0
  77. package/lib/abstract/chevre/payment.js +257 -0
  78. package/lib/abstract/chevre/permit.d.ts +59 -0
  79. package/lib/abstract/chevre/permit.js +154 -0
  80. package/lib/abstract/chevre/person/ownershipInfo.d.ts +92 -0
  81. package/lib/abstract/chevre/person/ownershipInfo.js +237 -0
  82. package/lib/abstract/chevre/person.d.ts +86 -0
  83. package/lib/abstract/chevre/person.js +234 -0
  84. package/lib/abstract/chevre/place.d.ts +128 -0
  85. package/lib/abstract/chevre/place.js +501 -0
  86. package/lib/abstract/chevre/priceSpecification.d.ts +26 -0
  87. package/lib/abstract/chevre/priceSpecification.js +162 -0
  88. package/lib/abstract/chevre/product.d.ts +53 -0
  89. package/lib/abstract/chevre/product.js +201 -0
  90. package/lib/abstract/chevre/project.d.ts +44 -0
  91. package/lib/abstract/chevre/project.js +222 -0
  92. package/lib/abstract/chevre/reservation/factory.d.ts +9 -0
  93. package/lib/abstract/chevre/reservation/factory.js +2 -0
  94. package/lib/abstract/chevre/reservation.d.ts +57 -0
  95. package/lib/abstract/chevre/reservation.js +190 -0
  96. package/lib/abstract/chevre/seller.d.ts +34 -0
  97. package/lib/abstract/chevre/seller.js +172 -0
  98. package/lib/abstract/chevre/task.d.ts +23 -0
  99. package/lib/abstract/chevre/task.js +132 -0
  100. package/lib/abstract/chevre/token.d.ts +18 -0
  101. package/lib/abstract/chevre/token.js +86 -0
  102. package/lib/abstract/chevre/transaction/moneyTransfer.d.ts +50 -0
  103. package/lib/abstract/chevre/transaction/moneyTransfer.js +195 -0
  104. package/lib/abstract/chevre/transaction/placeOrder/factory.d.ts +82 -0
  105. package/lib/abstract/chevre/transaction/placeOrder/factory.js +2 -0
  106. package/lib/abstract/chevre/transaction/placeOrder.d.ts +78 -0
  107. package/lib/abstract/chevre/transaction/placeOrder.js +232 -0
  108. package/lib/abstract/chevre/transaction/returnOrder.d.ts +43 -0
  109. package/lib/abstract/chevre/transaction/returnOrder.js +157 -0
  110. package/lib/abstract/chevre/transaction.d.ts +26 -0
  111. package/lib/abstract/chevre/transaction.js +12 -0
  112. package/lib/abstract/chevre/transactionNumber.d.ts +12 -0
  113. package/lib/abstract/chevre/transactionNumber.js +86 -0
  114. package/lib/abstract/chevre/trip.d.ts +34 -0
  115. package/lib/abstract/chevre/trip.js +171 -0
  116. package/lib/abstract/chevre/userPool.d.ts +26 -0
  117. package/lib/abstract/chevre/userPool.js +131 -0
  118. package/lib/abstract/chevre.d.ts +306 -0
  119. package/lib/abstract/chevre.js +616 -0
  120. package/lib/abstract/factory.d.ts +4 -0
  121. package/lib/abstract/factory.js +16 -0
  122. package/lib/abstract/index.d.ts +215 -0
  123. package/lib/abstract/index.js +413 -0
  124. package/lib/abstract/pecorino/accountTransaction.d.ts +27 -0
  125. package/lib/abstract/pecorino/accountTransaction.js +158 -0
  126. package/lib/abstract/pecorino/permit.d.ts +36 -0
  127. package/lib/abstract/pecorino/permit.js +107 -0
  128. package/lib/abstract/pecorino.d.ts +19 -0
  129. package/lib/abstract/pecorino.js +51 -0
  130. package/lib/abstract/service/account.d.ts +56 -0
  131. package/lib/abstract/service/account.js +107 -0
  132. package/lib/abstract/service/categoryCode.d.ts +13 -0
  133. package/lib/abstract/service/categoryCode.js +95 -0
  134. package/lib/abstract/service/creativeWork.d.ts +11 -0
  135. package/lib/abstract/service/creativeWork.js +95 -0
  136. package/lib/abstract/service/customer.d.ts +17 -0
  137. package/lib/abstract/service/customer.js +113 -0
  138. package/lib/abstract/service/delivery.d.ts +23 -0
  139. package/lib/abstract/service/delivery.js +90 -0
  140. package/lib/abstract/service/emailMessage.d.ts +30 -0
  141. package/lib/abstract/service/emailMessage.js +95 -0
  142. package/lib/abstract/service/event.d.ts +201 -0
  143. package/lib/abstract/service/event.js +220 -0
  144. package/lib/abstract/service/iam.d.ts +11 -0
  145. package/lib/abstract/service/iam.js +95 -0
  146. package/lib/abstract/service/offer.d.ts +56 -0
  147. package/lib/abstract/service/offer.js +155 -0
  148. package/lib/abstract/service/order/factory.d.ts +1 -0
  149. package/lib/abstract/service/order/factory.js +13 -0
  150. package/lib/abstract/service/order.d.ts +159 -0
  151. package/lib/abstract/service/order.js +308 -0
  152. package/lib/abstract/service/payment.d.ts +109 -0
  153. package/lib/abstract/service/payment.js +243 -0
  154. package/lib/abstract/service/permit.d.ts +49 -0
  155. package/lib/abstract/service/permit.js +124 -0
  156. package/lib/abstract/service/person/ownershipInfo.d.ts +134 -0
  157. package/lib/abstract/service/person/ownershipInfo.js +363 -0
  158. package/lib/abstract/service/person.d.ts +86 -0
  159. package/lib/abstract/service/person.js +234 -0
  160. package/lib/abstract/service/place.d.ts +76 -0
  161. package/lib/abstract/service/place.js +180 -0
  162. package/lib/abstract/service/product.d.ts +27 -0
  163. package/lib/abstract/service/product.js +114 -0
  164. package/lib/abstract/service/project.d.ts +30 -0
  165. package/lib/abstract/service/project.js +163 -0
  166. package/lib/abstract/service/reservation/factory.d.ts +1 -0
  167. package/lib/abstract/service/reservation/factory.js +13 -0
  168. package/lib/abstract/service/reservation.d.ts +54 -0
  169. package/lib/abstract/service/reservation.js +164 -0
  170. package/lib/abstract/service/seller.d.ts +17 -0
  171. package/lib/abstract/service/seller.js +113 -0
  172. package/lib/abstract/service/token.d.ts +18 -0
  173. package/lib/abstract/service/token.js +86 -0
  174. package/lib/abstract/service/transaction/moneyTransfer.d.ts +36 -0
  175. package/lib/abstract/service/transaction/moneyTransfer.js +148 -0
  176. package/lib/abstract/service/transaction/placeOrder.d.ts +99 -0
  177. package/lib/abstract/service/transaction/placeOrder.js +256 -0
  178. package/lib/abstract/service/transaction/placeOrder4sskts.d.ts +61 -0
  179. package/lib/abstract/service/transaction/placeOrder4sskts.js +131 -0
  180. package/lib/abstract/service/transaction/returnOrder.d.ts +39 -0
  181. package/lib/abstract/service/transaction/returnOrder.js +129 -0
  182. package/lib/abstract/service/transaction.d.ts +26 -0
  183. package/lib/abstract/service/transaction.js +12 -0
  184. package/lib/abstract/service.d.ts +72 -0
  185. package/lib/abstract/service.js +105 -0
  186. package/lib/abstract/transporters.d.ts +45 -0
  187. package/lib/abstract/transporters.js +195 -0
  188. package/lib/abstract.d.ts +1 -1
  189. package/lib/abstract.js +1 -1
  190. package/lib/bundle.js +7275 -8080
  191. package/package.json +5 -5
  192. package/example/src/searchEventOffers.ts +0 -44
  193. package/example/src/transaction/processPlaceOrderByAnonymousCreditCard.ts +0 -401
@@ -3318,7 +3318,6 @@ var TaskName;
3318
3318
  TaskName["AggregateScreeningEvent"] = "aggregateScreeningEvent";
3319
3319
  TaskName["AggregateUseActionsOnEvent"] = "aggregateUseActionsOnEvent";
3320
3320
  TaskName["DeleteAssetTransaction"] = "deleteAssetTransaction";
3321
- TaskName["DeleteAuthorization"] = "deleteAuthorization";
3322
3321
  TaskName["DeleteOrder"] = "deleteOrder";
3323
3322
  TaskName["DeleteTransaction"] = "deleteTransaction";
3324
3323
  TaskName["ImportEventCapacitiesFromCOA"] = "importEventCapacitiesFromCOA";
@@ -8729,8 +8728,11 @@ var OfferCatalogService = /** @class */ (function (_super) {
8729
8728
  };
8730
8729
  /**
8731
8730
  * オファーカタログ検索
8731
+ * レスポンス最適化(2023-02-28~)
8732
8732
  */
8733
- OfferCatalogService.prototype.search = function (params) {
8733
+ OfferCatalogService.prototype.search = function (params
8734
+ // ): Promise<ISearchResult<factory.offerCatalog.IOfferCatalog[]>> {
8735
+ ) {
8734
8736
  return __awaiter(this, void 0, void 0, function () {
8735
8737
  var _this = this;
8736
8738
  return __generator(this, function (_a) {
@@ -8755,21 +8757,6 @@ var OfferCatalogService = /** @class */ (function (_super) {
8755
8757
  });
8756
8758
  });
8757
8759
  };
8758
- OfferCatalogService.prototype.findById = function (params) {
8759
- return __awaiter(this, void 0, void 0, function () {
8760
- var _this = this;
8761
- return __generator(this, function (_a) {
8762
- return [2 /*return*/, this.fetch({
8763
- uri: "/offerCatalogs/" + encodeURIComponent(String(params.id)),
8764
- method: 'GET',
8765
- expectedStatusCodes: [http_status_1.OK]
8766
- })
8767
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
8768
- return [2 /*return*/, response.json()];
8769
- }); }); })];
8770
- });
8771
- });
8772
- };
8773
8760
  /**
8774
8761
  * オファーカタログ更新
8775
8762
  */
@@ -8829,6 +8816,31 @@ var OfferCatalogService = /** @class */ (function (_super) {
8829
8816
  });
8830
8817
  });
8831
8818
  };
8819
+ OfferCatalogService.prototype.searchItemListElement = function (params) {
8820
+ return __awaiter(this, void 0, void 0, function () {
8821
+ var _this = this;
8822
+ return __generator(this, function (_a) {
8823
+ return [2 /*return*/, this.fetch({
8824
+ uri: "/offerCatalogs/" + encodeURIComponent(String(params.id)) + "/itemListElement",
8825
+ method: 'GET',
8826
+ qs: params,
8827
+ expectedStatusCodes: [http_status_1.OK]
8828
+ })
8829
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
8830
+ var _a;
8831
+ return __generator(this, function (_b) {
8832
+ switch (_b.label) {
8833
+ case 0:
8834
+ _a = {};
8835
+ return [4 /*yield*/, response.json()];
8836
+ case 1: return [2 /*return*/, (_a.data = _b.sent(),
8837
+ _a)];
8838
+ }
8839
+ });
8840
+ }); })];
8841
+ });
8842
+ });
8843
+ };
8832
8844
  return OfferCatalogService;
8833
8845
  }(service_1.Service));
8834
8846
  exports.OfferCatalogService = OfferCatalogService;
@@ -16222,7 +16234,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
16222
16234
  exports.ProductService = void 0;
16223
16235
  var http_status_1 = require("http-status");
16224
16236
  var service_1 = require("../service");
16225
- // export type IProduct = factory.product.IProduct | factory.service.paymentService.IService;
16226
16237
  /**
16227
16238
  * プロダクトサービス
16228
16239
  */
@@ -49,10 +49,6 @@ async function main() {
49
49
  additionalProperty: [],
50
50
  movieTickets: [
51
51
  {
52
- project: {
53
- typeOf: client.factory.organizationType.Project,
54
- id: project.id
55
- },
56
52
  typeOf: paymentMethodType,
57
53
  identifier: 'AA6189998',
58
54
  accessCode: '16931727027',
@@ -50,10 +50,6 @@ async function main() {
50
50
  additionalProperty: [],
51
51
  movieTickets: [
52
52
  {
53
- project: {
54
- typeOf: client.factory.organizationType.Project,
55
- id: project.id
56
- },
57
53
  typeOf: paymentMethodType,
58
54
  identifier: '2343314517',
59
55
  accessCode: '1234',
@@ -343,7 +343,6 @@ async function main() {
343
343
  amount: 0,
344
344
  movieTickets: [{
345
345
  ...movieTicket,
346
- project: transaction.project,
347
346
  serviceOutput: {
348
347
  reservationFor: {
349
348
  typeOf: screeningEvent.typeOf,
@@ -174,7 +174,6 @@ async function main() {
174
174
  amount: 0,
175
175
  movieTickets: [{
176
176
  ...movieTicket,
177
- project: transaction.project,
178
177
  serviceOutput: {
179
178
  reservationFor: {
180
179
  typeOf: client.factory.eventType.ScreeningEvent,
@@ -334,13 +334,6 @@ function authorizeSeatReservationByEvent(params: {
334
334
  const selectedSeatOffers = availableSeatOffers.slice(0, 3);
335
335
  console.log(selectedSeatOffers.length, 'seats selected');
336
336
 
337
- // アドオン選択
338
- let acceptedAddOns: { id: string }[] = [];
339
- if (Array.isArray(selectedTicketOffer.addOn) && selectedTicketOffer.addOn.length > 0) {
340
- acceptedAddOns = [{ id: String(selectedTicketOffer.addOn[0].id) }];
341
- }
342
- console.log('addOn selected.', acceptedAddOns);
343
-
344
337
  await wait(5000);
345
338
  console.log('authorizing seat reservation...');
346
339
  const seatReservationAuth = <IAuthorizeReservationAction>await placeOrderService.authorizeSeatReservation({
@@ -349,7 +342,7 @@ function authorizeSeatReservationByEvent(params: {
349
342
  acceptedOffer: selectedSeatOffers.map((o) => {
350
343
  return {
351
344
  id: String(selectedTicketOffer.id),
352
- addOn: acceptedAddOns,
345
+ addOn: [],
353
346
  itemOffered: {
354
347
  serviceOutput: {
355
348
  typeOf: client.factory.reservationType.EventReservation,
@@ -0,0 +1,66 @@
1
+ // tslint:disable:no-console no-implicit-dependencies no-magic-numbers
2
+ import * as client from '../../../lib/index';
3
+ import { auth } from '../auth/clientCredentials';
4
+
5
+ const project = { id: process.env.PROJECT_ID };
6
+ const EVENT_ID = String(process.env.EVENT_ID);
7
+ const SELLER_ID = String(process.env.SELLER_ID);
8
+
9
+ const eventService = new client.service.Event({
10
+ endpoint: <string>process.env.API_ENDPOINT,
11
+ auth,
12
+ project
13
+ });
14
+
15
+ const productService = new client.service.Product({
16
+ endpoint: <string>process.env.API_ENDPOINT,
17
+ auth,
18
+ project
19
+ });
20
+
21
+ // tslint:disable-next-line:max-func-body-length
22
+ async function main() {
23
+ // 興行オファー検索
24
+ const eventOffers = await eventService.searchTicketOffers({
25
+ limit: 100,
26
+ page: 1,
27
+ event: { id: EVENT_ID }
28
+ });
29
+ console.log(eventOffers.map((o) => {
30
+ return `${(<client.factory.multilingualString>o.name).ja} ${o.addOn?.length}`;
31
+ })
32
+ .join('\n'));
33
+
34
+ console.log(eventOffers.length, '件の興行オファー');
35
+
36
+ const offerWithAddOn = eventOffers.find((offer) => Array.isArray(offer.addOn) && offer.addOn.length > 0);
37
+ if (offerWithAddOn === undefined) {
38
+ console.log('no offerWithAddOn');
39
+ } else {
40
+ const addOns = <client.factory.product.ITicketAddOn[] | client.factory.product.IMinimizedTicketAddOn[]>offerWithAddOn.addOn;
41
+ const addOnIds: string[] = [...new Set(
42
+ addOns.map((
43
+ a: client.factory.product.ITicketAddOn | client.factory.product.IMinimizedTicketAddOn) => String(a.itemOffered.id)
44
+ )
45
+ )];
46
+ console.log(addOnIds.length, '件のアドオンプロダクト');
47
+
48
+ for (const addOnId of addOnIds) {
49
+ // アドオンオファー検索
50
+ const addOnOffers = await productService.searchOffers({
51
+ limit: 100,
52
+ page: 1,
53
+ itemOffered: { id: addOnId },
54
+ seller: { id: SELLER_ID }
55
+ });
56
+ console.log(addOnOffers.map((offer) => `${offer.name.ja}`));
57
+ console.log('アドオン', addOnId, 'に', addOnOffers.length, '件のオファー');
58
+ }
59
+ }
60
+ }
61
+
62
+ main()
63
+ .then(() => {
64
+ console.log('success!');
65
+ })
66
+ .catch(console.error);
@@ -0,0 +1,14 @@
1
+ /**
2
+ * 抽象認証クライアント
3
+ */
4
+ export declare abstract class AuthClient {
5
+ abstract fetch(url: string, options: RequestInit, expectedStatusCodes: number[]): Promise<Response>;
6
+ abstract getAccessToken(): Promise<string>;
7
+ }
8
+ /**
9
+ * テスト認証クライアント
10
+ */
11
+ export declare class StubAuthClient implements AuthClient {
12
+ fetch(url: string, options: RequestInit, expectedStatusCodes: number[]): Promise<Response>;
13
+ getAccessToken(): Promise<string>;
14
+ }
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ 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;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.StubAuthClient = exports.AuthClient = void 0;
40
+ var transporters_1 = require("../transporters");
41
+ /**
42
+ * 抽象認証クライアント
43
+ */
44
+ var AuthClient = /** @class */ (function () {
45
+ function AuthClient() {
46
+ }
47
+ return AuthClient;
48
+ }());
49
+ exports.AuthClient = AuthClient;
50
+ /**
51
+ * テスト認証クライアント
52
+ */
53
+ // tslint:disable-next-line:no-single-line-block-comment
54
+ /* istanbul ignore next */
55
+ var StubAuthClient = /** @class */ (function () {
56
+ function StubAuthClient() {
57
+ }
58
+ // tslint:disable-next-line:prefer-function-over-method
59
+ StubAuthClient.prototype.fetch = function (url, options, expectedStatusCodes) {
60
+ return __awaiter(this, void 0, void 0, function () {
61
+ return __generator(this, function (_a) {
62
+ return [2 /*return*/, (new transporters_1.DefaultTransporter(expectedStatusCodes)).fetch(url, options)];
63
+ });
64
+ });
65
+ };
66
+ // tslint:disable-next-line:prefer-function-over-method
67
+ StubAuthClient.prototype.getAccessToken = function () {
68
+ return __awaiter(this, void 0, void 0, function () {
69
+ return __generator(this, function (_a) {
70
+ return [2 /*return*/, 'access_token'];
71
+ });
72
+ });
73
+ };
74
+ return StubAuthClient;
75
+ }());
76
+ exports.StubAuthClient = StubAuthClient;
@@ -0,0 +1,80 @@
1
+ import * as factory from '../factory';
2
+ import { ISearchResult, Service } from '../service';
3
+ export interface IOpenParams {
4
+ /**
5
+ * プロジェクト
6
+ */
7
+ project: {
8
+ typeOf: factory.organizationType.Project;
9
+ id: string;
10
+ };
11
+ /**
12
+ * 口座種別
13
+ */
14
+ typeOf: factory.accountType.Account;
15
+ /**
16
+ * 通貨
17
+ */
18
+ accountType: string;
19
+ /**
20
+ * 口座番号
21
+ * Pecorinoサービス内(ひとつのPecorinoAPIエンドポイント)でユニークとなるように指定側で管理すること
22
+ * 重複すればステータスコード409が返されます。
23
+ */
24
+ accountNumber: string;
25
+ /**
26
+ * 口座名義
27
+ */
28
+ name: string;
29
+ }
30
+ /**
31
+ * 口座サービス
32
+ */
33
+ export declare class AccountService extends Service {
34
+ /**
35
+ * 注文トークンによる口座開設
36
+ */
37
+ openByToken(params: {
38
+ instrument: {
39
+ /**
40
+ * 注文トークン
41
+ */
42
+ token?: string;
43
+ };
44
+ object: {
45
+ /**
46
+ * 決済方法区分
47
+ */
48
+ typeOf?: string;
49
+ /**
50
+ * 初期金額
51
+ */
52
+ initialBalance?: number;
53
+ };
54
+ }): Promise<void>;
55
+ /**
56
+ * 口座を開設する
57
+ */
58
+ open(params: IOpenParams[]): Promise<factory.account.IAccount | factory.account.IAccount[]>;
59
+ /**
60
+ * 口座編集
61
+ * 名義変更などに使用
62
+ */
63
+ update(params: {
64
+ /**
65
+ * 口座番号
66
+ */
67
+ accountNumber: string;
68
+ /**
69
+ * 口座名義
70
+ */
71
+ name?: string;
72
+ }): Promise<void>;
73
+ /**
74
+ * 口座を解約する
75
+ */
76
+ /**
77
+ * 口座を検索する
78
+ */
79
+ search(params: factory.account.ISearchConditions): Promise<ISearchResult<factory.account.IAccount[]>>;
80
+ }
@@ -0,0 +1,170 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (_) try {
33
+ 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;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ Object.defineProperty(exports, "__esModule", { value: true });
54
+ exports.AccountService = void 0;
55
+ var http_status_1 = require("http-status");
56
+ var service_1 = require("../service");
57
+ /**
58
+ * 口座サービス
59
+ */
60
+ var AccountService = /** @class */ (function (_super) {
61
+ __extends(AccountService, _super);
62
+ function AccountService() {
63
+ return _super !== null && _super.apply(this, arguments) || this;
64
+ }
65
+ /**
66
+ * 注文トークンによる口座開設
67
+ */
68
+ AccountService.prototype.openByToken = function (params) {
69
+ return __awaiter(this, void 0, void 0, function () {
70
+ return __generator(this, function (_a) {
71
+ switch (_a.label) {
72
+ case 0: return [4 /*yield*/, this.fetch({
73
+ uri: '/accounts/openByToken',
74
+ method: 'POST',
75
+ body: params,
76
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
77
+ })];
78
+ case 1:
79
+ _a.sent();
80
+ return [2 /*return*/];
81
+ }
82
+ });
83
+ });
84
+ };
85
+ /**
86
+ * 口座を開設する
87
+ */
88
+ AccountService.prototype.open = function (params) {
89
+ return __awaiter(this, void 0, void 0, function () {
90
+ var _this = this;
91
+ return __generator(this, function (_a) {
92
+ return [2 /*return*/, this.fetch({
93
+ uri: '/accounts',
94
+ method: 'POST',
95
+ body: params,
96
+ expectedStatusCodes: [http_status_1.CREATED]
97
+ })
98
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
99
+ return [2 /*return*/, response.json()];
100
+ }); }); })];
101
+ });
102
+ });
103
+ };
104
+ /**
105
+ * 口座編集
106
+ * 名義変更などに使用
107
+ */
108
+ AccountService.prototype.update = function (params) {
109
+ return __awaiter(this, void 0, void 0, function () {
110
+ return __generator(this, function (_a) {
111
+ switch (_a.label) {
112
+ case 0: return [4 /*yield*/, this.fetch({
113
+ uri: "/accounts/" + params.accountNumber,
114
+ method: 'PUT',
115
+ body: params,
116
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
117
+ })];
118
+ case 1:
119
+ _a.sent();
120
+ return [2 /*return*/];
121
+ }
122
+ });
123
+ });
124
+ };
125
+ /**
126
+ * 口座を解約する
127
+ */
128
+ // public async close(params: {
129
+ // /**
130
+ // * 口座番号
131
+ // */
132
+ // accountNumber: string;
133
+ // }): Promise<void> {
134
+ // await this.fetch({
135
+ // uri: `/accounts/${params.accountNumber}/close`,
136
+ // method: 'PUT',
137
+ // expectedStatusCodes: [NO_CONTENT]
138
+ // });
139
+ // }
140
+ /**
141
+ * 口座を検索する
142
+ */
143
+ AccountService.prototype.search = function (params) {
144
+ return __awaiter(this, void 0, void 0, function () {
145
+ var _this = this;
146
+ return __generator(this, function (_a) {
147
+ return [2 /*return*/, this.fetch({
148
+ uri: '/accounts',
149
+ method: 'GET',
150
+ qs: params,
151
+ expectedStatusCodes: [http_status_1.OK]
152
+ })
153
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
154
+ var _a;
155
+ return __generator(this, function (_b) {
156
+ switch (_b.label) {
157
+ case 0:
158
+ _a = {};
159
+ return [4 /*yield*/, response.json()];
160
+ case 1: return [2 /*return*/, (_a.data = _b.sent(),
161
+ _a)];
162
+ }
163
+ });
164
+ }); })];
165
+ });
166
+ });
167
+ };
168
+ return AccountService;
169
+ }(service_1.Service));
170
+ exports.AccountService = AccountService;
@@ -0,0 +1,79 @@
1
+ import * as factory from '../factory';
2
+ import { Service } from '../service';
3
+ /**
4
+ * 勘定科目サービス
5
+ */
6
+ export declare class AccountTitleService extends Service {
7
+ /**
8
+ * 科目分類作成
9
+ */
10
+ createAccounTitleCategory(params: factory.accountTitle.IAccountTitle): Promise<factory.accountTitle.IAccountTitle>;
11
+ /**
12
+ * 科目分類検索
13
+ */
14
+ searchAccountTitleCategories(params: factory.accountTitle.ISearchConditions): Promise<{
15
+ data: factory.accountTitle.IAccountTitle[];
16
+ }>;
17
+ /**
18
+ * 科目分類更新
19
+ */
20
+ updateAccounTitleCategory(params: factory.accountTitle.IAccountTitle): Promise<void>;
21
+ /**
22
+ * 科目分類削除
23
+ * 不可逆的な物理削除です
24
+ */
25
+ deleteAccounTitleCategory(params: {
26
+ codeValue: string;
27
+ }): Promise<void>;
28
+ /**
29
+ * 科目追加
30
+ */
31
+ createAccounTitleSet(params: factory.accountTitle.IAccountTitle): Promise<factory.accountTitle.IAccountTitle>;
32
+ /**
33
+ * 科目検索
34
+ */
35
+ searchAccountTitleSets(params: factory.accountTitle.ISearchConditions): Promise<{
36
+ data: factory.accountTitle.IAccountTitle[];
37
+ }>;
38
+ /**
39
+ * 科目更新
40
+ */
41
+ updateAccounTitleSet(params: factory.accountTitle.IAccountTitle): Promise<void>;
42
+ /**
43
+ * 科目削除
44
+ * 不可逆的な物理削除です
45
+ */
46
+ deleteAccounTitleSet(params: {
47
+ codeValue: string;
48
+ inCodeSet: {
49
+ codeValue: string;
50
+ };
51
+ }): Promise<void>;
52
+ /**
53
+ * 細目追加
54
+ */
55
+ create(params: factory.accountTitle.IAccountTitle): Promise<factory.accountTitle.IAccountTitle>;
56
+ /**
57
+ * 細目更新
58
+ */
59
+ update(params: factory.accountTitle.IAccountTitle): Promise<void>;
60
+ /**
61
+ * 細目検索
62
+ */
63
+ search(params: factory.accountTitle.ISearchConditions): Promise<{
64
+ data: factory.accountTitle.IAccountTitle[];
65
+ }>;
66
+ /**
67
+ * 細目削除
68
+ * 不可逆的な物理削除です
69
+ */
70
+ deleteByCodeValue(params: {
71
+ codeValue: string;
72
+ inCodeSet: {
73
+ codeValue: string;
74
+ inCodeSet: {
75
+ codeValue: string;
76
+ };
77
+ };
78
+ }): Promise<void>;
79
+ }