@cinerino/sdk 12.8.0-alpha.1 → 12.8.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.
- package/example/src/chevre/admin/adminEventOffersByIdentifier.ts +12 -6
- package/example/src/cloud/transaction/processPlaceOrderByCreditCard3DS.ts +17 -5
- package/example/src/cloud/transaction/processPlaceOrderUsingMemberProgramTier.ts +11 -7
- package/lib/abstract/chevre/eventOffer.d.ts +29 -0
- package/lib/abstract/chevre/eventOffer.js +84 -0
- package/lib/abstract/chevre.d.ts +9 -0
- package/lib/abstract/chevre.js +20 -0
- package/lib/abstract/chevreAdmin/event.d.ts +12 -1
- package/lib/abstract/chevreTxn/offer.d.ts +12 -2
- package/lib/abstract/chevreTxn/offer.js +22 -0
- package/lib/abstract/chevreTxn/transaction/placeOrder/factory.d.ts +9 -0
- package/lib/abstract/cloud/admin/event.d.ts +1 -10
- package/lib/abstract/cloud/admin/event.js +0 -32
- package/lib/abstract/cloud/txn/offer.d.ts +11 -1
- package/lib/abstract/cloud/txn/offer.js +28 -1
- package/lib/bundle.js +796 -673
- package/package.json +2 -2
- package/example/src/chevre/admin/adminCreateEventIfNotExistByIdentifier.ts +0 -138
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
// tslint:disable:no-console
|
|
2
2
|
// tslint:disable-next-line:no-implicit-dependencies
|
|
3
|
+
import * as moment from 'moment';
|
|
3
4
|
import * as client from '../../../../lib/index';
|
|
4
5
|
import * as auth from '../../auth/authAsAdmin';
|
|
5
6
|
|
|
6
7
|
const PROJECT_ID = String(process.env.PROJECT_ID);
|
|
7
8
|
const SELLER_ID = '59d20831e53ebc2b4e774466';
|
|
8
|
-
const OFFER_IDENTIFIER = '
|
|
9
|
-
const itemOfferedId = '
|
|
9
|
+
const OFFER_IDENTIFIER = '20251119eventOffer01';
|
|
10
|
+
const itemOfferedId = '691d48de08422fdedd8b864a';
|
|
10
11
|
|
|
11
12
|
// tslint:disable-next-line:max-func-body-length
|
|
12
13
|
async function main() {
|
|
@@ -24,13 +25,18 @@ async function main() {
|
|
|
24
25
|
});
|
|
25
26
|
|
|
26
27
|
const now = new Date();
|
|
28
|
+
const validFrom = moment(now)
|
|
29
|
+
.toDate();
|
|
30
|
+
const validThrough = moment(validFrom)
|
|
31
|
+
.add(1, 'minutes')
|
|
32
|
+
.toDate();
|
|
27
33
|
await eventOfferService.createEventOfferByIdentifier(
|
|
28
34
|
[
|
|
29
35
|
{
|
|
30
36
|
identifier: OFFER_IDENTIFIER,
|
|
31
37
|
availableAtOrFrom: { identifier: 'SmartTheaterTXN' },
|
|
32
|
-
validFrom
|
|
33
|
-
validThrough
|
|
38
|
+
validFrom,
|
|
39
|
+
validThrough
|
|
34
40
|
}
|
|
35
41
|
],
|
|
36
42
|
{
|
|
@@ -44,8 +50,8 @@ async function main() {
|
|
|
44
50
|
{
|
|
45
51
|
identifier: OFFER_IDENTIFIER,
|
|
46
52
|
availableAtOrFrom: { identifier: 'SmartTheaterTXN' },
|
|
47
|
-
validFrom
|
|
48
|
-
validThrough
|
|
53
|
+
validFrom,
|
|
54
|
+
validThrough
|
|
49
55
|
}
|
|
50
56
|
],
|
|
51
57
|
{
|
|
@@ -364,15 +364,24 @@ async function authorizeSeatReservationByEvent(params: {
|
|
|
364
364
|
const selectedSeatOffers = availableSeatOffers.slice(0, 1);
|
|
365
365
|
console.log(selectedSeatOffers.length, 'seats selected');
|
|
366
366
|
|
|
367
|
+
// tslint:disable-next-line:no-suspicious-comment
|
|
368
|
+
// TODO 拡張イベントオファー検索
|
|
369
|
+
|
|
370
|
+
await wait(3000);
|
|
371
|
+
// 拡張オファー使用の場合、オファーコードを指定してオファーチケットを発行
|
|
372
|
+
const { ticketToken } = await offerService.issueEventServiceOfferTicket({
|
|
373
|
+
audience: { id: transaction.id },
|
|
374
|
+
eventId: screeningEvent.id,
|
|
375
|
+
eventOfferId: '691d492f929e69df1e32b89d' // 拡張オファー使用の場合、オファーコードを指定する
|
|
376
|
+
});
|
|
377
|
+
console.log('offer ticket issued.', ticketToken);
|
|
378
|
+
|
|
367
379
|
await wait(3000);
|
|
368
380
|
console.log('authorizing seat reservation...');
|
|
369
381
|
const seatReservationAuth = <IAuthorizeReservationAction>await offerService.authorizeEventService({
|
|
370
382
|
object: {
|
|
371
383
|
reservationFor: {
|
|
372
|
-
id: screeningEvent.id
|
|
373
|
-
offers: {
|
|
374
|
-
identifier: '20251113eventOffer' // 拡張オファー使用の場合、オファーコードを指定する
|
|
375
|
-
}
|
|
384
|
+
id: screeningEvent.id
|
|
376
385
|
},
|
|
377
386
|
acceptedOffer: selectedSeatOffers.map((o) => {
|
|
378
387
|
return {
|
|
@@ -396,7 +405,10 @@ async function authorizeSeatReservationByEvent(params: {
|
|
|
396
405
|
};
|
|
397
406
|
})
|
|
398
407
|
},
|
|
399
|
-
purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
|
|
408
|
+
purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder },
|
|
409
|
+
instrument: [
|
|
410
|
+
{ ticketToken, typeOf: 'Ticket' } // オファーチケットを指定する
|
|
411
|
+
]
|
|
400
412
|
});
|
|
401
413
|
console.log('seat reservation authorized', seatReservationAuth.id);
|
|
402
414
|
|
|
@@ -323,17 +323,21 @@ async function authorizeSeatReservationByEvent(params: {
|
|
|
323
323
|
if (typeof MEMBER_PROGRAM_TIER_TOKEN !== 'string') {
|
|
324
324
|
throw new Error('process.env.MEMBER_PROGRAM_TIER_TOKEN required');
|
|
325
325
|
}
|
|
326
|
+
|
|
327
|
+
// tslint:disable-next-line:no-suspicious-comment
|
|
328
|
+
// TODO オファーチケット発行
|
|
329
|
+
// offers: {
|
|
330
|
+
// validForMemberTier: {
|
|
331
|
+
// token: MEMBER_PROGRAM_TIER_TOKEN,
|
|
332
|
+
// isTierOf: { identifier: 'DefaultMemberProgram' }
|
|
333
|
+
// }
|
|
334
|
+
// }
|
|
335
|
+
|
|
326
336
|
console.log('authorizing seat reservation...');
|
|
327
337
|
const seatReservationAuth = <IAuthorizeReservationAction>await offerService.authorizeEventService({
|
|
328
338
|
object: {
|
|
329
339
|
reservationFor: {
|
|
330
|
-
id: screeningEvent.id
|
|
331
|
-
offers: {
|
|
332
|
-
validForMemberTier: {
|
|
333
|
-
token: MEMBER_PROGRAM_TIER_TOKEN,
|
|
334
|
-
isTierOf: { identifier: 'DefaultMemberProgram' }
|
|
335
|
-
}
|
|
336
|
-
}
|
|
340
|
+
id: screeningEvent.id
|
|
337
341
|
},
|
|
338
342
|
acceptedOffer: selectedSeatOffers.map((o) => {
|
|
339
343
|
return {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as factory from '../factory';
|
|
2
|
+
import { Service } from '../service';
|
|
3
|
+
export interface IFindParams {
|
|
4
|
+
/**
|
|
5
|
+
* max: 20
|
|
6
|
+
*/
|
|
7
|
+
limit: number;
|
|
8
|
+
page: number;
|
|
9
|
+
/**
|
|
10
|
+
* アプリケーションコード
|
|
11
|
+
*/
|
|
12
|
+
availableAtOrFromIdentifier?: string;
|
|
13
|
+
/**
|
|
14
|
+
* イベントID
|
|
15
|
+
*/
|
|
16
|
+
itemOfferedId?: string;
|
|
17
|
+
/**
|
|
18
|
+
* イベントIDリスト
|
|
19
|
+
* max length: 10
|
|
20
|
+
*/
|
|
21
|
+
itemOfferedIds?: string[];
|
|
22
|
+
}
|
|
23
|
+
export declare type IEventOfferAsFindResult = Pick<factory.eventOffer.IEventOffer, 'availableAtOrFrom' | 'identifier' | 'itemOffered' | 'offeredBy' | 'validFrom' | 'validThrough'>;
|
|
24
|
+
/**
|
|
25
|
+
* 拡張イベントオファーサービス
|
|
26
|
+
*/
|
|
27
|
+
export declare class EventOfferService extends Service {
|
|
28
|
+
findEventOffers(params: IFindParams): Promise<IEventOfferAsFindResult[]>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.EventOfferService = void 0;
|
|
55
|
+
var http_status_1 = require("http-status");
|
|
56
|
+
var service_1 = require("../service");
|
|
57
|
+
var BASE_URI = '/eventOffers';
|
|
58
|
+
/**
|
|
59
|
+
* 拡張イベントオファーサービス
|
|
60
|
+
*/
|
|
61
|
+
var EventOfferService = /** @class */ (function (_super) {
|
|
62
|
+
__extends(EventOfferService, _super);
|
|
63
|
+
function EventOfferService() {
|
|
64
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
65
|
+
}
|
|
66
|
+
EventOfferService.prototype.findEventOffers = function (params) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
68
|
+
var _this = this;
|
|
69
|
+
return __generator(this, function (_a) {
|
|
70
|
+
return [2 /*return*/, this.fetch({
|
|
71
|
+
uri: BASE_URI,
|
|
72
|
+
method: 'GET',
|
|
73
|
+
qs: params,
|
|
74
|
+
expectedStatusCodes: [http_status_1.OK]
|
|
75
|
+
})
|
|
76
|
+
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
77
|
+
return [2 /*return*/, response.json()];
|
|
78
|
+
}); }); })];
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
return EventOfferService;
|
|
83
|
+
}(service_1.Service));
|
|
84
|
+
exports.EventOfferService = EventOfferService;
|
package/lib/abstract/chevre.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { CategoryCodeService } from './chevre/categoryCode';
|
|
|
3
3
|
import type { CreativeWorkService } from './chevre/creativeWork';
|
|
4
4
|
import type { EmailMessageService } from './chevre/emailMessage';
|
|
5
5
|
import type { EventService } from './chevre/event';
|
|
6
|
+
import type { EventOfferService } from './chevre/eventOffer';
|
|
6
7
|
import type { EventSeriesService } from './chevre/eventSeries';
|
|
7
8
|
import type { NoteService } from './chevre/note';
|
|
8
9
|
import type { PaymentProductService } from './chevre/paymentService';
|
|
@@ -42,6 +43,13 @@ export declare namespace service {
|
|
|
42
43
|
namespace Event {
|
|
43
44
|
let svc: typeof EventService | undefined;
|
|
44
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* イベントオファーサービス
|
|
48
|
+
*/
|
|
49
|
+
type EventOffer = EventOfferService;
|
|
50
|
+
namespace EventOffer {
|
|
51
|
+
let svc: typeof EventOfferService | undefined;
|
|
52
|
+
}
|
|
45
53
|
/**
|
|
46
54
|
* 施設コンテンツサービス
|
|
47
55
|
*/
|
|
@@ -118,6 +126,7 @@ export declare class Chevre {
|
|
|
118
126
|
createCreativeWorkInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<CreativeWorkService>;
|
|
119
127
|
createEmailMessageInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<EmailMessageService>;
|
|
120
128
|
createEventInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<EventService>;
|
|
129
|
+
createEventOfferInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<EventOfferService>;
|
|
121
130
|
createEventSeriesInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<EventSeriesService>;
|
|
122
131
|
createNoteInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<NoteService>;
|
|
123
132
|
createPaymentProductInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<PaymentProductService>;
|
package/lib/abstract/chevre.js
CHANGED
|
@@ -62,6 +62,9 @@ var service;
|
|
|
62
62
|
var Event;
|
|
63
63
|
(function (Event) {
|
|
64
64
|
})(Event = service.Event || (service.Event = {}));
|
|
65
|
+
var EventOffer;
|
|
66
|
+
(function (EventOffer) {
|
|
67
|
+
})(EventOffer = service.EventOffer || (service.EventOffer = {}));
|
|
65
68
|
var EventSeries;
|
|
66
69
|
(function (EventSeries) {
|
|
67
70
|
})(EventSeries = service.EventSeries || (service.EventSeries = {}));
|
|
@@ -168,6 +171,23 @@ var Chevre = /** @class */ (function () {
|
|
|
168
171
|
});
|
|
169
172
|
});
|
|
170
173
|
};
|
|
174
|
+
Chevre.prototype.createEventOfferInstance = function (params) {
|
|
175
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
176
|
+
var _a;
|
|
177
|
+
return __generator(this, function (_b) {
|
|
178
|
+
switch (_b.label) {
|
|
179
|
+
case 0:
|
|
180
|
+
if (!(service.EventOffer.svc === undefined)) return [3 /*break*/, 2];
|
|
181
|
+
_a = service.EventOffer;
|
|
182
|
+
return [4 /*yield*/, Promise.resolve().then(function () { return require('./chevre/eventOffer'); })];
|
|
183
|
+
case 1:
|
|
184
|
+
_a.svc = (_b.sent()).EventOfferService;
|
|
185
|
+
_b.label = 2;
|
|
186
|
+
case 2: return [2 /*return*/, new service.EventOffer.svc(__assign(__assign(__assign({}, this.options), params), { retryableStatusCodes: [] }))];
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
};
|
|
171
191
|
Chevre.prototype.createEventSeriesInstance = function (params) {
|
|
172
192
|
return __awaiter(this, void 0, void 0, function () {
|
|
173
193
|
var _a;
|
|
@@ -3,15 +3,26 @@ import { Service } from '../service';
|
|
|
3
3
|
declare type ISendEmailMessageOnEventUpdated = Pick<factory.action.transfer.send.message.email.IAttributes, 'purpose' | 'recipient'> & {
|
|
4
4
|
object: factory.action.transfer.send.message.email.IObjectAsEmailMessage;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* 識別子によるイベント追加パラメータ
|
|
8
|
+
*/
|
|
6
9
|
export declare type ICreateParamsByIdentifier = Pick<factory.event.screeningEvent.ICreateParams, 'additionalProperty' | 'doorTime' | 'endDate' | 'eventStatus' | 'maximumPhysicalAttendeeCapacity' | 'offers' | 'startDate'> & {
|
|
7
10
|
identifier: string;
|
|
8
11
|
offers: Pick<factory.event.screeningEvent.IOffers4create, 'eligibleQuantity' | 'seller' | 'unacceptedPaymentMethod'> & {
|
|
9
12
|
itemOffered: Pick<factory.event.screeningEvent.IItemOffered, 'id'>;
|
|
10
13
|
};
|
|
11
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* 識別子によるイベント編集パラメータ
|
|
17
|
+
*/
|
|
12
18
|
export declare type IUpdateParamsByIdentifier = Pick<factory.event.screeningEvent.IUpdateByIdParams, 'additionalProperty' | 'doorTime' | 'endDate' | 'eventStatus' | 'maximumPhysicalAttendeeCapacity' | 'startDate'> & {
|
|
13
19
|
identifier: string;
|
|
14
|
-
offers: Pick<factory.event.screeningEvent.IOffer4update, 'eligibleQuantity' | 'unacceptedPaymentMethod' | 'itemOffered'
|
|
20
|
+
offers: Pick<factory.event.screeningEvent.IOffer4update, 'eligibleQuantity' | 'unacceptedPaymentMethod' | 'itemOffered'> & {
|
|
21
|
+
/**
|
|
22
|
+
* アプリケーション設定
|
|
23
|
+
*/
|
|
24
|
+
seller: Pick<factory.event.screeningEvent.ISeller4create, 'makesOffer'>;
|
|
25
|
+
};
|
|
15
26
|
location?: never;
|
|
16
27
|
superEvent?: never;
|
|
17
28
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as factory from '../factory';
|
|
2
2
|
import { Service } from '../service';
|
|
3
|
-
import { IAuthorizeEventServiceResult, IAuthorizeProductOfferResult, IMinimalAuthorizeEventServiceResult } from './transaction/placeOrder/factory';
|
|
3
|
+
import { IAuthorizeEventServiceResult, IAuthorizeProductOfferResult, IMinimalAuthorizeEventServiceResult, IOfferTicket } from './transaction/placeOrder/factory';
|
|
4
4
|
export interface IPurpose {
|
|
5
5
|
typeOf: factory.transactionType;
|
|
6
6
|
id: string;
|
|
@@ -16,12 +16,22 @@ export declare class OfferService extends Service {
|
|
|
16
16
|
object: factory.action.authorize.offer.product.IObjectWithoutDetail;
|
|
17
17
|
purpose: factory.action.authorize.offer.product.IPurpose;
|
|
18
18
|
}): Promise<IAuthorizeProductOfferResult>;
|
|
19
|
+
/**
|
|
20
|
+
* 興行オファーチケット発行
|
|
21
|
+
*/
|
|
22
|
+
issueEventServiceOfferTicket(params: {
|
|
23
|
+
audience: Pick<factory.action.authorize.offer.eventService.IPurpose, 'id'>;
|
|
24
|
+
eventId: string;
|
|
25
|
+
eventOfferId?: string;
|
|
26
|
+
ticketedOffer?: Pick<factory.authorization.IOfferAsObject, 'token' | 'validForMemberTier'>;
|
|
27
|
+
}): Promise<IOfferTicket>;
|
|
19
28
|
/**
|
|
20
29
|
* 興行オファー承認
|
|
21
30
|
*/
|
|
22
31
|
authorizeEventService(params: {
|
|
23
|
-
object: factory.action.authorize.offer.eventService.IObjectWithoutDetail
|
|
32
|
+
object: Pick<factory.action.authorize.offer.eventService.IObjectWithoutDetail, 'acceptedOffer' | 'reservationFor'>;
|
|
24
33
|
purpose: factory.action.authorize.offer.eventService.IPurpose;
|
|
34
|
+
instrument?: factory.action.reserve.ITicketAsInstrument[];
|
|
25
35
|
}, options?: {
|
|
26
36
|
expectsMinimalResponse?: boolean;
|
|
27
37
|
/**
|
|
@@ -107,6 +107,28 @@ var OfferService = /** @class */ (function (_super) {
|
|
|
107
107
|
});
|
|
108
108
|
});
|
|
109
109
|
};
|
|
110
|
+
/**
|
|
111
|
+
* 興行オファーチケット発行
|
|
112
|
+
*/
|
|
113
|
+
OfferService.prototype.issueEventServiceOfferTicket = function (params) {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
115
|
+
var ticketedOffer, audience, eventId, eventOfferId;
|
|
116
|
+
var _this = this;
|
|
117
|
+
return __generator(this, function (_a) {
|
|
118
|
+
ticketedOffer = params.ticketedOffer, audience = params.audience, eventId = params.eventId, eventOfferId = params.eventOfferId;
|
|
119
|
+
return [2 /*return*/, this.fetch({
|
|
120
|
+
uri: "/offers/" + factory.product.ProductType.EventService + "/tickets",
|
|
121
|
+
method: 'POST',
|
|
122
|
+
expectedStatusCodes: [http_status_1.CREATED],
|
|
123
|
+
body: { ticketedOffer: ticketedOffer },
|
|
124
|
+
qs: __assign({ audience: { id: audience.id }, eventId: eventId }, (typeof eventOfferId === 'string') ? { eventOfferId: eventOfferId } : undefined)
|
|
125
|
+
})
|
|
126
|
+
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
127
|
+
return [2 /*return*/, response.json()];
|
|
128
|
+
}); }); })];
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
};
|
|
110
132
|
/**
|
|
111
133
|
* 興行オファー承認
|
|
112
134
|
*/
|
|
@@ -69,4 +69,13 @@ export declare type IMinimalOrderAsConfirmResult = Pick<factory.order.IOrder, 'c
|
|
|
69
69
|
export interface IMinimalConfirmResult {
|
|
70
70
|
order: IMinimalOrderAsConfirmResult;
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* 興行オファーチケット
|
|
74
|
+
*/
|
|
75
|
+
export interface IOfferTicket {
|
|
76
|
+
/**
|
|
77
|
+
* チケットトークン
|
|
78
|
+
*/
|
|
79
|
+
ticketToken: string;
|
|
80
|
+
}
|
|
72
81
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as factory from '../../factory';
|
|
2
2
|
import { Service } from '../../service';
|
|
3
|
-
import { ICreateParamsByIdentifier,
|
|
3
|
+
import { ICreateParamsByIdentifier, IUpdateParamsByIdentifier } from '../../chevreAdmin/event';
|
|
4
4
|
declare type ISendEmailMessageOnEventUpdated = Pick<factory.action.transfer.send.message.email.IAttributes, 'purpose' | 'recipient'> & {
|
|
5
5
|
object: factory.action.transfer.send.message.email.IObjectAsEmailMessage;
|
|
6
6
|
};
|
|
@@ -39,15 +39,6 @@ export declare class EventService extends Service {
|
|
|
39
39
|
updateEventsByIdentifier(params: IUpdateParamsByIdentifier[], options: {
|
|
40
40
|
typeOf: factory.eventType.ScreeningEvent;
|
|
41
41
|
}): Promise<void>;
|
|
42
|
-
/**
|
|
43
|
-
* イベントのアプリケーションオファー編集(識別子によるイベント複数編集)
|
|
44
|
-
* 識別子のイベントが存在しなければNotFound
|
|
45
|
-
*/
|
|
46
|
-
updateEventsSellerMakesOfferByIdentifier(
|
|
47
|
-
/**
|
|
48
|
-
* max: 10
|
|
49
|
-
*/
|
|
50
|
-
params: IUpdateEventSellerMakesOfferParamsByIdentifier[]): Promise<void>;
|
|
51
42
|
/**
|
|
52
43
|
* イベントステータス更新
|
|
53
44
|
*/
|
|
@@ -136,38 +136,6 @@ var EventService = /** @class */ (function (_super) {
|
|
|
136
136
|
});
|
|
137
137
|
});
|
|
138
138
|
};
|
|
139
|
-
/**
|
|
140
|
-
* イベントのアプリケーションオファー編集(識別子によるイベント複数編集)
|
|
141
|
-
* 識別子のイベントが存在しなければNotFound
|
|
142
|
-
*/
|
|
143
|
-
EventService.prototype.updateEventsSellerMakesOfferByIdentifier = function (
|
|
144
|
-
/**
|
|
145
|
-
* max: 10
|
|
146
|
-
*/
|
|
147
|
-
params) {
|
|
148
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
149
|
-
var _a, auth, endpoint, project, seller, disableAutoRetry, chevreAdmin, eventService;
|
|
150
|
-
return __generator(this, function (_b) {
|
|
151
|
-
switch (_b.label) {
|
|
152
|
-
case 0:
|
|
153
|
-
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry;
|
|
154
|
-
return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
|
|
155
|
-
case 1:
|
|
156
|
-
chevreAdmin = _b.sent();
|
|
157
|
-
return [4 /*yield*/, chevreAdmin.createEventInstance({
|
|
158
|
-
project: project,
|
|
159
|
-
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
|
|
160
|
-
})];
|
|
161
|
-
case 2:
|
|
162
|
-
eventService = _b.sent();
|
|
163
|
-
return [4 /*yield*/, eventService.updateEventsSellerMakesOfferByIdentifier(params)];
|
|
164
|
-
case 3:
|
|
165
|
-
_b.sent();
|
|
166
|
-
return [2 /*return*/];
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
};
|
|
171
139
|
/**
|
|
172
140
|
* イベントステータス更新
|
|
173
141
|
*/
|
|
@@ -1,16 +1,26 @@
|
|
|
1
|
-
import type { IAuthorizeEventServiceResult, IMinimalAuthorizeEventServiceResult } from '../../chevreTxn/transaction/placeOrder/factory';
|
|
1
|
+
import type { IAuthorizeEventServiceResult, IMinimalAuthorizeEventServiceResult, IOfferTicket } from '../../chevreTxn/transaction/placeOrder/factory';
|
|
2
2
|
import * as factory from '../../factory';
|
|
3
3
|
import { Service } from '../../service';
|
|
4
4
|
/**
|
|
5
5
|
* オファーサービス
|
|
6
6
|
*/
|
|
7
7
|
export declare class OfferService extends Service {
|
|
8
|
+
/**
|
|
9
|
+
* 興行オファーチケット発行
|
|
10
|
+
*/
|
|
11
|
+
issueEventServiceOfferTicket(params: {
|
|
12
|
+
audience: Pick<factory.action.authorize.offer.eventService.IPurpose, 'id'>;
|
|
13
|
+
eventId: string;
|
|
14
|
+
eventOfferId?: string;
|
|
15
|
+
ticketedOffer?: Pick<factory.authorization.IOfferAsObject, 'token' | 'validForMemberTier'>;
|
|
16
|
+
}): Promise<IOfferTicket>;
|
|
8
17
|
/**
|
|
9
18
|
* 興行オファー承認
|
|
10
19
|
*/
|
|
11
20
|
authorizeEventService(params: {
|
|
12
21
|
object: factory.action.authorize.offer.eventService.IObjectWithoutDetail;
|
|
13
22
|
purpose: factory.action.authorize.offer.eventService.IPurpose;
|
|
23
|
+
instrument?: factory.action.reserve.ITicketAsInstrument[];
|
|
14
24
|
}, options?: {
|
|
15
25
|
/**
|
|
16
26
|
* レスポンスを最小化する
|
|
@@ -75,6 +75,32 @@ var OfferService = /** @class */ (function (_super) {
|
|
|
75
75
|
// > & IAdditionalOptions) {
|
|
76
76
|
// super(options);
|
|
77
77
|
// }
|
|
78
|
+
/**
|
|
79
|
+
* 興行オファーチケット発行
|
|
80
|
+
*/
|
|
81
|
+
OfferService.prototype.issueEventServiceOfferTicket = function (params) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
+
var _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevreTxn, offerService, ticketedOffer, audience, eventId, eventOfferId;
|
|
84
|
+
return __generator(this, function (_b) {
|
|
85
|
+
switch (_b.label) {
|
|
86
|
+
case 0:
|
|
87
|
+
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
|
|
88
|
+
return [4 /*yield*/, index_1.loadChevreTxn({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
|
|
89
|
+
case 1:
|
|
90
|
+
chevreTxn = _b.sent();
|
|
91
|
+
return [4 /*yield*/, chevreTxn.createOfferInstance({
|
|
92
|
+
project: project,
|
|
93
|
+
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
|
|
94
|
+
retryableStatusCodes: __spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [])
|
|
95
|
+
})];
|
|
96
|
+
case 2:
|
|
97
|
+
offerService = _b.sent();
|
|
98
|
+
ticketedOffer = params.ticketedOffer, audience = params.audience, eventId = params.eventId, eventOfferId = params.eventOfferId;
|
|
99
|
+
return [2 /*return*/, offerService.issueEventServiceOfferTicket({ ticketedOffer: ticketedOffer, audience: audience, eventId: eventId, eventOfferId: eventOfferId })];
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
};
|
|
78
104
|
/**
|
|
79
105
|
* 興行オファー承認
|
|
80
106
|
*/
|
|
@@ -100,7 +126,8 @@ var OfferService = /** @class */ (function (_super) {
|
|
|
100
126
|
acceptedOffer: params.object.acceptedOffer,
|
|
101
127
|
reservationFor: params.object.reservationFor
|
|
102
128
|
},
|
|
103
|
-
purpose: { id: params.purpose.id, typeOf: factory.transactionType.PlaceOrder }
|
|
129
|
+
purpose: { id: params.purpose.id, typeOf: factory.transactionType.PlaceOrder },
|
|
130
|
+
instrument: (Array.isArray(params.instrument)) ? params.instrument : []
|
|
104
131
|
}, options)];
|
|
105
132
|
}
|
|
106
133
|
});
|