@cinerino/sdk 10.3.0 → 10.4.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.
@@ -5018,50 +5018,6 @@ var EventService = /** @class */ (function (_super) {
5018
5018
  });
5019
5019
  });
5020
5020
  };
5021
- // public async createScreeningEventSeriesIfNotExistByWorkPerformed(params: {
5022
- // attributes: factory.event.ICreateParams<factory.eventType.ScreeningEventSeries>[];
5023
- // qs: {
5024
- // /**
5025
- // * 全施設に作成するかどうか
5026
- // */
5027
- // createScreeningEventSeriesOnAllLocation?: boolean;
5028
- // };
5029
- // }): Promise<void> {
5030
- // await this.fetch({
5031
- // uri: '/events/createScreeningEventSeriesIfNotExistByWorkPerformed',
5032
- // method: 'POST',
5033
- // body: params.attributes,
5034
- // qs: params.qs,
5035
- // expectedStatusCodes: [NO_CONTENT]
5036
- // });
5037
- // }
5038
- // public async upsertScreeningEventSeriesByVersion(
5039
- // params: factory.event.ICreateParams<factory.eventType.ScreeningEventSeries>[]
5040
- // ): Promise<void> {
5041
- // await this.fetch({
5042
- // uri: `/events/${factory.eventType.ScreeningEventSeries}`,
5043
- // method: 'PUT',
5044
- // body: params,
5045
- // qs: {},
5046
- // expectedStatusCodes: [NO_CONTENT]
5047
- // });
5048
- // }
5049
- // public async aggregateScreeningEventMaxVersion(params: {
5050
- // workPerformed: {
5051
- // identifier: { $eq: string };
5052
- // };
5053
- // location: {
5054
- // branchCode: { $in: string[] };
5055
- // };
5056
- // }): Promise<{ maxVersion: string }> {
5057
- // return this.fetch({
5058
- // uri: '/events/aggregateScreeningEventMaxVersion',
5059
- // method: 'GET',
5060
- // qs: params,
5061
- // expectedStatusCodes: [OK]
5062
- // })
5063
- // .then(async (response) => response.json());
5064
- // }
5065
5021
  /**
5066
5022
  * イベント検索
5067
5023
  */
