@cinerino/sdk 12.3.0-alpha.3 → 12.3.0-alpha.4

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.
@@ -1121,22 +1121,21 @@ var EventService = /** @class */ (function (_super) {
1121
1121
  * 存在すれば、一部属性を更新する(eventStatus,superEvent,offers.seller.makesOffer)
1122
1122
  */
1123
1123
  EventService.prototype.upsertManyByAdditionalProperty = function (params, options) {
1124
- var _a, _b, _c, _d;
1125
1124
  return __awaiter(this, void 0, void 0, function () {
1126
1125
  var superEventId, locationBranchCode;
1127
- return __generator(this, function (_e) {
1128
- switch (_e.label) {
1126
+ return __generator(this, function (_a) {
1127
+ switch (_a.label) {
1129
1128
  case 0:
1130
1129
  if (!Array.isArray(params) || params.length === 0) {
1131
1130
  throw new factory.errors.ArgumentNull('body');
1132
1131
  }
1133
- superEventId = (_b = (_a = params[0]) === null || _a === void 0 ? void 0 : _a.superEvent) === null || _b === void 0 ? void 0 : _b.id;
1134
- locationBranchCode = (_d = (_c = params[0]) === null || _c === void 0 ? void 0 : _c.location) === null || _d === void 0 ? void 0 : _d.branchCode;
1132
+ superEventId = options.superEventId;
1133
+ locationBranchCode = options.locationBranchCode;
1135
1134
  if (typeof superEventId !== 'string' || superEventId === '') {
1136
- throw new factory.errors.ArgumentNull('superEvent.id');
1135
+ throw new factory.errors.ArgumentNull('superEventId');
1137
1136
  }
1138
1137
  if (typeof locationBranchCode !== 'string' || locationBranchCode === '') {
1139
- throw new factory.errors.ArgumentNull('location.branchCode');
1138
+ throw new factory.errors.ArgumentNull('locationBranchCode');
1140
1139
  }
1141
1140
  return [4 /*yield*/, this.fetch({
1142
1141
  uri: '/events',
@@ -1152,7 +1151,7 @@ var EventService = /** @class */ (function (_super) {
1152
1151
  expectedStatusCodes: [http_status_1.NO_CONTENT]
1153
1152
  })];
1154
1153
  case 1:
1155
- _e.sent();
1154
+ _a.sent();
1156
1155
  return [2 /*return*/];
1157
1156
  }
1158
1157
  });
@@ -8072,11 +8071,11 @@ var EventService = /** @class */ (function (_super) {
8072
8071
  // add options(2025-08-26~)
8073
8072
  options) {
8074
8073
  return __awaiter(this, void 0, void 0, function () {
8075
- var superEventId, locationBranchCode;
8074
+ var superEventId, locationBranchCode, hasTicketedSeat;
8076
8075
  return __generator(this, function (_a) {
8077
8076
  switch (_a.label) {
8078
8077
  case 0:
8079
- superEventId = options.superEventId, locationBranchCode = options.locationBranchCode;
8078
+ superEventId = options.superEventId, locationBranchCode = options.locationBranchCode, hasTicketedSeat = options.hasTicketedSeat;
8080
8079
  return [4 /*yield*/, this.fetch({
8081
8080
  uri: '/events',
8082
8081
  method: 'POST',
@@ -8085,7 +8084,8 @@ var EventService = /** @class */ (function (_super) {
8085
8084
  expectsNoContent: '1',
8086
8085
  typeOf: factory.eventType.ScreeningEvent,
8087
8086
  superEventId: superEventId,
8088
- locationBranchCode: locationBranchCode
8087
+ locationBranchCode: locationBranchCode,
8088
+ hasTicketedSeat: hasTicketedSeat
8089
8089
  },
8090
8090
  expectedStatusCodes: [http_status_1.NO_CONTENT]
8091
8091
  })];
@@ -20730,11 +20730,41 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
20730
20730
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
20731
20731
  }
20732
20732
  };
20733
+ var __rest = (this && this.__rest) || function (s, e) {
20734
+ var t = {};
20735
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
20736
+ t[p] = s[p];
20737
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
20738
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
20739
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20740
+ t[p[i]] = s[p[i]];
20741
+ }
20742
+ return t;
20743
+ };
20733
20744
  Object.defineProperty(exports, "__esModule", { value: true });
20734
20745
  exports.EventService = void 0;
20735
20746
  var factory = require("../../factory");
20736
20747
  var index_1 = require("../../index");
20737
20748
  var service_1 = require("../../service");
20749
+ function createUpsertParams(params) {
20750
+ var _a, _b, _c, _d;
20751
+ if (!Array.isArray(params.attributes) || params.attributes.length === 0) {
20752
+ throw new factory.errors.ArgumentNull('body');
20753
+ }
20754
+ var superEventId = (_b = (_a = params.attributes[0]) === null || _a === void 0 ? void 0 : _a.superEvent) === null || _b === void 0 ? void 0 : _b.id;
20755
+ var locationBranchCode = (_d = (_c = params.attributes[0]) === null || _c === void 0 ? void 0 : _c.location) === null || _d === void 0 ? void 0 : _d.branchCode;
20756
+ if (typeof superEventId !== 'string' || superEventId === '') {
20757
+ throw new factory.errors.ArgumentNull('superEvent.id');
20758
+ }
20759
+ if (typeof locationBranchCode !== 'string' || locationBranchCode === '') {
20760
+ throw new factory.errors.ArgumentNull('location.branchCode');
20761
+ }
20762
+ var upsertParams = params.attributes.map(function (_a) {
20763
+ var location = _a.location, superEvent = _a.superEvent, identifier = _a.identifier, typeOf = _a.typeOf, project = _a.project, createFields = __rest(_a, ["location", "superEvent", "identifier", "typeOf", "project"]);
20764
+ return createFields;
20765
+ });
20766
+ return { upsertParams: upsertParams, superEventId: superEventId, locationBranchCode: locationBranchCode };
20767
+ }
20738
20768
  /**
20739
20769
  * イベントサービス
20740
20770
  */
@@ -20750,39 +20780,44 @@ var EventService = /** @class */ (function (_super) {
20750
20780
  */
20751
20781
  EventService.prototype.upsertManyByAdditionalProperty = function (params) {
20752
20782
  return __awaiter(this, void 0, void 0, function () {
20753
- var _a, auth, endpoint, project, seller, chevreAdmin, eventService;
20754
- return __generator(this, function (_b) {
20755
- switch (_b.label) {
20783
+ var _a, upsertParams, superEventId, locationBranchCode, _b, auth, endpoint, project, seller, chevreAdmin, eventService;
20784
+ return __generator(this, function (_c) {
20785
+ switch (_c.label) {
20756
20786
  case 0:
20757
- _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller;
20787
+ _a = createUpsertParams(params), upsertParams = _a.upsertParams, superEventId = _a.superEventId, locationBranchCode = _a.locationBranchCode;
20788
+ _b = this.options, auth = _b.auth, endpoint = _b.endpoint, project = _b.project, seller = _b.seller;
20758
20789
  return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint })];
20759
20790
  case 1:
20760
- chevreAdmin = _b.sent();
20791
+ chevreAdmin = _c.sent();
20761
20792
  return [4 /*yield*/, chevreAdmin.createEventInstance({
20762
20793
  project: project,
20763
20794
  seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
20764
20795
  })];
20765
20796
  case 2:
20766
- eventService = _b.sent();
20767
- return [4 /*yield*/, eventService.upsertManyByAdditionalProperty(params.attributes, {
20797
+ eventService = _c.sent();
20798
+ return [4 /*yield*/, eventService.upsertManyByAdditionalProperty(upsertParams, {
20768
20799
  filter: { name: params.filter.name },
20769
- update: false
20800
+ update: false,
20801
+ superEventId: superEventId,
20802
+ locationBranchCode: locationBranchCode
20770
20803
  })];
20771
20804
  case 3:
20772
- _b.sent();
20805
+ _c.sent();
20773
20806
  return [4 /*yield*/, new Promise(function (resolve) {
20774
20807
  setTimeout(function () { resolve(); },
20775
20808
  // tslint:disable-next-line:no-magic-numbers
20776
20809
  1000);
20777
20810
  })];
20778
20811
  case 4:
20779
- _b.sent();
20780
- return [4 /*yield*/, eventService.upsertManyByAdditionalProperty(params.attributes, {
20812
+ _c.sent();
20813
+ return [4 /*yield*/, eventService.upsertManyByAdditionalProperty(upsertParams, {
20781
20814
  filter: { name: params.filter.name },
20782
- update: true
20815
+ update: true,
20816
+ superEventId: superEventId,
20817
+ locationBranchCode: locationBranchCode
20783
20818
  })];
20784
20819
  case 5:
20785
- _b.sent();
20820
+ _c.sent();
20786
20821
  return [2 /*return*/];
20787
20822
  }
20788
20823
  });
@@ -23,7 +23,6 @@ async function main() {
23
23
  await eventService.createScreeningEvents(
24
24
  [
25
25
  {
26
- typeOf: factory.eventType.ScreeningEvent,
27
26
  eventStatus: factory.eventStatusType.EventScheduled,
28
27
  startDate: moment('2025-09-01T10:00:00Z')
29
28
  .toDate(),
@@ -31,11 +31,6 @@ async function main() {
31
31
  filter: { name: ADDITIONAL_PROPERTY_NAME },
32
32
  attributes: [
33
33
  {
34
- typeOf: client.factory.eventType.ScreeningEvent,
35
- // project: {
36
- // typeOf: client.factory.organizationType.Project,
37
- // id: PROJECT_ID
38
- // },
39
34
  doorTime: moment(`${today}T13:00:00Z`)
40
35
  .toDate(),
41
36
  startDate: moment(`${today}T13:00:00Z`)
@@ -63,7 +58,11 @@ async function main() {
63
58
  maxValue: 6
64
59
  },
65
60
  itemOffered: {
66
- 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
+ }
67
66
  },
68
67
  seller: {
69
68
  makesOffer: [
@@ -4,6 +4,8 @@ declare type ISendEmailMessageOnEventUpdated = Pick<factory.action.transfer.send
4
4
  object: factory.action.transfer.send.message.email.IObjectAsEmailMessage;
5
5
  };
6
6
  declare type ICreateScreeningEventParams = Omit<factory.event.ICreateParams<factory.eventType.ScreeningEvent>, 'location' | 'superEvent'> & {
7
+ typeOf?: never;
8
+ project?: never;
7
9
  /**
8
10
  * ルームコードを指定
9
11
  */
@@ -66,6 +66,25 @@ exports.EventService = void 0;
66
66
  var factory = require("../../factory");
67
67
  var index_1 = require("../../index");
68
68
  var service_1 = require("../../service");
69
+ function createUpsertParams(params) {
70
+ var _a, _b, _c, _d;
71
+ if (!Array.isArray(params.attributes) || params.attributes.length === 0) {
72
+ throw new factory.errors.ArgumentNull('body');
73
+ }
74
+ var superEventId = (_b = (_a = params.attributes[0]) === null || _a === void 0 ? void 0 : _a.superEvent) === null || _b === void 0 ? void 0 : _b.id;
75
+ var locationBranchCode = (_d = (_c = params.attributes[0]) === null || _c === void 0 ? void 0 : _c.location) === null || _d === void 0 ? void 0 : _d.branchCode;
76
+ if (typeof superEventId !== 'string' || superEventId === '') {
77
+ throw new factory.errors.ArgumentNull('superEvent.id');
78
+ }
79
+ if (typeof locationBranchCode !== 'string' || locationBranchCode === '') {
80
+ throw new factory.errors.ArgumentNull('location.branchCode');
81
+ }
82
+ var upsertParams = params.attributes.map(function (_a) {
83
+ var location = _a.location, superEvent = _a.superEvent, identifier = _a.identifier, typeOf = _a.typeOf, project = _a.project, createFields = __rest(_a, ["location", "superEvent", "identifier", "typeOf", "project"]);
84
+ return createFields;
85
+ });
86
+ return { upsertParams: upsertParams, superEventId: superEventId, locationBranchCode: locationBranchCode };
87
+ }
69
88
  /**
70
89
  * イベントサービス
71
90
  */
@@ -80,37 +99,22 @@ var EventService = /** @class */ (function (_super) {
80
99
  * 存在すれば、一部属性を更新する(eventStatus,superEvent,offers.seller.makesOffer)
81
100
  */
82
101
  EventService.prototype.upsertManyByAdditionalProperty = function (params) {
83
- var _a, _b, _c, _d;
84
102
  return __awaiter(this, void 0, void 0, function () {
85
- var superEventId, locationBranchCode, upsertParams, _e, auth, endpoint, project, seller, chevreAdmin, eventService;
86
- return __generator(this, function (_f) {
87
- switch (_f.label) {
103
+ var _a, upsertParams, superEventId, locationBranchCode, _b, auth, endpoint, project, seller, chevreAdmin, eventService;
104
+ return __generator(this, function (_c) {
105
+ switch (_c.label) {
88
106
  case 0:
89
- if (!Array.isArray(params.attributes) || params.attributes.length === 0) {
90
- throw new factory.errors.ArgumentNull('body');
91
- }
92
- superEventId = (_b = (_a = params.attributes[0]) === null || _a === void 0 ? void 0 : _a.superEvent) === null || _b === void 0 ? void 0 : _b.id;
93
- locationBranchCode = (_d = (_c = params.attributes[0]) === null || _c === void 0 ? void 0 : _c.location) === null || _d === void 0 ? void 0 : _d.branchCode;
94
- if (typeof superEventId !== 'string' || superEventId === '') {
95
- throw new factory.errors.ArgumentNull('superEvent.id');
96
- }
97
- if (typeof locationBranchCode !== 'string' || locationBranchCode === '') {
98
- throw new factory.errors.ArgumentNull('location.branchCode');
99
- }
100
- upsertParams = params.attributes.map(function (_a) {
101
- var location = _a.location, superEvent = _a.superEvent, identifier = _a.identifier, createFields = __rest(_a, ["location", "superEvent", "identifier"]);
102
- return createFields;
103
- });
104
- _e = this.options, auth = _e.auth, endpoint = _e.endpoint, project = _e.project, seller = _e.seller;
107
+ _a = createUpsertParams(params), upsertParams = _a.upsertParams, superEventId = _a.superEventId, locationBranchCode = _a.locationBranchCode;
108
+ _b = this.options, auth = _b.auth, endpoint = _b.endpoint, project = _b.project, seller = _b.seller;
105
109
  return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint })];
106
110
  case 1:
107
- chevreAdmin = _f.sent();
111
+ chevreAdmin = _c.sent();
108
112
  return [4 /*yield*/, chevreAdmin.createEventInstance({
109
113
  project: project,
110
114
  seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
111
115
  })];
112
116
  case 2:
113
- eventService = _f.sent();
117
+ eventService = _c.sent();
114
118
  return [4 /*yield*/, eventService.upsertManyByAdditionalProperty(upsertParams, {
115
119
  filter: { name: params.filter.name },
116
120
  update: false,
@@ -118,14 +122,14 @@ var EventService = /** @class */ (function (_super) {
118
122
  locationBranchCode: locationBranchCode
119
123
  })];
120
124
  case 3:
121
- _f.sent();
125
+ _c.sent();
122
126
  return [4 /*yield*/, new Promise(function (resolve) {
123
127
  setTimeout(function () { resolve(); },
124
128
  // tslint:disable-next-line:no-magic-numbers
125
129
  1000);
126
130
  })];
127
131
  case 4:
128
- _f.sent();
132
+ _c.sent();
129
133
  return [4 /*yield*/, eventService.upsertManyByAdditionalProperty(upsertParams, {
130
134
  filter: { name: params.filter.name },
131
135
  update: true,
@@ -133,7 +137,7 @@ var EventService = /** @class */ (function (_super) {
133
137
  locationBranchCode: locationBranchCode
134
138
  })];
135
139
  case 5:
136
- _f.sent();
140
+ _c.sent();
137
141
  return [2 /*return*/];
138
142
  }
139
143
  });
package/lib/bundle.js CHANGED
@@ -20746,6 +20746,25 @@ exports.EventService = void 0;
20746
20746
  var factory = require("../../factory");
20747
20747
  var index_1 = require("../../index");
20748
20748
  var service_1 = require("../../service");
20749
+ function createUpsertParams(params) {
20750
+ var _a, _b, _c, _d;
20751
+ if (!Array.isArray(params.attributes) || params.attributes.length === 0) {
20752
+ throw new factory.errors.ArgumentNull('body');
20753
+ }
20754
+ var superEventId = (_b = (_a = params.attributes[0]) === null || _a === void 0 ? void 0 : _a.superEvent) === null || _b === void 0 ? void 0 : _b.id;
20755
+ var locationBranchCode = (_d = (_c = params.attributes[0]) === null || _c === void 0 ? void 0 : _c.location) === null || _d === void 0 ? void 0 : _d.branchCode;
20756
+ if (typeof superEventId !== 'string' || superEventId === '') {
20757
+ throw new factory.errors.ArgumentNull('superEvent.id');
20758
+ }
20759
+ if (typeof locationBranchCode !== 'string' || locationBranchCode === '') {
20760
+ throw new factory.errors.ArgumentNull('location.branchCode');
20761
+ }
20762
+ var upsertParams = params.attributes.map(function (_a) {
20763
+ var location = _a.location, superEvent = _a.superEvent, identifier = _a.identifier, typeOf = _a.typeOf, project = _a.project, createFields = __rest(_a, ["location", "superEvent", "identifier", "typeOf", "project"]);
20764
+ return createFields;
20765
+ });
20766
+ return { upsertParams: upsertParams, superEventId: superEventId, locationBranchCode: locationBranchCode };
20767
+ }
20749
20768
  /**
20750
20769
  * イベントサービス
20751
20770
  */
@@ -20760,37 +20779,22 @@ var EventService = /** @class */ (function (_super) {
20760
20779
  * 存在すれば、一部属性を更新する(eventStatus,superEvent,offers.seller.makesOffer)
20761
20780
  */
20762
20781
  EventService.prototype.upsertManyByAdditionalProperty = function (params) {
20763
- var _a, _b, _c, _d;
20764
20782
  return __awaiter(this, void 0, void 0, function () {
20765
- var superEventId, locationBranchCode, upsertParams, _e, auth, endpoint, project, seller, chevreAdmin, eventService;
20766
- return __generator(this, function (_f) {
20767
- switch (_f.label) {
20783
+ var _a, upsertParams, superEventId, locationBranchCode, _b, auth, endpoint, project, seller, chevreAdmin, eventService;
20784
+ return __generator(this, function (_c) {
20785
+ switch (_c.label) {
20768
20786
  case 0:
20769
- if (!Array.isArray(params.attributes) || params.attributes.length === 0) {
20770
- throw new factory.errors.ArgumentNull('body');
20771
- }
20772
- superEventId = (_b = (_a = params.attributes[0]) === null || _a === void 0 ? void 0 : _a.superEvent) === null || _b === void 0 ? void 0 : _b.id;
20773
- locationBranchCode = (_d = (_c = params.attributes[0]) === null || _c === void 0 ? void 0 : _c.location) === null || _d === void 0 ? void 0 : _d.branchCode;
20774
- if (typeof superEventId !== 'string' || superEventId === '') {
20775
- throw new factory.errors.ArgumentNull('superEvent.id');
20776
- }
20777
- if (typeof locationBranchCode !== 'string' || locationBranchCode === '') {
20778
- throw new factory.errors.ArgumentNull('location.branchCode');
20779
- }
20780
- upsertParams = params.attributes.map(function (_a) {
20781
- var location = _a.location, superEvent = _a.superEvent, identifier = _a.identifier, createFields = __rest(_a, ["location", "superEvent", "identifier"]);
20782
- return createFields;
20783
- });
20784
- _e = this.options, auth = _e.auth, endpoint = _e.endpoint, project = _e.project, seller = _e.seller;
20787
+ _a = createUpsertParams(params), upsertParams = _a.upsertParams, superEventId = _a.superEventId, locationBranchCode = _a.locationBranchCode;
20788
+ _b = this.options, auth = _b.auth, endpoint = _b.endpoint, project = _b.project, seller = _b.seller;
20785
20789
  return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint })];
20786
20790
  case 1:
20787
- chevreAdmin = _f.sent();
20791
+ chevreAdmin = _c.sent();
20788
20792
  return [4 /*yield*/, chevreAdmin.createEventInstance({
20789
20793
  project: project,
20790
20794
  seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
20791
20795
  })];
20792
20796
  case 2:
20793
- eventService = _f.sent();
20797
+ eventService = _c.sent();
20794
20798
  return [4 /*yield*/, eventService.upsertManyByAdditionalProperty(upsertParams, {
20795
20799
  filter: { name: params.filter.name },
20796
20800
  update: false,
@@ -20798,14 +20802,14 @@ var EventService = /** @class */ (function (_super) {
20798
20802
  locationBranchCode: locationBranchCode
20799
20803
  })];
20800
20804
  case 3:
20801
- _f.sent();
20805
+ _c.sent();
20802
20806
  return [4 /*yield*/, new Promise(function (resolve) {
20803
20807
  setTimeout(function () { resolve(); },
20804
20808
  // tslint:disable-next-line:no-magic-numbers
20805
20809
  1000);
20806
20810
  })];
20807
20811
  case 4:
20808
- _f.sent();
20812
+ _c.sent();
20809
20813
  return [4 /*yield*/, eventService.upsertManyByAdditionalProperty(upsertParams, {
20810
20814
  filter: { name: params.filter.name },
20811
20815
  update: true,
@@ -20813,7 +20817,7 @@ var EventService = /** @class */ (function (_super) {
20813
20817
  locationBranchCode: locationBranchCode
20814
20818
  })];
20815
20819
  case 5:
20816
- _f.sent();
20820
+ _c.sent();
20817
20821
  return [2 /*return*/];
20818
20822
  }
20819
20823
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "12.3.0-alpha.3",
3
+ "version": "12.3.0-alpha.4",
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": "4.398.0-alpha.2",
96
+ "@chevre/factory": "4.398.0-alpha.3",
97
97
  "debug": "3.2.7",
98
98
  "http-status": "1.7.4",
99
99
  "idtoken-verifier": "2.0.3",