@cinerino/sdk 12.3.0-alpha.9 → 12.4.0

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 (32) hide show
  1. package/example/src/chevre/admin/adminProductOffersByIdentifier.ts +86 -0
  2. package/example/src/chevre/default/findProductOffers.ts +43 -0
  3. package/example/src/cloud/admin/adminProductOffersByIdentifier.ts +78 -0
  4. package/example/src/cloud/admin/adminUpsertManyEventsByAdditionalProperty.ts +3 -1
  5. package/example/src/cloud/search/findProductOffers.ts +30 -0
  6. package/example/src/cloud/transaction/processPlaceOrderUsingMemberProgramTier.ts +10 -2
  7. package/lib/abstract/chevre/productOffer.d.ts +33 -0
  8. package/lib/abstract/chevre/productOffer.js +84 -0
  9. package/lib/abstract/chevre.d.ts +9 -0
  10. package/lib/abstract/chevre.js +20 -0
  11. package/lib/abstract/chevreAdmin/noteAboutOrder.js +4 -3
  12. package/lib/abstract/chevreAdmin/productOffer.d.ts +79 -0
  13. package/lib/abstract/{chevreConsole/eventOffer.js → chevreAdmin/productOffer.js} +54 -63
  14. package/lib/abstract/chevreAdmin.d.ts +9 -0
  15. package/lib/abstract/chevreAdmin.js +20 -0
  16. package/lib/abstract/chevreAsset/order/factory.d.ts +5 -2
  17. package/lib/abstract/chevreAsset/order.d.ts +5 -5
  18. package/lib/abstract/chevreConsole.d.ts +0 -9
  19. package/lib/abstract/chevreConsole.js +0 -20
  20. package/lib/abstract/cloud/admin/order.d.ts +2 -2
  21. package/lib/abstract/cloud/admin/productOffer.d.ts +48 -0
  22. package/lib/abstract/cloud/admin/productOffer.js +153 -0
  23. package/lib/abstract/cloud/admin.d.ts +9 -0
  24. package/lib/abstract/cloud/admin.js +20 -0
  25. package/lib/abstract/cloud/asset/order.d.ts +5 -5
  26. package/lib/abstract/cloud/search/productOffer.d.ts +11 -0
  27. package/lib/abstract/cloud/search/productOffer.js +89 -0
  28. package/lib/abstract/cloud/search.d.ts +12 -0
  29. package/lib/abstract/cloud/search.js +23 -0
  30. package/lib/bundle.js +1421 -987
  31. package/package.json +2 -2
  32. package/lib/abstract/chevreConsole/eventOffer.d.ts +0 -32
@@ -50,72 +50,38 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
50
50
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
51
  }
52
52
  };
53
- var __rest = (this && this.__rest) || function (s, e) {
54
- var t = {};
55
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
56
- t[p] = s[p];
57
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
58
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
59
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
60
- t[p[i]] = s[p[i]];
61
- }
62
- return t;
63
- };
64
53
  Object.defineProperty(exports, "__esModule", { value: true });
65
- exports.EventOfferService = void 0;
54
+ exports.ProductOfferService = void 0;
66
55
  var http_status_1 = require("http-status");
67
56
  var service_1 = require("../service");
57
+ var BASE_URI = '/productOffers';
68
58
  /**
69
- * イベントオファーサービス
59
+ * プロダクトオファーサービス
70
60
  */
