@cinerino/sdk 12.6.0-alpha.4 → 12.6.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/lib/abstract/chevre/event/factory.d.ts +0 -12
- package/lib/abstract/chevre/event/factory.js +13 -0
- package/lib/abstract/chevre/event.d.ts +1 -28
- package/lib/abstract/chevre/event.js +0 -19
- package/lib/abstract/chevreAdmin/event.d.ts +13 -17
- package/lib/abstract/chevreAdmin/event.js +0 -43
- package/lib/abstract/chevreConsole/event.d.ts +5 -3
- package/lib/abstract/cinerino/service/event.d.ts +1 -28
- package/lib/abstract/cinerino/service/event.js +0 -19
- package/lib/abstract/cloud/admin/event.d.ts +0 -33
- package/lib/abstract/cloud/admin/event.js +0 -80
- package/lib/bundle.js +1 -162
- package/package.json +2 -2
- package/example/src/chevre/searchEventSellerMakesOffer.ts +0 -43
- package/example/src/cloud/admin/adminUpsertManyEventsByAdditionalProperty.ts +0 -107
|
@@ -30,15 +30,3 @@ export declare type ISeatAsEventOffer = Pick<factory.place.seat.IPlaceWithOffer,
|
|
|
30
30
|
branchCode?: string;
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
|
-
export declare type ISellerMakesOffer = Pick<factory.event.screeningEvent.ISellerMakesOffer, 'availabilityEnds' | 'availabilityStarts' | 'validFrom' | 'validThrough'> & {
|
|
34
|
-
itemOffered: {
|
|
35
|
-
serviceOutput: {
|
|
36
|
-
reservationFor: {
|
|
37
|
-
/**
|
|
38
|
-
* イベントID
|
|
39
|
-
*/
|
|
40
|
-
id: string;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
};
|
|
@@ -1,2 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// export type ISellerMakesOffer =
|
|
4
|
+
// Pick<factory.event.screeningEvent.ISellerMakesOffer, 'availabilityEnds' | 'availabilityStarts' | 'validFrom' | 'validThrough'> & {
|
|
5
|
+
// itemOffered: {
|
|
6
|
+
// serviceOutput: {
|
|
7
|
+
// reservationFor: {
|
|
8
|
+
// /**
|
|
9
|
+
// * イベントID
|
|
10
|
+
// */
|
|
11
|
+
// id: string;
|
|
12
|
+
// };
|
|
13
|
+
// };
|
|
14
|
+
// };
|
|
15
|
+
// };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ISearchWithReservationForIdResult } from '../chevreConsole/aggregateReservation';
|
|
2
2
|
import * as factory from '../factory';
|
|
3
|
-
import { ISearchOfferCatalogItemAvailabilityResult, ISearchOfferCatalogItemResult, ISeatAsEventOffer
|
|
3
|
+
import { ISearchOfferCatalogItemAvailabilityResult, ISearchOfferCatalogItemResult, ISeatAsEventOffer } from './event/factory';
|
|
4
4
|
import { Service } from '../service';
|
|
5
5
|
declare type IKeyOfProjection = keyof factory.event.screeningEvent.IEvent;
|
|
6
6
|
declare type IProjection = {
|
|
@@ -31,33 +31,6 @@ export declare class EventService extends Service {
|
|
|
31
31
|
aggregateOffer?: 1;
|
|
32
32
|
};
|
|
33
33
|
}): Promise<ISearchWithReservationForIdResult[]>;
|
|
34
|
-
/**
|
|
35
|
-
* クライアントの販売設定検索
|
|
36
|
-
*/
|
|
37
|
-
searchSellerMakesOffer(params: {
|
|
38
|
-
/**
|
|
39
|
-
* min:1
|
|
40
|
-
* max:50
|
|
41
|
-
*/
|
|
42
|
-
limit: number;
|
|
43
|
-
/**
|
|
44
|
-
* min:1
|
|
45
|
-
*/
|
|
46
|
-
page: number;
|
|
47
|
-
availableAtOrFrom: {
|
|
48
|
-
/**
|
|
49
|
-
* クライアントID(指定必須)
|
|
50
|
-
*/
|
|
51
|
-
id: {
|
|
52
|
-
$eq: string;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* イベントID
|
|
57
|
-
* max:50
|
|
58
|
-
*/
|
|
59
|
-
eventIds: string[];
|
|
60
|
-
}): Promise<ISellerMakesOffer[]>;
|
|
61
34
|
/**
|
|
62
35
|
* イベント取得
|
|
63
36
|
*/
|
|
@@ -112,25 +112,6 @@ var EventService = /** @class */ (function (_super) {
|
|
|
112
112
|
});
|
|
113
113
|
});
|
|
114
114
|
};
|
|
115
|
-
/**
|
|
116
|
-
* クライアントの販売設定検索
|
|
117
|
-
*/
|
|
118
|
-
EventService.prototype.searchSellerMakesOffer = function (params) {
|
|
119
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
120
|
-
var _this = this;
|
|
121
|
-
return __generator(this, function (_a) {
|
|
122
|
-
return [2 /*return*/, this.fetch({
|
|
123
|
-
uri: '/events/sellerMakesOffer',
|
|
124
|
-
method: 'GET',
|
|
125
|
-
qs: params,
|
|
126
|
-
expectedStatusCodes: [http_status_1.OK]
|
|
127
|
-
})
|
|
128
|
-
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
129
|
-
return [2 /*return*/, response.json()];
|
|
130
|
-
}); }); })];
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
};
|
|
134
115
|
/**
|
|
135
116
|
* イベント取得
|
|
136
117
|
*/
|
|
@@ -18,9 +18,21 @@ export declare type IUpdateParamsByIdentifier = Pick<factory.event.screeningEven
|
|
|
18
18
|
superEvent?: never;
|
|
19
19
|
};
|
|
20
20
|
export interface IUpdateEventSellerMakesOfferParamsByIdentifier {
|
|
21
|
+
/**
|
|
22
|
+
* イベント識別子
|
|
23
|
+
*/
|
|
21
24
|
identifier: string;
|
|
22
25
|
offers: {
|
|
23
|
-
seller:
|
|
26
|
+
seller: {
|
|
27
|
+
makesOffer: (factory.event.screeningEvent.ISellerMakesOffer4create & {
|
|
28
|
+
/**
|
|
29
|
+
* アプリケーションオファーコード
|
|
30
|
+
* イベント内でユニーク必須
|
|
31
|
+
* 8-32文字の^[0-9a-zA-Z]+$
|
|
32
|
+
*/
|
|
33
|
+
identifier: string;
|
|
34
|
+
})[];
|
|
35
|
+
};
|
|
24
36
|
};
|
|
25
37
|
location?: never;
|
|
26
38
|
superEvent?: never;
|
|
@@ -72,22 +84,6 @@ export declare class EventService extends Service {
|
|
|
72
84
|
* max: 10
|
|
73
85
|
*/
|
|
74
86
|
params: IUpdateEventSellerMakesOfferParamsByIdentifier[]): Promise<void>;
|
|
75
|
-
/**
|
|
76
|
-
* イベント冪等複数作成
|
|
77
|
-
* 特定の追加特性をキーにして、存在しなければ作成する
|
|
78
|
-
* 存在すれば、一部属性を更新する(eventStatus,superEvent,offers.seller.makesOffer)
|
|
79
|
-
*/
|
|
80
|
-
upsertManyByAdditionalProperty(params: factory.event.screeningEvent.ICreateParams[], options: {
|
|
81
|
-
filter: {
|
|
82
|
-
/**
|
|
83
|
-
* キーにする追加特性name
|
|
84
|
-
*/
|
|
85
|
-
name: string;
|
|
86
|
-
};
|
|
87
|
-
update: boolean;
|
|
88
|
-
superEventId: string;
|
|
89
|
-
locationBranchCode: string;
|
|
90
|
-
}): Promise<void>;
|
|
91
87
|
/**
|
|
92
88
|
* イベント部分更新
|
|
93
89
|
*/
|
|
@@ -53,7 +53,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
53
53
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
54
|
exports.EventService = void 0;
|
|
55
55
|
var http_status_1 = require("http-status");
|
|
56
|
-
var factory = require("../factory");
|
|
57
56
|
var service_1 = require("../service");
|
|
58
57
|
/**
|
|
59
58
|
* イベントサービス
|
|
@@ -153,48 +152,6 @@ var EventService = /** @class */ (function (_super) {
|
|
|
153
152
|
});
|
|
154
153
|
});
|
|
155
154
|
};
|
|
156
|
-
/**
|
|
157
|
-
* イベント冪等複数作成
|
|
158
|
-
* 特定の追加特性をキーにして、存在しなければ作成する
|
|
159
|
-
* 存在すれば、一部属性を更新する(eventStatus,superEvent,offers.seller.makesOffer)
|
|
160
|
-
*/
|
|
161
|
-
EventService.prototype.upsertManyByAdditionalProperty = function (params, options) {
|
|
162
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
163
|
-
var superEventId, locationBranchCode;
|
|
164
|
-
return __generator(this, function (_a) {
|
|
165
|
-
switch (_a.label) {
|
|
166
|
-
case 0:
|
|
167
|
-
if (!Array.isArray(params) || params.length === 0) {
|
|
168
|
-
throw new factory.errors.ArgumentNull('body');
|
|
169
|
-
}
|
|
170
|
-
superEventId = options.superEventId;
|
|
171
|
-
locationBranchCode = options.locationBranchCode;
|
|
172
|
-
if (typeof superEventId !== 'string' || superEventId === '') {
|
|
173
|
-
throw new factory.errors.ArgumentNull('superEventId');
|
|
174
|
-
}
|
|
175
|
-
if (typeof locationBranchCode !== 'string' || locationBranchCode === '') {
|
|
176
|
-
throw new factory.errors.ArgumentNull('locationBranchCode');
|
|
177
|
-
}
|
|
178
|
-
return [4 /*yield*/, this.fetch({
|
|
179
|
-
uri: '/events',
|
|
180
|
-
method: 'PUT',
|
|
181
|
-
body: params,
|
|
182
|
-
qs: {
|
|
183
|
-
filter: options.filter,
|
|
184
|
-
update: options.update === true,
|
|
185
|
-
typeOf: factory.eventType.ScreeningEvent,
|
|
186
|
-
superEventId: superEventId,
|
|
187
|
-
locationBranchCode: locationBranchCode // add query(2025-08-27~)
|
|
188
|
-
},
|
|
189
|
-
expectedStatusCodes: [http_status_1.NO_CONTENT]
|
|
190
|
-
})];
|
|
191
|
-
case 1:
|
|
192
|
-
_a.sent();
|
|
193
|
-
return [2 /*return*/];
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
});
|
|
197
|
-
};
|
|
198
155
|
/**
|
|
199
156
|
* イベント部分更新
|
|
200
157
|
*/
|
|
@@ -8,6 +8,10 @@ declare type IProjection = {
|
|
|
8
8
|
declare type IUnset = {
|
|
9
9
|
[key in keyof factory.event.screeningEvent.IEvent]?: 1;
|
|
10
10
|
};
|
|
11
|
+
declare type IUpdateEventByIdAttributes = Pick<factory.event.screeningEvent.IUpdateParams, 'additionalProperty' | 'doorTime' | 'endDate' | 'eventStatus' | 'location' | 'maximumPhysicalAttendeeCapacity' | 'offers' | 'startDate'> & {
|
|
12
|
+
offers: Pick<factory.event.screeningEvent.IOffers4create, 'eligibleQuantity' | 'identifier' | 'itemOffered' | 'seller' | 'unacceptedPaymentMethod'> & {};
|
|
13
|
+
$unset?: IUnset;
|
|
14
|
+
};
|
|
11
15
|
/**
|
|
12
16
|
* イベントサービス
|
|
13
17
|
*/
|
|
@@ -39,9 +43,7 @@ export declare class EventService extends Service {
|
|
|
39
43
|
*/
|
|
40
44
|
updateEventById(params: {
|
|
41
45
|
id: string;
|
|
42
|
-
attributes:
|
|
43
|
-
$unset?: IUnset;
|
|
44
|
-
};
|
|
46
|
+
attributes: IUpdateEventByIdAttributes;
|
|
45
47
|
options: {
|
|
46
48
|
disableOverwriteMakesOffer: boolean;
|
|
47
49
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISearchOfferCatalogItemAvailabilityResult, ISearchOfferCatalogItemResult, ISeatAsEventOffer
|
|
1
|
+
import { ISearchOfferCatalogItemAvailabilityResult, ISearchOfferCatalogItemResult, ISeatAsEventOffer } from '../../chevre/event/factory';
|
|
2
2
|
import type { ISearchWithReservationForIdResult } from '../../chevreConsole/aggregateReservation';
|
|
3
3
|
import * as factory from '../../factory';
|
|
4
4
|
import { IAdditionalOptions, IOptions, ISearchResult, Service } from '../../service';
|
|
@@ -151,33 +151,6 @@ export declare class EventService extends Service {
|
|
|
151
151
|
aggregateOffer?: 1;
|
|
152
152
|
};
|
|
153
153
|
}): Promise<ISearchWithReservationForIdResult[]>;
|
|
154
|
-
/**
|
|
155
|
-
* クライアントの販売設定検索
|
|
156
|
-
*/
|
|
157
|
-
searchSellerMakesOffer(params: {
|
|
158
|
-
/**
|
|
159
|
-
* min:1
|
|
160
|
-
* max:50
|
|
161
|
-
*/
|
|
162
|
-
limit: number;
|
|
163
|
-
/**
|
|
164
|
-
* min:1
|
|
165
|
-
*/
|
|
166
|
-
page: number;
|
|
167
|
-
availableAtOrFrom: {
|
|
168
|
-
/**
|
|
169
|
-
* クライアントID(指定必須)
|
|
170
|
-
*/
|
|
171
|
-
id: {
|
|
172
|
-
$eq: string;
|
|
173
|
-
};
|
|
174
|
-
};
|
|
175
|
-
/**
|
|
176
|
-
* イベントID
|
|
177
|
-
* max:50
|
|
178
|
-
*/
|
|
179
|
-
eventIds: string[];
|
|
180
|
-
}): Promise<ISearchSellerMakesOfferResult[]>;
|
|
181
154
|
/**
|
|
182
155
|
* イベント取得
|
|
183
156
|
* alias of search
|
|
@@ -180,25 +180,6 @@ var EventService = /** @class */ (function (_super) {
|
|
|
180
180
|
});
|
|
181
181
|
});
|
|
182
182
|
};
|
|
183
|
-
/**
|
|
184
|
-
* クライアントの販売設定検索
|
|
185
|
-
*/
|
|
186
|
-
EventService.prototype.searchSellerMakesOffer = function (params) {
|
|
187
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
188
|
-
var _this = this;
|
|
189
|
-
return __generator(this, function (_a) {
|
|
190
|
-
return [2 /*return*/, this.fetch({
|
|
191
|
-
uri: '/events/sellerMakesOffer',
|
|
192
|
-
method: 'GET',
|
|
193
|
-
qs: params,
|
|
194
|
-
expectedStatusCodes: [http_status_1.OK]
|
|
195
|
-
})
|
|
196
|
-
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
197
|
-
return [2 /*return*/, response.json()];
|
|
198
|
-
}); }); })];
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
};
|
|
202
183
|
/**
|
|
203
184
|
* イベント取得
|
|
204
185
|
* alias of search
|
|
@@ -4,22 +4,6 @@ import { ICreateParamsByIdentifier, IUpdateEventSellerMakesOfferParamsByIdentifi
|
|
|
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
|
};
|
|
7
|
-
declare type ICreateScreeningEventParams = Omit<factory.event.screeningEvent.ICreateParams, 'location' | 'superEvent'> & {
|
|
8
|
-
typeOf?: never;
|
|
9
|
-
project?: never;
|
|
10
|
-
/**
|
|
11
|
-
* ルームコードを指定
|
|
12
|
-
*/
|
|
13
|
-
location: {
|
|
14
|
-
branchCode: string;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* 施設コンテンツIDを指定
|
|
18
|
-
*/
|
|
19
|
-
superEvent: {
|
|
20
|
-
id: string;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
7
|
/**
|
|
24
8
|
* イベントサービス
|
|
25
9
|
*/
|
|
@@ -62,23 +46,6 @@ export declare class EventService extends Service {
|
|
|
62
46
|
* max: 10
|
|
63
47
|
*/
|
|
64
48
|
params: IUpdateEventSellerMakesOfferParamsByIdentifier[]): Promise<void>;
|
|
65
|
-
/**
|
|
66
|
-
* イベント冪等複数作成
|
|
67
|
-
* 特定の追加特性をキーにして、存在しなければ作成する
|
|
68
|
-
* 存在すれば、一部属性を更新する(eventStatus,superEvent,offers.seller.makesOffer)
|
|
69
|
-
*/
|
|
70
|
-
upsertManyByAdditionalProperty(params: {
|
|
71
|
-
/**
|
|
72
|
-
* 最大長:10
|
|
73
|
-
*/
|
|
74
|
-
attributes: ICreateScreeningEventParams[];
|
|
75
|
-
filter: {
|
|
76
|
-
/**
|
|
77
|
-
* キーにする追加特性name
|
|
78
|
-
*/
|
|
79
|
-
name: string;
|
|
80
|
-
};
|
|
81
|
-
}): Promise<void>;
|
|
82
49
|
/**
|
|
83
50
|
* イベントステータス更新
|
|
84
51
|
*/
|
|
@@ -61,41 +61,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
61
61
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
65
|
-
var t = {};
|
|
66
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
67
|
-
t[p] = s[p];
|
|
68
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
69
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
70
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
71
|
-
t[p[i]] = s[p[i]];
|
|
72
|
-
}
|
|
73
|
-
return t;
|
|
74
|
-
};
|
|
75
64
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
76
65
|
exports.EventService = void 0;
|
|
77
66
|
var factory = require("../../factory");
|
|
78
67
|
var index_1 = require("../../index");
|
|
79
68
|
var service_1 = require("../../service");
|
|
80
|
-
function createUpsertParams(params) {
|
|
81
|
-
var _a, _b, _c, _d;
|
|
82
|
-
if (!Array.isArray(params.attributes) || params.attributes.length === 0) {
|
|
83
|
-
throw new factory.errors.ArgumentNull('body');
|
|
84
|
-
}
|
|
85
|
-
var superEventId = (_b = (_a = params.attributes[0]) === null || _a === void 0 ? void 0 : _a.superEvent) === null || _b === void 0 ? void 0 : _b.id;
|
|
86
|
-
var locationBranchCode = (_d = (_c = params.attributes[0]) === null || _c === void 0 ? void 0 : _c.location) === null || _d === void 0 ? void 0 : _d.branchCode;
|
|
87
|
-
if (typeof superEventId !== 'string' || superEventId === '') {
|
|
88
|
-
throw new factory.errors.ArgumentNull('superEvent.id');
|
|
89
|
-
}
|
|
90
|
-
if (typeof locationBranchCode !== 'string' || locationBranchCode === '') {
|
|
91
|
-
throw new factory.errors.ArgumentNull('location.branchCode');
|
|
92
|
-
}
|
|
93
|
-
var upsertParams = params.attributes.map(function (_a) {
|
|
94
|
-
var location = _a.location, superEvent = _a.superEvent, identifier = _a.identifier, typeOf = _a.typeOf, project = _a.project, createFields = __rest(_a, ["location", "superEvent", "identifier", "typeOf", "project"]);
|
|
95
|
-
return createFields;
|
|
96
|
-
});
|
|
97
|
-
return { upsertParams: upsertParams, superEventId: superEventId, locationBranchCode: locationBranchCode };
|
|
98
|
-
}
|
|
99
69
|
/**
|
|
100
70
|
* イベントサービス
|
|
101
71
|
*/
|
|
@@ -197,56 +167,6 @@ var EventService = /** @class */ (function (_super) {
|
|
|
197
167
|
});
|
|
198
168
|
});
|
|
199
169
|
};
|
|
200
|
-
/**
|
|
201
|
-
* イベント冪等複数作成
|
|
202
|
-
* 特定の追加特性をキーにして、存在しなければ作成する
|
|
203
|
-
* 存在すれば、一部属性を更新する(eventStatus,superEvent,offers.seller.makesOffer)
|
|
204
|
-
*/
|
|
205
|
-
EventService.prototype.upsertManyByAdditionalProperty = function (params) {
|
|
206
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
207
|
-
var _a, upsertParams, superEventId, locationBranchCode, _b, auth, endpoint, project, seller, chevreAdmin, eventService;
|
|
208
|
-
return __generator(this, function (_c) {
|
|
209
|
-
switch (_c.label) {
|
|
210
|
-
case 0:
|
|
211
|
-
_a = createUpsertParams(params), upsertParams = _a.upsertParams, superEventId = _a.superEventId, locationBranchCode = _a.locationBranchCode;
|
|
212
|
-
_b = this.options, auth = _b.auth, endpoint = _b.endpoint, project = _b.project, seller = _b.seller;
|
|
213
|
-
return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint })];
|
|
214
|
-
case 1:
|
|
215
|
-
chevreAdmin = _c.sent();
|
|
216
|
-
return [4 /*yield*/, chevreAdmin.createEventInstance({
|
|
217
|
-
project: project,
|
|
218
|
-
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
|
|
219
|
-
})];
|
|
220
|
-
case 2:
|
|
221
|
-
eventService = _c.sent();
|
|
222
|
-
return [4 /*yield*/, eventService.upsertManyByAdditionalProperty(upsertParams, {
|
|
223
|
-
filter: { name: params.filter.name },
|
|
224
|
-
update: false,
|
|
225
|
-
superEventId: superEventId,
|
|
226
|
-
locationBranchCode: locationBranchCode
|
|
227
|
-
})];
|
|
228
|
-
case 3:
|
|
229
|
-
_c.sent();
|
|
230
|
-
return [4 /*yield*/, new Promise(function (resolve) {
|
|
231
|
-
setTimeout(function () { resolve(); },
|
|
232
|
-
// tslint:disable-next-line:no-magic-numbers
|
|
233
|
-
1000);
|
|
234
|
-
})];
|
|
235
|
-
case 4:
|
|
236
|
-
_c.sent();
|
|
237
|
-
return [4 /*yield*/, eventService.upsertManyByAdditionalProperty(upsertParams, {
|
|
238
|
-
filter: { name: params.filter.name },
|
|
239
|
-
update: true,
|
|
240
|
-
superEventId: superEventId,
|
|
241
|
-
locationBranchCode: locationBranchCode
|
|
242
|
-
})];
|
|
243
|
-
case 5:
|
|
244
|
-
_c.sent();
|
|
245
|
-
return [2 /*return*/];
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
});
|
|
249
|
-
};
|
|
250
170
|
/**
|
|
251
171
|
* イベントステータス更新
|
|
252
172
|
*/
|
package/lib/bundle.js
CHANGED
|
@@ -749,25 +749,6 @@ var EventService = /** @class */ (function (_super) {
|
|
|
749
749
|
});
|
|
750
750
|
});
|
|
751
751
|
};
|
|
752
|
-
/**
|
|
753
|
-
* クライアントの販売設定検索
|
|
754
|
-
*/
|
|
755
|
-
EventService.prototype.searchSellerMakesOffer = function (params) {
|
|
756
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
757
|
-
var _this = this;
|
|
758
|
-
return __generator(this, function (_a) {
|
|
759
|
-
return [2 /*return*/, this.fetch({
|
|
760
|
-
uri: '/events/sellerMakesOffer',
|
|
761
|
-
method: 'GET',
|
|
762
|
-
qs: params,
|
|
763
|
-
expectedStatusCodes: [http_status_1.OK]
|
|
764
|
-
})
|
|
765
|
-
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
766
|
-
return [2 /*return*/, response.json()];
|
|
767
|
-
}); }); })];
|
|
768
|
-
});
|
|
769
|
-
});
|
|
770
|
-
};
|
|
771
752
|
/**
|
|
772
753
|
* イベント取得
|
|
773
754
|
*/
|
|
@@ -2833,7 +2814,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
2833
2814
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2834
2815
|
exports.EventService = void 0;
|
|
2835
2816
|
var http_status_1 = require("http-status");
|
|
2836
|
-
var factory = require("../factory");
|
|
2837
2817
|
var service_1 = require("../service");
|
|
2838
2818
|
/**
|
|
2839
2819
|
* イベントサービス
|
|
@@ -2933,48 +2913,6 @@ var EventService = /** @class */ (function (_super) {
|
|
|
2933
2913
|
});
|
|
2934
2914
|
});
|
|
2935
2915
|
};
|
|
2936
|
-
/**
|
|
2937
|
-
* イベント冪等複数作成
|
|
2938
|
-
* 特定の追加特性をキーにして、存在しなければ作成する
|
|
2939
|
-
* 存在すれば、一部属性を更新する(eventStatus,superEvent,offers.seller.makesOffer)
|
|
2940
|
-
*/
|
|
2941
|
-
EventService.prototype.upsertManyByAdditionalProperty = function (params, options) {
|
|
2942
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
2943
|
-
var superEventId, locationBranchCode;
|
|
2944
|
-
return __generator(this, function (_a) {
|
|
2945
|
-
switch (_a.label) {
|
|
2946
|
-
case 0:
|
|
2947
|
-
if (!Array.isArray(params) || params.length === 0) {
|
|
2948
|
-
throw new factory.errors.ArgumentNull('body');
|
|
2949
|
-
}
|
|
2950
|
-
superEventId = options.superEventId;
|
|
2951
|
-
locationBranchCode = options.locationBranchCode;
|
|
2952
|
-
if (typeof superEventId !== 'string' || superEventId === '') {
|
|
2953
|
-
throw new factory.errors.ArgumentNull('superEventId');
|
|
2954
|
-
}
|
|
2955
|
-
if (typeof locationBranchCode !== 'string' || locationBranchCode === '') {
|
|
2956
|
-
throw new factory.errors.ArgumentNull('locationBranchCode');
|
|
2957
|
-
}
|
|
2958
|
-
return [4 /*yield*/, this.fetch({
|
|
2959
|
-
uri: '/events',
|
|
2960
|
-
method: 'PUT',
|
|
2961
|
-
body: params,
|
|
2962
|
-
qs: {
|
|
2963
|
-
filter: options.filter,
|
|
2964
|
-
update: options.update === true,
|
|
2965
|
-
typeOf: factory.eventType.ScreeningEvent,
|
|
2966
|
-
superEventId: superEventId,
|
|
2967
|
-
locationBranchCode: locationBranchCode // add query(2025-08-27~)
|
|
2968
|
-
},
|
|
2969
|
-
expectedStatusCodes: [http_status_1.NO_CONTENT]
|
|
2970
|
-
})];
|
|
2971
|
-
case 1:
|
|
2972
|
-
_a.sent();
|
|
2973
|
-
return [2 /*return*/];
|
|
2974
|
-
}
|
|
2975
|
-
});
|
|
2976
|
-
});
|
|
2977
|
-
};
|
|
2978
2916
|
/**
|
|
2979
2917
|
* イベント部分更新
|
|
2980
2918
|
*/
|
|
@@ -2999,7 +2937,7 @@ var EventService = /** @class */ (function (_super) {
|
|
|
2999
2937
|
}(service_1.Service));
|
|
3000
2938
|
exports.EventService = EventService;
|
|
3001
2939
|
|
|
3002
|
-
},{"../
|
|
2940
|
+
},{"../service":171,"http-status":456}],23:[function(require,module,exports){
|
|
3003
2941
|
"use strict";
|
|
3004
2942
|
var __extends = (this && this.__extends) || (function () {
|
|
3005
2943
|
var extendStatics = function (d, b) {
|
|
@@ -20171,25 +20109,6 @@ var EventService = /** @class */ (function (_super) {
|
|
|
20171
20109
|
});
|
|
20172
20110
|
});
|
|
20173
20111
|
};
|
|
20174
|
-
/**
|
|
20175
|
-
* クライアントの販売設定検索
|
|
20176
|
-
*/
|
|
20177
|
-
EventService.prototype.searchSellerMakesOffer = function (params) {
|
|
20178
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
20179
|
-
var _this = this;
|
|
20180
|
-
return __generator(this, function (_a) {
|
|
20181
|
-
return [2 /*return*/, this.fetch({
|
|
20182
|
-
uri: '/events/sellerMakesOffer',
|
|
20183
|
-
method: 'GET',
|
|
20184
|
-
qs: params,
|
|
20185
|
-
expectedStatusCodes: [http_status_1.OK]
|
|
20186
|
-
})
|
|
20187
|
-
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
20188
|
-
return [2 /*return*/, response.json()];
|
|
20189
|
-
}); }); })];
|
|
20190
|
-
});
|
|
20191
|
-
});
|
|
20192
|
-
};
|
|
20193
20112
|
/**
|
|
20194
20113
|
* イベント取得
|
|
20195
20114
|
* alias of search
|
|
@@ -21477,41 +21396,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
21477
21396
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
21478
21397
|
}
|
|
21479
21398
|
};
|
|
21480
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
21481
|
-
var t = {};
|
|
21482
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
21483
|
-
t[p] = s[p];
|
|
21484
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21485
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
21486
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
21487
|
-
t[p[i]] = s[p[i]];
|
|
21488
|
-
}
|
|
21489
|
-
return t;
|
|
21490
|
-
};
|
|
21491
21399
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21492
21400
|
exports.EventService = void 0;
|
|
21493
21401
|
var factory = require("../../factory");
|
|
21494
21402
|
var index_1 = require("../../index");
|
|
21495
21403
|
var service_1 = require("../../service");
|
|
21496
|
-
function createUpsertParams(params) {
|
|
21497
|
-
var _a, _b, _c, _d;
|
|
21498
|
-
if (!Array.isArray(params.attributes) || params.attributes.length === 0) {
|
|
21499
|
-
throw new factory.errors.ArgumentNull('body');
|
|
21500
|
-
}
|
|
21501
|
-
var superEventId = (_b = (_a = params.attributes[0]) === null || _a === void 0 ? void 0 : _a.superEvent) === null || _b === void 0 ? void 0 : _b.id;
|
|
21502
|
-
var locationBranchCode = (_d = (_c = params.attributes[0]) === null || _c === void 0 ? void 0 : _c.location) === null || _d === void 0 ? void 0 : _d.branchCode;
|
|
21503
|
-
if (typeof superEventId !== 'string' || superEventId === '') {
|
|
21504
|
-
throw new factory.errors.ArgumentNull('superEvent.id');
|
|
21505
|
-
}
|
|
21506
|
-
if (typeof locationBranchCode !== 'string' || locationBranchCode === '') {
|
|
21507
|
-
throw new factory.errors.ArgumentNull('location.branchCode');
|
|
21508
|
-
}
|
|
21509
|
-
var upsertParams = params.attributes.map(function (_a) {
|
|
21510
|
-
var location = _a.location, superEvent = _a.superEvent, identifier = _a.identifier, typeOf = _a.typeOf, project = _a.project, createFields = __rest(_a, ["location", "superEvent", "identifier", "typeOf", "project"]);
|
|
21511
|
-
return createFields;
|
|
21512
|
-
});
|
|
21513
|
-
return { upsertParams: upsertParams, superEventId: superEventId, locationBranchCode: locationBranchCode };
|
|
21514
|
-
}
|
|
21515
21404
|
/**
|
|
21516
21405
|
* イベントサービス
|
|
21517
21406
|
*/
|
|
@@ -21613,56 +21502,6 @@ var EventService = /** @class */ (function (_super) {
|
|
|
21613
21502
|
});
|
|
21614
21503
|
});
|
|
21615
21504
|
};
|
|
21616
|
-
/**
|
|
21617
|
-
* イベント冪等複数作成
|
|
21618
|
-
* 特定の追加特性をキーにして、存在しなければ作成する
|
|
21619
|
-
* 存在すれば、一部属性を更新する(eventStatus,superEvent,offers.seller.makesOffer)
|
|
21620
|
-
*/
|
|
21621
|
-
EventService.prototype.upsertManyByAdditionalProperty = function (params) {
|
|
21622
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
21623
|
-
var _a, upsertParams, superEventId, locationBranchCode, _b, auth, endpoint, project, seller, chevreAdmin, eventService;
|
|
21624
|
-
return __generator(this, function (_c) {
|
|
21625
|
-
switch (_c.label) {
|
|
21626
|
-
case 0:
|
|
21627
|
-
_a = createUpsertParams(params), upsertParams = _a.upsertParams, superEventId = _a.superEventId, locationBranchCode = _a.locationBranchCode;
|
|
21628
|
-
_b = this.options, auth = _b.auth, endpoint = _b.endpoint, project = _b.project, seller = _b.seller;
|
|
21629
|
-
return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint })];
|
|
21630
|
-
case 1:
|
|
21631
|
-
chevreAdmin = _c.sent();
|
|
21632
|
-
return [4 /*yield*/, chevreAdmin.createEventInstance({
|
|
21633
|
-
project: project,
|
|
21634
|
-
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
|
|
21635
|
-
})];
|
|
21636
|
-
case 2:
|
|
21637
|
-
eventService = _c.sent();
|
|
21638
|
-
return [4 /*yield*/, eventService.upsertManyByAdditionalProperty(upsertParams, {
|
|
21639
|
-
filter: { name: params.filter.name },
|
|
21640
|
-
update: false,
|
|
21641
|
-
superEventId: superEventId,
|
|
21642
|
-
locationBranchCode: locationBranchCode
|
|
21643
|
-
})];
|
|
21644
|
-
case 3:
|
|
21645
|
-
_c.sent();
|
|
21646
|
-
return [4 /*yield*/, new Promise(function (resolve) {
|
|
21647
|
-
setTimeout(function () { resolve(); },
|
|
21648
|
-
// tslint:disable-next-line:no-magic-numbers
|
|
21649
|
-
1000);
|
|
21650
|
-
})];
|
|
21651
|
-
case 4:
|
|
21652
|
-
_c.sent();
|
|
21653
|
-
return [4 /*yield*/, eventService.upsertManyByAdditionalProperty(upsertParams, {
|
|
21654
|
-
filter: { name: params.filter.name },
|
|
21655
|
-
update: true,
|
|
21656
|
-
superEventId: superEventId,
|
|
21657
|
-
locationBranchCode: locationBranchCode
|
|
21658
|
-
})];
|
|
21659
|
-
case 5:
|
|
21660
|
-
_c.sent();
|
|
21661
|
-
return [2 /*return*/];
|
|
21662
|
-
}
|
|
21663
|
-
});
|
|
21664
|
-
});
|
|
21665
|
-
};
|
|
21666
21505
|
/**
|
|
21667
21506
|
* イベントステータス更新
|
|
21668
21507
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cinerino/sdk",
|
|
3
|
-
"version": "12.6.0
|
|
3
|
+
"version": "12.6.0",
|
|
4
4
|
"description": "Cinerino SDK",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"browser": {
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"watchify": "^3.11.1"
|
|
94
94
|
},
|
|
95
95
|
"dependencies": {
|
|
96
|
-
"@chevre/factory": "5.1.0
|
|
96
|
+
"@chevre/factory": "5.1.0",
|
|
97
97
|
"debug": "3.2.7",
|
|
98
98
|
"http-status": "1.7.4",
|
|
99
99
|
"idtoken-verifier": "2.0.3",
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// tslint:disable:no-implicit-dependencies no-console
|
|
2
|
-
import * as client from '../../../lib/index';
|
|
3
|
-
|
|
4
|
-
const PROJECT_ID = String(process.env.PROJECT_ID);
|
|
5
|
-
|
|
6
|
-
async function main() {
|
|
7
|
-
const authClient = await client.auth.ClientCredentials.createInstance({
|
|
8
|
-
domain: <string>process.env.CHEVRE_AUTHORIZE_SERVER_DOMAIN,
|
|
9
|
-
clientId: <string>process.env.CHEVRE_CLIENT_ID,
|
|
10
|
-
clientSecret: <string>process.env.CHEVRE_CLIENT_SECRET,
|
|
11
|
-
scopes: [],
|
|
12
|
-
state: ''
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const chevre = await client.loadChevre({
|
|
16
|
-
endpoint: <string>process.env.CHEVRE_ENDPOINT,
|
|
17
|
-
auth: authClient
|
|
18
|
-
});
|
|
19
|
-
const eventService = await chevre.createEventInstance({
|
|
20
|
-
project: { id: PROJECT_ID },
|
|
21
|
-
seller: { id: '' }
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const result = await eventService.searchSellerMakesOffer({
|
|
25
|
-
page: 1,
|
|
26
|
-
limit: 50,
|
|
27
|
-
availableAtOrFrom: { id: { $eq: '51qbjcfr72h62m06vtv5kkhgje' } },
|
|
28
|
-
eventIds: [
|
|
29
|
-
'bm0f0cadv', 'xx',
|
|
30
|
-
// tslint:disable-next-line:no-magic-numbers prefer-array-literal
|
|
31
|
-
...[...Array(48)].map(() => 'xxxxxxxxxxxxxxxxxxx')
|
|
32
|
-
]
|
|
33
|
-
});
|
|
34
|
-
// tslint:disable-next-line:no-null-keyword
|
|
35
|
-
console.dir(result, { depth: null });
|
|
36
|
-
console.log(result.length, 'offers returned');
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
main()
|
|
40
|
-
.then(() => {
|
|
41
|
-
console.log('success!');
|
|
42
|
-
})
|
|
43
|
-
.catch(console.error);
|
|
@@ -1,107 +0,0 @@
|
|
|
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
|
-
|
|
7
|
-
const PROJECT_ID = String(process.env.PROJECT_ID);
|
|
8
|
-
const SELLER_ID = '59d20831e53ebc2b4e774466';
|
|
9
|
-
const EVENT_SERVICE_ID = '681aa7c1b53b6dbbe5efbec7';
|
|
10
|
-
const AVAILABLE_AT_OR_FROM_ID = '51qbjcfr72h62m06vtv5kkhgje';
|
|
11
|
-
const ADDITIONAL_PROPERTY_NAME = 'sampleCreateId';
|
|
12
|
-
|
|
13
|
-
async function main() {
|
|
14
|
-
const authClient = await auth.login();
|
|
15
|
-
await authClient.refreshAccessToken();
|
|
16
|
-
const loginTicket = authClient.verifyIdToken({});
|
|
17
|
-
console.log('username is', loginTicket.getUsername());
|
|
18
|
-
|
|
19
|
-
const eventService = await (await client.loadCloudAdmin({
|
|
20
|
-
endpoint: <string>process.env.API_ADMIN_ENDPOINT,
|
|
21
|
-
auth: authClient
|
|
22
|
-
})).createEventInstance({
|
|
23
|
-
project: { id: PROJECT_ID },
|
|
24
|
-
seller: { id: SELLER_ID }
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
const today = moment()
|
|
28
|
-
.tz('Asia/Tokyo')
|
|
29
|
-
.format('YYYY-MM-DD');
|
|
30
|
-
await eventService.upsertManyByAdditionalProperty({
|
|
31
|
-
filter: { name: ADDITIONAL_PROPERTY_NAME },
|
|
32
|
-
attributes: [
|
|
33
|
-
{
|
|
34
|
-
doorTime: moment(`${today}T13:00:00Z`)
|
|
35
|
-
.toDate(),
|
|
36
|
-
startDate: moment(`${today}T13:00:00Z`)
|
|
37
|
-
.toDate(),
|
|
38
|
-
endDate: moment(`${today}T14:00:00Z`)
|
|
39
|
-
.toDate(),
|
|
40
|
-
eventStatus: client.factory.eventStatusType.EventScheduled,
|
|
41
|
-
additionalProperty: [
|
|
42
|
-
// { name: ADDITIONAL_PROPERTY_NAME, value: `fromSamples:${Date.now()}` }
|
|
43
|
-
{
|
|
44
|
-
name: ADDITIONAL_PROPERTY_NAME, value: `fromSamples:${moment()
|
|
45
|
-
.format('YYYY-MM-DD HH:mm')}`
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
// maximumPhysicalAttendeeCapacity: 3,
|
|
49
|
-
location: {
|
|
50
|
-
branchCode: '10'
|
|
51
|
-
},
|
|
52
|
-
superEvent: {
|
|
53
|
-
id: '7k9ayl8hc'
|
|
54
|
-
},
|
|
55
|
-
offers: {
|
|
56
|
-
identifier: '12345678', // <-プロダクトオファーでメンバープログラムティアごとのオファーを定義する場合に指定
|
|
57
|
-
unacceptedPaymentMethod: [],
|
|
58
|
-
eligibleQuantity: {
|
|
59
|
-
maxValue: 6
|
|
60
|
-
},
|
|
61
|
-
itemOffered: {
|
|
62
|
-
id: EVENT_SERVICE_ID,
|
|
63
|
-
serviceOutput: {
|
|
64
|
-
typeOf: client.factory.reservationType.EventReservation,
|
|
65
|
-
reservedTicket: { typeOf: 'Ticket', ticketedSeat: { typeOf: client.factory.placeType.Seat } }
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
seller: {
|
|
69
|
-
makesOffer: [
|
|
70
|
-
{
|
|
71
|
-
typeOf: client.factory.offerType.Offer,
|
|
72
|
-
availableAtOrFrom: { id: AVAILABLE_AT_OR_FROM_ID }, // <-販売アプリケーションIDを指定する
|
|
73
|
-
availabilityStarts: moment(`${today}T13:00:00Z`)
|
|
74
|
-
.toDate(),
|
|
75
|
-
availabilityEnds: moment(`${today}T14:00:00Z`)
|
|
76
|
-
.toDate(),
|
|
77
|
-
validFrom: moment(`${today}T13:00:00Z`)
|
|
78
|
-
.toDate(),
|
|
79
|
-
validThrough: moment(`${today}T14:00:00Z`)
|
|
80
|
-
.toDate(),
|
|
81
|
-
validForMemberTier: { typeOf: 'MemberProgramTier' } // <-プロダクトオファーでメンバープログラムティアごとのオファーを定義する場合に指定
|
|
82
|
-
}
|
|
83
|
-
]
|
|
84
|
-
// makesOfferDefaultを指定するとmakesOfferよりも優先される
|
|
85
|
-
// makesOfferDefault: {
|
|
86
|
-
// typeOf: client.factory.offerType.Offer,
|
|
87
|
-
// availabilityStarts: moment('2024-05-11T00:00:00.000Z')
|
|
88
|
-
// .toDate(),
|
|
89
|
-
// availabilityEnds: moment('2024-05-12T00:00:00.000Z')
|
|
90
|
-
// .toDate(),
|
|
91
|
-
// validFrom: moment('2024-05-11T00:00:00.000Z')
|
|
92
|
-
// .toDate(),
|
|
93
|
-
// validThrough: moment('2024-05-12T00:00:00.000Z')
|
|
94
|
-
// .toDate()
|
|
95
|
-
// }
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
]
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
main()
|
|
104
|
-
.then(() => {
|
|
105
|
-
console.log('success!');
|
|
106
|
-
})
|
|
107
|
-
.catch(console.error);
|