@@ -5111,7 +5067,7 @@ var EventService = /** @class */ (function (_super) {
5111
5067
  /**
5112
5068
  * イベント更新
5113
5069
  */
5114
- EventService.prototype.update = function (params) {
5070
+ EventService.prototype.updateById = function (params) {
5115
5071
  return __awaiter(this, void 0, void 0, function () {
5116
5072
  return __generator(this, function (_a) {
5117
5073
  switch (_a.label) {
@@ -5119,26 +5075,7 @@ var EventService = /** @class */ (function (_super) {
5119
5075
  uri: "/events/" + encodeURIComponent(String(params.id)),
5120
5076
  method: 'PUT',
5121
5077
  body: params.attributes,
5122
- qs: params.qs,
5123
- expectedStatusCodes: [http_status_1.NO_CONTENT]
5124
- })];
5125
- case 1:
5126
- _a.sent();
5127
- return [2 /*return*/];
5128
- }
5129
- });
5130
- });
5131
- };
5132
- /**
5133
- * イベント削除
5134
- */
5135
- EventService.prototype.deleteById = function (params) {
5136
- return __awaiter(this, void 0, void 0, function () {
5137
- return __generator(this, function (_a) {
5138
- switch (_a.label) {
5139
- case 0: return [4 /*yield*/, this.fetch({
5140
- uri: "/events/" + encodeURIComponent(String(params.id)),
5141
- method: 'DELETE',
5078
+ // qs: params.qs,
5142
5079
  expectedStatusCodes: [http_status_1.NO_CONTENT]
5143
5080
  })];
5144
5081
  case 1:
@@ -5238,7 +5175,7 @@ var EventSeriesService = /** @class */ (function (_super) {
5238
5175
  function EventSeriesService() {
5239
5176
  return _super !== null && _super.apply(this, arguments) || this;
5240
5177
  }
5241
- EventSeriesService.prototype.createScreeningEventSeriesIfNotExistByWorkPerformed = function (params) {
5178
+ EventSeriesService.prototype.createIfNotExistByWorkPerformed = function (params) {
5242
5179
  return __awaiter(this, void 0, void 0, function () {
5243
5180
  return __generator(this, function (_a) {
5244
5181
  switch (_a.label) {
@@ -5259,7 +5196,7 @@ var EventSeriesService = /** @class */ (function (_super) {
5259
5196
  /**
5260
5197
  * 施設コンテンツ作成
5261
5198
  */
5262
- EventSeriesService.prototype.createEventSeries = function (params) {
5199
+ EventSeriesService.prototype.create = function (params) {
5263
5200
  return __awaiter(this, void 0, void 0, function () {
5264
5201
  var _this = this;
5265
5202
  return __generator(this, function (_a) {
@@ -5279,7 +5216,7 @@ var EventSeriesService = /** @class */ (function (_super) {
5279
5216
  * 施設コンテンツ冪等置換(施設+コンテンツ+バージョンに対してユニーク)
5280
5217
  * 存在しなければ作成し、存在すれば置換
5281
5218
  */
5282
- EventSeriesService.prototype.upsertScreeningEventSeriesByVersion = function (params) {
5219
+ EventSeriesService.prototype.upsertByVersion = function (params) {
5283
5220
  return __awaiter(this, void 0, void 0, function () {
5284
5221
  return __generator(this, function (_a) {
5285
5222
  switch (_a.label) {
@@ -5297,7 +5234,7 @@ var EventSeriesService = /** @class */ (function (_super) {
5297
5234
  });
5298
5235
  });
5299
5236
  };
5300
- EventSeriesService.prototype.aggregateScreeningEventMaxVersion = function (params) {
5237
+ EventSeriesService.prototype.aggregateMaxVersion = function (params) {
5301
5238
  return __awaiter(this, void 0, void 0, function () {
5302
5239
  var _this = this;
5303
5240
  return __generator(this, function (_a) {
@@ -5316,7 +5253,7 @@ var EventSeriesService = /** @class */ (function (_super) {
5316
5253
  /**
5317
5254
  * 施設コンテンツ更新
5318
5255
  */
5319
- EventSeriesService.prototype.update = function (params) {
5256
+ EventSeriesService.prototype.updateById = function (params) {
5320
5257
  return __awaiter(this, void 0, void 0, function () {
5321
5258
  return __generator(this, function (_a) {
5322
5259
  switch (_a.label) {
@@ -5334,6 +5271,25 @@ var EventSeriesService = /** @class */ (function (_super) {
5334
5271
  });
5335
5272
  });
5336
5273
  };
5274
+ /**
5275
+ * 施設コンテンツ削除
5276
+ */
5277
+ EventSeriesService.prototype.deleteById = function (params) {
5278
+ return __awaiter(this, void 0, void 0, function () {
5279
+ return __generator(this, function (_a) {
5280
+ switch (_a.label) {
5281
+ case 0: return [4 /*yield*/, this.fetch({
5282
+ uri: "/events/" + factory.eventType.ScreeningEventSeries + "/" + encodeURIComponent(String(params.id)),
5283
+ method: 'DELETE',
5284
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
5285
+ })];
5286
+ case 1:
5287
+ _a.sent();
5288
+ return [2 /*return*/];
5289
+ }
5290
+ });
5291
+ });
5292
+ };
5337
5293
  return EventSeriesService;
5338
5294
  }(service_1.Service));
5339
5295
  exports.EventSeriesService = EventSeriesService;
@@ -9864,7 +9820,7 @@ var ReservationService = /** @class */ (function (_super) {
9864
9820
  /**
9865
9821
  * 予約検索
9866
9822
  */
9867
- ReservationService.prototype.search = function (params) {
9823
+ ReservationService.prototype.find = function (params) {
9868
9824
  return __awaiter(this, void 0, void 0, function () {
9869
9825
  var _this = this;
9870
9826
  return __generator(this, function (_a) {
@@ -9874,18 +9830,9 @@ var ReservationService = /** @class */ (function (_super) {
9874
9830
  qs: params,
9875
9831
  expectedStatusCodes: [http_status_1.OK]
9876
9832
  })
9877
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
9878
- var _a;
9879
- return __generator(this, function (_b) {
9880
- switch (_b.label) {
9881
- case 0:
9882
- _a = {};
9883
- return [4 /*yield*/, response.json()];
9884
- case 1: return [2 /*return*/, (_a.data = _b.sent(),
9885
- _a)];
9886
- }
9887
- });
9888
- }); })];
9833
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
9834
+ return [2 /*return*/, response.json()];
9835
+ }); }); })];
9889
9836
  });
9890
9837
  });
9891
9838
  };
@@ -17621,7 +17568,7 @@ var EventService = /** @class */ (function (_super) {
17621
17568
  })];
17622
17569
  case 2:
17623
17570
  eventSeriesService = _b.sent();
17624
- return [4 /*yield*/, eventSeriesService.upsertScreeningEventSeriesByVersion(params)];
17571
+ return [4 /*yield*/, eventSeriesService.upsertByVersion(params)];
17625
17572
  case 3:
17626
17573
  _b.sent();
17627
17574
  return [2 /*return*/];
@@ -18888,7 +18835,7 @@ var ReservationService = /** @class */ (function (_super) {
18888
18835
  })];
18889
18836
  case 2:
18890
18837
  reservationService = _b.sent();
18891
- return [4 /*yield*/, reservationService.search(__assign(__assign({}, params), { limit: limit,
18838
+ return [4 /*yield*/, reservationService.find(__assign(__assign({}, params), { limit: limit,
18892
18839
  page: page,
18893
18840
  // statusを明示的に制限(2023-05-29~)
18894
18841
  reservationStatus: __assign(__assign({}, params === null || params === void 0 ? void 0 : params.reservationStatus), { $in: [
@@ -18896,7 +18843,7 @@ var ReservationService = /** @class */ (function (_super) {
18896
18843
  factory.reservationStatusType.ReservationConfirmed
18897
18844
  ] }), typeOf: factory.reservationType.EventReservation }))];
18898
18845
  case 3:
18899
- data = (_b.sent()).data;
18846
+ data = _b.sent();
18900
18847
  return [2 /*return*/, { data: data }];
18901
18848
  }
18902
18849
  });
@@ -4,7 +4,9 @@ import { IUnset, Service } from '../service';
4
4
  * コンテンツサービス
5
5
  */
6
6
  export declare class CreativeWorkService extends Service {
7
- createMovie(params: factory.creativeWork.movie.ICreateParams): Promise<factory.creativeWork.movie.ICreativeWork>;
7
+ createMovie(params: factory.creativeWork.movie.ICreateParams): Promise<{
8
+ id: string;
9
+ }>;
8
10
  /**
9
11
  * コンテンツ冪等置換
10
12
  */
@@ -46,17 +46,11 @@ export declare class EventService extends Service {
46
46
  /**
47
47
  * イベント更新
48
48
  */
49
- update<T extends factory.eventType.Event | factory.eventType.ScreeningEvent>(params: {
49
+ updateById<T extends factory.eventType.Event | factory.eventType.ScreeningEvent>(params: {
50
50
  id: string;
51
51
  attributes: factory.event.IUpdateParams<T> & {
52
52
  $unset?: IUnset<T>;
53
53
  };
54
- qs: {
55
- /**
56
- * 関連リソースへの同期有無(2023-07-28~)
57
- */
58
- useSync?: boolean;
59
- };
60
54
  }): Promise<void>;
61
55
  /**
62
56
  * イベント部分更新
@@ -164,7 +164,7 @@ var EventService = /** @class */ (function (_super) {
164
164
  /**
165
165
  * イベント更新
166
166
  */
167
- EventService.prototype.update = function (params) {
167
+ EventService.prototype.updateById = function (params) {
168
168
  return __awaiter(this, void 0, void 0, function () {
169
169
  return __generator(this, function (_a) {
170
170
  switch (_a.label) {
@@ -172,7 +172,7 @@ var EventService = /** @class */ (function (_super) {
172
172
  uri: "/events/" + encodeURIComponent(String(params.id)),
173
173
  method: 'PUT',
174
174
  body: params.attributes,
175
- qs: params.qs,
175
+ // qs: params.qs,
176
176
  expectedStatusCodes: [http_status_1.NO_CONTENT]
177
177
  })];
178
178
  case 1:
@@ -1,8 +1,5 @@
1
1
  import * as factory from '../factory';
2
2
  import { Service } from '../service';
3
- declare type IUnset = {
4
- [key in keyof factory.event.IEvent<factory.eventType.ScreeningEventSeries>]?: 1;
5
- };
6
3
  /**
7
4
  * 施設コンテンツサービス
8
5
  */
@@ -46,9 +43,7 @@ export declare class EventSeriesService extends Service {
46
43
  */
47
44
  updateById(params: {
48
45
  id: string;
49
- attributes: factory.event.IUpdateParams<factory.eventType.ScreeningEventSeries> & {
50
- $unset?: IUnset;
51
- };
46
+ attributes: factory.event.IUpdateParams<factory.eventType.ScreeningEventSeries> & {};
52
47
  qs: {
53
48
  /**
54
49
  * 関連リソースへの同期有無(2023-07-28~)
@@ -63,4 +58,3 @@ export declare class EventSeriesService extends Service {
63
58
  id: string;
64
59
  }): Promise<void>;
65
60
  }
66
- export {};
@@ -6,7 +6,9 @@ export import IPriceSpecification = factory.priceSpecification.IPriceSpecificati
6
6
  * 価格仕様サービス
7
7
  */
8
8
  export declare class PriceSpecificationService extends Service {
9
- create<T extends IAvailablePriceSpecificationType>(params: IPriceSpecification<T>): Promise<IPriceSpecification<T>>;
9
+ create<T extends IAvailablePriceSpecificationType>(params: IPriceSpecification<T>): Promise<{
10
+ id: string;
11
+ }>;
10
12
  /**
11
13
  * 価格仕様検索
12
14
  */
@@ -1,12 +1,12 @@
1
1
  import * as factory from '../factory';
2
- import { ISearchResult, Service } from '../service';
2
+ import { Service } from '../service';
3
3
  import { ITicket, IUseAction } from './reservation/factory';
4
4
  export interface IUseActionResult {
5
5
  id: string;
6
6
  }
7
- declare type IKeyOfProjection<T extends factory.reservationType> = keyof factory.reservation.IReservation<T> | '_id';
7
+ declare type IKeyOfProjection<T extends factory.reservationType> = keyof factory.reservation.IReservation<T>;
8
8
  declare type IProjection<T extends factory.reservationType> = {
9
- [key in IKeyOfProjection<T>]?: 0;
9
+ [key in IKeyOfProjection<T>]?: 1;
10
10
  };
11
11
  interface IProjectionSearchConditions<T extends factory.reservationType> {
12
12
  $projection?: IProjection<T>;
@@ -18,7 +18,7 @@ export declare class ReservationService extends Service {
18
18
  /**
19
19
  * 予約検索
20
20
  */
21
- search<T extends factory.reservationType>(params: Omit<factory.reservation.ISearchConditions<T>, 'project' | 'provider'> & IProjectionSearchConditions<T> & {
21
+ find<T extends factory.reservationType>(params: Omit<factory.reservation.ISearchConditions<T>, 'project' | 'provider'> & IProjectionSearchConditions<T> & {
22
22
  /**
23
23
  * min: 1
24
24
  * max: 20
@@ -28,7 +28,7 @@ export declare class ReservationService extends Service {
28
28
  * min: 1
29
29
  */
30
30
  page: number;
31
- }): Promise<ISearchResult<factory.reservation.IReservation<T>[]>>;
31
+ }): Promise<factory.reservation.IReservation<T>[]>;
32
32
  /**
33
33
  * 予約部分更新
34
34
  */
@@ -76,7 +76,7 @@ var ReservationService = /** @class */ (function (_super) {
76
76
  /**
77
77
  * 予約検索
78
78
  */
79
- ReservationService.prototype.search = function (params) {
79
+ ReservationService.prototype.find = function (params) {
80
80
  return __awaiter(this, void 0, void 0, function () {
81
81
  var _this = this;
82
82
  return __generator(this, function (_a) {
@@ -86,18 +86,9 @@ var ReservationService = /** @class */ (function (_super) {
86
86
  qs: params,
87
87
  expectedStatusCodes: [http_status_1.OK]
88
88
  })
89
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
90
- var _a;
91
- return __generator(this, function (_b) {
92
- switch (_b.label) {
93
- case 0:
94
- _a = {};
95
- return [4 /*yield*/, response.json()];
96
- case 1: return [2 /*return*/, (_a.data = _b.sent(),
97
- _a)];
98
- }
99
- });
100
- }); })];
89
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
90
+ return [2 /*return*/, response.json()];
91
+ }); }); })];
101
92
  });
102
93
  });
103
94
  };
@@ -107,7 +107,7 @@ var ReservationService = /** @class */ (function (_super) {
107
107
  })];
108
108
  case 2:
109
109
  reservationService = _b.sent();
110
- return [4 /*yield*/, reservationService.search(__assign(__assign({}, params), { limit: limit,
110
+ return [4 /*yield*/, reservationService.find(__assign(__assign({}, params), { limit: limit,
111
111
  page: page,
112
112
  // statusを明示的に制限(2023-05-29~)
113
113
  reservationStatus: __assign(__assign({}, params === null || params === void 0 ? void 0 : params.reservationStatus), { $in: [
@@ -115,7 +115,7 @@ var ReservationService = /** @class */ (function (_super) {
115
115
  factory.reservationStatusType.ReservationConfirmed
116
116
  ] }), typeOf: factory.reservationType.EventReservation }))];
117
117
  case 3:
118
- data = (_b.sent()).data;
118
+ data = _b.sent();
119
119
  return [2 /*return*/, { data: data }];
120
120
  }
121
121
  });
package/lib/bundle.js CHANGED
@@ -6299,7 +6299,7 @@ var EventService = /** @class */ (function (_super) {
6299
6299
  /**
6300
6300
  * イベント更新
6301
6301
  */
6302
- EventService.prototype.update = function (params) {
6302
+ EventService.prototype.updateById = function (params) {
6303
6303
  return __awaiter(this, void 0, void 0, function () {
6304
6304
  return __generator(this, function (_a) {
6305
6305
  switch (_a.label) {
@@ -6307,7 +6307,7 @@ var EventService = /** @class */ (function (_super) {
6307
6307
  uri: "/events/" + encodeURIComponent(String(params.id)),
6308
6308
  method: 'PUT',
6309
6309
  body: params.attributes,
6310
- qs: params.qs,
6310
+ // qs: params.qs,
6311
6311
  expectedStatusCodes: [http_status_1.NO_CONTENT]
6312
6312
  })];
6313
6313
  case 1:
@@ -11052,7 +11052,7 @@ var ReservationService = /** @class */ (function (_super) {
11052
11052
  /**
11053
11053
  * 予約検索
11054
11054
  */
11055
- ReservationService.prototype.search = function (params) {
11055
+ ReservationService.prototype.find = function (params) {
11056
11056
  return __awaiter(this, void 0, void 0, function () {
11057
11057
  var _this = this;
11058
11058
  return __generator(this, function (_a) {
@@ -11062,18 +11062,9 @@ var ReservationService = /** @class */ (function (_super) {
11062
11062
  qs: params,
11063
11063
  expectedStatusCodes: [http_status_1.OK]
11064
11064
  })
11065
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
11066
- var _a;
11067
- return __generator(this, function (_b) {
11068
- switch (_b.label) {
11069
- case 0:
11070
- _a = {};
11071
- return [4 /*yield*/, response.json()];
11072
- case 1: return [2 /*return*/, (_a.data = _b.sent(),
11073
- _a)];
11074
- }
11075
- });
11076
- }); })];
11065
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
11066
+ return [2 /*return*/, response.json()];
11067
+ }); }); })];
11077
11068
  });
11078
11069
  });
11079
11070
  };
@@ -18844,7 +18835,7 @@ var ReservationService = /** @class */ (function (_super) {
18844
18835
  })];
18845
18836
  case 2:
18846
18837
  reservationService = _b.sent();
18847
- return [4 /*yield*/, reservationService.search(__assign(__assign({}, params), { limit: limit,
18838
+ return [4 /*yield*/, reservationService.find(__assign(__assign({}, params), { limit: limit,
18848
18839
  page: page,
18849
18840
  // statusを明示的に制限(2023-05-29~)
18850
18841
  reservationStatus: __assign(__assign({}, params === null || params === void 0 ? void 0 : params.reservationStatus), { $in: [
@@ -18852,7 +18843,7 @@ var ReservationService = /** @class */ (function (_super) {
18852
18843
  factory.reservationStatusType.ReservationConfirmed
18853
18844
  ] }), typeOf: factory.reservationType.EventReservation }))];
18854
18845
  case 3:
18855
- data = (_b.sent()).data;
18846
+ data = _b.sent();
18856
18847
  return [2 /*return*/, { data: data }];
18857
18848
  }
18858
18849
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "10.3.0",
3
+ "version": "10.4.0",
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.379.0-alpha.0",
95
+ "@chevre/factory": "4.380.0",
96
96
  "debug": "3.2.7",
97
97
  "http-status": "1.7.4",
98
98
  "idtoken-verifier": "2.0.3",
@@ -1,37 +0,0 @@
1
- // tslint:disable:no-implicit-dependencies no-console no-magic-numbers
2
- import * as client from '../../../lib/';
3
-
4
- const project = { id: 'cinerino' };
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 reservationService = await (await client.loadChevreAdmin({
16
- endpoint: <string>process.env.CHEVRE_ENDPOINT,
17
- auth: authClient
18
- })).createReservationInstance({
19
- project,
20
- seller: { id: '' }
21
- });
22
-
23
- const { data } = await reservationService.search({
24
- limit: 10,
25
- page: 1,
26
- typeOf: client.factory.reservationType.EventReservation,
27
- $projection: { underName: 0 }
28
- });
29
- console.log(data);
30
- console.log(data.length);
31
- }
32
-
33
- main()
34
- .then(() => {
35
- console.log('main processed.');
36
- })
37
- .catch(console.error);