71
- var EventOfferService = /** @class */ (function (_super) {
72
- __extends(EventOfferService, _super);
73
- function EventOfferService() {
61
+ var ProductOfferService = /** @class */ (function (_super) {
62
+ __extends(ProductOfferService, _super);
63
+ function ProductOfferService() {
74
64
  return _super !== null && _super.apply(this, arguments) || this;
75
65
  }
76
- EventOfferService.prototype.create = function (params) {
77
- return __awaiter(this, void 0, void 0, function () {
78
- var _this = this;
79
- return __generator(this, function (_a) {
80
- return [2 /*return*/, this.fetch({
81
- uri: '/eventOffers',
82
- method: 'POST',
83
- body: params,
84
- expectedStatusCodes: [http_status_1.CREATED]
85
- })
86
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
87
- return [2 /*return*/, response.json()];
88
- }); }); })];
89
- });
90
- });
91
- };
92
- EventOfferService.prototype.projectFields = function (params) {
93
- return __awaiter(this, void 0, void 0, function () {
94
- var _this = this;
95
- return __generator(this, function (_a) {
96
- return [2 /*return*/, this.fetch({
97
- uri: '/eventOffers',
98
- method: 'GET',
99
- qs: params,
100
- expectedStatusCodes: [http_status_1.OK]
101
- })
102
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
103
- return [2 /*return*/, response.json()];
104
- }); }); })];
105
- });
106
- });
107
- };
108
- EventOfferService.prototype.updateById = function (params) {
66
+ /**
67
+ * メンバープログラムティアで有効なプロダクトオファーを追加する
68
+ */
69
+ ProductOfferService.prototype.createValidForMemberTierByIdentifier = function (
70
+ /**
71
+ * max: 20
72
+ */
73
+ params, options) {
109
74
  return __awaiter(this, void 0, void 0, function () {
110
- var id, body;
75
+ var itemOfferedIdentifier, offeredById;
111
76
  return __generator(this, function (_a) {
112
77
  switch (_a.label) {
113
78
  case 0:
114
- id = params.id, body = __rest(params, ["id"]);
79
+ itemOfferedIdentifier = options.itemOfferedIdentifier, offeredById = options.offeredById;
115
80
  return [4 /*yield*/, this.fetch({
116
- uri: "/eventOffers/" + encodeURIComponent(String(id)),
117
- method: 'PUT',
118
- body: body,
81
+ uri: BASE_URI,
82
+ method: 'POST',
83
+ body: params,
84
+ qs: { itemOfferedIdentifier: itemOfferedIdentifier, offeredById: offeredById },
119
85
  expectedStatusCodes: [http_status_1.NO_CONTENT]
120
86
  })];
121
87
  case 1:
@@ -125,16 +91,25 @@ var EventOfferService = /** @class */ (function (_super) {
125
91
  });
126
92
  });
127
93
  };
128
- EventOfferService.prototype.deleteById = function (params) {
94
+ /**
95
+ * メンバープログラムティアで有効なプロダクトオファーを編集する
96
+ */
97
+ ProductOfferService.prototype.updateValidForMemberTierByIdentifier = function (
98
+ /**
99
+ * max: 20
100
+ */
101
+ params, options) {
129
102
  return __awaiter(this, void 0, void 0, function () {
130
- var id;
103
+ var itemOfferedIdentifier, offeredById;
131
104
  return __generator(this, function (_a) {
132
105
  switch (_a.label) {
133
106
  case 0:
134
- id = params.id;
107
+ itemOfferedIdentifier = options.itemOfferedIdentifier, offeredById = options.offeredById;
135
108
  return [4 /*yield*/, this.fetch({
136
- uri: "/eventOffers/" + encodeURIComponent(String(id)),
137
- method: 'DELETE',
109
+ uri: BASE_URI,
110
+ method: 'PUT',
111
+ body: params,
112
+ qs: { itemOfferedIdentifier: itemOfferedIdentifier, offeredById: offeredById },
138
113
  expectedStatusCodes: [http_status_1.NO_CONTENT]
139
114
  })];
140
115
  case 1:
@@ -144,17 +119,33 @@ var EventOfferService = /** @class */ (function (_super) {
144
119
  });
145
120
  });
146
121
  };
122
+ ProductOfferService.prototype.findProductOffers = function (params) {
123
+ return __awaiter(this, void 0, void 0, function () {
124
+ var _this = this;
125
+ return __generator(this, function (_a) {
126
+ return [2 /*return*/, this.fetch({
127
+ uri: BASE_URI,
128
+ method: 'GET',
129
+ qs: params,
130
+ expectedStatusCodes: [http_status_1.OK]
131
+ })
132
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
133
+ return [2 /*return*/, response.json()];
134
+ }); }); })];
135
+ });
136
+ });
137
+ };
147
138
  /**
148
139
  * 有効なメンバーティアトークンを発行する(開発使用目的)
149
140
  */
150
- EventOfferService.prototype.publichMemberTierToken = function (params) {
141
+ ProductOfferService.prototype.publishMemberTierToken = function (params) {
151
142
  return __awaiter(this, void 0, void 0, function () {
152
143
  var id;
153
144
  var _this = this;
154
145
  return __generator(this, function (_a) {
155
146
  id = params.id;
156
147
  return [2 /*return*/, this.fetch({
157
- uri: "/eventOffers/" + encodeURIComponent(String(id)) + "/tokens",
148
+ uri: BASE_URI + "/" + encodeURIComponent(String(id)) + "/tokens",
158
149
  method: 'POST',
159
150
  expectedStatusCodes: [http_status_1.CREATED]
160
151
  })
@@ -164,6 +155,6 @@ var EventOfferService = /** @class */ (function (_super) {
164
155
  });
165
156
  });
166
157
  };
167
- return EventOfferService;
158
+ return ProductOfferService;
168
159
  }(service_1.Service));
169
- exports.EventOfferService = EventOfferService;
160
+ exports.ProductOfferService = ProductOfferService;
@@ -14,6 +14,7 @@ import type { OfferCatalogService } from './chevreAdmin/offerCatalog';
14
14
  import type { OfferCatalogItemService } from './chevreAdmin/offerCatalogItem';
15
15
  import type { OrderService } from './chevreAdmin/order';
16
16
  import type { ProductService } from './chevreAdmin/product';
17
+ import type { ProductOfferService } from './chevreAdmin/productOffer';
17
18
  import type { ReservationService } from './chevreAdmin/reservation';
18
19
  import type { SellerService } from './chevreAdmin/seller';
19
20
  export declare namespace service {
@@ -95,6 +96,13 @@ export declare namespace service {
95
96
  namespace Product {
96
97
  let svc: typeof ProductService | undefined;
97
98
  }
99
+ /**
100
+ * プロダクトオファーサービス
101
+ */
102
+ type ProductOffer = ProductOfferService;
103
+ namespace ProductOffer {
104
+ let svc: typeof ProductOfferService | undefined;
105
+ }
98
106
  /**
99
107
  * 予約サービス
100
108
  */
@@ -157,6 +165,7 @@ export declare class ChevreAdmin {
157
165
  createNoteAboutOrderInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<NoteAboutOrderService>;
158
166
  createOrderInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<OrderService>;
159
167
  createProductInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<ProductService>;
168
+ createProductOfferInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<ProductOfferService>;
160
169
  createReservationInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<ReservationService>;
161
170
  createSellerInstance(params: Pick<IOptions, 'project'>): Promise<SellerService>;
162
171
  createOfferInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<OfferService>;
@@ -83,6 +83,9 @@ var service;
83
83
  var Product;
84
84
  (function (Product) {
85
85
  })(Product = service.Product || (service.Product = {}));
86
+ var ProductOffer;
87
+ (function (ProductOffer) {
88
+ })(ProductOffer = service.ProductOffer || (service.ProductOffer = {}));
86
89
  var Reservation;
87
90
  (function (Reservation) {
88
91
  })(Reservation = service.Reservation || (service.Reservation = {}));
@@ -299,6 +302,23 @@ var ChevreAdmin = /** @class */ (function () {
299
302
  });
300
303
  });
301
304
  };
305
+ ChevreAdmin.prototype.createProductOfferInstance = function (params) {
306
+ return __awaiter(this, void 0, void 0, function () {
307
+ var _a;
308
+ return __generator(this, function (_b) {
309
+ switch (_b.label) {
310
+ case 0:
311
+ if (!(service.ProductOffer.svc === undefined)) return [3 /*break*/, 2];
312
+ _a = service.ProductOffer;
313
+ return [4 /*yield*/, Promise.resolve().then(function () { return require('./chevreAdmin/productOffer'); })];
314
+ case 1:
315
+ _a.svc = (_b.sent()).ProductOfferService;
316
+ _b.label = 2;
317
+ case 2: return [2 /*return*/, new service.ProductOffer.svc(__assign(__assign(__assign({}, this.options), params), { retryableStatusCodes: [] }))];
318
+ }
319
+ });
320
+ });
321
+ };
302
322
  ChevreAdmin.prototype.createReservationInstance = function (params) {
303
323
  return __awaiter(this, void 0, void 0, function () {
304
324
  var _a;
@@ -19,5 +19,8 @@ export declare type IAcceptedOffer = factory.order.IAcceptedOffer<factory.order.
19
19
  /**
20
20
  * 確認番号による照会結果としての注文
21
21
  */
22
- export declare type IOrderAsFindByConfirmationNumberResult = Pick<factory.order.IOrder, 'confirmationNumber' | 'customer' | 'dateReturned' | 'orderDate' | 'orderNumber' | 'orderStatus' | 'orderedItem' | 'paymentMethods' | 'price' | 'priceCurrency' | 'seller' | 'project' | 'typeOf'> & {};
23
- export declare type IOptimizedOrder = IOrderAsFindByConfirmationNumberResult;
22
+ export declare type IOrderAsFindByConfirmationNumberResult = Pick<factory.order.IOrder, 'confirmationNumber' | 'dateReturned' | 'orderDate' | 'orderNumber' | 'orderStatus' | 'orderedItem' | 'paymentMethods' | 'price' | 'priceCurrency' | 'seller' | 'project' | 'typeOf'> & {
23
+ customer: {
24
+ id: string;
25
+ };
26
+ };
@@ -1,4 +1,4 @@
1
- import { IAcceptedOffer, IAuthorizeResult, IOptimizedOrder } from './order/factory';
1
+ import { IAcceptedOffer, IAuthorizeResult, IOrderAsFindByConfirmationNumberResult } from './order/factory';
2
2
  import { Service } from '../service';
3
3
  /**
4
4
  * 注文サービス
@@ -30,7 +30,7 @@ export declare class OrderService extends Service {
30
30
  orderDateFrom?: Date;
31
31
  orderDateThrough?: Date;
32
32
  orderNumber?: string;
33
- }): Promise<IOptimizedOrder[]>;
33
+ }): Promise<IOrderAsFindByConfirmationNumberResult[]>;
34
34
  /**
35
35
  * イベントIDと確認番号で検索
36
36
  */
@@ -50,7 +50,7 @@ export declare class OrderService extends Service {
50
50
  $in: string[];
51
51
  };
52
52
  };
53
- }): Promise<IOptimizedOrder[]>;
53
+ }): Promise<IOrderAsFindByConfirmationNumberResult[]>;
54
54
  /**
55
55
  * 予約番号と電話番号で注文情報を取得する(sskts専用)
56
56
  */
@@ -58,7 +58,7 @@ export declare class OrderService extends Service {
58
58
  theaterCode: string;
59
59
  confirmationNumber: string;
60
60
  telephone: string;
61
- }): Promise<IOptimizedOrder[]>;
61
+ }): Promise<IOrderAsFindByConfirmationNumberResult[]>;
62
62
  /**
63
63
  * 注文番号と何かしらで注文照会
64
64
  */
