@cinerino/sdk 5.12.0 → 5.13.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1430,19 +1430,21 @@ var ReservationService = /** @class */ (function (_super) {
1430
1430
  });
1431
1431
  };
1432
1432
  /**
1433
- * 予約を使用する
1434
- * 注文コードから取得したトークンを利用して、予約に入場記録を追加します
1433
+ * 予約を使用する(入場する)
1435
1434
  */
1436
- ReservationService.prototype.useByToken = function (params) {
1435
+ ReservationService.prototype.useByTicket = function (params) {
1437
1436
  return __awaiter(this, void 0, void 0, function () {
1437
+ var instrument, location, object;
1438
1438
  return __generator(this, function (_a) {
1439
1439
  switch (_a.label) {
1440
- case 0: return [4 /*yield*/, this.fetch({
1441
- uri: '/reservations/use',
1442
- method: 'POST',
1443
- body: params,
1444
- expectedStatusCodes: [http_status_1.NO_CONTENT]
1445
- })];
1440
+ case 0:
1441
+ instrument = params.instrument, location = params.location, object = params.object;
1442
+ return [4 /*yield*/, this.fetch({
1443
+ uri: "/reservations/" + String(object === null || object === void 0 ? void 0 : object.id) + "/actions/use",
1444
+ method: 'POST',
1445
+ body: { instrument: instrument, location: location },
1446
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
1447
+ })];
1446
1448
  case 1:
1447
1449
  _a.sent();
1448
1450
  return [2 /*return*/];
@@ -10721,6 +10723,29 @@ var ReservationService = /** @class */ (function (_super) {
10721
10723
  });
10722
10724
  });
10723
10725
  };
10726
+ /**
10727
+ * 予約を使用する(入場する)
10728
+ */
10729
+ ReservationService.prototype.useByTicket = function (params) {
10730
+ return __awaiter(this, void 0, void 0, function () {
10731
+ var instrument, location, object;
10732
+ return __generator(this, function (_a) {
10733
+ switch (_a.label) {
10734
+ case 0:
10735
+ instrument = params.instrument, location = params.location, object = params.object;
10736
+ return [4 /*yield*/, this.fetch({
10737
+ uri: "/reservations/" + String(object === null || object === void 0 ? void 0 : object.id) + "/actions/use",
10738
+ method: 'POST',
10739
+ body: { instrument: instrument, location: location },
10740
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
10741
+ })];
10742
+ case 1:
10743
+ _a.sent();
10744
+ return [2 /*return*/];
10745
+ }
10746
+ });
10747
+ });
10748
+ };
10724
10749
  /**
10725
10750
  * 予約に対する使用アクション検索
10726
10751
  */
@@ -10750,33 +10775,6 @@ var ReservationService = /** @class */ (function (_super) {
10750
10775
  });
10751
10776
  });
10752
10777
  };
10753
- /**
10754
- * 予約を使用する(入場する)
10755
- */
10756
- ReservationService.prototype.use = function (params) {
10757
- return __awaiter(this, void 0, void 0, function () {
10758
- var _this = this;
10759
- return __generator(this, function (_a) {
10760
- return [2 /*return*/, this.fetch({
10761
- uri: "/reservations/eventReservation/screeningEvent/" + encodeURIComponent(String(params.object.id)) + "/attended",
10762
- method: 'PUT',
10763
- body: params,
10764
- expectedStatusCodes: [http_status_1.NO_CONTENT, http_status_1.OK]
10765
- })
10766
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
10767
- return __generator(this, function (_a) {
10768
- if (response.status === http_status_1.OK) {
10769
- return [2 /*return*/, response.json()];
10770
- }
10771
- else {
10772
- return [2 /*return*/];
10773
- }
10774
- return [2 /*return*/];
10775
- });
10776
- }); })];
10777
- });
10778
- });
10779
- };
10780
10778
  return ReservationService;
10781
10779
  }(service_1.Service));
10782
10780
  exports.ReservationService = ReservationService;
