@cinerino/sdk 10.11.0-alpha.3 → 10.11.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.
@@ -5482,17 +5482,18 @@ var IAMService = /** @class */ (function (_super) {
5482
5482
  */
5483
5483
  IAMService.prototype.createMember = function (params) {
5484
5484
  return __awaiter(this, void 0, void 0, function () {
5485
- var _this = this;
5486
5485
  return __generator(this, function (_a) {
5487
- return [2 /*return*/, this.fetch({
5488
- uri: '/iam/members',
5489
- method: 'POST',
5490
- body: params,
5491
- expectedStatusCodes: [http_status_1.CREATED]
5492
- })
5493
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
5494
- return [2 /*return*/, response.json()];
5495
- }); }); })];
5486
+ switch (_a.label) {
5487
+ case 0: return [4 /*yield*/, this.fetch({
5488
+ uri: '/iam/members',
5489
+ method: 'POST',
5490
+ body: params,
5491
+ expectedStatusCodes: [http_status_1.CREATED, http_status_1.NO_CONTENT]
5492
+ })];
5493
+ case 1:
5494
+ _a.sent();
5495
+ return [2 /*return*/];
5496
+ }
5496
5497
  });
5497
5498
  });
5498
5499
  };
@@ -6902,21 +6903,16 @@ var OfferItemConditionService = /** @class */ (function (_super) {
6902
6903
  });
6903
6904
  });
6904
6905
  };
6905
- OfferItemConditionService.prototype.findById = function (params) {
6906
- return __awaiter(this, void 0, void 0, function () {
6907
- var _this = this;
6908
- return __generator(this, function (_a) {
6909
- return [2 /*return*/, this.fetch({
6910
- uri: "/offerItemConditions/" + encodeURIComponent(String(params.id)),
6911
- method: 'GET',
6912
- expectedStatusCodes: [http_status_1.OK]
6913
- })
6914
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
6915
- return [2 /*return*/, response.json()];
6916
- }); }); })];
6917
- });
6918
- });
6919
- };
6906
+ // public async findById(params: {
6907
+ // id: string;
6908
+ // }): Promise<factory.offerItemCondition.IOfferItemCondition> {
6909
+ // return this.fetch({
6910
+ // uri: `/offerItemConditions/${encodeURIComponent(String(params.id))}`,
6911
+ // method: 'GET',
6912
+ // expectedStatusCodes: [OK]
6913
+ // })
6914
+ // .then(async (response) => response.json());
6915
+ // }
6920
6916
  OfferItemConditionService.prototype.update = function (params) {
6921
6917
  return __awaiter(this, void 0, void 0, function () {
6922
6918
  return __generator(this, function (_a) {
@@ -10257,18 +10253,20 @@ var SellerService = /** @class */ (function (_super) {
10257
10253
  var _a;
10258
10254
  return __awaiter(this, void 0, void 0, function () {
10259
10255
  var sellerId;
10260
- var _this = this;
10261
10256
  return __generator(this, function (_b) {
10262
- sellerId = (_a = params[0]) === null || _a === void 0 ? void 0 : _a.member.memberOf.id;
10263
- return [2 /*return*/, this.fetch({
10264
- uri: "/sellers/" + String(sellerId) + "/members",
10265
- method: 'POST',
10266
- body: params,
10267
- expectedStatusCodes: [http_status_1.CREATED]
10268
- })
10269
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
10270
- return [2 /*return*/, response.json()];
10271
- }); }); })];
10257
+ switch (_b.label) {
10258
+ case 0:
10259
+ sellerId = (_a = params[0]) === null || _a === void 0 ? void 0 : _a.member.memberOf.id;
10260
+ return [4 /*yield*/, this.fetch({
10261
+ uri: "/sellers/" + String(sellerId) + "/members",
10262
+ method: 'POST',
10263
+ body: params,
10264
+ expectedStatusCodes: [http_status_1.CREATED, http_status_1.NO_CONTENT]
10265
+ })];
10266
+ case 1:
10267
+ _b.sent();
10268
+ return [2 /*return*/];
10269
+ }
10272
10270
  });
10273
10271
  });
10274
10272
  };
@@ -10564,6 +10562,7 @@ exports.TicketService = TicketService;
10564
10562
 