@@ -67,7 +67,7 @@ export declare class OrderService extends Service {
67
67
  customer?: {
68
68
  telephone?: string;
69
69
  };
70
- }): Promise<IOptimizedOrder>;
70
+ }): Promise<IOrderAsFindByConfirmationNumberResult>;
71
71
  /**
72
72
  * 注文配送
73
73
  */
@@ -22,7 +22,6 @@ import type { CustomerService } from './chevreConsole/customer';
22
22
  import type { CustomerTypeService } from './chevreConsole/customerType';
23
23
  import type { EmailMessageService } from './chevreConsole/emailMessage';
24
24
  import type { EventService } from './chevreConsole/event';
25
- import type { EventOfferService } from './chevreConsole/eventOffer';
26
25
  import type { EventSeriesService } from './chevreConsole/eventSeries';
27
26
  import type { HasMerchantReturnPolicyService } from './chevreConsole/hasMerchantReturnPolicy';
28
27
  import type { IAMService } from './chevreConsole/iam';
@@ -196,13 +195,6 @@ export declare namespace service {
196
195
  namespace Event {
197
196
  let svc: typeof EventService | undefined;
198
197
  }
199
- /**
200
- * イベントオファーサービス
201
- */
202
- type EventOffer = EventOfferService;
203
- namespace EventOffer {
204
- let svc: typeof EventOfferService | undefined;
205
- }
206
198
  /**
207
199
  * 施設コンテンツサービス
208
200
  */
@@ -589,7 +581,6 @@ export declare class ChevreConsole {
589
581
  createCustomerTypeInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<CustomerTypeService>;
590
582
  createEmailMessageInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<EmailMessageService>;
591
583
  createEventInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<EventService>;
592
- createEventOfferInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<EventOfferService>;
593
584
  createEventSeriesInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<EventSeriesService>;
594
585
  createHasMerchantReturnPolicyInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<HasMerchantReturnPolicyService>;
595
586
  createIAMInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<IAMService>;
@@ -104,9 +104,6 @@ var service;
104
104
  var Event;
105
105
  (function (Event) {
106
106
  })(Event = service.Event || (service.Event = {}));
107
- var EventOffer;
108
- (function (EventOffer) {
109
- })(EventOffer = service.EventOffer || (service.EventOffer = {}));
110
107
  var EventSeries;
111
108
  (function (EventSeries) {
112
109
  })(EventSeries = service.EventSeries || (service.EventSeries = {}));
@@ -588,23 +585,6 @@ var ChevreConsole = /** @class */ (function () {
588
585
  });
589
586
  });