@@ -1,4 +1,4 @@
1
- import { IUseAction } from '../chevreAdmin/reservation/factory';
1
+ import { ITicket, IUseAction } from '../chevreAdmin/reservation/factory';
2
2
  import * as factory from '../factory';
3
3
  import { ISearchResult, Service } from '../service';
4
4
  /**
@@ -12,29 +12,25 @@ export declare class ReservationService extends Service {
12
12
  data: factory.reservation.IReservation<T>[];
13
13
  }>;
14
14
  /**
15
- * 予約を使用する
16
- * 注文コードから取得したトークンを利用して、予約に入場記録を追加します
15
+ * 予約を使用する(入場する)
17
16
  */
18
- useByToken(params: {
19
- object: {
20
- /**
21
- * 予約ID
22
- */
23
- id: string;
24
- };
25
- instrument: {
26
- /**
27
- * トークン
28
- * service.Token.getToken() にて取得したトークンを使用します
29
- */
30
- token: string;
31
- };
17
+ useByTicket(params: {
18
+ /**
19
+ * 使用チケット
20
+ */
21
+ instrument: ITicket;
32
22
  location?: {
33
23
  /**
34
24
  * 入場ゲートコード
35
25
  */
36
26
  identifier?: string;
37
27
  };
28
+ object: {
29
+ /**
30
+ * 予約ID
31
+ */
32
+ id: string;
33
+ };
38
34
  }): Promise<void>;
39
35
  /**
40
36
  * 予約に対する入場アクションを検索する
@@ -92,19 +92,21 @@ var ReservationService = /** @class */ (function (_super) {
92
92
  });
93
93
  };
94
94
  /**
95
- * 予約を使用する
96
- * 注文コードから取得したトークンを利用して、予約に入場記録を追加します
95
+ * 予約を使用する(入場する)
97
96
  */
98
- ReservationService.prototype.useByToken = function (params) {
97
+ ReservationService.prototype.useByTicket = function (params) {
99
98
  return __awaiter(this, void 0, void 0, function () {
99
+ var instrument, location, object;
100
100
  return __generator(this, function (_a) {
101
101
  switch (_a.label) {
102
- case 0: return [4 /*yield*/, this.fetch({
103
- uri: '/reservations/use',
104
- method: 'POST',
105
- body: params,
106
- expectedStatusCodes: [http_status_1.NO_CONTENT]
107
- })];
102
+ case 0:
103
+ instrument = params.instrument, location = params.location, object = params.object;
104
+ return [4 /*yield*/, this.fetch({
105
+ uri: "/reservations/" + String(object === null || object === void 0 ? void 0 : object.id) + "/actions/use",
106
+ method: 'POST',
107
+ body: { instrument: instrument, location: location },
108
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
109
+ })];
108
110
  case 1:
109
111
  _a.sent();
110
112
  return [2 /*return*/];
@@ -10,3 +10,21 @@ export interface IUseAction {
10
10
  typeOf: factory.actionType.UseAction;
11
11
  location?: factory.action.consume.use.reservation.ILocation;
12
12
  }
13
+ interface ITicketAsJWT {
14
+ /**
15
+ * jsonwebtoken
16
+ * service.Token.getToken() にて取得したトークンなど
17
+ */
18
+ token: string;
19
+ }
20
+ interface ITicketAsCode {
21
+ /**
22
+ * 注文コードなど
23
+ */
24
+ ticketToken: string;
25
+ }
26
+ /**
27
+ * 予約使用チケット
28
+ */
29
+ export declare type ITicket = ITicketAsJWT | ITicketAsCode;
30
+ export {};
@@ -1,6 +1,6 @@
1
1
  import * as factory from '../factory';
2
2
  import { ISearchResult, Service } from '../service';
3
- import { IUseAction } from './reservation/factory';
3
+ import { ITicket, IUseAction } from './reservation/factory';
4
4
  export interface IUseActionResult {
5
5
  id: string;
6
6
  }
@@ -28,6 +28,27 @@ export declare class ReservationService extends Service {
28
28
  additionalTicketText?: string;
29
29
  };
30
30
  }): Promise<void>;
31
+ /**
32
+ * 予約を使用する(入場する)
33
+ */
34
+ useByTicket(params: {
35
+ /**
36
+ * 使用チケット
37
+ */
38
+ instrument: ITicket;
39
+ location?: {
40
+ /**
41
+ * 入場ゲートコード
42
+ */
43
+ identifier?: string;
44
+ };
45
+ object: {
46
+ /**
47
+ * 予約ID
48
+ */
49
+ id: string;
50
+ };
51
+ }): Promise<void>;
31
52
  /**
32
53
  * 予約に対する使用アクション検索
33
54
  */
@@ -45,19 +66,5 @@ export declare class ReservationService extends Service {
45
66
  [key in keyof IUseAction]?: 0;
46
67
  };
47
68
  }): Promise<ISearchResult<IUseAction[]>>;
48
- /**
49
- * 予約を使用する(入場する)
50
- */
51
- use(params: {
52
- instrument?: {
53
- token?: string;
54
- };
55
- location?: {
56
- identifier?: string;
57
- };
58
- object: {
59
- id: string;
60
- };
61
- }): Promise<void | IUseActionResult>;
62
69
  }
63
70
  export {};
@@ -110,6 +110,29 @@ var ReservationService = /** @class */ (function (_super) {
110
110
  });
111
111
  });
112
112
  };
