@cinerino/sdk 3.160.0-alpha.0 → 3.160.0-alpha.2

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 (42) hide show
  1. package/example/playground/public/lib/bundle.js +167 -16
  2. package/example/src/chevre/authorizeOrder.ts +1 -1
  3. package/example/src/chevre/authorizePermit.ts +1 -1
  4. package/example/src/chevre/createEvents.ts +1 -1
  5. package/example/src/chevre/findOrderByConfirmationNumber.ts +1 -1
  6. package/example/src/chevre/findPerson.ts +1 -1
  7. package/example/src/chevre/person/authorizeMyOwnershipInfo.ts +1 -1
  8. package/example/src/chevre/searchAcceptedOffersByConfirmationNumber.ts +1 -1
  9. package/example/src/chevre/searchCreditCards.ts +1 -1
  10. package/example/src/chevre/searchEventOffers.ts +1 -1
  11. package/example/src/chevre/searchEvents.ts +1 -1
  12. package/example/src/chevre/searchProjects.ts +1 -2
  13. package/example/src/chevre/transaction/processPlaceOrder.ts +1 -1
  14. package/example/src/chevre/updateOrder.ts +1 -1
  15. package/example/src/st/person/getProfile.ts +2 -1
  16. package/example/src/st/person/searchCreditCards.ts +2 -1
  17. package/example/src/st/person/searchMemberships.ts +2 -1
  18. package/example/src/st/person/searchMyOrders.ts +2 -1
  19. package/example/src/st/person/searchPaymentCards.ts +2 -1
  20. package/example/src/st/person/searchReservations.ts +2 -1
  21. package/example/src/st/processPlaceOrderByPOS.ts +2 -1
  22. package/example/src/st/searchEventSeats.ts +2 -1
  23. package/example/src/st/searchMovies.ts +2 -1
  24. package/example/src/transaction/processOrderMembershipByCreditCard.ts +1 -1
  25. package/example/src/transaction/processPlaceOrderByMovieTicket.ts +1 -1
  26. package/example/src/transaction/searchEventOffers.ts +1 -1
  27. package/example/src/transaction/test/lockTransactionTest.ts +1 -1
  28. package/example/src/transaction/test/rateLimitTransactionTest.ts +1 -1
  29. package/example/src/updateOrder.ts +1 -1
  30. package/lib/abstract/chevre/seller/factory.d.ts +3 -0
  31. package/lib/abstract/chevre/seller.d.ts +39 -1
  32. package/lib/abstract/chevre/seller.js +79 -0
  33. package/lib/abstract/pecorino/accountTransaction.d.ts +3 -2
  34. package/lib/abstract/pecorino/accountTransaction.js +13 -2
  35. package/lib/abstract/pecorino/permit.d.ts +2 -1
  36. package/lib/abstract/pecorino/permit.js +13 -2
  37. package/lib/bundle.js +105 -4
  38. package/package.json +1 -1
  39. package/example/src/st/searchScreeningEventSeries.ts +0 -54
  40. package/example/src/st/searchScreeningRooms.ts +0 -45
  41. package/example/src/st/searchSeats.ts +0 -48
  42. package/example/src/st/searchSellers.ts +0 -45
@@ -1708,6 +1708,17 @@ var __extends = (this && this.__extends) || (function () {
1708
1708
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1709
1709
  };
1710
1710
  })();
1711
+ var __assign = (this && this.__assign) || function () {
1712
+ __assign = Object.assign || function(t) {
1713
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
1714
+ s = arguments[i];
1715
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
1716
+ t[p] = s[p];
1717
+ }
1718
+ return t;
1719
+ };
1720
+ return __assign.apply(this, arguments);
1721
+ };
1711
1722
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1712
1723
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1713
1724
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -1753,8 +1764,8 @@ var service_1 = require("../service");
1753
1764
  */