590
587
  };
591
- ChevreConsole.prototype.createEventOfferInstance = function (params) {
592
- return __awaiter(this, void 0, void 0, function () {
593
- var _a;
594
- return __generator(this, function (_b) {
595
- switch (_b.label) {
596
- case 0:
597
- if (!(service.EventOffer.svc === undefined)) return [3 /*break*/, 2];
598
- _a = service.EventOffer;
599
- return [4 /*yield*/, Promise.resolve().then(function () { return require('./chevreConsole/eventOffer'); })];
600
- case 1:
601
- _a.svc = (_b.sent()).EventOfferService;
602
- _b.label = 2;
603
- case 2: return [2 /*return*/, new service.EventOffer.svc(__assign(__assign(__assign({}, this.options), params), { retryableStatusCodes: [] }))];
604
- }
605
- });
606
- });
607
- };
608
588
  ChevreConsole.prototype.createEventSeriesInstance = function (params) {
609
589
  return __awaiter(this, void 0, void 0, function () {
610
590
  var _a;
@@ -1,6 +1,6 @@
1
1
  import * as factory from '../../factory';
2
2
  import { ISearchResult, Service } from '../../service';
3
- import { IAcceptedOffer, IOptimizedOrder, ISearchOrdersOptions } from '../../chevreAsset/order/factory';
3
+ import { IAcceptedOffer, IOrderAsFindByConfirmationNumberResult, ISearchOrdersOptions } from '../../chevreAsset/order/factory';
4
4
  import { IOrderAsSearchResult, IOrderAsSearchWithUnwindAcceptedOffersResult, IReturner, IUpdateChangeableAttributesParams } from '../../chevreConsole/order/factory';
5
5
  /**
6
6
  * 注文サービス
@@ -14,7 +14,7 @@ export declare class OrderService extends Service {
14
14
  * 注文番号
15
15
  */
16
16
  orderNumber: string;
17
- }): Promise<IOptimizedOrder>;
17
+ }): Promise<IOrderAsFindByConfirmationNumberResult>;
18
18
  /**
19
19
  * 注文を検索する
20
20
  */