113
+ /**
114
+ * 予約を使用する(入場する)
115
+ */
116
+ ReservationService.prototype.useByTicket = function (params) {
117
+ return __awaiter(this, void 0, void 0, function () {
118
+ var instrument, location, object;
119
+ return __generator(this, function (_a) {
120
+ switch (_a.label) {
121
+ case 0:
122
+ instrument = params.instrument, location = params.location, object = params.object;
123
+ return [4 /*yield*/, this.fetch({
124
+ uri: "/reservations/" + String(object === null || object === void 0 ? void 0 : object.id) + "/actions/use",
125
+ method: 'POST',
126
+ body: { instrument: instrument, location: location },
127
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
128
+ })];
129
+ case 1:
130
+ _a.sent();
131
+ return [2 /*return*/];
132
+ }
133
+ });
134
+ });
135
+ };
113
136
  /**
114
137
  * 予約に対する使用アクション検索
115
138
  */
@@ -139,33 +162,6 @@ var ReservationService = /** @class */ (function (_super) {
139
162
  });
140
163
  });
141
164
  };
142
- /**
143
- * 予約を使用する(入場する)
144
- */
145
- ReservationService.prototype.use = function (params) {
146
- return __awaiter(this, void 0, void 0, function () {
147
- var _this = this;
148
- return __generator(this, function (_a) {
149
- return [2 /*return*/, this.fetch({
150
- uri: "/reservations/eventReservation/screeningEvent/" + encodeURIComponent(String(params.object.id)) + "/attended",
151
- method: 'PUT',
152
- body: params,
153
- expectedStatusCodes: [http_status_1.NO_CONTENT, http_status_1.OK]
154
- })
155
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
156
- return __generator(this, function (_a) {
157
- if (response.status === http_status_1.OK) {
158
- return [2 /*return*/, response.json()];
159
- }
160
- else {
161
- return [2 /*return*/];
162
- }
163
- return [2 /*return*/];
164
- });
165
- }); })];
166
- });
167
- });
168
- };
169
165
  return ReservationService;
170
166
  }(service_1.Service));
171
167
  exports.ReservationService = ReservationService;
package/lib/bundle.js CHANGED
@@ -1430,19 +1430,21 @@ var ReservationService = /** @class */ (function (_super) {
1430
1430
  });
1431
1431
  };
1432
1432
  /**
1433
- * 予約を使用する
1434
- * 注文コードから取得したトークンを利用して、予約に入場記録を追加します
1433
+ * 予約を使用する(入場する)
1435
1434
  */