1754
1765
  var AggregationService = /** @class */ (function (_super) {
1755
1766
  __extends(AggregationService, _super);
1756
- function AggregationService() {
1757
- return _super !== null && _super.apply(this, arguments) || this;
1767
+ function AggregationService(options) {
1768
+ return _super.call(this, __assign(__assign({}, options), { project: { id: '' } })) || this;
1758
1769
  }
1759
1770
  AggregationService.prototype.search = function (params) {
1760
1771
  return __awaiter(this, void 0, void 0, function () {
@@ -4735,6 +4746,17 @@ var __extends = (this && this.__extends) || (function () {
4735
4746
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4736
4747
  };
4737
4748
  })();
4749
+ var __assign = (this && this.__assign) || function () {
4750
+ __assign = Object.assign || function(t) {
4751
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4752
+ s = arguments[i];
4753
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
4754
+ t[p] = s[p];
4755
+ }
4756
+ return t;
4757
+ };
4758
+ return __assign.apply(this, arguments);
4759
+ };
4738
4760
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4739
4761
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4740
4762
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -4780,8 +4802,8 @@ var service_1 = require("../service");
4780
4802
  */
4781
4803
  var MeService = /** @class */ (function (_super) {
4782
4804
  __extends(MeService, _super);
4783
- function MeService() {
4784
- return _super !== null && _super.apply(this, arguments) || this;
4805
+ function MeService(options) {
4806
+ return _super.call(this, __assign(__assign({}, options), { project: { id: '' } })) || this;
4785
4807
  }
4786
4808
  /**
4787
4809
  * マイプロジェクト検索
@@ -7977,6 +7999,17 @@ var __extends = (this && this.__extends) || (function () {
7977
7999
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
7978
8000
  };
7979
8001
  })();
8002
+ var __assign = (this && this.__assign) || function () {
8003
+ __assign = Object.assign || function(t) {
8004
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
8005
+ s = arguments[i];
8006
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
8007
+ t[p] = s[p];
8008
+ }
8009
+ return t;
8010
+ };
8011
+ return __assign.apply(this, arguments);
8012
+ };
7980
8013
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
7981
8014
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7982
8015
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8033,8 +8066,8 @@ var service_1 = require("../service");
8033
8066
  */
8034
8067
  var ProjectService = /** @class */ (function (_super) {
8035
8068
  __extends(ProjectService, _super);
8036
- function ProjectService() {
8037
- return _super !== null && _super.apply(this, arguments) || this;
8069
+ function ProjectService(options) {
8070
+ return _super.call(this, __assign(__assign({}, options), { project: { id: '' } })) || this;
8038
8071
  }
8039
8072
  /**
8040
8073
  * プロジェクト作成
@@ -8697,6 +8730,85 @@ var SellerService = /** @class */ (function (_super) {
8697
8730
  });
8698
8731
  });
8699
8732
  };
8733
+ SellerService.prototype.searchMakesProductOffer = function (params) {
8734
+ var _a;
8735
+ return __awaiter(this, void 0, void 0, function () {
8736
+ var _this = this;
8737
+ return __generator(this, function (_b) {
8738
+ return [2 /*return*/, this.fetch({
8739
+ uri: "/sellers/" + ((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) + "/makesProductOffer",
8740
+ method: 'GET',
8741
+ qs: params.qs,
8742
+ expectedStatusCodes: [http_status_1.OK]
8743
+ })
8744
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
8745
+ var _a;
8746
+ return __generator(this, function (_b) {
8747
+ switch (_b.label) {
8748
+ case 0:
8749
+ _a = {};
8750
+ return [4 /*yield*/, response.json()];
8751
+ case 1: return [2 /*return*/, (_a.data = _b.sent(),
8752
+ _a)];
8753
+ }
8754
+ });
8755
+ }); })];
8756
+ });
8757
+ });
8758
+ };
8759
+ SellerService.prototype.createMakesProductOffer = function (params) {
8760
+ var _a;
8761
+ return __awaiter(this, void 0, void 0, function () {
8762
+ return __generator(this, function (_b) {
8763
+ switch (_b.label) {
8764
+ case 0: return [4 /*yield*/, this.fetch({
8765
+ uri: "/sellers/" + String((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) + "/makesProductOffer",
8766
+ method: 'POST',
8767
+ body: params,
8768
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
8769
+ })];
8770
+ case 1:
8771
+ _b.sent();
8772
+ return [2 /*return*/];
8773
+ }
8774
+ });
8775
+ });
8776
+ };
8777
+ SellerService.prototype.updateMakesProductOffer = function (params) {
8778
+ var _a;
8779
+ return __awaiter(this, void 0, void 0, function () {
8780
+ return __generator(this, function (_b) {
8781
+ switch (_b.label) {
8782
+ case 0: return [4 /*yield*/, this.fetch({
8783
+ uri: "/sellers/" + String((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) + "/makesProductOffer/" + params.itemOffered.id,
8784
+ method: 'PUT',
8785
+ body: params,
8786
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
8787
+ })];
8788
+ case 1:
8789
+ _b.sent();
8790
+ return [2 /*return*/];
8791
+ }
8792
+ });
8793
+ });
8794
+ };
8795
+ SellerService.prototype.deleteMakesProductOffer = function (params) {
8796
+ var _a;
8797
+ return __awaiter(this, void 0, void 0, function () {
8798
+ return __generator(this, function (_b) {
8799
+ switch (_b.label) {
8800
+ case 0: return [4 /*yield*/, this.fetch({
8801
+ uri: "/sellers/" + ((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) + "/makesProductOffer/" + params.itemOffered.id,
8802
+ method: 'DELETE',
8803
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
8804
+ })];
8805
+ case 1:
8806
+ _b.sent();
8807
+ return [2 /*return*/];
8808
+ }
8809
+ });
8810
+ });
8811
+ };
8700
8812
  return SellerService;
8701
8813
  }(service_1.Service));
8702
8814
  exports.SellerService = SellerService;
@@ -10461,6 +10573,17 @@ var __extends = (this && this.__extends) || (function () {
10461
10573
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10462
10574
  };
10463
10575
  })();
10576
+ var __assign = (this && this.__assign) || function () {
10577
+ __assign = Object.assign || function(t) {
10578
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
10579
+ s = arguments[i];
10580
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10581
+ t[p] = s[p];
10582
+ }
10583
+ return t;
10584
+ };
10585
+ return __assign.apply(this, arguments);
10586
+ };
10464
10587
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
10465
10588
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10466
10589
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -10506,8 +10629,8 @@ var service_1 = require("../service");
10506
10629
  */
10507
10630
  var AccountTransactionService = /** @class */ (function (_super) {
10508
10631
  __extends(AccountTransactionService, _super);
10509
- function AccountTransactionService() {
10510
- return _super !== null && _super.apply(this, arguments) || this;
10632
+ function AccountTransactionService(options) {
10633
+ return _super.call(this, __assign(__assign({}, options), { project: { id: '' } })) || this;
10511
10634
  }
10512
10635
  /**
10513
10636
  * 取引検索
@@ -10621,6 +10744,17 @@ var __extends = (this && this.__extends) || (function () {
10621
10744
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10622
10745
  };
10623
10746
  })();
10747
+ var __assign = (this && this.__assign) || function () {
10748
+ __assign = Object.assign || function(t) {
10749
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
10750
+ s = arguments[i];
10751
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10752
+ t[p] = s[p];
10753
+ }
10754
+ return t;
10755
+ };
10756
+ return __assign.apply(this, arguments);
10757
+ };
10624
10758
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
10625
10759
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10626
10760
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -10666,8 +10800,8 @@ var service_1 = require("../service");
10666
10800
  */
10667
10801
  var PermitService = /** @class */ (function (_super) {
10668
10802
  __extends(PermitService, _super);
10669
- function PermitService() {
10670
- return _super !== null && _super.apply(this, arguments) || this;
10803
+ function PermitService(options) {
10804
+ return _super.call(this, __assign(__assign({}, options), { project: { id: '' } })) || this;
10671
10805
  }
10672
10806
  /**
10673
10807
  * 許可証照会
@@ -10763,9 +10897,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
10763
10897
  }
10764
10898
  };
10765
10899
  Object.defineProperty(exports, "__esModule", { value: true });
10766
- exports.Service = void 0;
10900
+ exports.Service = exports.RESOURCE_SELECTOR_SEPARATOR = void 0;
10767
10901
  var qs = require("qs");
10768
10902
  var transporters_1 = require("./transporters");
10903
+ exports.RESOURCE_SELECTOR_SEPARATOR = ':';
10769
10904
  /**
10770
10905
  * base service class
10771
10906
  */
@@ -10777,10 +10912,10 @@ var Service = /** @class */ (function () {
10777
10912
  * Create and send request to API
10778
10913
  */
10779
10914
  Service.prototype.fetch = function (options) {
10780
- var _a;
10915
+ var _a, _b;
10781
10916
  return __awaiter(this, void 0, void 0, function () {
10782
10917
  var defaultOptions, baseUrl, url, querystrings, headers, fetchOptions, transporter;
10783
- return __generator(this, function (_b) {
10918
+ return __generator(this, function (_c) {
10784
10919
  defaultOptions = __assign(__assign({ headers: {} }, {
10785
10920
  method: 'GET'
10786
10921
  }), options);
@@ -10788,7 +10923,12 @@ var Service = /** @class */ (function () {
10788
10923
  // tslint:disable-next-line:no-single-line-block-comment
10789
10924
  /* istanbul ignore else */
10790
10925
  if (typeof ((_a = this.options.project) === null || _a === void 0 ? void 0 : _a.id) === 'string' && this.options.project.id.length > 0) {
10791
- baseUrl = baseUrl + "/projects/" + this.options.project.id;
10926
+ if (typeof ((_b = this.options.seller) === null || _b === void 0 ? void 0 : _b.id) === 'string' && this.options.seller.id.length > 0) {
10927
+ baseUrl = baseUrl + "/projects/" + this.options.project.id + exports.RESOURCE_SELECTOR_SEPARATOR + this.options.seller.id;
10928
+ }
10929
+ else {
10930
+ baseUrl = baseUrl + "/projects/" + this.options.project.id;
10931
+ }
10792
10932
  }
10793
10933
  url = "" + baseUrl + defaultOptions.uri;
10794
10934
  querystrings = qs.stringify(defaultOptions.qs);
@@ -13204,6 +13344,17 @@ var __extends = (this && this.__extends) || (function () {
13204
13344
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13205
13345
  };
13206
13346
  })();
13347
+ var __assign = (this && this.__assign) || function () {
13348
+ __assign = Object.assign || function(t) {
13349
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
13350
+ s = arguments[i];
13351
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
13352
+ t[p] = s[p];
13353
+ }
13354
+ return t;
13355
+ };
13356
+ return __assign.apply(this, arguments);
13357
+ };
13207
13358
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13208
13359
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13209
13360
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -13249,8 +13400,8 @@ var service_1 = require("../service");
13249
13400
  */
13250
13401
  var ProjectService = /** @class */ (function (_super) {
13251
13402
  __extends(ProjectService, _super);
13252
- function ProjectService() {
13253
- return _super !== null && _super.apply(this, arguments) || this;
13403
+ function ProjectService(options) {
13404
+ return _super.call(this, __assign(__assign({}, options), { project: { id: '' } })) || this;
13254
13405
  }
13255
13406
  /**
13256
13407
  * プロジェクト検索
@@ -2,7 +2,7 @@
2
2
  import * as client from '../../../lib/';
3
3
  import * as auth from '../auth/authAsAdmin';
4
4
 
5
- const project = { id: process.env.PROJECT_ID };
5
+ const project = { id: String(process.env.PROJECT_ID) };
6
6
 
7
7
  async function main() {
8
8
  const authClient = await auth.login();
@@ -2,7 +2,7 @@
2
2
  import * as client from '../../../lib/';
3
3
  import * as auth from '../auth/auth';
4
4
 
5
- const project = { id: process.env.PROJECT_ID };
5
+ const project = { id: String(process.env.PROJECT_ID) };
6
6
 
7
7
  async function main() {
8
8
  const authClient = await auth.login();
@@ -2,7 +2,7 @@
2
2
  import { chevre } from '../../../lib/index';
3
3
  import * as auth from '../auth/authAsAdmin';
4
4
 
5
- const project = { id: process.env.PROJECT_ID };
5
+ const project = { id: String(process.env.PROJECT_ID) };
6
6
 
7
7
  async function main() {
8
8
  const authClient = await auth.login();
@@ -2,7 +2,7 @@
2
2
  import * as client from '../../../lib/';
3
3
  import * as auth from '../auth/authAsAdmin';
4
4
 
5
- const project = { id: process.env.PROJECT_ID };
5
+ const project = { id: String(process.env.PROJECT_ID) };
6
6
 
7
7
  async function main() {
8
8
  const authClient = await auth.login();
@@ -1,7 +1,7 @@
1
1
  // tslint:disable:no-implicit-dependencies no-console no-magic-numbers
2
2
  import * as client from '../../../lib/';
3
3
 
4
- const project = { id: process.env.PROJECT_ID };
4
+ const project = { id: String(process.env.PROJECT_ID) };
5
5
 
6
6
  async function main() {
7
7
  const authClient = new client.auth.ClientCredentials({
@@ -7,7 +7,7 @@
7
7
  import * as client from '../../../../lib/index';
8
8
  import * as auth from '../../auth/auth';
9
9
 
10
- const project = { id: process.env.PROJECT_ID };
10
+ const project = { id: String(process.env.PROJECT_ID) };
11
11
 
12
12
  async function main() {
13
13
  const authClient = await auth.login();
@@ -2,7 +2,7 @@
2
2
  import * as client from '../../../lib/';
3
3
  import * as auth from '../auth/authAsAdmin';
4
4
 
5
- const project = { id: process.env.PROJECT_ID };
5
+ const project = { id: String(process.env.PROJECT_ID) };
6
6
 
7
7
  async function main() {
8
8
  const authClient = await auth.login();
@@ -1,7 +1,7 @@
1
1
  // tslint:disable:no-implicit-dependencies no-console no-magic-numbers
2
2
  import * as client from '../../../lib/';
3
3
 
4
- const project = { id: process.env.PROJECT_ID };
4
+ const project = { id: String(process.env.PROJECT_ID) };
5
5
 
6
6
  async function main() {
7
7
  const authClient = new client.auth.ClientCredentials({
@@ -2,7 +2,7 @@
2
2
  import * as client from '../../../lib/index';
3
3
  import * as auth from '../auth/authAsAdmin';
4
4
 
5
- const PROJECT_ID = process.env.PROJECT_ID;
5
+ const PROJECT_ID = String(process.env.PROJECT_ID);
6
6
 
7
7
  async function main() {
8
8
  const authClient = await auth.login();
@@ -2,7 +2,7 @@
2
2
  import * as moment from 'moment';
3
3
  import * as client from '../../../lib/index';
4
4
 
5
- const PROJECT_ID = process.env.PROJECT_ID;
5
+ const PROJECT_ID = String(process.env.PROJECT_ID);
6
6
 
7
7
  async function main() {
8
8
  const authClient = new client.auth.ClientCredentials({
@@ -12,8 +12,7 @@ async function main() {
12
12
 
13
13
  const meService = new client.chevre.service.Me({
14
14
  endpoint: <string>process.env.CHEVRE_ENDPOINT,
15
- auth: authClient,
16
- project: { id: '' }
15
+ auth: authClient
17
16
  });
18
17
 
19
18
  const { data } = await meService.searchProjects({
@@ -3,7 +3,7 @@ import * as moment from 'moment';
3
3
  import * as client from '../../../../lib/index';
4
4
  import * as auth from '../../auth/authAsAdmin';
5
5
 
6
- const project = { id: process.env.PROJECT_ID };
6
+ const project = { id: String(process.env.PROJECT_ID) };
7
7
 
8
8
  const profile = {
9
9
  email: <string>process.env.TEST_PROFILE_EMAIL,
@@ -2,7 +2,7 @@
2
2
  import * as client from '../../../lib/';
3
3
  import * as auth from '../auth/authAsAdmin';
4
4
 
5
- const project = { id: process.env.PROJECT_ID };
5
+ const project = { id: String(process.env.PROJECT_ID) };
6
6
 
7
7
  async function main() {
8
8
  const authClient = await auth.login();
@@ -21,7 +21,8 @@ async function main() {
21
21
 
22
22
  const personService = new client.service.Person({
23
23
  endpoint: <string>process.env.ST_API_ENDPOINT,
24
- auth: authClient
24
+ auth: authClient,
25
+ project: { id: '' }
25
26
  });
26
27
 
27
28
  console.log('searching...');
@@ -14,7 +14,8 @@ async function main() {
14
14
 
15
15
  const personService = new client.service.Person({
16
16
  endpoint: <string>process.env.ST_API_ENDPOINT,
17
- auth: authClient
17
+ auth: authClient,
18
+ project: { id: '' }
18
19
  });
19
20
 
20
21
  console.log('searching...');
@@ -14,7 +14,8 @@ async function main() {
14
14
 
15
15
  const personService = new client.service.Person({
16
16
  endpoint: <string>process.env.ST_API_ENDPOINT,
17
- auth: authClient
17
+ auth: authClient,
18
+ project: { id: '' }
18
19
  });
19
20
 
20
21
  console.log('searching...');
@@ -14,7 +14,8 @@ async function main() {
14
14
 
15
15
  const personService = new client.service.Person({
16
16
  endpoint: <string>process.env.ST_API_ENDPOINT,
17
- auth: authClient
17
+ auth: authClient,
18
+ project: { id: '' }
18
19
  });
19
20
 
20
21
  console.log('searching...');
@@ -14,7 +14,8 @@ async function main() {
14
14
 
15
15
  const personService = new client.service.Person({
16
16
  endpoint: <string>process.env.ST_API_ENDPOINT,
17
- auth: authClient
17
+ auth: authClient,
18
+ project: { id: '' }
18
19
  });
19
20
 
20
21
  console.log('searching...');
@@ -14,7 +14,8 @@ async function main() {
14
14
 
15
15
  const personService = new client.service.Person({
16
16
  endpoint: <string>process.env.ST_API_ENDPOINT,
17
- auth: authClient
17
+ auth: authClient,
18
+ project: { id: '' }
18
19
  });
19
20
 
20
21
  console.log('searching...');
@@ -17,7 +17,8 @@ const auth = new client.auth.ClientCredentials({
17
17
 
18
18
  const sellerService = new client.service.Seller({
19
19
  endpoint: <string>process.env.ST_API_ENDPOINT,
20
- auth: auth
20
+ auth: auth,
21
+ project: { id: '' }
21
22
  });
22
23
 
23
24
  // tslint:disable-next-line:max-func-body-length
@@ -13,7 +13,8 @@ const auth = new client.auth.ClientCredentials({
13
13
 
14
14
  const sellerService = new client.service.Seller({
15
15
  endpoint: <string>process.env.ST_API_ENDPOINT,
16
- auth: auth
16
+ auth: auth,
17
+ project: { id: '' }
17
18
  });
18
19
 
19
20
  const eventId = '220406001001010900';
@@ -14,7 +14,8 @@ const auth = new client.auth.ClientCredentials({
14
14
 
15
15
  const sellerService = new client.service.Seller({
16
16
  endpoint: <string>process.env.ST_API_ENDPOINT,
17
- auth: auth
17
+ auth: auth,
18
+ project: { id: '' }
18
19
  });
19
20
 
20
21
  // tslint:disable-next-line:max-func-body-length
@@ -4,7 +4,7 @@ import * as client from '../../../lib/index';
4
4
  // import { auth } from '../auth/clientCredentials';
5
5
  import * as auth from '../auth/auth';
6
6
 
7
- const project = { id: process.env.PROJECT_ID };
7
+ const project = { id: String(process.env.PROJECT_ID) };
8
8
 
9
9
  const profile = {
10
10
  email: <string>process.env.TEST_PROFILE_EMAIL,
@@ -4,7 +4,7 @@ import * as client from '../../../lib/index';
4
4
  // import * as auth from '../auth/auth';
5
5
  import { auth as authClient } from '../auth/clientCredentials';
6
6
 
7
- const project = { id: process.env.PROJECT_ID };
7
+ const project = { id: String(process.env.PROJECT_ID) };
8
8
 
9
9
  const creditCard = {
10
10
  cardNo: '4111111111111111',
@@ -2,7 +2,7 @@
2
2
  import * as client from '../../../lib/index';
3
3
  import { auth } from '../auth/clientCredentials';
4
4
 
5
- const project = { id: process.env.PROJECT_ID };
5
+ const project = { id: String(process.env.PROJECT_ID) };
6
6
  const EVENT_ID = String(process.env.EVENT_ID);
7
7
  const SELLER_ID = String(process.env.SELLER_ID);
8
8
 
@@ -3,7 +3,7 @@ import * as moment from 'moment';
3
3
  import * as client from '../../../../lib/index';
4
4
  import { auth as authClient } from '../../auth/clientCredentials';
5
5
 
6
- const project = { id: process.env.PROJECT_ID };
6
+ const project = { id: String(process.env.PROJECT_ID) };
7
7
 
8
8
  const profile = {
9
9
  email: <string>process.env.TEST_PROFILE_EMAIL,
@@ -3,7 +3,7 @@ import * as moment from 'moment';
3
3
  import * as client from '../../../../lib/index';
4
4
  import { auth as authClient } from '../../auth/clientCredentials';
5
5
 
6
- const project = { id: process.env.PROJECT_ID };
6
+ const project = { id: String(process.env.PROJECT_ID) };
7
7
 
8
8
  const profile = {
9
9
  email: <string>process.env.TEST_PROFILE_EMAIL,
@@ -2,7 +2,7 @@
2
2
  import * as client from '../../lib/';
3
3
  import * as auth from './auth/authAsAdmin';
4
4
 
5
- const project = { id: process.env.PROJECT_ID };
5
+ const project = { id: String(process.env.PROJECT_ID) };
6
6
 
7
7
  async function main() {
8
8
  const authClient = await auth.login();
@@ -10,3 +10,6 @@ export declare type IProvidePaymentService = Pick<factory.service.paymentService
10
10
  };
11
11
  export declare type ISearchPaymentServiceConditions = Pick<factory.product.ISearchConditions, 'limit' | 'page' | 'sort' | 'typeOf'>;
12
12
  export declare type IPaymentAccepted = Pick<factory.categoryCode.ICategoryCode, 'codeValue' | 'additionalProperty' | 'color' | 'image' | 'name'>;
13
+ export declare type IMakesProductOffer = Pick<factory.product.IOffer, 'availabilityEnds' | 'availabilityStarts' | 'seller' | 'validFrom' | 'validThrough'> & {
14
+ itemOffered: Pick<factory.product.IProduct, 'id' | 'name' | 'typeOf'>;
15
+ };
@@ -1,6 +1,6 @@
1
1
  import * as factory from '../factory';
2
2
  import { IAdditionalOptions, IOptions, ISearchResult, IUnset, Service } from '../service';
3
- import { IPaymentAccepted, IPaymentServiceByProvider, IProvidePaymentService, ISearchPaymentServiceConditions } from './seller/factory';
3
+ import { IMakesProductOffer, IPaymentAccepted, IPaymentServiceByProvider, IProvidePaymentService, ISearchPaymentServiceConditions } from './seller/factory';
4
4
  /**
5
5
  * 販売者サービス
6
6
  */
@@ -106,4 +106,42 @@ export declare class SellerService extends Service<IOptions & IAdditionalOptions
106
106
  id: string;
107
107
  provider: Pick<factory.service.paymentService.IProvider, 'id'>;
108
108
  }): Promise<void>;
109
+ searchMakesProductOffer(params: {
110
+ seller: {
111
+ /**
112
+ * 販売者ID
113
+ */
114
+ id: string;
115
+ };
116
+ /**
117
+ * 検索条件
118
+ */
119
+ qs: {
120
+ limit?: number;
121
+ page?: number;
122
+ itemOffered?: {
123
+ id?: {
124
+ $eq?: string;
125
+ };
126
+ };
127
+ };
128
+ }): Promise<ISearchResult<IMakesProductOffer[]>>;
129
+ createMakesProductOffer(params: Pick<factory.product.IOffer, 'availabilityEnds' | 'availabilityStarts' | 'seller' | 'validFrom' | 'validThrough'> & {
130
+ itemOffered: {
131
+ id: string;
132
+ };
133
+ }): Promise<void>;
134
+ updateMakesProductOffer(params: Pick<factory.product.IOffer, 'availabilityEnds' | 'availabilityStarts' | 'seller' | 'validFrom' | 'validThrough'> & {
135
+ itemOffered: {
136
+ id: string;
137
+ };
138
+ }): Promise<void>;
139
+ deleteMakesProductOffer(params: {
140
+ itemOffered: {
141
+ id: string;
142
+ };
143
+ seller: {
144
+ id: string;
145
+ };
146
+ }): Promise<void>;
109
147
  }
@@ -305,6 +305,85 @@ var SellerService = /** @class */ (function (_super) {
305
305
  });
306
306
  });
307
307
  };
308
+ SellerService.prototype.searchMakesProductOffer = function (params) {
309
+ var _a;
310
+ return __awaiter(this, void 0, void 0, function () {
311
+ var _this = this;
312
+ return __generator(this, function (_b) {
313
+ return [2 /*return*/, this.fetch({
314
+ uri: "/sellers/" + ((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) + "/makesProductOffer",
315
+ method: 'GET',
316
+ qs: params.qs,
317
+ expectedStatusCodes: [http_status_1.OK]
318
+ })
319
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
320
+ var _a;
321
+ return __generator(this, function (_b) {
322
+ switch (_b.label) {
323
+ case 0:
324
+ _a = {};
325
+ return [4 /*yield*/, response.json()];
326
+ case 1: return [2 /*return*/, (_a.data = _b.sent(),
327
+ _a)];
328
+ }
329
+ });
330
+ }); })];
331
+ });
332
+ });
333
+ };
334
+ SellerService.prototype.createMakesProductOffer = function (params) {
335
+ var _a;
336
+ return __awaiter(this, void 0, void 0, function () {
337
+ return __generator(this, function (_b) {
338
+ switch (_b.label) {
339
+ case 0: return [4 /*yield*/, this.fetch({
340
+ uri: "/sellers/" + String((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) + "/makesProductOffer",
341
+ method: 'POST',
342
+ body: params,
343
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
344
+ })];
345
+ case 1:
346
+ _b.sent();
347
+ return [2 /*return*/];
348
+ }
349
+ });
350
+ });
351
+ };
352
+ SellerService.prototype.updateMakesProductOffer = function (params) {
353
+ var _a;
354
+ return __awaiter(this, void 0, void 0, function () {
355
+ return __generator(this, function (_b) {
356
+ switch (_b.label) {
357
+ case 0: return [4 /*yield*/, this.fetch({
358
+ uri: "/sellers/" + String((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) + "/makesProductOffer/" + params.itemOffered.id,
359
+ method: 'PUT',
360
+ body: params,
361
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
362
+ })];
363
+ case 1:
364
+ _b.sent();
365
+ return [2 /*return*/];
366
+ }
367
+ });
368
+ });
369
+ };
370
+ SellerService.prototype.deleteMakesProductOffer = function (params) {
371
+ var _a;
372
+ return __awaiter(this, void 0, void 0, function () {
373
+ return __generator(this, function (_b) {
374
+ switch (_b.label) {
375
+ case 0: return [4 /*yield*/, this.fetch({
376
+ uri: "/sellers/" + ((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) + "/makesProductOffer/" + params.itemOffered.id,
377
+ method: 'DELETE',
378
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
379
+ })];
380
+ case 1:
381
+ _b.sent();
382
+ return [2 /*return*/];
383
+ }
384
+ });
385
+ });
386
+ };
308
387
  return SellerService;
309
388
  }(service_1.Service));
310
389
  exports.SellerService = SellerService;
@@ -1,13 +1,14 @@
1
1
  import * as factory from '@chevre/factory';
2
- import { ISearchResult, Service } from '../service';
2
+ import { IOptions, ISearchResult, Service } from '../service';
3
3
  /**
4
4
  * 口座取引サービス
5
5
  */
6
6
  export declare class AccountTransactionService extends Service {
7
+ constructor(options: Pick<IOptions, 'auth' | 'endpoint' | 'transporter'>);
7
8
  /**
8
9
  * 取引検索
9
10
  */
10
- search(params: Omit<factory.account.transaction.ISearchConditions, 'project'>): Promise<ISearchResult<Pick<factory.account.transaction.ITransaction<factory.account.transactionType>, 'id' | 'status' | 'transactionNumber' | 'agent' | 'endDate' | 'expires' | 'object' | 'project' | 'recipient' | 'startDate' | 'typeOf'>[]>>;
11
+ search(params: factory.account.transaction.ISearchConditions): Promise<ISearchResult<Pick<factory.account.transaction.ITransaction<factory.account.transactionType>, 'id' | 'status' | 'transactionNumber' | 'agent' | 'endDate' | 'expires' | 'object' | 'project' | 'recipient' | 'startDate' | 'typeOf'>[]>>;
11
12
  /**
12
13
  * 取引開始
13
14
  */
@@ -14,6 +14,17 @@ var __extends = (this && this.__extends) || (function () {
14
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
15
  };
16
16
  })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
17
28
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
29
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
30
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -59,8 +70,8 @@ var service_1 = require("../service");
59
70
  */
60
71
  var AccountTransactionService = /** @class */ (function (_super) {
61
72
  __extends(AccountTransactionService, _super);
62
- function AccountTransactionService() {
63
- return _super !== null && _super.apply(this, arguments) || this;
73
+ function AccountTransactionService(options) {
74
+ return _super.call(this, __assign(__assign({}, options), { project: { id: '' } })) || this;
64
75
  }
65
76
  /**
66
77
  * 取引検索
@@ -1,10 +1,11 @@
1
1
  import * as factory from '../factory';
2
- import { Service } from '../service';
2
+ import { IOptions, Service } from '../service';
3
3
  declare type IPermitAsResponse = Omit<factory.permit.IPermit, 'accessCode' | 'additionalProperty' | 'issuedBy'>;
4
4
  /**
5
5
  * 許可証サービス
6
6
  */
7
7
  export declare class PermitService extends Service {
8
+ constructor(options: Pick<IOptions, 'auth' | 'endpoint' | 'transporter'>);
8
9
  /**
9
10
  * 許可証照会
10
11
  * 存在しない場合、ステータスコード404を返します
@@ -14,6 +14,17 @@ var __extends = (this && this.__extends) || (function () {
14
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
15
  };
16
16
  })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
17
28
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
29
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
30
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -59,8 +70,8 @@ var service_1 = require("../service");
59
70
  */
60
71
  var PermitService = /** @class */ (function (_super) {
61
72
  __extends(PermitService, _super);
62
- function PermitService() {
63
- return _super !== null && _super.apply(this, arguments) || this;
73
+ function PermitService(options) {
74
+ return _super.call(this, __assign(__assign({}, options), { project: { id: '' } })) || this;
64
75
  }
65
76
  /**
66
77
  * 許可証照会
package/lib/bundle.js CHANGED
@@ -8730,6 +8730,85 @@ var SellerService = /** @class */ (function (_super) {
8730
8730
  });
8731
8731
  });
8732
8732
  };
8733
+ SellerService.prototype.searchMakesProductOffer = function (params) {
8734
+ var _a;
8735
+ return __awaiter(this, void 0, void 0, function () {
8736
+ var _this = this;
8737
+ return __generator(this, function (_b) {
8738
+ return [2 /*return*/, this.fetch({
8739
+ uri: "/sellers/" + ((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) + "/makesProductOffer",
8740
+ method: 'GET',
8741
+ qs: params.qs,
8742
+ expectedStatusCodes: [http_status_1.OK]
8743
+ })
8744
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
8745
+ var _a;
8746
+ return __generator(this, function (_b) {
8747
+ switch (_b.label) {
8748
+ case 0:
8749
+ _a = {};
8750
+ return [4 /*yield*/, response.json()];
8751
+ case 1: return [2 /*return*/, (_a.data = _b.sent(),
8752
+ _a)];
8753
+ }
8754
+ });
8755
+ }); })];
8756
+ });
8757
+ });
8758
+ };
8759
+ SellerService.prototype.createMakesProductOffer = function (params) {
8760
+ var _a;
8761
+ return __awaiter(this, void 0, void 0, function () {
8762
+ return __generator(this, function (_b) {
8763
+ switch (_b.label) {
8764
+ case 0: return [4 /*yield*/, this.fetch({
8765
+ uri: "/sellers/" + String((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) + "/makesProductOffer",
8766
+ method: 'POST',
8767
+ body: params,
8768
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
8769
+ })];
8770
+ case 1:
8771
+ _b.sent();
8772
+ return [2 /*return*/];
8773
+ }
8774
+ });
8775
+ });
8776
+ };
8777
+ SellerService.prototype.updateMakesProductOffer = function (params) {
8778
+ var _a;
8779
+ return __awaiter(this, void 0, void 0, function () {
8780
+ return __generator(this, function (_b) {
8781
+ switch (_b.label) {
8782
+ case 0: return [4 /*yield*/, this.fetch({
8783
+ uri: "/sellers/" + String((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) + "/makesProductOffer/" + params.itemOffered.id,
8784
+ method: 'PUT',
8785
+ body: params,
8786
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
8787
+ })];
8788
+ case 1:
8789
+ _b.sent();
8790
+ return [2 /*return*/];
8791
+ }
8792
+ });
8793
+ });
8794
+ };
8795
+ SellerService.prototype.deleteMakesProductOffer = function (params) {
8796
+ var _a;
8797
+ return __awaiter(this, void 0, void 0, function () {
8798
+ return __generator(this, function (_b) {
8799
+ switch (_b.label) {
8800
+ case 0: return [4 /*yield*/, this.fetch({
8801
+ uri: "/sellers/" + ((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) + "/makesProductOffer/" + params.itemOffered.id,
8802
+ method: 'DELETE',
8803
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
8804
+ })];
8805
+ case 1:
8806
+ _b.sent();
8807
+ return [2 /*return*/];
8808
+ }
8809
+ });
8810
+ });
8811
+ };
8733
8812
  return SellerService;
8734
8813
  }(service_1.Service));
8735
8814
  exports.SellerService = SellerService;
@@ -10494,6 +10573,17 @@ var __extends = (this && this.__extends) || (function () {
10494
10573
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10495
10574
  };
10496
10575
  })();
10576
+ var __assign = (this && this.__assign) || function () {
10577
+ __assign = Object.assign || function(t) {
10578
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
10579
+ s = arguments[i];
10580
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10581
+ t[p] = s[p];
10582
+ }
10583
+ return t;
10584
+ };
10585
+ return __assign.apply(this, arguments);
10586
+ };
10497
10587
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
10498
10588
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10499
10589
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -10539,8 +10629,8 @@ var service_1 = require("../service");
10539
10629
  */
10540
10630
  var AccountTransactionService = /** @class */ (function (_super) {
10541
10631
  __extends(AccountTransactionService, _super);
10542
- function AccountTransactionService() {
10543
- return _super !== null && _super.apply(this, arguments) || this;
10632
+ function AccountTransactionService(options) {
10633
+ return _super.call(this, __assign(__assign({}, options), { project: { id: '' } })) || this;
10544
10634
  }
10545
10635
  /**
10546
10636
  * 取引検索
@@ -10654,6 +10744,17 @@ var __extends = (this && this.__extends) || (function () {
10654
10744
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10655
10745
  };
10656
10746
  })();
10747
+ var __assign = (this && this.__assign) || function () {
10748
+ __assign = Object.assign || function(t) {
10749
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
10750
+ s = arguments[i];
10751
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10752
+ t[p] = s[p];
10753
+ }
10754
+ return t;
10755
+ };
10756
+ return __assign.apply(this, arguments);
10757
+ };
10657
10758
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
10658
10759
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10659
10760
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -10699,8 +10800,8 @@ var service_1 = require("../service");
10699
10800
  */
10700
10801
  var PermitService = /** @class */ (function (_super) {
10701
10802
  __extends(PermitService, _super);
10702
- function PermitService() {
10703
- return _super !== null && _super.apply(this, arguments) || this;
10803
+ function PermitService(options) {
10804
+ return _super.call(this, __assign(__assign({}, options), { project: { id: '' } })) || this;
10704
10805
  }
10705
10806
  /**
10706
10807
  * 許可証照会
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "3.160.0-alpha.0",
3
+ "version": "3.160.0-alpha.2",
4
4
  "description": "Cinerino SDK",
5
5
  "main": "./lib/index.js",
6
6
  "browser": {
@@ -1,54 +0,0 @@
1
- // tslint:disable:no-console no-implicit-dependencies no-magic-numbers
2
- import * as httpStatus from 'http-status';
3
- import * as moment from 'moment';
4
-
5
- import * as client from '../../../lib/index';
6
-
7
- const auth = new client.auth.ClientCredentials({
8
- domain: <string>process.env.ST_AUTHORIZE_SERVER_DOMAIN,
9
- clientId: <string>process.env.ST_CLIENT_ID,
10
- clientSecret: <string>process.env.ST_CLIENT_SECRET,
11
- scopes: [],
12
- state: 'teststate'
13
- });
14
-
15
- const sellerService = new client.service.Seller({
16
- endpoint: <string>process.env.ST_API_ENDPOINT,
17
- auth: auth
18
- });
19
-
20
- // tslint:disable-next-line:max-func-body-length
21
- async function main() {
22
- console.log('検索しています...');
23
- const searchResult = await sellerService.fetch({
24
- uri: '/events/ScreeningEventSeries',
25
- method: 'GET',
26
- qs: {
27
- limit: 100,
28
- startFrom: moment('2019-07-04T00:00:00+09:00')
29
- .toDate(),
30
- startThrough: moment('2019-07-04T00:00:00+09:00')
31
- .toDate(),
32
- endFrom: moment('2119-07-05T00:00:00+09:00')
33
- .toDate(),
34
- endThrough: moment('2119-07-05T00:00:00+09:00')
35
- .toDate()
36
- },
37
- expectedStatusCodes: [httpStatus.OK]
38
- })
39
- .then(async (response) => {
40
- return {
41
- data: await response.json()
42
- };
43
- });
44
- console.log(searchResult.data);
45
- console.log(searchResult.data.length);
46
- }
47
-
48
- main()
49
- .then(() => {
50
- console.log('main processed.');
51
- })
52
- .catch((err) => {
53
- console.error(err);
54
- });
@@ -1,45 +0,0 @@
1
- // tslint:disable:no-console no-implicit-dependencies no-magic-numbers
2
- import * as httpStatus from 'http-status';
3
-
4
- import * as client from '../../../lib/index';
5
-
6
- const auth = new client.auth.ClientCredentials({
7
- domain: <string>process.env.ST_AUTHORIZE_SERVER_DOMAIN,
8
- clientId: <string>process.env.ST_CLIENT_ID,
9
- clientSecret: <string>process.env.ST_CLIENT_SECRET,
10
- scopes: [],
11
- state: 'teststate'
12
- });
13
-
14
- const sellerService = new client.service.Seller({
15
- endpoint: <string>process.env.ST_API_ENDPOINT,
16
- auth: auth
17
- });
18
-
19
- // tslint:disable-next-line:max-func-body-length
20
- async function main() {
21
- console.log('ルームを検索しています...');
22
- const searchResult = await sellerService.fetch({
23
- uri: '/places/ScreeningRoom',
24
- method: 'GET',
25
- qs: {
26
- limit: 100
27
- },
28
- expectedStatusCodes: [httpStatus.OK]
29
- })
30
- .then(async (response) => {
31
- return {
32
- data: await response.json()
33
- };
34
- });
35
- console.log(searchResult.data);
36
- console.log(searchResult.data.length);
37
- }
38
-
39
- main()
40
- .then(() => {
41
- console.log('main processed.');
42
- })
43
- .catch((err) => {
44
- console.error(err);
45
- });
@@ -1,48 +0,0 @@
1
- // tslint:disable:no-console no-implicit-dependencies no-magic-numbers
2
- import * as httpStatus from 'http-status';
3
-
4
- import * as client from '../../../lib/index';
5
-
6
- const auth = new client.auth.ClientCredentials({
7
- domain: <string>process.env.ST_AUTHORIZE_SERVER_DOMAIN,
8
- clientId: <string>process.env.ST_CLIENT_ID,
9
- clientSecret: <string>process.env.ST_CLIENT_SECRET,
10
- scopes: [],
11
- state: 'teststate'
12
- });
13
-
14
- const sellerService = new client.service.Seller({
15
- endpoint: <string>process.env.ST_API_ENDPOINT,
16
- auth: auth
17
- });
18
-
19
- // tslint:disable-next-line:max-func-body-length
20
- async function main() {
21
- console.log('座席を検索しています...');
22
- const searchResult = await sellerService.fetch({
23
- uri: '/places/Seat',
24
- method: 'GET',
25
- qs: {
26
- limit: 10,
27
- movieTheaterBranchCode: '002',
28
- screeningRoomBranchCode: '1'
29
- },
30
- expectedStatusCodes: [httpStatus.OK]
31
- })
32
- .then(async (response) => {
33
- return {
34
- data: await response.json()
35
- };
36
- });
37
- console.log(searchResult.data);
38
- console.log(searchResult.data.length);
39
- console.log(searchResult.data[0]?.containedInPlace);
40
- }
41
-
42
- main()
43
- .then(() => {
44
- console.log('main processed.');
45
- })
46
- .catch((err) => {
47
- console.error(err);
48
- });
@@ -1,45 +0,0 @@
1
- // tslint:disable:no-console no-implicit-dependencies no-magic-numbers
2
- import * as httpStatus from 'http-status';
3
-
4
- import * as client from '../../../lib/index';
5
-
6
- const auth = new client.auth.ClientCredentials({
7
- domain: <string>process.env.ST_AUTHORIZE_SERVER_DOMAIN,
8
- clientId: <string>process.env.ST_CLIENT_ID,
9
- clientSecret: <string>process.env.ST_CLIENT_SECRET,
10
- scopes: [],
11
- state: 'teststate'
12
- });
13
-
14
- const sellerService = new client.service.Seller({
15
- endpoint: <string>process.env.ST_API_ENDPOINT,
16
- auth: auth
17
- });
18
-
19
- // tslint:disable-next-line:max-func-body-length
20
- async function main() {
21
- console.log('searching sellers...');
22
- const searchResult = await sellerService.fetch({
23
- uri: '/sellers',
24
- method: 'GET',
25
- qs: {
26
- limit: 100
27
- },
28
- expectedStatusCodes: [httpStatus.OK]
29
- })
30
- .then(async (response) => {
31
- return {
32
- data: await response.json()
33
- };
34
- });
35
- console.log(searchResult.data);
36
- console.log(searchResult.data.map((s: any) => s.additionalProperty));
37
- }
38
-
39
- main()
40
- .then(() => {
41
- console.log('main processed.');
42
- })
43
- .catch((err) => {
44
- console.error(err);
45
- });