10565
10563
  },{"../service":139,"http-status":372}],58:[function(require,module,exports){
10566
10564
  "use strict";
10565
+ // import { OK } from 'http-status';
10567
10566
  var __extends = (this && this.__extends) || (function () {
10568
10567
  var extendStatics = function (d, b) {
10569
10568
  extendStatics = Object.setPrototypeOf ||
@@ -10579,45 +10578,8 @@ var __extends = (this && this.__extends) || (function () {
10579
10578
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10580
10579
  };
10581
10580
  })();
10582
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
10583
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10584
- return new (P || (P = Promise))(function (resolve, reject) {
10585
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
10586
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
10587
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10588
- step((generator = generator.apply(thisArg, _arguments || [])).next());
10589
- });
10590
- };
10591
- var __generator = (this && this.__generator) || function (thisArg, body) {
10592
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
10593
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
10594
- function verb(n) { return function (v) { return step([n, v]); }; }
10595
- function step(op) {
10596
- if (f) throw new TypeError("Generator is already executing.");
10597
- while (_) try {
10598
- 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;
10599
- if (y = 0, t) op = [op[0] & 2, t.value];
10600
- switch (op[0]) {
10601
- case 0: case 1: t = op; break;
10602
- case 4: _.label++; return { value: op[1], done: false };
10603
- case 5: _.label++; y = op[1]; op = [0]; continue;
10604
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
10605
- default:
10606
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
10607
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
10608
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
10609
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
10610
- if (t[2]) _.ops.pop();
10611
- _.trys.pop(); continue;
10612
- }
10613
- op = body.call(thisArg, _);
10614
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
10615
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
10616
- }
10617
- };
10618
10581
  Object.defineProperty(exports, "__esModule", { value: true });
10619
10582
  exports.TokenService = void 0;
10620
- var http_status_1 = require("http-status");
10621
10583
  var service_1 = require("../service");
10622
10584
  /**
10623
10585
  * トークンサービス
@@ -10627,30 +10589,11 @@ var TokenService = /** @class */ (function (_super) {
10627
10589
  function TokenService() {
10628
10590
  return _super !== null && _super.apply(this, arguments) || this;
10629
10591
  }
10630
- /**
10631
- * トークンを取得する
10632
- */
10633
- TokenService.prototype.getToken = function (params) {
10634
- return __awaiter(this, void 0, void 0, function () {
10635
- var _this = this;
10636
- return __generator(this, function (_a) {
10637
- return [2 /*return*/, this.fetch({
10638
- uri: '/tokens',
10639
- method: 'POST',
10640
- body: params,
10641
- expectedStatusCodes: [http_status_1.OK]
10642
- })
10643
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
10644
- return [2 /*return*/, response.json()];
10645
- }); }); })];
10646
- });
10647
- });
10648
- };
10649
10592
  return TokenService;
10650
10593
  }(service_1.Service));
10651
10594
  exports.TokenService = TokenService;
10652
10595
 