@@ -0,0 +1,48 @@
1
+ import { IFindParams } from '../../chevreAdmin/productOffer';
2
+ import * as factory from '../../factory';
3
+ import { Service } from '../../service';
4
+ /**
5
+ * プロダクトサービス
6
+ */
7
+ export declare class ProductOfferService extends Service {
8
+ /**
9
+ * メンバープログラムティアで有効なプロダクトオファーを追加する
10
+ */
11
+ createValidForMemberTierByIdentifier(
12
+ /**
13
+ * max: 20
14
+ */
15
+ params: factory.productOffer.IAddValidForMemberTierParams[], options: {
16
+ /**
17
+ * プロダクトオファーコレクションコード
18
+ */
19
+ itemOfferedIdentifier: string;
20
+ /**
21
+ * オファー提供販売者ID
22
+ */
23
+ offeredById: string;
24
+ }): Promise<void>;
25
+ /**
26
+ * メンバープログラムティアで有効なプロダクトオファーを編集する
27
+ */
28
+ updateValidForMemberTierByIdentifier(
29
+ /**
30
+ * max: 20
31
+ */
32
+ params: factory.productOffer.IAddValidForMemberTierParams[], options: {
33
+ /**
34
+ * プロダクトオファーコレクションコード
35
+ */
36
+ itemOfferedIdentifier: string;
37
+ /**
38
+ * オファー提供販売者ID
39
+ */
40
+ offeredById: string;
41
+ }): Promise<void>;
42
+ /**
43
+ * プロダクトオファーを検索する
44
+ */
45
+ findProductOffers(params: IFindParams): Promise<(Omit<factory.productOffer.IProductOffer, 'project'> & {
46
+ id: string;
47
+ })[]>;
48
+ }
@@ -0,0 +1,153 @@
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.ProductOfferService = void 0;
55
+ var index_1 = require("../../index");
56
+ var service_1 = require("../../service");
57
+ /**
58
+ * プロダクトサービス
59
+ */
60
+ var ProductOfferService = /** @class */ (function (_super) {
61
+ __extends(ProductOfferService, _super);
62
+ function ProductOfferService() {
63
+ return _super !== null && _super.apply(this, arguments) || this;
64
+ }
65
+ /**
66
+ * メンバープログラムティアで有効なプロダクトオファーを追加する
67
+ */
68
+ ProductOfferService.prototype.createValidForMemberTierByIdentifier = function (
69
+ /**
70
+ * max: 20
71
+ */
72
+ params, options) {
73
+ return __awaiter(this, void 0, void 0, function () {
74
+ var _a, auth, endpoint, project, seller, chevreAdmin, productOfferService;
75
+ return __generator(this, function (_b) {
76
+ switch (_b.label) {
77
+ case 0:
78
+ _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller;
79
+ return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint })];
80
+ case 1:
81
+ chevreAdmin = _b.sent();
82
+ return [4 /*yield*/, chevreAdmin.createProductOfferInstance({
83
+ project: project,
84
+ seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
85
+ })];
86
+ case 2:
87
+ productOfferService = _b.sent();
88
+ return [4 /*yield*/, productOfferService.createValidForMemberTierByIdentifier(params, options)];
89
+ case 3:
90
+ _b.sent();
91
+ return [2 /*return*/];
92
+ }
93
+ });
94
+ });
95
+ };
96
+ /**
97
+ * メンバープログラムティアで有効なプロダクトオファーを編集する
98
+ */
99
+ ProductOfferService.prototype.updateValidForMemberTierByIdentifier = function (
100
+ /**
101
+ * max: 20
102
+ */
103
+ params, options) {
104
+ return __awaiter(this, void 0, void 0, function () {
105
+ var _a, auth, endpoint, project, seller, chevreAdmin, productOfferService;
106
+ return __generator(this, function (_b) {
107
+ switch (_b.label) {
108
+ case 0:
109
+ _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller;
110
+ return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint })];
111
+ case 1:
112
+ chevreAdmin = _b.sent();
113
+ return [4 /*yield*/, chevreAdmin.createProductOfferInstance({
114
+ project: project,
115
+ seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
116
+ })];
117
+ case 2:
118
+ productOfferService = _b.sent();
119
+ return [4 /*yield*/, productOfferService.updateValidForMemberTierByIdentifier(params, options)];
120
+ case 3:
121
+ _b.sent();
122
+ return [2 /*return*/];
123
+ }
124
+ });
125
+ });
126
+ };
127
+ /**
128
+ * プロダクトオファーを検索する
129
+ */
130
+ ProductOfferService.prototype.findProductOffers = function (params) {
131
+ return __awaiter(this, void 0, void 0, function () {
132
+ var _a, auth, endpoint, project, seller, chevreAdmin, productOfferService;
133
+ return __generator(this, function (_b) {
134
+ switch (_b.label) {
135
+ case 0:
136
+ _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller;
137
+ return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint })];
138
+ case 1:
139
+ chevreAdmin = _b.sent();
140
+ return [4 /*yield*/, chevreAdmin.createProductOfferInstance({
141
+ project: project,
142
+ seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
143
+ })];
144
+ case 2:
145
+ productOfferService = _b.sent();
146
+ return [2 /*return*/, productOfferService.findProductOffers(params)];
147
+ }
148
+ });
149
+ });
150
+ };
151
+ return ProductOfferService;
152
+ }(service_1.Service));
153
+ exports.ProductOfferService = ProductOfferService;
@@ -9,6 +9,7 @@ import type { OfferCatalogService } from './admin/offerCatalog';
9
9
  import type { OfferCatalogItemService } from './admin/offerCatalogItem';