1436
- ReservationService.prototype.useByToken = function (params) {
1435
+ ReservationService.prototype.useByTicket = function (params) {
1437
1436
  return __awaiter(this, void 0, void 0, function () {
1437
+ var instrument, location, object;
1438
1438
  return __generator(this, function (_a) {
1439
1439
  switch (_a.label) {
1440
- case 0: return [4 /*yield*/, this.fetch({
1441
- uri: '/reservations/use',
1442
- method: 'POST',
1443
- body: params,
1444
- expectedStatusCodes: [http_status_1.NO_CONTENT]
1445
- })];
1440
+ case 0:
1441
+ instrument = params.instrument, location = params.location, object = params.object;
1442
+ return [4 /*yield*/, this.fetch({
1443
+ uri: "/reservations/" + String(object === null || object === void 0 ? void 0 : object.id) + "/actions/use",
1444
+ method: 'POST',
1445
+ body: { instrument: instrument, location: location },
1446
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
1447
+ })];
1446
1448
  case 1:
1447
1449
  _a.sent();
1448
1450
  return [2 /*return*/];
@@ -12722,6 +12724,29 @@ var ReservationService = /** @class */ (function (_super) {
12722
12724
  });
12723
12725
  });
12724
12726
  };
12727
+ /**
12728
+ * 予約を使用する(入場する)
12729
+ */
12730
+ ReservationService.prototype.useByTicket = function (params) {
12731
+ return __awaiter(this, void 0, void 0, function () {
12732
+ var instrument, location, object;
12733
+ return __generator(this, function (_a) {
12734
+ switch (_a.label) {
12735
+ case 0:
12736
+ instrument = params.instrument, location = params.location, object = params.object;
12737
+ return [4 /*yield*/, this.fetch({
12738
+ uri: "/reservations/" + String(object === null || object === void 0 ? void 0 : object.id) + "/actions/use",
12739
+ method: 'POST',
12740
+ body: { instrument: instrument, location: location },
12741
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
12742
+ })];
12743
+ case 1:
12744
+ _a.sent();
12745
+ return [2 /*return*/];
12746
+ }
12747
+ });
12748
+ });
12749
+ };
12725
12750
  /**
12726
12751
  * 予約に対する使用アクション検索
12727
12752
  */
@@ -12751,33 +12776,6 @@ var ReservationService = /** @class */ (function (_super) {
12751
12776
  });
12752
12777
  });
12753
12778
  };
12754
- /**
12755
- * 予約を使用する(入場する)
12756
- */
12757
- ReservationService.prototype.use = function (params) {
12758
- return __awaiter(this, void 0, void 0, function () {
12759
- var _this = this;
12760
- return __generator(this, function (_a) {
12761
- return [2 /*return*/, this.fetch({
12762
- uri: "/reservations/eventReservation/screeningEvent/" + encodeURIComponent(String(params.object.id)) + "/attended",
12763
- method: 'PUT',
12764
- body: params,
12765
- expectedStatusCodes: [http_status_1.NO_CONTENT, http_status_1.OK]
12766
- })
12767
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
12768
- return __generator(this, function (_a) {
12769
- if (response.status === http_status_1.OK) {
12770
- return [2 /*return*/, response.json()];
12771
- }
12772
- else {
12773
- return [2 /*return*/];
12774
- }
12775
- return [2 /*return*/];
12776
- });
12777
- }); })];
12778
- });
12779
- });
12780
- };
12781
12779
  return ReservationService;
12782
12780
  }(service_1.Service));
12783
12781
  exports.ReservationService = ReservationService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "5.12.0",
3
+ "version": "5.13.0-alpha.1",
4
4
  "description": "Cinerino SDK",
5
5
  "main": "./lib/index.js",
6
6
  "browser": {
@@ -92,7 +92,7 @@
92
92
  "watchify": "^3.11.1"
93
93
  },
94
94
  "dependencies": {
95
- "@chevre/factory": "4.356.0",
95
+ "@chevre/factory": "4.358.0",
96
96
  "debug": "^3.2.6",
97
97
  "http-status": "^1.4.2",
98
98
  "idtoken-verifier": "^2.0.3",