10653
- },{"../service":139,"http-status":372}],59:[function(require,module,exports){
10596
+ },{"../service":139}],59:[function(require,module,exports){
10654
10597
  "use strict";
10655
10598
  var __extends = (this && this.__extends) || (function () {
10656
10599
  var extendStatics = function (d, b) {
@@ -12488,7 +12431,7 @@ exports.ReservationService = ReservationService;
12488
12431
 
12489
12432
  },{"../service":139,"http-status":372}],72:[function(require,module,exports){
12490
12433
  arguments[4][58][0].apply(exports,arguments)
12491
- },{"../service":139,"dup":58,"http-status":372}],73:[function(require,module,exports){
12434
+ },{"../service":139,"dup":58}],73:[function(require,module,exports){
12492
12435
  "use strict";
12493
12436
  var __assign = (this && this.__assign) || function () {
12494
12437
  __assign = Object.assign || function(t) {
@@ -20155,50 +20098,9 @@ var __extends = (this && this.__extends) || (function () {
20155
20098
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
20156
20099
  };
20157
20100
  })();
20158
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
20159
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
20160
- return new (P || (P = Promise))(function (resolve, reject) {
20161
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20162
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20163
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20164
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20165
- });
20166
- };
20167
- var __generator = (this && this.__generator) || function (thisArg, body) {
20168
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
20169
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
20170
- function verb(n) { return function (v) { return step([n, v]); }; }
20171
- function step(op) {
20172
- if (f) throw new TypeError("Generator is already executing.");
20173
- while (_) try {
20174
- 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;
20175
- if (y = 0, t) op = [op[0] & 2, t.value];
20176
- switch (op[0]) {
20177
- case 0: case 1: t = op; break;
20178
- case 4: _.label++; return { value: op[1], done: false };
20179
- case 5: _.label++; y = op[1]; op = [0]; continue;
20180
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
20181
- default:
20182
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
20183
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
20184
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
20185
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
20186
- if (t[2]) _.ops.pop();
20187
- _.trys.pop(); continue;
20188
- }
20189
- op = body.call(thisArg, _);
20190
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
20191
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
20192
- }
20193
- };
20194
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
20195
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
20196
- to[j] = from[i];
20197
- return to;
20198
- };
20199
20101
  Object.defineProperty(exports, "__esModule", { value: true });
20200
20102
  exports.TokenService = void 0;
20201
- var index_1 = require("../../index");
20103
+ // import { loadChevreAsset } from '../../index';
20202
20104
  var service_1 = require("../../service");
20203
20105
  /**
20204
20106
  * トークンサービス
@@ -20208,43 +20110,11 @@ var TokenService = /** @class */ (function (_super) {
20208
20110
  function TokenService() {
20209
20111
  return _super !== null && _super.apply(this, arguments) || this;
20210
20112
  }
20211
- // constructor(options: IAdditionalOptions & Pick<IOptions, 'auth' | 'endpoint' | 'transporter' | 'project' | 'defaultPath'>) {
20212
- // super({ ...options, retryableStatusCodes: [BAD_GATEWAY, FORBIDDEN, UNAUTHORIZED] });
20213
- // }
20214
- /**
20215
- * トークンを取得する
20216
- */
20217
- TokenService.prototype.getToken = function (params) {
20218
- return __awaiter(this, void 0, void 0, function () {
20219
- var _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevreAsset, code, tokenService, token;
20220
- return __generator(this, function (_b) {
20221
- switch (_b.label) {
20222
- case 0:
20223
- _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
20224
- return [4 /*yield*/, index_1.loadChevreAsset({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
20225
- case 1:
20226
- chevreAsset = _b.sent();
20227
- code = params.code;
20228
- return [4 /*yield*/, chevreAsset.createTokenInstance({
20229
- project: project,
20230
- seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
20231
- retryableStatusCodes: __spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [])
20232
- })];
20233
- case 2:
20234
- tokenService = _b.sent();
20235
- return [4 /*yield*/, tokenService.getToken({ code: code })];
20236
- case 3:
20237
- token = (_b.sent()).token;
20238
- return [2 /*return*/, { token: token }];
20239
- }
20240
- });
20241
- });
20242
- };
20243
20113
  return TokenService;
20244
20114
  }(service_1.Service));
20245
20115
  exports.TokenService = TokenService;
20246
20116
 
20247
- },{"../../index":135,"../../service":139}],125:[function(require,module,exports){
20117
+ },{"../../service":139}],125:[function(require,module,exports){
20248
20118
  "use strict";
20249
20119
  var __assign = (this && this.__assign) || function () {
20250
20120
  __assign = Object.assign || function(t) {
@@ -8,13 +8,6 @@ export interface IUseAction {
8
8
  typeOf: factory.actionType.UseAction;
9
9
  location?: factory.action.consume.use.reservation.ILocation;
10
10
  }
11
- interface ITicketAsJWT {
12
- /**
13
- * jsonwebtoken
14
- * service.Token.getToken() にて取得したトークンなど
15
- */
16
- token: string;
17
- }
18
11
  interface ITicketAsCode {
19
12
  /**
20
13
  * 注文コードなど
@@ -24,5 +17,5 @@ interface ITicketAsCode {
24
17
  /**
25
18
  * 予約使用チケット
26
19
  */
27
- export declare type ITicket = ITicketAsJWT | ITicketAsCode;
20
+ export declare type ITicket = ITicketAsCode;
28
21
  export {};
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ // export type ITicket = ITicketAsJWT | ITicketAsCode;
@@ -9,10 +9,4 @@ export interface ITokenResponse {
9
9
  * トークンサービス
10
10
  */
11
11
  export declare class TokenService extends Service {
12
- /**
13
- * トークンを取得する
14
- */
15
- getToken(params: {
16
- code: string;
17
- }): Promise<ITokenResponse>;
18
12
  }
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ // import { OK } from 'http-status';
2
3
  var __extends = (this && this.__extends) || (function () {
3
4
  var extendStatics = function (d, b) {
4
5
  extendStatics = Object.setPrototypeOf ||
@@ -14,45 +15,8 @@ var __extends = (this && this.__extends) || (function () {
14
15
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
16
  };
16
17
  })();
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
18
  Object.defineProperty(exports, "__esModule", { value: true });
54
19
  exports.TokenService = void 0;
55
- var http_status_1 = require("http-status");
56
20
  var service_1 = require("../service");
57
21
  /**
58
22
  * トークンサービス
@@ -62,25 +26,6 @@ var TokenService = /** @class */ (function (_super) {
62
26
  function TokenService() {
63
27
  return _super !== null && _super.apply(this, arguments) || this;
64
28
  }
65
- /**
66
- * トークンを取得する
67
- */
68
- TokenService.prototype.getToken = function (params) {
69
- return __awaiter(this, void 0, void 0, function () {
70
- var _this = this;
71
- return __generator(this, function (_a) {
72
- return [2 /*return*/, this.fetch({
73
- uri: '/tokens',
74
- method: 'POST',
75
- body: params,
76
- expectedStatusCodes: [http_status_1.OK]
77
- })
78
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
79
- return [2 /*return*/, response.json()];
80
- }); }); })];
81
- });
82
- });
83
- };
84
29
  return TokenService;
85
30
  }(service_1.Service));
86
31
  exports.TokenService = TokenService;
@@ -14,7 +14,7 @@ interface IOfferAsFindByCodeResult {
14
14
  /**
15
15
  * コードによる予約照会結果
16
16
  */
17
- export declare type IFindByCodeResult = Pick<factory.reservation.IReservation<factory.reservationType.EventReservation>, 'id' | 'additionalTicketText' | 'reservationStatus'> & {
17
+ export declare type IFindByCodeResult = Pick<factory.reservation.IReservation<factory.reservationType.EventReservation>, 'id' | 'additionalTicketText' | 'checkedIn' | 'reservationStatus'> & {
18
18
  reservedTicket: {
19
19
  ticketType: IOfferAsFindByCodeResult;
20
20
  };
@@ -9,10 +9,4 @@ export interface ITokenResponse {
9
9
  * トークンサービス
10
10
  */
11
11
  export declare class TokenService extends Service {
12
- /**
13
- * トークンを取得する
14
- */
15
- getToken(params: {
16
- code: string;
17
- }): Promise<ITokenResponse>;
18
12
  }
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ // import { OK } from 'http-status';
2
3
  var __extends = (this && this.__extends) || (function () {
3
4
  var extendStatics = function (d, b) {
4
5
  extendStatics = Object.setPrototypeOf ||
@@ -14,45 +15,8 @@ var __extends = (this && this.__extends) || (function () {
14
15
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
16
  };
16
17
  })();
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
18
  Object.defineProperty(exports, "__esModule", { value: true });
54
19
  exports.TokenService = void 0;
55
- var http_status_1 = require("http-status");
56
20
  var service_1 = require("../service");
57
21
  /**
58
22
  * トークンサービス
@@ -62,25 +26,6 @@ var TokenService = /** @class */ (function (_super) {
62
26
  function TokenService() {
63
27
  return _super !== null && _super.apply(this, arguments) || this;
64
28
  }
65
- /**
66
- * トークンを取得する
67
- */
68
- TokenService.prototype.getToken = function (params) {
69
- return __awaiter(this, void 0, void 0, function () {
70
- var _this = this;
71
- return __generator(this, function (_a) {
72
- return [2 /*return*/, this.fetch({
73
- uri: '/tokens',
74
- method: 'POST',
75
- body: params,
76
- expectedStatusCodes: [http_status_1.OK]
77
- })
78
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
79
- return [2 /*return*/, response.json()];
80
- }); }); })];
81
- });
82
- });
83
- };
84
29
  return TokenService;
85
30
  }(service_1.Service));
86
31
  exports.TokenService = TokenService;
@@ -67,9 +67,6 @@ var ReservationService = /** @class */ (function (_super) {
67
67
  function ReservationService() {
68
68
  return _super !== null && _super.apply(this, arguments) || this;
69
69
  }
70
- // constructor(options: IAdditionalOptions & Pick<IOptions, 'auth' | 'endpoint' | 'transporter' | 'project' | 'defaultPath'>) {
71
- // super({ ...options, retryableStatusCodes: [BAD_GATEWAY, FORBIDDEN, UNAUTHORIZED] });
72
- // }
73
70
  /**
74
71
  * コードによる予約照会
75
72
  */
@@ -9,13 +9,4 @@ export interface ITokenResponse {
9
9
  * トークンサービス
10
10
  */
11
11
  export declare class TokenService extends Service {
12
- /**
13
- * トークンを取得する
14
- */
15
- getToken(params: {
16
- /**
17
- * 注文コード(注文承認によって発行)
18
- */
19
- code: string;
20
- }): Promise<ITokenResponse>;
21
12
  }
@@ -14,50 +14,9 @@ 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 __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
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
54
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
55
- to[j] = from[i];
56
- return to;
57
- };
58
17
  Object.defineProperty(exports, "__esModule", { value: true });
59
18
  exports.TokenService = void 0;
60
- var index_1 = require("../../index");
19
+ // import { loadChevreAsset } from '../../index';
61
20
  var service_1 = require("../../service");
62
21
  /**
63
22
  * トークンサービス
@@ -67,38 +26,6 @@ var TokenService = /** @class */ (function (_super) {
67
26
  function TokenService() {
68
27
  return _super !== null && _super.apply(this, arguments) || this;
69
28
  }
70
- // constructor(options: IAdditionalOptions & Pick<IOptions, 'auth' | 'endpoint' | 'transporter' | 'project' | 'defaultPath'>) {
71
- // super({ ...options, retryableStatusCodes: [BAD_GATEWAY, FORBIDDEN, UNAUTHORIZED] });
72
- // }
73
- /**
74
- * トークンを取得する
75
- */
76
- TokenService.prototype.getToken = function (params) {
77
- return __awaiter(this, void 0, void 0, function () {
78
- var _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevreAsset, code, tokenService, token;
79
- return __generator(this, function (_b) {
80
- switch (_b.label) {
81
- case 0:
82
- _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
83
- return [4 /*yield*/, index_1.loadChevreAsset({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
84
- case 1:
85
- chevreAsset = _b.sent();
86
- code = params.code;
87
- return [4 /*yield*/, chevreAsset.createTokenInstance({
88
- project: project,
89
- seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
90
- retryableStatusCodes: __spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [])
91
- })];
92
- case 2:
93
- tokenService = _b.sent();
94
- return [4 /*yield*/, tokenService.getToken({ code: code })];
95
- case 3:
96
- token = (_b.sent()).token;
97
- return [2 /*return*/, { token: token }];
98
- }
99
- });
100
- });
101
- };
102
29
  return TokenService;
103
30
  }(service_1.Service));
104
31
  exports.TokenService = TokenService;
package/lib/bundle.js CHANGED
@@ -11782,6 +11782,7 @@ exports.TicketService = TicketService;
11782
11782
 
11783
11783
  },{"../service":139,"http-status":372}],67:[function(require,module,exports){
11784
11784
  "use strict";
11785
+ // import { OK } from 'http-status';
11785
11786
  var __extends = (this && this.__extends) || (function () {
11786
11787
  var extendStatics = function (d, b) {
11787
11788
  extendStatics = Object.setPrototypeOf ||
@@ -11797,45 +11798,8 @@ var __extends = (this && this.__extends) || (function () {
11797
11798
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
11798
11799
  };
11799
11800
  })();
11800
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
11801
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
11802
- return new (P || (P = Promise))(function (resolve, reject) {
11803
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
11804
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
11805
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
11806
- step((generator = generator.apply(thisArg, _arguments || [])).next());
11807
- });
11808
- };
11809
- var __generator = (this && this.__generator) || function (thisArg, body) {
11810
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
11811
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
11812
- function verb(n) { return function (v) { return step([n, v]); }; }
11813
- function step(op) {
11814
- if (f) throw new TypeError("Generator is already executing.");
11815
- while (_) try {
11816
- 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;
11817
- if (y = 0, t) op = [op[0] & 2, t.value];
11818
- switch (op[0]) {
11819
- case 0: case 1: t = op; break;
11820
- case 4: _.label++; return { value: op[1], done: false };
11821
- case 5: _.label++; y = op[1]; op = [0]; continue;
11822
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
11823
- default:
11824
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
11825
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
11826
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
11827
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
11828
- if (t[2]) _.ops.pop();
11829
- _.trys.pop(); continue;
11830
- }
11831
- op = body.call(thisArg, _);
11832
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
11833
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
11834
- }
11835
- };
11836
11801
  Object.defineProperty(exports, "__esModule", { value: true });
11837
11802
  exports.TokenService = void 0;
11838
- var http_status_1 = require("http-status");
11839
11803
  var service_1 = require("../service");
11840
11804
  /**
11841
11805
  * トークンサービス
@@ -11845,30 +11809,11 @@ var TokenService = /** @class */ (function (_super) {
11845
11809
  function TokenService() {
11846
11810
  return _super !== null && _super.apply(this, arguments) || this;
11847
11811
  }
11848
- /**
11849
- * トークンを取得する
11850
- */
11851
- TokenService.prototype.getToken = function (params) {
11852
- return __awaiter(this, void 0, void 0, function () {
11853
- var _this = this;
11854
- return __generator(this, function (_a) {
11855
- return [2 /*return*/, this.fetch({
11856
- uri: '/tokens',
11857
- method: 'POST',
11858
- body: params,
11859
- expectedStatusCodes: [http_status_1.OK]
11860
- })
11861
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
11862
- return [2 /*return*/, response.json()];
11863
- }); }); })];
11864
- });
11865
- });
11866
- };
11867
11812
  return TokenService;
11868
11813
  }(service_1.Service));
11869
11814
  exports.TokenService = TokenService;
11870
11815
 
11871
- },{"../service":139,"http-status":372}],68:[function(require,module,exports){
11816
+ },{"../service":139}],68:[function(require,module,exports){
11872
11817
  "use strict";
11873
11818
  var __extends = (this && this.__extends) || (function () {
11874
11819
  var extendStatics = function (d, b) {
@@ -13706,7 +13651,7 @@ exports.ReservationService = ReservationService;
13706
13651
 
13707
13652
  },{"../service":139,"http-status":372}],81:[function(require,module,exports){
13708
13653
  arguments[4][67][0].apply(exports,arguments)
13709
- },{"../service":139,"dup":67,"http-status":372}],82:[function(require,module,exports){
13654
+ },{"../service":139,"dup":67}],82:[function(require,module,exports){
13710
13655
  "use strict";
13711
13656
  var __assign = (this && this.__assign) || function () {
13712
13657
  __assign = Object.assign || function(t) {
@@ -20077,9 +20022,6 @@ var ReservationService = /** @class */ (function (_super) {
20077
20022
  function ReservationService() {
20078
20023
  return _super !== null && _super.apply(this, arguments) || this;
20079
20024
  }
20080
- // constructor(options: IAdditionalOptions & Pick<IOptions, 'auth' | 'endpoint' | 'transporter' | 'project' | 'defaultPath'>) {
20081
- // super({ ...options, retryableStatusCodes: [BAD_GATEWAY, FORBIDDEN, UNAUTHORIZED] });
20082
- // }
20083
20025
  /**
20084
20026
  * コードによる予約照会
20085
20027
  */
@@ -20153,50 +20095,9 @@ var __extends = (this && this.__extends) || (function () {
20153
20095
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
20154
20096
  };
20155
20097
  })();
20156
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
20157
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
20158
- return new (P || (P = Promise))(function (resolve, reject) {
20159
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20160
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20161
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20162
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20163
- });
20164
- };
20165
- var __generator = (this && this.__generator) || function (thisArg, body) {
20166
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
20167
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
20168
- function verb(n) { return function (v) { return step([n, v]); }; }
20169
- function step(op) {
20170
- if (f) throw new TypeError("Generator is already executing.");
20171
- while (_) try {
20172
- 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;
20173
- if (y = 0, t) op = [op[0] & 2, t.value];
20174
- switch (op[0]) {
20175
- case 0: case 1: t = op; break;
20176
- case 4: _.label++; return { value: op[1], done: false };
20177
- case 5: _.label++; y = op[1]; op = [0]; continue;
20178
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
20179
- default:
20180
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
20181
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
20182
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
20183
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
20184
- if (t[2]) _.ops.pop();
20185
- _.trys.pop(); continue;
20186
- }
20187
- op = body.call(thisArg, _);
20188
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
20189
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
20190
- }
20191
- };
20192
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
20193
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
20194
- to[j] = from[i];
20195
- return to;
20196
- };
20197
20098
  Object.defineProperty(exports, "__esModule", { value: true });
20198
20099
  exports.TokenService = void 0;
20199
- var index_1 = require("../../index");
20100
+ // import { loadChevreAsset } from '../../index';
20200
20101
  var service_1 = require("../../service");
20201
20102
  /**
20202
20103
  * トークンサービス
@@ -20206,43 +20107,11 @@ var TokenService = /** @class */ (function (_super) {
20206
20107
  function TokenService() {
20207
20108
  return _super !== null && _super.apply(this, arguments) || this;
20208
20109
  }
20209
- // constructor(options: IAdditionalOptions & Pick<IOptions, 'auth' | 'endpoint' | 'transporter' | 'project' | 'defaultPath'>) {
20210
- // super({ ...options, retryableStatusCodes: [BAD_GATEWAY, FORBIDDEN, UNAUTHORIZED] });
20211
- // }
20212
- /**
20213
- * トークンを取得する
20214
- */
20215
- TokenService.prototype.getToken = function (params) {
20216
- return __awaiter(this, void 0, void 0, function () {
20217
- var _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevreAsset, code, tokenService, token;
20218
- return __generator(this, function (_b) {
20219
- switch (_b.label) {
20220
- case 0:
20221
- _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
20222
- return [4 /*yield*/, index_1.loadChevreAsset({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
20223
- case 1:
20224
- chevreAsset = _b.sent();
20225
- code = params.code;
20226
- return [4 /*yield*/, chevreAsset.createTokenInstance({
20227
- project: project,
20228
- seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
20229
- retryableStatusCodes: __spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [])
20230
- })];
20231
- case 2:
20232
- tokenService = _b.sent();
20233
- return [4 /*yield*/, tokenService.getToken({ code: code })];
20234
- case 3:
20235
- token = (_b.sent()).token;
20236
- return [2 /*return*/, { token: token }];
20237
- }
20238
- });
20239
- });
20240
- };
20241
20110
  return TokenService;
20242
20111
  }(service_1.Service));
20243
20112
  exports.TokenService = TokenService;
20244
20113
 
20245
- },{"../../index":135,"../../service":139}],125:[function(require,module,exports){
20114
+ },{"../../service":139}],125:[function(require,module,exports){
20246
20115
  "use strict";
20247
20116
  var __assign = (this && this.__assign) || function () {
20248
20117
  __assign = Object.assign || function(t) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "10.11.0-alpha.3",
3
+ "version": "10.11.0",
4
4
  "description": "Cinerino SDK",
5
5
  "main": "./lib/index.js",
6
6
  "browser": {
@@ -1,57 +0,0 @@
1
- // tslint:disable:no-console
2
- // tslint:disable-next-line:no-implicit-dependencies
3
- import { loadChevreAdmin } from '../../../lib/index';
4
- import * as authAsAdmin from '../auth/authAsAdmin';
5
-
6
- const project = { id: String(process.env.PROJECT_ID) };
7
- const TOKEN = 'xxx';
8
-
9
- async function main() {
10
- const authClient = await authAsAdmin.login();
11
- await authClient.refreshAccessToken();
12
- const loginTicket = authClient.verifyIdToken({});
13
- console.log('username is', loginTicket.getUsername());
14
-
15
- // const authClient = await auth.ClientCredentials.createInstance({
16
- // domain: '',
17
- // clientId: '',
18
- // clientSecret: '',
19
- // scopes: [],
20
- // state: ''
21
- // });
22
- // authClient.setCredentials({ access_token: TOKEN });
23
-
24
- const permissionService = await (await loadChevreAdmin({
25
- endpoint: <string>process.env.CHEVRE_ENDPOINT,
26
- auth: authClient
27
- })).createPermissionInstance({
28
- project,
29
- seller: { id: '' }
30
- });
31
- const rservationService = await (await loadChevreAdmin({
32
- endpoint: <string>process.env.CHEVRE_ENDPOINT,
33
- auth: authClient
34
- })).createReservationInstance({
35
- project,
36
- seller: { id: '' }
37
- });
38
-
39
- const result = await permissionService.search();
40
- console.log('result:', result);
41
-
42
- const useResult = await rservationService.useByTicket({
43
- instrument: {
44
- token: TOKEN
45
- },
46
- object: {
47
- id: '439356058063863-0'
48
- }
49
- });
50
- console.log('useResult:', useResult);
51
- }
52
-
53
- main()
54
- .then(() => {
55
- console.log('success!');
56
- })
57
- .catch(console.error);