@cinerino/sdk 12.3.0-alpha.1 → 12.3.0-alpha.11
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/playground/public/lib/bundle.js +59 -24
- package/example/src/chevre/admin/adminCreateEventIfNotExistByIdentifier.ts +150 -0
- package/example/src/chevre/admin/adminCreateEventIfNotExistByIdentifierBySoftware.ts +103 -0
- package/example/src/chevre/admin/adminCreateNotesIfNotExistByIdentifier.ts +71 -0
- package/example/src/chevre/admin/adminProductOffersByIdentifier.ts +83 -0
- package/example/src/chevre/console/adminEvents.ts +3 -4
- package/example/src/chevre/default/findProductOffers.ts +43 -0
- package/example/src/cloud/admin/adminCreateEventIfNotExistByIdentifierBySoftware.ts +102 -0
- package/example/src/cloud/admin/adminUpsertManyEventsByAdditionalProperty.ts +19 -21
- package/example/src/cloud/findOrderByConfirmationNumber.ts +2 -2
- package/example/src/cloud/search/findProducts.ts +2 -1
- package/example/src/cloud/transaction/processPlaceOrderUsingMemberProgramTier.ts +10 -2
- package/example/src/searchEvents.ts +6 -4
- package/lib/abstract/chevre/productOffer.d.ts +29 -0
- package/lib/abstract/chevre/productOffer.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 +41 -0
- package/lib/abstract/chevreAdmin/event.js +54 -0
- package/lib/abstract/chevreAdmin/note.d.ts +50 -10
- package/lib/abstract/chevreAdmin/note.js +42 -19
- package/lib/abstract/chevreAdmin/noteAboutOrder.d.ts +21 -0
- package/lib/abstract/chevreAdmin/noteAboutOrder.js +120 -0
- package/lib/abstract/chevreAdmin/productOffer.d.ts +44 -0
- package/lib/abstract/{chevreConsole/eventOffer.js → chevreAdmin/productOffer.js} +46 -63
- package/lib/abstract/chevreAdmin.d.ts +20 -2
- package/lib/abstract/chevreAdmin.js +40 -0
- package/lib/abstract/chevreConsole/event.js +4 -3
- package/lib/abstract/chevreConsole.d.ts +0 -9
- package/lib/abstract/chevreConsole.js +0 -20
- package/lib/abstract/cloud/admin/event.d.ts +45 -11
- package/lib/abstract/cloud/admin/event.js +100 -12
- package/lib/abstract/cloud/admin/{note.d.ts → noteAboutOrder.d.ts} +17 -3
- package/lib/abstract/cloud/admin/{note.js → noteAboutOrder.js} +18 -13
- package/lib/abstract/cloud/admin.d.ts +8 -8
- package/lib/abstract/cloud/admin.js +8 -8
- package/lib/bundle.js +1536 -1099
- package/package.json +3 -2
- package/lib/abstract/chevreConsole/eventOffer.d.ts +0 -32
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
// tslint:disable-next-line:no-implicit-dependencies
|
|
3
|
+
import * as moment from 'moment-timezone';
|
|
4
|
+
import * as client from '../../../../lib/index';
|
|
5
|
+
// import * as auth from '../../auth/authAsAdmin';
|
|
6
|
+
import { auth } from '../../auth/clientCredentials';
|
|
7
|
+
|
|
8
|
+
const PROJECT_ID = String(process.env.PROJECT_ID);
|
|
9
|
+
const SELLER_ID = '5a392dfdfca1c8737fb6da42';
|
|
10
|
+
const EVENT_SERVICE_ID = '630b139e4dd0621c0496a30c';
|
|
11
|
+
const AVAILABLE_AT_OR_FROM_ID = '51qbjcfr72h62m06vtv5kkhgje';
|
|
12
|
+
const ADDITIONAL_PROPERTY_NAME = 'oldEventId';
|
|
13
|
+
const SUPER_EVENT_ID = '7kaf1djmz';
|
|
14
|
+
const LOCATION_BRANCH_CODE = '01';
|
|
15
|
+
|
|
16
|
+
// tslint:disable-next-line:max-func-body-length
|
|
17
|
+
async function main() {
|
|
18
|
+
// const authClient = await auth.login();
|
|
19
|
+
// await authClient.refreshAccessToken();
|
|
20
|
+
// const loginTicket = authClient.verifyIdToken({});
|
|
21
|
+
// console.log('username is', loginTicket.getUsername());
|
|
22
|
+
|
|
23
|
+
const eventService = await (await client.loadCloudAdmin({
|
|
24
|
+
endpoint: <string>process.env.API_ADMIN_ENDPOINT,
|
|
25
|
+
auth: await auth()
|
|
26
|
+
})).createEventInstance({
|
|
27
|
+
project: { id: PROJECT_ID },
|
|
28
|
+
seller: { id: SELLER_ID }
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const today = moment()
|
|
32
|
+
.tz('Asia/Tokyo')
|
|
33
|
+
.format('YYYY-MM-DD');
|
|
34
|
+
const identifier = '250909001001010900';
|
|
35
|
+
await eventService.createIfNotExistByIdentifier(
|
|
36
|
+
[
|
|
37
|
+
{
|
|
38
|
+
identifier,
|
|
39
|
+
doorTime: moment(`${today}T13:00:00Z`)
|
|
40
|
+
.toDate(),
|
|
41
|
+
startDate: moment(`${today}T13:00:00Z`)
|
|
42
|
+
.toDate(),
|
|
43
|
+
endDate: moment(`${today}T14:00:00Z`)
|
|
44
|
+
.toDate(),
|
|
45
|
+
eventStatus: client.factory.eventStatusType.EventScheduled,
|
|
46
|
+
additionalProperty: [
|
|
47
|
+
{ name: ADDITIONAL_PROPERTY_NAME, value: identifier }
|
|
48
|
+
],
|
|
49
|
+
offers: {
|
|
50
|
+
unacceptedPaymentMethod: [],
|
|
51
|
+
eligibleQuantity: {
|
|
52
|
+
maxValue: 6
|
|
53
|
+
},
|
|
54
|
+
itemOffered: {
|
|
55
|
+
id: EVENT_SERVICE_ID
|
|
56
|
+
},
|
|
57
|
+
seller: {
|
|
58
|
+
makesOffer: [
|
|
59
|
+
{
|
|
60
|
+
typeOf: client.factory.offerType.Offer,
|
|
61
|
+
availableAtOrFrom: { id: AVAILABLE_AT_OR_FROM_ID }, // <-販売アプリケーションIDを指定する
|
|
62
|
+
availabilityStarts: moment(`${today}T00:00:00+09:00`)
|
|
63
|
+
.toDate(),
|
|
64
|
+
availabilityEnds: moment(`${today}T14:00:00Z`)
|
|
65
|
+
.toDate(),
|
|
66
|
+
validFrom: moment(`${today}T00:00:00+09:00`)
|
|
67
|
+
.toDate(),
|
|
68
|
+
validThrough: moment(`${today}T14:00:00Z`)
|
|
69
|
+
.toDate()
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
// makesOfferDefaultを指定するとmakesOfferよりも優先される
|
|
73
|
+
// makesOfferDefault: {
|
|
74
|
+
// typeOf: client.factory.offerType.Offer,
|
|
75
|
+
// availabilityStarts: moment('2024-05-11T00:00:00.000Z')
|
|
76
|
+
// .toDate(),
|
|
77
|
+
// availabilityEnds: moment('2024-05-12T00:00:00.000Z')
|
|
78
|
+
// .toDate(),
|
|
79
|
+
// validFrom: moment('2024-05-11T00:00:00.000Z')
|
|
80
|
+
// .toDate(),
|
|
81
|
+
// validThrough: moment('2024-05-12T00:00:00.000Z')
|
|
82
|
+
// .toDate()
|
|
83
|
+
// }
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
{
|
|
89
|
+
locationBranchCode: LOCATION_BRANCH_CODE,
|
|
90
|
+
superEventId: SUPER_EVENT_ID,
|
|
91
|
+
hasTicketedSeat: true,
|
|
92
|
+
typeOf: client.factory.eventType.ScreeningEvent
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
console.log('created.');
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
main()
|
|
99
|
+
.then(() => {
|
|
100
|
+
console.log('success!');
|
|
101
|
+
})
|
|
102
|
+
.catch(console.error);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// tslint:disable:no-console
|
|
2
2
|
// tslint:disable-next-line:no-implicit-dependencies
|
|
3
|
-
import * as moment from 'moment';
|
|
3
|
+
import * as moment from 'moment-timezone';
|
|
4
4
|
import * as client from '../../../../lib/index';
|
|
5
5
|
import * as auth from '../../auth/authAsAdmin';
|
|
6
6
|
|
|
@@ -24,24 +24,18 @@ async function main() {
|
|
|
24
24
|
seller: { id: SELLER_ID }
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
+
const today = moment()
|
|
28
|
+
.tz('Asia/Tokyo')
|
|
29
|
+
.format('YYYY-MM-DD');
|
|
27
30
|
await eventService.upsertManyByAdditionalProperty({
|
|
28
31
|
filter: { name: ADDITIONAL_PROPERTY_NAME },
|
|
29
|
-
options: {
|
|
30
|
-
superEventId: '7k9ayl8hc',
|
|
31
|
-
locationBranchCode: '10'
|
|
32
|
-
},
|
|
33
32
|
attributes: [
|
|
34
33
|
{
|
|
35
|
-
|
|
36
|
-
project: {
|
|
37
|
-
typeOf: client.factory.organizationType.Project,
|
|
38
|
-
id: PROJECT_ID
|
|
39
|
-
},
|
|
40
|
-
doorTime: moment('2025-09-01T10:00:00Z')
|
|
34
|
+
doorTime: moment(`${today}T13:00:00Z`)
|
|
41
35
|
.toDate(),
|
|
42
|
-
startDate: moment(
|
|
36
|
+
startDate: moment(`${today}T13:00:00Z`)
|
|
43
37
|
.toDate(),
|
|
44
|
-
endDate: moment(
|
|
38
|
+
endDate: moment(`${today}T14:00:00Z`)
|
|
45
39
|
.toDate(),
|
|
46
40
|
eventStatus: client.factory.eventStatusType.EventScheduled,
|
|
47
41
|
additionalProperty: [
|
|
@@ -52,9 +46,9 @@ async function main() {
|
|
|
52
46
|
}
|
|
53
47
|
],
|
|
54
48
|
// maximumPhysicalAttendeeCapacity: 3,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
location: {
|
|
50
|
+
branchCode: '10'
|
|
51
|
+
},
|
|
58
52
|
superEvent: {
|
|
59
53
|
id: '7k9ayl8hc'
|
|
60
54
|
},
|
|
@@ -64,20 +58,24 @@ async function main() {
|
|
|
64
58
|
maxValue: 6
|
|
65
59
|
},
|
|
66
60
|
itemOffered: {
|
|
67
|
-
id: EVENT_SERVICE_ID
|
|
61
|
+
id: EVENT_SERVICE_ID,
|
|
62
|
+
serviceOutput: {
|
|
63
|
+
typeOf: client.factory.reservationType.EventReservation,
|
|
64
|
+
reservedTicket: { typeOf: 'Ticket', ticketedSeat: { typeOf: client.factory.placeType.Seat } }
|
|
65
|
+
}
|
|
68
66
|
},
|
|
69
67
|
seller: {
|
|
70
68
|
makesOffer: [
|
|
71
69
|
{
|
|
72
70
|
typeOf: client.factory.offerType.Offer,
|
|
73
71
|
availableAtOrFrom: { id: AVAILABLE_AT_OR_FROM_ID }, // <-販売アプリケーションIDを指定する
|
|
74
|
-
availabilityStarts: moment(
|
|
72
|
+
availabilityStarts: moment(`${today}T13:00:00Z`)
|
|
75
73
|
.toDate(),
|
|
76
|
-
availabilityEnds: moment(
|
|
74
|
+
availabilityEnds: moment(`${today}T14:00:00Z`)
|
|
77
75
|
.toDate(),
|
|
78
|
-
validFrom: moment(
|
|
76
|
+
validFrom: moment(`${today}T13:00:00Z`)
|
|
79
77
|
.toDate(),
|
|
80
|
-
validThrough: moment(
|
|
78
|
+
validThrough: moment(`${today}T14:00:00Z`)
|
|
81
79
|
.toDate()
|
|
82
80
|
}
|
|
83
81
|
]
|
|
@@ -14,9 +14,9 @@ async function main() {
|
|
|
14
14
|
seller: { id: '' }
|
|
15
15
|
});
|
|
16
16
|
const orders = await orderService.findByConfirmationNumber({
|
|
17
|
-
confirmationNumber: '
|
|
17
|
+
confirmationNumber: '74441',
|
|
18
18
|
customer: {
|
|
19
|
-
telephone: '+
|
|
19
|
+
telephone: '+819011111111'
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
// tslint:disable-next-line:no-null-keyword
|
|
@@ -19,7 +19,8 @@ async function main() {
|
|
|
19
19
|
page: 1,
|
|
20
20
|
typeOf: factory.product.ProductType.EventService
|
|
21
21
|
});
|
|
22
|
-
|
|
22
|
+
// tslint:disable-next-line:no-null-keyword
|
|
23
|
+
console.dir(result, { depth: null });
|
|
23
24
|
console.log(result.length, 'data found');
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -237,7 +237,7 @@ type IAuthorizeReservationAction = Pick<client.factory.action.authorize.offer.ev
|
|
|
237
237
|
|
|
238
238
|
// tslint:disable-next-line:max-func-body-length
|
|
239
239
|
async function authorizeSeatReservationByEvent(params: {
|
|
240
|
-
event:
|
|
240
|
+
event: { id: string };
|
|
241
241
|
transaction: Pick<client.factory.transaction.placeOrder.ITransaction, 'id'>;
|
|
242
242
|
}): Promise<{
|
|
243
243
|
price: number;
|
|
@@ -320,12 +320,20 @@ async function authorizeSeatReservationByEvent(params: {
|
|
|
320
320
|
console.log(selectedSeatOffers.length, 'seats selected');
|
|
321
321
|
|
|
322
322
|
await wait(3000);
|
|
323
|
+
if (typeof MEMBER_PROGRAM_TIER_TOKEN !== 'string') {
|
|
324
|
+
throw new Error('process.env.MEMBER_PROGRAM_TIER_TOKEN required');
|
|
325
|
+
}
|
|
323
326
|
console.log('authorizing seat reservation...');
|
|
324
327
|
const seatReservationAuth = <IAuthorizeReservationAction>await offerService.authorizeEventService({
|
|
325
328
|
object: {
|
|
326
329
|
reservationFor: {
|
|
327
330
|
id: screeningEvent.id,
|
|
328
|
-
offers: {
|
|
331
|
+
offers: {
|
|
332
|
+
validForMemberTier: {
|
|
333
|
+
token: MEMBER_PROGRAM_TIER_TOKEN,
|
|
334
|
+
isTierOf: { identifier: 'DefaultMemberProgram' }
|
|
335
|
+
}
|
|
336
|
+
}
|
|
329
337
|
},
|
|
330
338
|
acceptedOffer: selectedSeatOffers.map((o) => {
|
|
331
339
|
return {
|
|
@@ -6,6 +6,7 @@ import { auth } from './auth/clientCredentials';
|
|
|
6
6
|
const PROJECT_ID = String(process.env.PROJECT_ID);
|
|
7
7
|
|
|
8
8
|
async function main() {
|
|
9
|
+
const now = new Date();
|
|
9
10
|
const eventService = new (await client.loadService()).Event({
|
|
10
11
|
endpoint: <string>process.env.API_ENDPOINT,
|
|
11
12
|
auth: await auth(),
|
|
@@ -17,17 +18,18 @@ async function main() {
|
|
|
17
18
|
page: 1,
|
|
18
19
|
limit: 1,
|
|
19
20
|
typeOf: client.factory.eventType.ScreeningEvent,
|
|
20
|
-
startFrom:
|
|
21
|
-
startThrough: moment()
|
|
21
|
+
startFrom: now,
|
|
22
|
+
startThrough: moment(now)
|
|
22
23
|
.add(1, 'days')
|
|
23
24
|
.toDate(),
|
|
24
25
|
sort: {
|
|
25
26
|
startDate: client.factory.sortType.Ascending
|
|
26
27
|
},
|
|
27
|
-
sellerMakesOfferAvailableAtIn: ['xx', 'xxx']
|
|
28
|
+
sellerMakesOfferAvailableAtIn: ['xx', 'xxx'],
|
|
29
|
+
identifiers: ['x', 'x']
|
|
28
30
|
});
|
|
29
31
|
// tslint:disable-next-line:no-null-keyword
|
|
30
|
-
|
|
32
|
+
console.dir(data.at(0), { depth: null });
|
|
31
33
|
// tslint:disable-next-line:no-null-keyword
|
|
32
34
|
// console.dir(data.at(0)?.offers?.seller.makesOffer, { depth: null });
|
|
33
35
|
console.log(data.length, 'events');
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as factory from '../factory';
|
|
2
|
+
import { Service } from '../service';
|
|
3
|
+
export declare type IProductOfferAsFindResult = Pick<factory.productOffer.IProductOffer, 'acceptedPaymentMethod' | 'availability' | 'identifier' | 'itemOffered' | 'validForMemberTier' | 'validFrom' | 'validThrough'> & {
|
|
4
|
+
id: string;
|
|
5
|
+
};
|
|
6
|
+
export interface IFindParams {
|
|
7
|
+
/**
|
|
8
|
+
* max: 20
|
|
9
|
+
*/
|
|
10
|
+
limit: number;
|
|
11
|
+
page: number;
|
|
12
|
+
/**
|
|
13
|
+
* オファーコレクションコード
|
|
14
|
+
* max length: 10
|
|
15
|
+
*/
|
|
16
|
+
itemOfferedIdentifiers?: string[];
|
|
17
|
+
/**
|
|
18
|
+
* オファーコード
|
|
19
|
+
* max length: 10
|
|
20
|
+
*/
|
|
21
|
+
identifiers?: string[];
|
|
22
|
+
id?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* プロダクトオファーサービス
|
|
26
|
+
*/
|
|
27
|
+
export declare class ProductOfferService extends Service {
|
|
28
|
+
findProductOffers(params: IFindParams): Promise<IProductOfferAsFindResult[]>;
|
|
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.ProductOfferService = void 0;
|
|
55
|
+
var http_status_1 = require("http-status");
|
|
56
|
+
var service_1 = require("../service");
|
|
57
|
+
var BASE_URI = '/productOffers';
|
|
58
|
+
/**
|
|
59
|
+
* プロダクトオファーサービス
|
|
60
|
+
*/
|
|
61
|
+
var ProductOfferService = /** @class */ (function (_super) {
|
|
62
|
+
__extends(ProductOfferService, _super);
|
|
63
|
+
function ProductOfferService() {
|
|
64
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
65
|
+
}
|
|
66
|
+
ProductOfferService.prototype.findProductOffers = 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 ProductOfferService;
|
|
83
|
+
}(service_1.Service));
|
|
84
|
+
exports.ProductOfferService = ProductOfferService;
|
package/lib/abstract/chevre.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { PaymentProductService } from './chevre/paymentService';
|
|
|
8
8
|
import type { PlaceService } from './chevre/place';
|
|
9
9
|
import type { HasPOSService } from './chevre/place/hasPOS';
|
|
10
10
|
import type { ProductService } from './chevre/product';
|
|
11
|
+
import type { ProductOfferService } from './chevre/productOffer';
|
|
11
12
|
import type { SellerService } from './chevre/seller';
|
|
12
13
|
import type { TripService } from './chevre/trip';
|
|
13
14
|
export declare namespace service {
|
|
@@ -77,6 +78,13 @@ export declare namespace service {
|
|
|
77
78
|
namespace Product {
|
|
78
79
|
let svc: typeof ProductService | undefined;
|
|
79
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* プロダクトオファーサービス
|
|
83
|
+
*/
|
|
84
|
+
type ProductOffer = ProductOfferService;
|
|
85
|
+
namespace ProductOffer {
|
|
86
|
+
let svc: typeof ProductOfferService | undefined;
|
|
87
|
+
}
|
|
80
88
|
/**
|
|
81
89
|
* 販売者サービス
|
|
82
90
|
*/
|
|
@@ -107,6 +115,7 @@ export declare class Chevre {
|
|
|
107
115
|
createPlaceInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<PlaceService>;
|
|
108
116
|
createHasPOSInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<HasPOSService>;
|
|
109
117
|
createProductInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<ProductService>;
|
|
118
|
+
createProductOfferInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<ProductOfferService>;
|
|
110
119
|
createSellerInstance(params: Pick<IOptions, 'project'>): Promise<SellerService>;
|
|
111
120
|
createTripInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<TripService>;
|
|
112
121
|
}
|
package/lib/abstract/chevre.js
CHANGED
|
@@ -80,6 +80,9 @@ var service;
|
|
|
80
80
|
var Product;
|
|
81
81
|
(function (Product) {
|
|
82
82
|
})(Product = service.Product || (service.Product = {}));
|
|
83
|
+
var ProductOffer;
|
|
84
|
+
(function (ProductOffer) {
|
|
85
|
+
})(ProductOffer = service.ProductOffer || (service.ProductOffer = {}));
|
|
83
86
|
var Seller;
|
|
84
87
|
(function (Seller) {
|
|
85
88
|
})(Seller = service.Seller || (service.Seller = {}));
|
|
@@ -247,6 +250,23 @@ var Chevre = /** @class */ (function () {
|
|
|
247
250
|
});
|
|
248
251
|
});
|
|
249
252
|
};
|
|
253
|
+
Chevre.prototype.createProductOfferInstance = function (params) {
|
|
254
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
255
|
+
var _a;
|
|
256
|
+
return __generator(this, function (_b) {
|
|
257
|
+
switch (_b.label) {
|
|
258
|
+
case 0:
|
|
259
|
+
if (!(service.ProductOffer.svc === undefined)) return [3 /*break*/, 2];
|
|
260
|
+
_a = service.ProductOffer;
|
|
261
|
+
return [4 /*yield*/, Promise.resolve().then(function () { return require('./chevre/productOffer'); })];
|
|
262
|
+
case 1:
|
|
263
|
+
_a.svc = (_b.sent()).ProductOfferService;
|
|
264
|
+
_b.label = 2;
|
|
265
|
+
case 2: return [2 /*return*/, new service.ProductOffer.svc(__assign(__assign(__assign({}, this.options), params), { retryableStatusCodes: [] }))];
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
});
|
|
269
|
+
};
|
|
250
270
|
Chevre.prototype.createSellerInstance = function (params) {
|
|
251
271
|
return __awaiter(this, void 0, void 0, function () {
|
|
252
272
|
var _a;
|
|
@@ -3,10 +3,51 @@ 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
|
+
export declare type ICreateParamsByIdentifier = Pick<factory.event.ICreateParams<factory.eventType.ScreeningEvent>, 'additionalProperty' | 'doorTime' | 'endDate' | 'eventStatus' | 'maximumPhysicalAttendeeCapacity' | 'offers' | 'startDate'> & {
|
|
7
|
+
identifier: string;
|
|
8
|
+
offers: Pick<factory.event.screeningEvent.IOffers4create, 'eligibleQuantity' | 'seller' | 'unacceptedPaymentMethod'> & {
|
|
9
|
+
itemOffered: Pick<factory.event.screeningEvent.IItemOffered, 'id'>;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare type IUpdateParamsByIdentifier = Pick<factory.event.IUpdateParams<factory.eventType.ScreeningEvent>, 'additionalProperty' | 'doorTime' | 'endDate' | 'eventStatus' | 'maximumPhysicalAttendeeCapacity' | 'offers' | 'startDate'> & {
|
|
13
|
+
identifier: string;
|
|
14
|
+
offers: Pick<factory.event.screeningEvent.IOffers4create, 'eligibleQuantity' | 'seller' | 'unacceptedPaymentMethod'> & {
|
|
15
|
+
itemOffered: Pick<factory.event.screeningEvent.IItemOffered, 'id'>;
|
|
16
|
+
};
|
|
17
|
+
location?: never;
|
|
18
|
+
superEvent?: never;
|
|
19
|
+
};
|
|
6
20
|
/**
|
|
7
21
|
* イベントサービス
|
|
8
22
|
*/
|
|
9
23
|
export declare class EventService extends Service {
|
|
24
|
+
/**
|
|
25
|
+
* イベント冪等複数作成
|
|
26
|
+
* イベントコードをキーにして、存在しなければ作成する
|
|
27
|
+
*/
|
|
28
|
+
createIfNotExistByIdentifier(params: ICreateParamsByIdentifier[], options: {
|
|
29
|
+
/**
|
|
30
|
+
* 施設コンテンツID
|
|
31
|
+
*/
|
|
32
|
+
superEventId: string;
|
|
33
|
+
/**
|
|
34
|
+
* ルームコード
|
|
35
|
+
*/
|
|
36
|
+
locationBranchCode: string;
|
|
37
|
+
/**
|
|
38
|
+
* 座席有無
|
|
39
|
+
*/
|
|
40
|
+
hasTicketedSeat: boolean;
|
|
41
|
+
typeOf: factory.eventType.ScreeningEvent;
|
|
42
|
+
}): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* 識別子によるイベント複数更新
|
|
45
|
+
* 識別子のイベントが存在しなければNotFound
|
|
46
|
+
* 座席有無は変更できない
|
|
47
|
+
*/
|
|
48
|
+
updateEventsByIdentifier(params: IUpdateParamsByIdentifier[], options: {
|
|
49
|
+
typeOf: factory.eventType.ScreeningEvent;
|
|
50
|
+
}): Promise<void>;
|
|
10
51
|
/**
|
|
11
52
|
* イベント冪等複数作成
|
|
12
53
|
* 特定の追加特性をキーにして、存在しなければ作成する
|
|
@@ -63,6 +63,60 @@ var EventService = /** @class */ (function (_super) {
|
|
|
63
63
|
function EventService() {
|
|
64
64
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* イベント冪等複数作成
|
|
68
|
+
* イベントコードをキーにして、存在しなければ作成する
|
|
69
|
+
*/
|
|
70
|
+
EventService.prototype.createIfNotExistByIdentifier = function (params, options) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
72
|
+
var superEventId, locationBranchCode, hasTicketedSeat, typeOf;
|
|
73
|
+
return __generator(this, function (_a) {
|
|
74
|
+
switch (_a.label) {
|
|
75
|
+
case 0:
|
|
76
|
+
superEventId = options.superEventId, locationBranchCode = options.locationBranchCode, hasTicketedSeat = options.hasTicketedSeat, typeOf = options.typeOf;
|
|
77
|
+
return [4 /*yield*/, this.fetch({
|
|
78
|
+
uri: '/events',
|
|
79
|
+
method: 'POST',
|
|
80
|
+
body: params,
|
|
81
|
+
qs: { superEventId: superEventId, locationBranchCode: locationBranchCode, hasTicketedSeat: hasTicketedSeat, typeOf: typeOf },
|
|
82
|
+
expectedStatusCodes: [http_status_1.NO_CONTENT]
|
|
83
|
+
})];
|
|
84
|
+
case 1:
|
|
85
|
+
_a.sent();
|
|
86
|
+
return [2 /*return*/];
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* 識別子によるイベント複数更新
|
|
93
|
+
* 識別子のイベントが存在しなければNotFound
|
|
94
|
+
* 座席有無は変更できない
|
|
95
|
+
*/
|
|
96
|
+
EventService.prototype.updateEventsByIdentifier = function (params, options) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
98
|
+
var typeOf;
|
|
99
|
+
return __generator(this, function (_a) {
|
|
100
|
+
switch (_a.label) {
|
|
101
|
+
case 0:
|
|
102
|
+
typeOf = options.typeOf;
|
|
103
|
+
return [4 /*yield*/, this.fetch({
|
|
104
|
+
uri: '/events',
|
|
105
|
+
method: 'PUT',
|
|
106
|
+
body: params,
|
|
107
|
+
qs: {
|
|
108
|
+
typeOf: typeOf,
|
|
109
|
+
updateBy: 'identifier'
|
|
110
|
+
},
|
|
111
|
+
expectedStatusCodes: [http_status_1.NO_CONTENT]
|
|
112
|
+
})];
|
|
113
|
+
case 1:
|
|
114
|
+
_a.sent();
|
|
115
|
+
return [2 /*return*/];
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
};
|
|
66
120
|
/**
|
|
67
121
|
* イベント冪等複数作成
|
|
68
122
|
* 特定の追加特性をキーにして、存在しなければ作成する
|
|
@@ -1,21 +1,61 @@
|
|
|
1
1
|
import * as factory from '../factory';
|
|
2
2
|
import { Service } from '../service';
|
|
3
3
|
declare type INoteDigitalDocument = factory.creativeWork.noteDigitalDocument.INoteDigitalDocument;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
interface ICreateParams {
|
|
5
|
+
/**
|
|
6
|
+
* メモ識別子
|
|
7
|
+
*/
|
|
8
|
+
identifier: string;
|
|
9
|
+
/**
|
|
10
|
+
* メモコンテンツ
|
|
11
|
+
*/
|
|
12
|
+
text: string;
|
|
13
|
+
about: {
|
|
14
|
+
/**
|
|
15
|
+
* メモの主題リソースID
|
|
16
|
+
*/
|
|
17
|
+
id: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
interface IDeleteParams {
|
|
21
|
+
id: string;
|
|
22
|
+
}
|
|
23
|
+
export interface IFindParams {
|
|
24
|
+
limit: number;
|
|
25
|
+
page: number;
|
|
26
|
+
inclusion?: (keyof factory.creativeWork.noteDigitalDocument.INoteDigitalDocument)[];
|
|
27
|
+
/**
|
|
28
|
+
* 主題リソースタイプ
|
|
29
|
+
*/
|
|
30
|
+
aboutTypeOf: factory.creativeWork.noteDigitalDocument.IAbout['typeOf'];
|
|
31
|
+
/**
|
|
32
|
+
* 主題リソースIDリスト
|
|
33
|
+
* max: 10
|
|
34
|
+
*/
|
|
35
|
+
aboutIds?: string[];
|
|
36
|
+
/**
|
|
37
|
+
* メモ識別子リスト
|
|
38
|
+
* max: 10
|
|
39
|
+
*/
|
|
40
|
+
identifiers?: string[];
|
|
41
|
+
/**
|
|
42
|
+
* メモID
|
|
43
|
+
*/
|
|
44
|
+
id?: string;
|
|
45
|
+
}
|
|
8
46
|
/**
|
|
9
47
|
* メモサービス
|
|
10
48
|
*/
|
|
11
49
|
export declare class NoteService extends Service {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
50
|
+
createNotesByIdentifier(params: ICreateParams[], options: {
|
|
51
|
+
aboutTypeOf: factory.creativeWork.noteDigitalDocument.IAbout['typeOf'];
|
|
52
|
+
}): Promise<void>;
|
|
53
|
+
updateNotesByIdentifier(params: ICreateParams[], options: {
|
|
54
|
+
aboutTypeOf: factory.creativeWork.noteDigitalDocument.IAbout['typeOf'];
|
|
55
|
+
}): Promise<void>;
|
|
56
|
+
findNotes(params: IFindParams): Promise<(INoteDigitalDocument & {
|
|
17
57
|
id: string;
|
|
18
58
|
})[]>;
|
|
19
|
-
|
|
59
|
+
deleteNotesByIds(params: IDeleteParams[]): Promise<void>;
|
|
20
60
|
}
|
|
21
61
|
export {};
|