10
10
  import type { OrderService } from './admin/order';
11
11
  import type { ProductService } from './admin/product';
12
+ import type { ProductOfferService } from './admin/productOffer';
12
13
  import type { ReservationService } from './admin/reservation';
13
14
  import type { SellerService } from './admin/seller';
14
15
  export declare namespace service {
@@ -83,6 +84,13 @@ export declare namespace service {
83
84
  namespace Product {
84
85
  let svc: typeof ProductService | undefined;
85
86
  }
87
+ /**
88
+ * プロダクトオファーサービス
89
+ */
90
+ type ProductOffer = ProductOfferService;
91
+ namespace ProductOffer {
92
+ let svc: typeof ProductOfferService | undefined;
93
+ }
86
94
  /**
87
95
  * 予約サービス
88
96
  */
@@ -114,6 +122,7 @@ export declare class CloudAdmin {
114
122
  createOfferCatalogItemInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<OfferCatalogItemService>;
115
123
  createOrderInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<OrderService>;
116
124
  createProductInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<ProductService>;
125
+ createProductOfferInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<ProductOfferService>;
117
126
  createReservationInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<ReservationService>;
118
127
  createSellerInstance(params: Pick<IOptions, 'project'>): Promise<SellerService>;
119
128
  }
@@ -80,6 +80,9 @@ var service;
80
80
  var Product;
81
81
  (function (Product) {
82
82
  })(Product = service.Product || (service.Product = {}));
83
+ var ProductOffer;
84
+ (function (ProductOffer) {
85
+ })(ProductOffer = service.ProductOffer || (service.ProductOffer = {}));
83
86
  var Reservation;
84
87
  (function (Reservation) {
85
88
  })(Reservation = service.Reservation || (service.Reservation = {}));
@@ -272,6 +275,23 @@ var CloudAdmin = /** @class */ (function () {
272
275
  });
273
276
  });
274
277
  };
278
+ CloudAdmin.prototype.createProductOfferInstance = function (params) {
279
+ return __awaiter(this, void 0, void 0, function () {
280
+ var _a;
281
+ return __generator(this, function (_b) {
282
+ switch (_b.label) {
283
+ case 0:
284
+ if (!(service.ProductOffer.svc === undefined)) return [3 /*break*/, 2];
285
+ _a = service.ProductOffer;
286
+ return [4 /*yield*/, Promise.resolve().then(function () { return require('./admin/productOffer'); })];
287
+ case 1:
288
+ _a.svc = (_b.sent()).ProductOfferService;
289
+ _b.label = 2;
290
+ case 2: return [2 /*return*/, new service.ProductOffer.svc(__assign(__assign(__assign({}, this.options), params), { retryableStatusCodes: defaultRetryableStatusCodes }))];
291
+ }
292
+ });
293
+ });
294
+ };
275
295
  CloudAdmin.prototype.createReservationInstance = function (params) {
276
296
  return __awaiter(this, void 0, void 0, function () {
277
297
  var _a;