@cinerino/sdk 10.1.0 → 10.2.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.
@@ -11645,6 +11645,11 @@ exports.OrderService = void 0;
11645
11645
  var http_status_1 = require("http-status");
11646
11646
  var factory = require("../factory");
11647
11647
  var service_1 = require("../service");
11648
+ // type IKeyOfProjection = keyof factory.order.IOrder | '_id';
11649
+ // type IProjection = { [key in IKeyOfProjection]?: 0; };
11650
+ // interface IProjectionSearchConditions {
11651
+ // $projection?: IProjection;
11652
+ // }
11648
11653
  /**
11649
11654
  * 注文サービス
11650
11655
  */
@@ -11658,14 +11663,17 @@ var OrderService = /** @class */ (function (_super) {
11658
11663
  */
11659
11664
  OrderService.prototype.createIfNotExist = function (params) {
11660
11665
  return __awaiter(this, void 0, void 0, function () {
11666
+ var confirmationNumber, orderNumber;
11661
11667
  return __generator(this, function (_a) {
11662
11668
  switch (_a.label) {
11663
- case 0: return [4 /*yield*/, this.fetch({
11664
- uri: "/orders/" + params.orderNumber,
11665
- method: 'PUT',
11666
- body: params,
11667
- expectedStatusCodes: [http_status_1.NO_CONTENT]
11668
- })];
11669
+ case 0:
11670
+ confirmationNumber = params.confirmationNumber, orderNumber = params.orderNumber;
11671
+ return [4 /*yield*/, this.fetch({
11672
+ uri: "/orders/" + params.orderNumber,
11673
+ method: 'PUT',
11674
+ body: { confirmationNumber: confirmationNumber, orderNumber: orderNumber },
11675
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
11676
+ })];
11669
11677
  case 1:
11670
11678
  _a.sent();
11671
11679
  return [2 /*return*/];
@@ -11677,7 +11685,9 @@ var OrderService = /** @class */ (function (_super) {
11677
11685
  * 確認番号で検索
11678
11686
  * 確認番号と購入者情報で注文を検索します
11679
11687
  */
11680
- OrderService.prototype.findByConfirmationNumber = function (params) {
11688
+ OrderService.prototype.findByConfirmationNumber = function (params
11689
+ // & IProjectionSearchConditions // discontinue(2024-07-24~)
11690
+ ) {
11681
11691
  return __awaiter(this, void 0, void 0, function () {
11682
11692
  var _this = this;
11683
11693
  return __generator(this, function (_a) {
@@ -11696,7 +11706,9 @@ var OrderService = /** @class */ (function (_super) {
11696
11706
  /**
11697
11707
  * イベントIDと確認番号で検索
11698
11708
  */
11699
- OrderService.prototype.findByEventAndConfirmationNumber = function (params) {
11709
+ OrderService.prototype.findByEventAndConfirmationNumber = function (params
11710
+ // & IProjectionSearchConditions // discontinue(2024-07-24~)
11711
+ ) {
11700
11712
  return __awaiter(this, void 0, void 0, function () {
11701
11713
  var _this = this;
11702
11714
  return __generator(this, function (_a) {
@@ -11715,7 +11727,9 @@ var OrderService = /** @class */ (function (_super) {
11715
11727
  /**
11716
11728
  * 予約番号と電話番号で注文情報を取得する(sskts専用)
11717
11729
  */
11718
- OrderService.prototype.findByOrderInquiryKey4sskts = function (params) {
11730
+ OrderService.prototype.findByOrderInquiryKey4sskts = function (params
11731
+ // & IProjectionSearchConditions // discontinue(2024-07-24~)
11732
+ ) {
11719
11733
  return __awaiter(this, void 0, void 0, function () {
11720
11734
  var _this = this;
11721
11735
  return __generator(this, function (_a) {
@@ -11734,7 +11748,9 @@ var OrderService = /** @class */ (function (_super) {
11734
11748
  /**
11735
11749
  * 注文番号と何かしらで注文照会
11736
11750
  */
11737
- OrderService.prototype.findOneByOrderNumberAndSomething = function (params) {
11751
+ OrderService.prototype.findOneByOrderNumberAndSomething = function (params
11752
+ // & IProjectionSearchConditions // discontinue(2024-07-24~)
11753
+ ) {
11738
11754
  return __awaiter(this, void 0, void 0, function () {
11739
11755
  var _this = this;
11740
11756
  return __generator(this, function (_a) {
@@ -12017,17 +12033,15 @@ var PersonService = /** @class */ (function (_super) {
12017
12033
  /**
12018
12034
  * プロフィール検索
12019
12035
  */
12020
- PersonService.prototype.getProfile = function (params) {
12036
+ PersonService.prototype.getProfile = function () {
12021
12037
  return __awaiter(this, void 0, void 0, function () {
12022
- var id;
12023
12038
  var _this = this;
12024
12039
  return __generator(this, function (_a) {
12025
- id = (typeof params.id === 'string') ? params.id : 'me';
12026
12040
  return [2 /*return*/, this.fetch({
12027
- uri: "/people/" + id + "/profile",
12041
+ uri: '/people/me/profile',
12028
12042
  method: 'GET',
12029
- expectedStatusCodes: [http_status_1.OK],
12030
- qs: { iss: params.iss }
12043
+ expectedStatusCodes: [http_status_1.OK]
12044
+ // qs: { iss: params.iss }
12031
12045
  })
12032
12046
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
12033
12047
  return [2 /*return*/, response.json()];
@@ -12040,18 +12054,15 @@ var PersonService = /** @class */ (function (_super) {
12040
12054
  */
12041
12055
  PersonService.prototype.updateProfile = function (params) {
12042
12056
  return __awaiter(this, void 0, void 0, function () {
12043
- var id;
12044
12057
  return __generator(this, function (_a) {
12045
12058
  switch (_a.label) {
12046
- case 0:
12047
- id = (typeof params.id === 'string') ? params.id : 'me';
12048
- return [4 /*yield*/, this.fetch({
12049
- uri: "/people/" + id + "/profile",
12050
- method: 'PATCH',
12051
- body: params,
12052
- expectedStatusCodes: [http_status_1.NO_CONTENT],
12053
- qs: { iss: params.iss }
12054
- })];
12059
+ case 0: return [4 /*yield*/, this.fetch({
12060
+ uri: '/people/me/profile',
12061
+ method: 'PATCH',
12062
+ body: params,
12063
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
12064
+ // qs: { iss: params.iss }
12065
+ })];
12055
12066
  case 1:
12056
12067
  _a.sent();
12057
12068
  return [2 /*return*/];
@@ -12064,12 +12075,10 @@ var PersonService = /** @class */ (function (_super) {
12064
12075
  */
12065
12076
  PersonService.prototype.searchOrders = function (params) {
12066
12077
  return __awaiter(this, void 0, void 0, function () {
12067
- var id;
12068
12078
  var _this = this;
12069
12079
  return __generator(this, function (_a) {
12070
- id = (typeof params.id === 'string') ? params.id : 'me';
12071
12080
  return [2 /*return*/, this.fetch({
12072
- uri: "/people/" + id + "/orders",
12081
+ uri: '/people/me/orders',
12073
12082
  method: 'GET',
12074
12083
  qs: params,
12075
12084
  expectedStatusCodes: [http_status_1.OK]
@@ -12092,17 +12101,15 @@ var PersonService = /** @class */ (function (_super) {
12092
12101
  /**
12093
12102
  * ユーザー取得
12094
12103
  */
12095
- PersonService.prototype.findById = function (params) {
12104
+ PersonService.prototype.findById = function () {
12096
12105
  return __awaiter(this, void 0, void 0, function () {
12097
- var id;
12098
12106
  var _this = this;
12099
12107
  return __generator(this, function (_a) {
12100
- id = (typeof params.id === 'string') ? params.id : 'me';
12101
12108
  return [2 /*return*/, this.fetch({
12102
- uri: "/people/" + id,
12109
+ uri: '/people/me',
12103
12110
  method: 'GET',
12104
- expectedStatusCodes: [http_status_1.OK],
12105
- qs: { iss: params.iss }
12111
+ expectedStatusCodes: [http_status_1.OK]
12112
+ // qs: { iss: params.iss }
12106
12113
  })
12107
12114
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
12108
12115
  return [2 /*return*/, response.json()];
@@ -12115,18 +12122,15 @@ var PersonService = /** @class */ (function (_super) {
12115
12122
  */
12116
12123
  PersonService.prototype.deleteById = function (params) {
12117
12124
  return __awaiter(this, void 0, void 0, function () {
12118
- var id;
12119
12125
  return __generator(this, function (_a) {
12120
12126
  switch (_a.label) {
12121
- case 0:
12122
- id = (typeof params.id === 'string') ? params.id : 'me';
12123
- return [4 /*yield*/, this.fetch({
12124
- uri: "/people/" + id,
12125
- method: 'DELETE',
12126
- body: params,
12127
- expectedStatusCodes: [http_status_1.NO_CONTENT],
12128
- qs: { iss: params.iss }
12129
- })];
12127
+ case 0: return [4 /*yield*/, this.fetch({
12128
+ uri: '/people/me',
12129
+ method: 'DELETE',
12130
+ body: params,
12131
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
12132
+ // qs: { iss: params.iss }
12133
+ })];
12130
12134
  case 1:
12131
12135
  _a.sent();
12132
12136
  return [2 /*return*/];
@@ -14514,18 +14518,9 @@ var EventService = /** @class */ (function (_super) {
14514
14518
  qs: query,
14515
14519
  expectedStatusCodes: [http_status_1.OK]
14516
14520
  })
14517
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
14518
- var _a;
14519
- return __generator(this, function (_b) {
14520
- switch (_b.label) {
14521
- case 0:
14522
- _a = {};
14523
- return [4 /*yield*/, response.json()];
14524
- case 1: return [2 /*return*/, (_a.data = _b.sent(),
14525
- _a)];
14526
- }
14527
- });
14528
- }); })];
14521
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
14522
+ return [2 /*return*/, response.json()];
14523
+ }); }); })];
14529
14524
  });
14530
14525
  });
14531
14526
  };
@@ -15317,20 +15312,14 @@ var ServiceFactory = require("../service");
15317
15312
  // import * as OrderServiceFactory from '../chevreAsset/order/factory';
15318
15313
  var categoryCode_1 = require("./service/categoryCode");
15319
15314
  var creativeWork_1 = require("./service/creativeWork");
15320
- // import { DeliveryService } from './service/delivery';
15321
15315
  var emailMessage_1 = require("./service/emailMessage");
15322
15316
  var event_1 = require("./service/event");
15323
- // import { OrderService } from './service/order';
15324
- // import { PersonService } from './service/person';
15325
- // import { PersonOwnershipInfoService } from './service/person/ownershipInfo';
15326
15317
  var place_1 = require("./service/place");
15327
15318
  var hasPOS_1 = require("./service/place/hasPOS");
15328
15319
  var product_1 = require("./service/product");
15329
- // import { ReservationService } from './service/reservation';
15330
15320
  var seller_1 = require("./service/seller");
15331
- // import { TokenService } from './service/token';
15332
15321
  /**
15333
- * サービスモジュール
15322
+ * パブリックリソースサービス群
15334
15323
  */
15335
15324
  var service;
15336
15325
  (function (service) {
@@ -15436,19 +15425,6 @@ var service;
15436
15425
  return Seller;
15437
15426
  }(seller_1.SellerService));
15438
15427
  service.Seller = Seller;
15439
- // export namespace order {
15440
- // // tslint:disable-next-line:no-shadowed-variable
15441
- // export import factory = OrderServiceFactory;
15442
- // }
15443
- // export class Person extends PersonService { }
15444
- // export namespace person {
15445
- // // tslint:disable-next-line:no-shadowed-variable
15446
- // export class OwnershipInfo extends PersonOwnershipInfoService { }
15447
- // }
15448
- // export class Delivery extends DeliveryService { }
15449
- // export class Order extends OrderService { }
15450
- // export class Reservation extends ReservationService { }
15451
- // export class Token extends TokenService { }
15452
15428
  })(service = exports.service || (exports.service = {}));
15453
15429
 
15454
15430
  },{"../service":138,"./service/categoryCode":95,"./service/creativeWork":96,"./service/emailMessage":97,"./service/event":98,"./service/place":99,"./service/place/hasPOS":100,"./service/product":101,"./service/seller":102}],95:[function(require,module,exports){
@@ -15937,7 +15913,7 @@ var EventService = /** @class */ (function (_super) {
15937
15913
  return __generator(this, function (_a) {
15938
15914
  event = params.event, query = __rest(params, ["event"]);
15939
15915
  return [2 /*return*/, this.fetch({
15940
- uri: "/events/" + params.event.id + "/seats",
15916
+ uri: "/events/" + event.id + "/seats",
15941
15917
  method: 'GET',
15942
15918
  qs: query,
15943
15919
  expectedStatusCodes: [http_status_1.OK]
@@ -18355,23 +18331,23 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
18355
18331
  }
18356
18332
  };
18357
18333
  Object.defineProperty(exports, "__esModule", { value: true });
18358
- exports.OrderService = exports.DEFAULT_PROJECTION = void 0;
18334
+ exports.OrderService = void 0;
18359
18335
  var factory = require("../../factory");
18360
18336
  var index_1 = require("../../index");
18361
18337
  var service_1 = require("../../service");
18362
- exports.DEFAULT_PROJECTION = {
18363
- // _id: 0, // IDを使用(2023-02-14~)
18364
- acceptedOffers: 0,
18365
- discounts: 0,
18366
- identifier: 0,
18367
- isGift: 0,
18368
- 'paymentMethods.issuedThrough.serviceOutput': 0,
18369
- returner: 0,
18370
- // 'seller.telephone': 0, // ドキュメントからunset済なので不要(2024-03-14~)
18371
- // 'seller.url': 0, // ドキュメントからunset済なので不要(2024-03-14~)
18372
- url: 0,
18373
- additionalProperty: 0
18374
- };
18338
+ // export const DEFAULT_PROJECTION: { [key: string]: 0 } = {
18339
+ // // _id: 0, // IDを使用(2023-02-14~)
18340
+ // acceptedOffers: 0,
18341
+ // discounts: 0,
18342
+ // identifier: 0,
18343
+ // isGift: 0,
18344
+ // 'paymentMethods.issuedThrough.serviceOutput': 0,
18345
+ // returner: 0,
18346
+ // // 'seller.telephone': 0, // ドキュメントからunset済なので不要(2024-03-14~)
18347
+ // // 'seller.url': 0, // ドキュメントからunset済なので不要(2024-03-14~)
18348
+ // url: 0,
18349
+ // additionalProperty: 0
18350
+ // };
18375
18351
  var MAX_SEARCH_LIMIT = 20;
18376
18352
  /**
18377
18353
  * 注文サービス
@@ -18401,7 +18377,7 @@ var OrderService = /** @class */ (function (_super) {
18401
18377
  case 2:
18402
18378
  orderService = _b.sent();
18403
18379
  return [2 /*return*/, orderService.findByOrderNumber({ orderNumber: String(params.orderNumber) }, {
18404
- $projection: exports.DEFAULT_PROJECTION
18380
+ // $projection: DEFAULT_PROJECTION
18405
18381
  })];
18406
18382
  }
18407
18383
  });
@@ -18440,7 +18416,9 @@ var OrderService = /** @class */ (function (_super) {
18440
18416
  case 2:
18441
18417
  orderService = _b.sent();
18442
18418
  return [4 /*yield*/, orderService.search(__assign(__assign({}, params), { limit: limit,
18443
- page: page, $projection: exports.DEFAULT_PROJECTION }))];
18419
+ page: page
18420
+ // $projection: DEFAULT_PROJECTION
18421
+ }))];
18444
18422
  case 3:
18445
18423
  data = (_b.sent()).data;
18446
18424
  return [2 /*return*/, { data: data }];
@@ -18917,6 +18895,10 @@ exports.CloudAsset = exports.service = void 0;
18917
18895
  // tslint:disable:max-classes-per-file
18918
18896
  var http_status_1 = require("http-status");
18919
18897
  var OrderServiceFactory = require("../chevreAsset/order/factory");
18898
+ /**
18899
+ * 資産サービス群
18900
+ * 資産: プライベートなリソース(所有権が誰かに所属する)
18901
+ */
18920
18902
  var service;
18921
18903
  (function (service) {
18922
18904
  var Person;
@@ -18961,6 +18943,9 @@ var CloudAsset = /** @class */ (function () {
18961
18943
  }
18962
18944
  this.options = options;
18963
18945
  }
18946
+ /**
18947
+ * 注文サービスインスタンス生成
18948
+ */
18964
18949
  CloudAsset.prototype.createOrderInstance = function (params) {
18965
18950
  return __awaiter(this, void 0, void 0, function () {
18966
18951
  var _a;
@@ -18978,6 +18963,9 @@ var CloudAsset = /** @class */ (function () {
18978
18963
  });
18979
18964
  });
18980
18965
  };
18966
+ /**
18967
+ * 注文配送サービスインスタンス生成
18968
+ */
18981
18969
  CloudAsset.prototype.createDeliveryInstance = function (params) {
18982
18970
  return __awaiter(this, void 0, void 0, function () {
18983
18971
  var _a;
@@ -18995,6 +18983,9 @@ var CloudAsset = /** @class */ (function () {
18995
18983
  });
18996
18984
  });
18997
18985
  };
18986
+ /**
18987
+ * 予約サービスインスタンス生成
18988
+ */
18998
18989
  CloudAsset.prototype.createReservationInstance = function (params) {
18999
18990
  return __awaiter(this, void 0, void 0, function () {
19000
18991
  var _a;
@@ -19012,6 +19003,9 @@ var CloudAsset = /** @class */ (function () {
19012
19003
  });
19013
19004
  });
19014
19005
  };
19006
+ /**
19007
+ * トークンサービスインスタンス生成
19008
+ */
19015
19009
  CloudAsset.prototype.createTokenInstance = function (params) {
19016
19010
  return __awaiter(this, void 0, void 0, function () {
19017
19011
  var _a;
@@ -19029,6 +19023,9 @@ var CloudAsset = /** @class */ (function () {
19029
19023
  });
19030
19024
  });
19031
19025
  };
19026
+ /**
19027
+ * 会員サービスインスタンス生成
19028
+ */
19032
19029
  CloudAsset.prototype.createPersonInstance = function (params) {
19033
19030
  return __awaiter(this, void 0, void 0, function () {
19034
19031
  var _a;
@@ -19046,6 +19043,9 @@ var CloudAsset = /** @class */ (function () {
19046
19043
  });
19047
19044
  });
19048
19045
  };
19046
+ /**
19047
+ * 会員所有権サービスインスタンス生成
19048
+ */
19049
19049
  CloudAsset.prototype.createPersonOwnershipInfoInstance = function (params) {
19050
19050
  return __awaiter(this, void 0, void 0, function () {
19051
19051
  var _a;
@@ -19141,9 +19141,8 @@ var DeliveryService = /** @class */ (function (_super) {
19141
19141
  // super({ ...options, retryableStatusCodes: [BAD_GATEWAY, FORBIDDEN, UNAUTHORIZED] });
19142
19142
  // }
19143
19143
  /**
19144
- * 注文を配送する
19145
- * 作成された注文データに対して、同期的に注文を配送します(所有権が作成されます)
19146
- * すでに配送済の場合、何もしません。
19144
+ * OrderPaymentDueであれば同期的にOrderProcessingへの処理を実行する
19145
+ * OrderPaymentDueでなければ何もしない
19147
19146
  */
19148
19147
  DeliveryService.prototype.sendOrder = function (params) {
19149
19148
  return __awaiter(this, void 0, void 0, function () {
@@ -19413,6 +19412,7 @@ var OrderService = /** @class */ (function (_super) {
19413
19412
  });
19414
19413
  };
19415
19414
  /**
19415
+ * 注文承認
19416
19416
  * 注文コードを発行する
19417
19417
  */
19418
19418
  OrderService.prototype.authorize = function (params) {
@@ -19569,9 +19569,8 @@ var PersonService = /** @class */ (function (_super) {
19569
19569
  case 2:
19570
19570
  personService = _b.sent();
19571
19571
  return [4 /*yield*/, personService.deleteById({
19572
- id: 'me',
19573
- physically: false,
19574
- iss: '' // 使用されないので空文字でok
19572
+ physically: false // fix falseでok
19573
+ // iss: '' // 使用されないので空文字でok
19575
19574
  })];
19576
19575
  case 3:
19577
19576
  _b.sent();
@@ -19669,6 +19668,9 @@ var PersonOwnershipInfoService = /** @class */ (function (_super) {
19669
19668
  // constructor(options: Pick<IOptions, 'auth' | 'endpoint' | 'transporter' | 'project' | 'defaultPath'>) {
19670
19669
  // super({ ...options, retryableStatusCodes: [BAD_GATEWAY, FORBIDDEN, UNAUTHORIZED] });
19671
19670
  // }
19671
+ /**
19672
+ * ペイメントカード所有権検索
19673
+ */
19672
19674
  PersonOwnershipInfoService.prototype.searchMyPaymentCards = function (params) {
19673
19675
  var _a, _b, _c;
19674
19676
  return __awaiter(this, void 0, void 0, function () {
@@ -22117,6 +22119,9 @@ exports.loadService = loadService;
22117
22119
  var cloudAdmin;
22118
22120
  // tslint:disable-next-line:no-single-line-block-comment
22119
22121
  /* istanbul ignore next */
22122
+ /**
22123
+ * 管理サービス群を読み込む
22124
+ */
22120
22125
  function loadCloudAdmin() {
22121
22126
  var params = [];
22122
22127
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -22140,6 +22145,9 @@ exports.loadCloudAdmin = loadCloudAdmin;
22140
22145
  var cloudAsset;
22141
22146
  // tslint:disable-next-line:no-single-line-block-comment
22142
22147
  /* istanbul ignore next */
22148
+ /**
22149
+ * 資産サービス群を読み込む
22150
+ */
22143
22151
  function loadCloudAsset() {
22144
22152
  var params = [];
22145
22153
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -22163,6 +22171,9 @@ exports.loadCloudAsset = loadCloudAsset;
22163
22171
  var cloudPay;
22164
22172
  // tslint:disable-next-line:no-single-line-block-comment
22165
22173
  /* istanbul ignore next */
22174
+ /**
22175
+ * 決済サービス群を読み込む
22176
+ */
22166
22177
  function loadCloudPay() {
22167
22178
  var params = [];
22168
22179
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -22186,6 +22197,9 @@ exports.loadCloudPay = loadCloudPay;
22186
22197
  var cloudTxc;
22187
22198
  // tslint:disable-next-line:no-single-line-block-comment
22188
22199
  /* istanbul ignore next */
22200
+ /**
22201
+ * 取引(COA)サービス群を読み込む
22202
+ */
22189
22203
  function loadCloudTxc() {
22190
22204
  var params = [];
22191
22205
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -22209,6 +22223,9 @@ exports.loadCloudTxc = loadCloudTxc;
22209
22223
  var cloudTxn;
22210
22224
  // tslint:disable-next-line:no-single-line-block-comment
22211
22225
  /* istanbul ignore next */
22226
+ /**
22227
+ * 取引サービス群を読み込む
22228
+ */
22212
22229
  function loadCloudTxn() {
22213
22230
  var params = [];
22214
22231
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -68,8 +68,8 @@ async function main() {
68
68
 
69
69
  console.log('searching offers...');
70
70
  const searchSeatsResult = await eventService.searchSeats({ id: selectedEvent.id });
71
- console.log(searchSeatsResult.data.length, 'seats found');
72
- const seatOffers = searchSeatsResult.data;
71
+ console.log(searchSeatsResult.length, 'seats found');
72
+ const seatOffers = searchSeatsResult;
73
73
  console.log(seatOffers.length, 'seatOffers found');
74
74
  const availableSeatOffers = seatOffers.filter((o) => o.offers?.shift()?.availability === client.factory.itemAvailability.InStock);
75
75
  console.log(availableSeatOffers.length, 'availableSeatOffers found');
@@ -22,3 +22,11 @@ export interface ISearchOfferCatalogItemAvailabilityResult {
22
22
  */
23
23
  isAvailable: boolean;
24
24
  }
25
+ export declare type ISeatAsEventOffer = Pick<factory.place.seat.IPlaceWithOffer, 'branchCode' | 'name' | 'offers' | 'seatingType'> & {
26
+ containedInPlace?: {
27
+ /**
28
+ * セクションコード
29
+ */
30
+ branchCode?: string;
31
+ };
32
+ };
@@ -1,6 +1,6 @@
1
1
  import type { ISearchWithReservationForIdResult } from '../chevreAdmin/aggregateReservation';
2
2
  import * as factory from '../factory';
3
- import { ISearchedEvent, ISearchOfferCatalogItemAvailabilityResult, ISearchOfferCatalogItemResult } from './event/factory';
3
+ import { ISearchedEvent, ISearchOfferCatalogItemAvailabilityResult, ISearchOfferCatalogItemResult, ISeatAsEventOffer } from './event/factory';
4
4
  import { ISearchResult, Service } from '../service';
5
5
  declare type IKeyOfProjection<T extends factory.eventType> = keyof factory.event.IEvent<T> | '_id';
6
6
  declare type IProjection<T extends factory.eventType> = {
@@ -55,7 +55,7 @@ export declare class EventService extends Service {
55
55
  */
56
56
  searchSeats(params: {
57
57
  id: string;
58
- } & Omit<factory.place.seat.ISearchConditions, 'project'>): Promise<ISearchResult<factory.place.seat.IPlaceWithOffer[]>>;
58
+ } & Omit<factory.place.seat.ISearchConditions, 'project' | '$projection'>): Promise<ISeatAsEventOffer[]>;
59
59
  /**
60
60
  * オファーで利用可能な適用決済カード条件を検索する
61
61
  */
@@ -174,18 +174,9 @@ var EventService = /** @class */ (function (_super) {
174
174
  qs: query,
175
175
  expectedStatusCodes: [http_status_1.OK]
176
176
  })
177
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
178
- var _a;
179
- return __generator(this, function (_b) {
180
- switch (_b.label) {
181
- case 0:
182
- _a = {};
183
- return [4 /*yield*/, response.json()];
184
- case 1: return [2 /*return*/, (_a.data = _b.sent(),
185
- _a)];
186
- }
187
- });
188
- }); })];
177
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
178
+ return [2 /*return*/, response.json()];
179
+ }); }); })];
189
180
  });
190
181
  });
191
182
  };
@@ -8,7 +8,7 @@ export declare type IOrderAsSearchWithUnwindAcceptedOffersResult = Pick<factory.
8
8
  /**
9
9
  * オファー展開しない検索結果としての注文
10
10
  */
11
- export declare type IOrderAsSearchResult = Omit<factory.order.IOrder, 'discounts' | 'isGift' | 'returner'>;
11
+ export declare type IOrderAsSearchResult = Pick<factory.order.IOrder, 'broker' | 'confirmationNumber' | 'customer' | 'dateReturned' | 'id' | 'name' | 'orderDate' | 'orderNumber' | 'orderStatus' | 'orderedItem' | 'paymentMethods' | 'previousOrderStatus' | 'price' | 'priceCurrency' | 'project' | 'seller' | 'typeOf'>;
12
12
  export interface ISearchOrdersOptions {
13
13
  /**
14
14
  * オファーを展開するかどうか
@@ -2,8 +2,12 @@ import * as factory from '../factory';
2
2
  import { IAcceptedOffer, IExternalOrder, IOrderAsSearchResult, IOrderAsSearchWithUnwindAcceptedOffersResult, IReturner, ISearchOrdersOptions, IUpdateChangeableAttributesParams } from './order/factory';
3
3
  import { ISearchResult, Service } from '../service';
4
4
  declare type IKeyOfProjection = keyof factory.order.IOrder | '_id';
5
+ /**
6
+ * 注文検索時projection
7
+ * 0->1(2024-07-29~)
8
+ */
5
9
  declare type IProjection = {
6
- [key in IKeyOfProjection]?: 0;
10
+ [key in IKeyOfProjection]?: 1;
7
11
  };
8
12
  /**
9
13
  * 注文サービス
@@ -86,6 +90,7 @@ export declare class OrderService extends Service {
86
90
  */
87
91
  search(params: Omit<factory.order.ISearchConditions, 'project' | 'provider'> & {
88
92
  $projection?: IProjection;
93
+ $projectDisabled?: '1';
89
94
  } & ISearchOrdersOptions & {
90
95
  /**
91
96
  * min: 1
@@ -107,7 +112,8 @@ export declare class OrderService extends Service {
107
112
  orderNumber: string;
108
113
  }, options: {
109
114
  $projection?: IProjection;
110
- }): Promise<Omit<factory.order.IOrder, 'acceptedOffers' | 'discounts' | 'isGift' | 'returner'>>;
115
+ $projectDisabled?: '1';
116
+ }): Promise<Pick<factory.order.IOrder, 'broker' | 'confirmationNumber' | 'customer' | 'dateReturned' | 'id' | 'identifier' | 'name' | 'orderDate' | 'orderNumber' | 'orderStatus' | 'orderedItem' | 'paymentMethods' | 'previousOrderStatus' | 'price' | 'priceCurrency' | 'project' | 'seller' | 'typeOf' | 'url'>>;
111
117
  /**
112
118
  * 返品者検索
113
119
  */
@@ -1,15 +1,7 @@
1
- import { ISearchedEvent, ISearchOfferCatalogItemAvailabilityResult, ISearchOfferCatalogItemResult } from '../../chevre/event/factory';
1
+ import { ISearchedEvent, ISearchOfferCatalogItemAvailabilityResult, ISearchOfferCatalogItemResult, ISeatAsEventOffer } from '../../chevre/event/factory';
2
2
  import type { ISearchWithReservationForIdResult } from '../../chevreAdmin/aggregateReservation';
3
3
  import * as factory from '../../factory';
4
4
  import { IAdditionalOptions, IOptions, ISearchResult, Service } from '../../service';
5
- declare type ISearchSeatsResult = Pick<factory.place.seat.IPlaceWithOffer, 'branchCode' | 'name' | 'offers' | 'seatingType'> & {
6
- containedInPlace?: {
7
- /**
8
- * セクションコード
9
- */
10
- branchCode?: string;
11
- };
12
- };
13
5
  declare type IKeyOfProjection<T extends factory.eventType> = keyof factory.event.IEvent<T> | '_id';
14
6
  declare type IProjection<T extends factory.eventType> = {
15
7
  [key in IKeyOfProjection<T>]?: 0;
@@ -135,9 +127,9 @@ export declare class EventService extends Service {
135
127
  event: {
136
128
  id: string;
137
129
  };
138
- limit?: number;
139
- page?: number;
140
- }): Promise<ISearchResult<ISearchSeatsResult[]>>;
130
+ limit: number;
131
+ page: number;
132
+ }): Promise<ISearchResult<ISeatAsEventOffer[]>>;
141
133
  /**
142
134
  * 興行オファー検索
143
135
  * サブカタログ設定有無による違いについては、includedInDataCatalogパラメータの説明を参照してください
@@ -159,7 +159,7 @@ var EventService = /** @class */ (function (_super) {
159
159
  return __generator(this, function (_a) {
160
160
  event = params.event, query = __rest(params, ["event"]);
161
161
  return [2 /*return*/, this.fetch({
162
- uri: "/events/" + params.event.id + "/seats",
162
+ uri: "/events/" + encodeURIComponent(String(event.id)) + "/seats",
163
163
  method: 'GET',
164
164
  qs: query,
165
165
  expectedStatusCodes: [http_status_1.OK]
@@ -2,9 +2,6 @@ import * as factory from '../../factory';
2
2
  import { ISearchResult, Service } from '../../service';
3
3
  import { IOrderAsSearchResult, IOrderAsSearchWithUnwindAcceptedOffersResult, IReturner, IUpdateChangeableAttributesParams } from '../../chevreAdmin/order/factory';
4
4
  import { IAcceptedOffer, IOptimizedOrder, ISearchOrdersOptions } from '../../chevreAsset/order/factory';
5
- export declare const DEFAULT_PROJECTION: {
6
- [key: string]: number;
7
- };
8
5
  /**
9
6
  * 注文サービス
10
7
  */
@@ -21,7 +18,7 @@ export declare class OrderService extends Service {
21
18
  /**
22
19
  * 注文を検索する
23
20
  */
24
- search(params: Omit<factory.order.ISearchConditions, 'project' | 'provider'> & ISearchOrdersOptions & {
21
+ search(params: Omit<factory.order.ISearchConditions, 'project' | 'provider'> & Pick<ISearchOrdersOptions, '$unwindAcceptedOffers'> & {
25
22
  /**
26
23
  * min: 1
27
24
  * max: 20
@@ -62,23 +62,23 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
62
62
  }
63
63
  };
64
64
  Object.defineProperty(exports, "__esModule", { value: true });
65
- exports.OrderService = exports.DEFAULT_PROJECTION = void 0;
65
+ exports.OrderService = void 0;
66
66
  var factory = require("../../factory");
67
67
  var index_1 = require("../../index");
68
68
  var service_1 = require("../../service");
69
- exports.DEFAULT_PROJECTION = {
70
- // _id: 0, // IDを使用(2023-02-14~)
71
- acceptedOffers: 0,
72
- discounts: 0,
73
- identifier: 0,
74
- isGift: 0,
75
- 'paymentMethods.issuedThrough.serviceOutput': 0,
76
- returner: 0,
77
- // 'seller.telephone': 0, // ドキュメントからunset済なので不要(2024-03-14~)
78
- // 'seller.url': 0, // ドキュメントからunset済なので不要(2024-03-14~)
79
- url: 0,
80
- additionalProperty: 0
81
- };
69
+ // export const DEFAULT_PROJECTION: { [key: string]: 0 } = {
70
+ // // _id: 0, // IDを使用(2023-02-14~)
71
+ // acceptedOffers: 0,
72
+ // discounts: 0,
73
+ // identifier: 0,
74
+ // isGift: 0,
75
+ // 'paymentMethods.issuedThrough.serviceOutput': 0,
76
+ // returner: 0,
77
+ // // 'seller.telephone': 0, // ドキュメントからunset済なので不要(2024-03-14~)
78
+ // // 'seller.url': 0, // ドキュメントからunset済なので不要(2024-03-14~)
79
+ // url: 0,
80
+ // additionalProperty: 0
81
+ // };
82
82
  var MAX_SEARCH_LIMIT = 20;
83
83
  /**
84
84
  * 注文サービス
@@ -108,7 +108,7 @@ var OrderService = /** @class */ (function (_super) {
108
108
  case 2:
109
109
  orderService = _b.sent();
110
110
  return [2 /*return*/, orderService.findByOrderNumber({ orderNumber: String(params.orderNumber) }, {
111
- $projection: exports.DEFAULT_PROJECTION
111
+ // $projection: DEFAULT_PROJECTION
112
112
  })];
113
113
  }
114
114
  });
@@ -147,7 +147,9 @@ var OrderService = /** @class */ (function (_super) {
147
147
  case 2:
148
148
  orderService = _b.sent();
149
149
  return [4 /*yield*/, orderService.search(__assign(__assign({}, params), { limit: limit,
150
- page: page, $projection: exports.DEFAULT_PROJECTION }))];
150
+ page: page
151
+ // $projection: DEFAULT_PROJECTION
152
+ }))];
151
153
  case 3:
152
154
  data = (_b.sent()).data;
153
155
  return [2 /*return*/, { data: data }];
package/lib/bundle.js CHANGED
@@ -731,18 +731,9 @@ var EventService = /** @class */ (function (_super) {
731
731
  qs: query,
732
732
  expectedStatusCodes: [http_status_1.OK]
733
733
  })
734
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
735
- var _a;
736
- return __generator(this, function (_b) {
737
- switch (_b.label) {
738
- case 0:
739
- _a = {};
740
- return [4 /*yield*/, response.json()];
741
- case 1: return [2 /*return*/, (_a.data = _b.sent(),
742
- _a)];
743
- }
744
- });
745
- }); })];
734
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
735
+ return [2 /*return*/, response.json()];
736
+ }); }); })];
746
737
  });
747
738
  });
748
739
  };
@@ -15922,7 +15913,7 @@ var EventService = /** @class */ (function (_super) {
15922
15913
  return __generator(this, function (_a) {
15923
15914
  event = params.event, query = __rest(params, ["event"]);
15924
15915
  return [2 /*return*/, this.fetch({
15925
- uri: "/events/" + params.event.id + "/seats",
15916
+ uri: "/events/" + encodeURIComponent(String(event.id)) + "/seats",
15926
15917
  method: 'GET',
15927
15918
  qs: query,
15928
15919
  expectedStatusCodes: [http_status_1.OK]
@@ -18340,23 +18331,23 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
18340
18331
  }
18341
18332
  };
18342
18333
  Object.defineProperty(exports, "__esModule", { value: true });
18343
- exports.OrderService = exports.DEFAULT_PROJECTION = void 0;
18334
+ exports.OrderService = void 0;
18344
18335
  var factory = require("../../factory");
18345
18336
  var index_1 = require("../../index");
18346
18337
  var service_1 = require("../../service");
18347
- exports.DEFAULT_PROJECTION = {
18348
- // _id: 0, // IDを使用(2023-02-14~)
18349
- acceptedOffers: 0,
18350
- discounts: 0,
18351
- identifier: 0,
18352
- isGift: 0,
18353
- 'paymentMethods.issuedThrough.serviceOutput': 0,
18354
- returner: 0,
18355
- // 'seller.telephone': 0, // ドキュメントからunset済なので不要(2024-03-14~)
18356
- // 'seller.url': 0, // ドキュメントからunset済なので不要(2024-03-14~)
18357
- url: 0,
18358
- additionalProperty: 0
18359
- };
18338
+ // export const DEFAULT_PROJECTION: { [key: string]: 0 } = {
18339
+ // // _id: 0, // IDを使用(2023-02-14~)
18340
+ // acceptedOffers: 0,
18341
+ // discounts: 0,
18342
+ // identifier: 0,
18343
+ // isGift: 0,
18344
+ // 'paymentMethods.issuedThrough.serviceOutput': 0,
18345
+ // returner: 0,
18346
+ // // 'seller.telephone': 0, // ドキュメントからunset済なので不要(2024-03-14~)
18347
+ // // 'seller.url': 0, // ドキュメントからunset済なので不要(2024-03-14~)
18348
+ // url: 0,
18349
+ // additionalProperty: 0
18350
+ // };
18360
18351
  var MAX_SEARCH_LIMIT = 20;
18361
18352
  /**
18362
18353
  * 注文サービス
@@ -18386,7 +18377,7 @@ var OrderService = /** @class */ (function (_super) {
18386
18377
  case 2:
18387
18378
  orderService = _b.sent();
18388
18379
  return [2 /*return*/, orderService.findByOrderNumber({ orderNumber: String(params.orderNumber) }, {
18389
- $projection: exports.DEFAULT_PROJECTION
18380
+ // $projection: DEFAULT_PROJECTION
18390
18381
  })];
18391
18382
  }
18392
18383
  });
@@ -18425,7 +18416,9 @@ var OrderService = /** @class */ (function (_super) {
18425
18416
  case 2:
18426
18417
  orderService = _b.sent();
18427
18418
  return [4 /*yield*/, orderService.search(__assign(__assign({}, params), { limit: limit,
18428
- page: page, $projection: exports.DEFAULT_PROJECTION }))];
18419
+ page: page
18420
+ // $projection: DEFAULT_PROJECTION
18421
+ }))];
18429
18422
  case 3:
18430
18423
  data = (_b.sent()).data;
18431
18424
  return [2 /*return*/, { data: data }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "10.1.0",
3
+ "version": "10.2.0",
4
4
  "description": "Cinerino SDK",
5
5
  "main": "./lib/index.js",
6
6
  "browser": {