@cinerino/sdk 12.6.0-alpha.3 → 12.6.0-alpha.5

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.
@@ -28,8 +28,9 @@ async function main() {
28
28
  const today = moment()
29
29
  .tz('Asia/Tokyo')
30
30
  .format('YYYY-MM-DD');
31
- const identifier = `fromSamples${moment()
32
- .format('YYYYMMDDTHHmm')}`;
31
+ // const identifier = `fromSamples${moment()
32
+ // .format('YYYYMMDDTHHmm')}`;
33
+ const identifier = 'fromSamples20251028T1337';
33
34
  await eventService.createIfNotExistByIdentifier(
34
35
  [
35
36
  {
@@ -88,7 +89,8 @@ async function main() {
88
89
  locationBranchCode: '10',
89
90
  superEventId: '7k9ayl8hc',
90
91
  hasTicketedSeat: true,
91
- typeOf: client.factory.eventType.ScreeningEvent
92
+ typeOf: client.factory.eventType.ScreeningEvent,
93
+ disableOverwriteMakesOffer: true
92
94
  }
93
95
  );
94
96
  console.log('created.');
@@ -118,25 +120,26 @@ async function main() {
118
120
  },
119
121
  seller: {
120
122
  makesOffer: [
121
- {
122
- typeOf: client.factory.offerType.Offer,
123
- availableAtOrFrom: { id: AVAILABLE_AT_OR_FROM_ID }, // <-販売アプリケーションIDを指定する
124
- availabilityStarts: moment(`${today}T00:00:00+09:00`)
125
- .toDate(),
126
- availabilityEnds: moment(`${today}T14:00:00Z`)
127
- .toDate(),
128
- validFrom: moment(`${today}T00:00:00+09:00`)
129
- .toDate(),
130
- validThrough: moment(`${today}T14:00:00Z`)
131
- .toDate()
132
- }
123
+ // {
124
+ // typeOf: client.factory.offerType.Offer,
125
+ // availableAtOrFrom: { id: AVAILABLE_AT_OR_FROM_ID }, // <-販売アプリケーションIDを指定する
126
+ // availabilityStarts: moment(`${today}T00:00:00+09:00`)
127
+ // .toDate(),
128
+ // availabilityEnds: moment(`${today}T14:00:00Z`)
129
+ // .toDate(),
130
+ // validFrom: moment(`${today}T00:00:00+09:00`)
131
+ // .toDate(),
132
+ // validThrough: moment(`${today}T14:00:00Z`)
133
+ // .toDate()
134
+ // }
133
135
  ]
134
136
  }
135
137
  }
136
138
  }
137
139
  ],
138
140
  {
139
- typeOf: client.factory.eventType.ScreeningEvent
141
+ typeOf: client.factory.eventType.ScreeningEvent,
142
+ disableOverwriteMakesOffer: false
140
143
  }
141
144
  );
142
145
  console.log('updated.');
@@ -90,7 +90,8 @@ async function main() {
90
90
  locationBranchCode: LOCATION_BRANCH_CODE,
91
91
  superEventId: SUPER_EVENT_ID,
92
92
  hasTicketedSeat: true,
93
- typeOf: client.factory.eventType.ScreeningEvent
93
+ typeOf: client.factory.eventType.ScreeningEvent,
94
+ disableOverwriteMakesOffer: false
94
95
  }
95
96
  );
96
97
  console.log('created.');
@@ -0,0 +1,82 @@
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 AVAILABLE_AT_OR_FROM_ID = '51qbjcfr72h62m06vtv5kkhgje';
10
+ const AVAILABLE_AT_OR_FROM_ID2 = 'ckevmf3fueqcunnideu6artt';
11
+ const { EVENT_IDENTIFIER } = process.env;
12
+
13
+ // tslint:disable-next-line:max-func-body-length
14
+ async function main() {
15
+ if (typeof EVENT_IDENTIFIER !== 'string') {
16
+ throw new Error('environment variables required');
17
+ }
18
+
19
+ const authClient = await auth.login();
20
+ await authClient.refreshAccessToken();
21
+ const loginTicket = authClient.verifyIdToken({});
22
+ console.log('username is', loginTicket.getUsername());
23
+
24
+ const eventService = await (await client.loadChevreAdmin({
25
+ endpoint: <string>process.env.CHEVRE_ENDPOINT,
26
+ auth: authClient
27
+ })).createEventInstance({
28
+ project: { id: PROJECT_ID },
29
+ seller: { id: SELLER_ID }
30
+ });
31
+
32
+ const today = moment()
33
+ .tz('Asia/Tokyo')
34
+ .format('YYYY-MM-DD');
35
+ await eventService.updateEventsSellerMakesOfferByIdentifier(
36
+ [
37
+ {
38
+ identifier: EVENT_IDENTIFIER,
39
+ offers: {
40
+ seller: {
41
+ makesOffer: [
42
+ {
43
+ typeOf: client.factory.offerType.Offer,
44
+ availableAtOrFrom: { id: AVAILABLE_AT_OR_FROM_ID },
45
+ availabilityStarts: moment(`${today}T00:00:00+09:00`)
46
+ .toDate(),
47
+ availabilityEnds: moment(`${today}T14:00:00Z`)
48
+ .toDate(),
49
+ validFrom: moment(`${today}T00:00:00+09:00`)
50
+ .toDate(),
51
+ validThrough: moment(`${today}T14:00:00Z`)
52
+ .toDate(),
53
+ identifier: '12345678x1'
54
+ },
55
+ {
56
+ typeOf: client.factory.offerType.Offer,
57
+ availableAtOrFrom: { id: AVAILABLE_AT_OR_FROM_ID2 },
58
+ availabilityStarts: moment(`${today}T00:00:00+09:00`)
59
+ .toDate(),
60
+ availabilityEnds: moment(`${today}T14:00:00Z`)
61
+ .toDate(),
62
+ validFrom: moment(`${today}T00:00:00+09:00`)
63
+ .toDate(),
64
+ validThrough: moment(`${today}T14:00:00Z`)
65
+ .toDate(),
66
+ identifier: '12345678x2'
67
+ }
68
+ ]
69
+ }
70
+ }
71
+ }
72
+ ]
73
+ );
74
+ console.log('updated.');
75
+
76
+ }
77
+
78
+ main()
79
+ .then(() => {
80
+ console.log('success!');
81
+ })
82
+ .catch(console.error);
@@ -17,6 +17,14 @@ export declare type IUpdateParamsByIdentifier = Pick<factory.event.screeningEven
17
17
  location?: never;
18
18
  superEvent?: never;
19
19
  };
20
+ export interface IUpdateEventSellerMakesOfferParamsByIdentifier {
21
+ identifier: string;
22
+ offers: {
23
+ seller: Pick<factory.event.screeningEvent.ISeller4create, 'makesOffer'>;
24
+ };
25
+ location?: never;
26
+ superEvent?: never;
27
+ }
20
28
  /**
21
29
  * イベントサービス
22
30
  */
@@ -39,31 +47,31 @@ export declare class EventService extends Service {
39
47
  */
40
48
  hasTicketedSeat: boolean;
41
49
  typeOf: factory.eventType.ScreeningEvent;
50
+ disableOverwriteMakesOffer: boolean;
42
51
  }): Promise<void>;
43
52
  /**
44
53
  * 識別子によるイベント複数更新
45
54
  * 識別子のイベントが存在しなければNotFound
46
55
  * 座席有無は変更できない
47
56
  */
48
- updateEventsByIdentifier(params: IUpdateParamsByIdentifier[], options: {
57
+ updateEventsByIdentifier(
58
+ /**
59
+ * max: 10
60
+ */
61
+ params: IUpdateParamsByIdentifier[], options: {
49
62
  typeOf: factory.eventType.ScreeningEvent;
63
+ disableOverwriteMakesOffer: boolean;
50
64
  }): Promise<void>;
51
65
  /**
52
- * イベント冪等複数作成
53
- * 特定の追加特性をキーにして、存在しなければ作成する
54
- * 存在すれば、一部属性を更新する(eventStatus,superEvent,offers.seller.makesOffer)
66
+ * イベントのアプリケーションオファー編集(識別子によるイベント複数編集)
67
+ * 識別子のイベントが存在しなければNotFound
68
+ * 2025-10-28~
55
69
  */
56
- upsertManyByAdditionalProperty(params: factory.event.screeningEvent.ICreateParams[], options: {
57
- filter: {
58
- /**
59
- * キーにする追加特性name
60
- */
61
- name: string;
62
- };
63
- update: boolean;
64
- superEventId: string;
65
- locationBranchCode: string;
66
- }): Promise<void>;
70
+ updateEventsSellerMakesOfferByIdentifier(
71
+ /**
72
+ * max: 10
73
+ */
74
+ params: IUpdateEventSellerMakesOfferParamsByIdentifier[]): Promise<void>;
67
75
  /**
68
76
  * イベント部分更新
69
77
  */
@@ -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
  * イベントサービス
@@ -69,16 +68,20 @@ var EventService = /** @class */ (function (_super) {
69
68
  */
70
69
  EventService.prototype.createIfNotExistByIdentifier = function (params, options) {
71
70
  return __awaiter(this, void 0, void 0, function () {
72
- var superEventId, locationBranchCode, hasTicketedSeat, typeOf;
71
+ var superEventId, locationBranchCode, hasTicketedSeat, typeOf, disableOverwriteMakesOffer;
73
72
  return __generator(this, function (_a) {
74
73
  switch (_a.label) {
75
74
  case 0:
76
- superEventId = options.superEventId, locationBranchCode = options.locationBranchCode, hasTicketedSeat = options.hasTicketedSeat, typeOf = options.typeOf;
75
+ superEventId = options.superEventId, locationBranchCode = options.locationBranchCode, hasTicketedSeat = options.hasTicketedSeat, typeOf = options.typeOf, disableOverwriteMakesOffer = options.disableOverwriteMakesOffer;
77
76
  return [4 /*yield*/, this.fetch({
78
77
  uri: '/events',
79
78
  method: 'POST',
80
79
  body: params,
81
- qs: { superEventId: superEventId, locationBranchCode: locationBranchCode, hasTicketedSeat: hasTicketedSeat, typeOf: typeOf },
80
+ qs: {
81
+ superEventId: superEventId, locationBranchCode: locationBranchCode, hasTicketedSeat: hasTicketedSeat, typeOf: typeOf,
82
+ // support disableOverwriteMakesOffer(2025-10-28~)
83
+ disableOverwriteMakesOffer: disableOverwriteMakesOffer === true
84
+ },
82
85
  expectedStatusCodes: [http_status_1.NO_CONTENT]
83
86
  })];
84
87
  case 1:
@@ -93,20 +96,26 @@ var EventService = /** @class */ (function (_super) {
93
96
  * 識別子のイベントが存在しなければNotFound
94
97
  * 座席有無は変更できない
95
98
  */
96
- EventService.prototype.updateEventsByIdentifier = function (params, options) {
99
+ EventService.prototype.updateEventsByIdentifier = function (
100
+ /**
101
+ * max: 10
102
+ */
103
+ params, options) {
97
104
  return __awaiter(this, void 0, void 0, function () {
98
- var typeOf;
105
+ var typeOf, disableOverwriteMakesOffer;
99
106
  return __generator(this, function (_a) {
100
107
  switch (_a.label) {
101
108
  case 0:
102
- typeOf = options.typeOf;
109
+ typeOf = options.typeOf, disableOverwriteMakesOffer = options.disableOverwriteMakesOffer;
103
110
  return [4 /*yield*/, this.fetch({
104
111
  uri: '/events',
105
112
  method: 'PUT',
106
113
  body: params,
107
114
  qs: {
108
115
  typeOf: typeOf,
109
- updateBy: 'identifier'
116
+ updateBy: 'identifier',
117
+ // support disableOverwriteMakesOffer(2025-10-28~)
118
+ disableOverwriteMakesOffer: disableOverwriteMakesOffer === true
110
119
  },
111
120
  expectedStatusCodes: [http_status_1.NO_CONTENT]
112
121
  })];
@@ -118,40 +127,24 @@ var EventService = /** @class */ (function (_super) {
118
127
  });
119
128
  };
120
129
  /**
121
- * イベント冪等複数作成
122
- * 特定の追加特性をキーにして、存在しなければ作成する
123
- * 存在すれば、一部属性を更新する(eventStatus,superEvent,offers.seller.makesOffer)
130
+ * イベントのアプリケーションオファー編集(識別子によるイベント複数編集)
131
+ * 識別子のイベントが存在しなければNotFound
132
+ * 2025-10-28~
133
+ */
134
+ EventService.prototype.updateEventsSellerMakesOfferByIdentifier = function (
135
+ /**
136
+ * max: 10
124
137
  */
125
- EventService.prototype.upsertManyByAdditionalProperty = function (params, options) {
138
+ params) {
126
139
  return __awaiter(this, void 0, void 0, function () {
127
- var superEventId, locationBranchCode;
128
140
  return __generator(this, function (_a) {
129
141
  switch (_a.label) {
130
- case 0:
131
- if (!Array.isArray(params) || params.length === 0) {
132
- throw new factory.errors.ArgumentNull('body');
133
- }
134
- superEventId = options.superEventId;
135
- locationBranchCode = options.locationBranchCode;
136
- if (typeof superEventId !== 'string' || superEventId === '') {
137
- throw new factory.errors.ArgumentNull('superEventId');
138
- }
139
- if (typeof locationBranchCode !== 'string' || locationBranchCode === '') {
140
- throw new factory.errors.ArgumentNull('locationBranchCode');
141
- }
142
- return [4 /*yield*/, this.fetch({
143
- uri: '/events',
144
- method: 'PUT',
145
- body: params,
146
- qs: {
147
- filter: options.filter,
148
- update: options.update === true,
149
- typeOf: factory.eventType.ScreeningEvent,
150
- superEventId: superEventId,
151
- locationBranchCode: locationBranchCode // add query(2025-08-27~)
152
- },
153
- expectedStatusCodes: [http_status_1.NO_CONTENT]
154
- })];
142
+ case 0: return [4 /*yield*/, this.fetch({
143
+ uri: "/eventSellerMakesOffer",
144
+ method: 'PUT',
145
+ body: params,
146
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
147
+ })];
155
148
  case 1:
156
149
  _a.sent();
157
150
  return [2 /*return*/];
@@ -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: factory.event.screeningEvent.IUpdateParams & {
43
- $unset?: IUnset;
44
- };
46
+ attributes: IUpdateEventByIdAttributes;
45
47
  options: {
46
48
  disableOverwriteMakesOffer: boolean;
47
49
  };
@@ -1,25 +1,9 @@
1
1
  import * as factory from '../../factory';
2
2
  import { Service } from '../../service';
3
- import { ICreateParamsByIdentifier, IUpdateParamsByIdentifier } from '../../chevreAdmin/event';
3
+ import { ICreateParamsByIdentifier, IUpdateEventSellerMakesOfferParamsByIdentifier, IUpdateParamsByIdentifier } from '../../chevreAdmin/event';
4
4
  declare type ISendEmailMessageOnEventUpdated = Pick<factory.action.transfer.send.message.email.IAttributes, 'purpose' | 'recipient'> & {
5
5
  object: factory.action.transfer.send.message.email.IObjectAsEmailMessage;
6
6
  };
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
  */
@@ -27,6 +11,7 @@ export declare class EventService extends Service {
27
11
  /**
28
12
  * イベント冪等複数作成
29
13
  * イベント識別子をキーにして、存在しなければ作成する
14
+ * アプリケーションオファーは設定されない
30
15
  */
31
16
  createIfNotExistByIdentifier(params: ICreateParamsByIdentifier[], options: {
32
17
  /**
@@ -47,27 +32,20 @@ export declare class EventService extends Service {
47
32
  * 識別子によるイベント複数更新
48
33
  * 識別子のイベントが存在しなければNotFound
49
34
  * 座席有無は変更できない
35
+ * アプリケーションオファーは変更できない
50
36
  */
51
37
  updateEventsByIdentifier(params: IUpdateParamsByIdentifier[], options: {
52
38
  typeOf: factory.eventType.ScreeningEvent;
53
39
  }): Promise<void>;
54
40
  /**
55
- * イベント冪等複数作成
56
- * 特定の追加特性をキーにして、存在しなければ作成する
57
- * 存在すれば、一部属性を更新する(eventStatus,superEvent,offers.seller.makesOffer)
41
+ * イベントのアプリケーションオファー編集(識別子によるイベント複数編集)
42
+ * 識別子のイベントが存在しなければNotFound
58
43
  */
59
- upsertManyByAdditionalProperty(params: {
60
- /**
61
- * 最大長:10
62
- */
63
- attributes: ICreateScreeningEventParams[];
64
- filter: {
65
- /**
66
- * キーにする追加特性name
67
- */
68
- name: string;
69
- };
70
- }): Promise<void>;
44
+ updateEventsSellerMakesOfferByIdentifier(
45
+ /**
46
+ * max: 10
47
+ */
48
+ params: IUpdateEventSellerMakesOfferParamsByIdentifier[]): Promise<void>;
71
49
  /**
72
50
  * イベントステータス更新
73
51
  */
@@ -14,6 +14,17 @@ var __extends = (this && this.__extends) || (function () {
14
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
15
  };
16
16
  })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
17
28
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
29
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
30
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -50,41 +61,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
50
61
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
62
  }
52
63
  };
53
- var __rest = (this && this.__rest) || function (s, e) {
54
- var t = {};
55
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
56
- t[p] = s[p];
57
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
58
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
59
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
60
- t[p[i]] = s[p[i]];
61
- }
62
- return t;
63
- };
64
64
  Object.defineProperty(exports, "__esModule", { value: true });
65
65
  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
- }
88
69
  /**
89
70
  * イベントサービス
90
71
  */
@@ -96,6 +77,7 @@ var EventService = /** @class */ (function (_super) {
96
77
  /**
97
78
  * イベント冪等複数作成
98
79
  * イベント識別子をキーにして、存在しなければ作成する
80
+ * アプリケーションオファーは設定されない
99
81
  */
100
82
  EventService.prototype.createIfNotExistByIdentifier = function (params, options) {
101
83
  return __awaiter(this, void 0, void 0, function () {
@@ -113,7 +95,8 @@ var EventService = /** @class */ (function (_super) {
113
95
  })];
114
96
  case 2:
115
97
  eventService = _b.sent();
116
- return [4 /*yield*/, eventService.createIfNotExistByIdentifier(params, options)];
98
+ return [4 /*yield*/, eventService.createIfNotExistByIdentifier(params, __assign(__assign({}, options), { disableOverwriteMakesOffer: true // force disableOverwriteMakesOffer(2025-10-28~)
99
+ }))];
117
100
  case 3:
118
101
  _b.sent();
119
102
  return [2 /*return*/];
@@ -125,6 +108,7 @@ var EventService = /** @class */ (function (_super) {
125
108
  * 識別子によるイベント複数更新
126
109
  * 識別子のイベントが存在しなければNotFound
127
110
  * 座席有無は変更できない
111
+ * アプリケーションオファーは変更できない
128
112
  */
129
113
  EventService.prototype.updateEventsByIdentifier = function (params, options) {
130
114
  return __awaiter(this, void 0, void 0, function () {
@@ -142,7 +126,8 @@ var EventService = /** @class */ (function (_super) {
142
126
  })];
143
127
  case 2:
144
128
  eventService = _b.sent();
145
- return [4 /*yield*/, eventService.updateEventsByIdentifier(params, options)];
129
+ return [4 /*yield*/, eventService.updateEventsByIdentifier(params, __assign(__assign({}, options), { disableOverwriteMakesOffer: true // force disableOverwriteMakesOffer(2025-10-28~)
130
+ }))];
146
131
  case 3:
147
132
  _b.sent();
148
133
  return [2 /*return*/];
@@ -151,50 +136,32 @@ var EventService = /** @class */ (function (_super) {
151
136
  });
152
137
  };
153
138
  /**
154
- * イベント冪等複数作成
155
- * 特定の追加特性をキーにして、存在しなければ作成する
156
- * 存在すれば、一部属性を更新する(eventStatus,superEvent,offers.seller.makesOffer)
139
+ * イベントのアプリケーションオファー編集(識別子によるイベント複数編集)
140
+ * 識別子のイベントが存在しなければNotFound
141
+ */
142
+ EventService.prototype.updateEventsSellerMakesOfferByIdentifier = function (
143
+ /**
144
+ * max: 10
157
145
  */
158
- EventService.prototype.upsertManyByAdditionalProperty = function (params) {
146
+ params) {
159
147
  return __awaiter(this, void 0, void 0, function () {
160
- var _a, upsertParams, superEventId, locationBranchCode, _b, auth, endpoint, project, seller, chevreAdmin, eventService;
161
- return __generator(this, function (_c) {
162
- switch (_c.label) {
148
+ var _a, auth, endpoint, project, seller, disableAutoRetry, chevreAdmin, eventService;
149
+ return __generator(this, function (_b) {
150
+ switch (_b.label) {
163
151
  case 0:
164
- _a = createUpsertParams(params), upsertParams = _a.upsertParams, superEventId = _a.superEventId, locationBranchCode = _a.locationBranchCode;
165
- _b = this.options, auth = _b.auth, endpoint = _b.endpoint, project = _b.project, seller = _b.seller;
166
- return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint })];
152
+ _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry;
153
+ return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
167
154
  case 1:
168
- chevreAdmin = _c.sent();
155
+ chevreAdmin = _b.sent();
169
156
  return [4 /*yield*/, chevreAdmin.createEventInstance({
170
157
  project: project,
171
158
  seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
172
159
  })];
173
160
  case 2:
174
- eventService = _c.sent();
175
- return [4 /*yield*/, eventService.upsertManyByAdditionalProperty(upsertParams, {
176
- filter: { name: params.filter.name },
177
- update: false,
178
- superEventId: superEventId,
179
- locationBranchCode: locationBranchCode
180
- })];
161
+ eventService = _b.sent();
162
+ return [4 /*yield*/, eventService.updateEventsSellerMakesOfferByIdentifier(params)];
181
163
  case 3:
182
- _c.sent();
183
- return [4 /*yield*/, new Promise(function (resolve) {
184
- setTimeout(function () { resolve(); },
185
- // tslint:disable-next-line:no-magic-numbers
186
- 1000);
187
- })];
188
- case 4:
189
- _c.sent();
190
- return [4 /*yield*/, eventService.upsertManyByAdditionalProperty(upsertParams, {
191
- filter: { name: params.filter.name },
192
- update: true,
193
- superEventId: superEventId,
194
- locationBranchCode: locationBranchCode
195
- })];
196
- case 5:
197
- _c.sent();
164
+ _b.sent();
198
165
  return [2 /*return*/];
199
166
  }
200
167
  });
package/lib/bundle.js CHANGED
@@ -2833,7 +2833,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
2833
2833
  Object.defineProperty(exports, "__esModule", { value: true });
2834
2834
  exports.EventService = void 0;
2835
2835
  var http_status_1 = require("http-status");
2836
- var factory = require("../factory");
2837
2836
  var service_1 = require("../service");
2838
2837
  /**
2839
2838
  * イベントサービス
@@ -2849,16 +2848,20 @@ var EventService = /** @class */ (function (_super) {
2849
2848
  */
2850
2849
  EventService.prototype.createIfNotExistByIdentifier = function (params, options) {
2851
2850
  return __awaiter(this, void 0, void 0, function () {
2852
- var superEventId, locationBranchCode, hasTicketedSeat, typeOf;
2851
+ var superEventId, locationBranchCode, hasTicketedSeat, typeOf, disableOverwriteMakesOffer;
2853
2852
  return __generator(this, function (_a) {
2854
2853
  switch (_a.label) {
2855
2854
  case 0:
2856
- superEventId = options.superEventId, locationBranchCode = options.locationBranchCode, hasTicketedSeat = options.hasTicketedSeat, typeOf = options.typeOf;
2855
+ superEventId = options.superEventId, locationBranchCode = options.locationBranchCode, hasTicketedSeat = options.hasTicketedSeat, typeOf = options.typeOf, disableOverwriteMakesOffer = options.disableOverwriteMakesOffer;
2857
2856
  return [4 /*yield*/, this.fetch({
2858
2857
  uri: '/events',
2859
2858
  method: 'POST',
2860
2859
  body: params,
2861
- qs: { superEventId: superEventId, locationBranchCode: locationBranchCode, hasTicketedSeat: hasTicketedSeat, typeOf: typeOf },
2860
+ qs: {
2861
+ superEventId: superEventId, locationBranchCode: locationBranchCode, hasTicketedSeat: hasTicketedSeat, typeOf: typeOf,
2862
+ // support disableOverwriteMakesOffer(2025-10-28~)
2863
+ disableOverwriteMakesOffer: disableOverwriteMakesOffer === true
2864
+ },
2862
2865
  expectedStatusCodes: [http_status_1.NO_CONTENT]
2863
2866
  })];
2864
2867
  case 1:
@@ -2873,20 +2876,26 @@ var EventService = /** @class */ (function (_super) {
2873
2876
  * 識別子のイベントが存在しなければNotFound
2874
2877
  * 座席有無は変更できない
2875
2878
  */
2876
- EventService.prototype.updateEventsByIdentifier = function (params, options) {
2879
+ EventService.prototype.updateEventsByIdentifier = function (
2880
+ /**
2881
+ * max: 10
2882
+ */
2883
+ params, options) {
2877
2884
  return __awaiter(this, void 0, void 0, function () {
2878
- var typeOf;
2885
+ var typeOf, disableOverwriteMakesOffer;
2879
2886
  return __generator(this, function (_a) {
2880
2887
  switch (_a.label) {
2881
2888
  case 0:
2882
- typeOf = options.typeOf;
2889
+ typeOf = options.typeOf, disableOverwriteMakesOffer = options.disableOverwriteMakesOffer;
2883
2890
  return [4 /*yield*/, this.fetch({
2884
2891
  uri: '/events',
2885
2892
  method: 'PUT',
2886
2893
  body: params,
2887
2894
  qs: {
2888
2895
  typeOf: typeOf,
2889
- updateBy: 'identifier'
2896
+ updateBy: 'identifier',
2897
+ // support disableOverwriteMakesOffer(2025-10-28~)
2898
+ disableOverwriteMakesOffer: disableOverwriteMakesOffer === true
2890
2899
  },
2891
2900
  expectedStatusCodes: [http_status_1.NO_CONTENT]
2892
2901
  })];
@@ -2898,40 +2907,24 @@ var EventService = /** @class */ (function (_super) {
2898
2907
  });
2899
2908
  };
2900
2909
  /**
2901
- * イベント冪等複数作成
2902
- * 特定の追加特性をキーにして、存在しなければ作成する
2903
- * 存在すれば、一部属性を更新する(eventStatus,superEvent,offers.seller.makesOffer)
2910
+ * イベントのアプリケーションオファー編集(識別子によるイベント複数編集)
2911
+ * 識別子のイベントが存在しなければNotFound
2912
+ * 2025-10-28~
2913
+ */
2914
+ EventService.prototype.updateEventsSellerMakesOfferByIdentifier = function (
2915
+ /**
2916
+ * max: 10
2904
2917
  */
2905
- EventService.prototype.upsertManyByAdditionalProperty = function (params, options) {
2918
+ params) {
2906
2919
  return __awaiter(this, void 0, void 0, function () {
2907
- var superEventId, locationBranchCode;
2908
2920
  return __generator(this, function (_a) {
2909
2921
  switch (_a.label) {
2910
- case 0:
2911
- if (!Array.isArray(params) || params.length === 0) {
2912
- throw new factory.errors.ArgumentNull('body');
2913
- }
2914
- superEventId = options.superEventId;
2915
- locationBranchCode = options.locationBranchCode;
2916
- if (typeof superEventId !== 'string' || superEventId === '') {
2917
- throw new factory.errors.ArgumentNull('superEventId');
2918
- }
2919
- if (typeof locationBranchCode !== 'string' || locationBranchCode === '') {
2920
- throw new factory.errors.ArgumentNull('locationBranchCode');
2921
- }
2922
- return [4 /*yield*/, this.fetch({
2923
- uri: '/events',
2924
- method: 'PUT',
2925
- body: params,
2926
- qs: {
2927
- filter: options.filter,
2928
- update: options.update === true,
2929
- typeOf: factory.eventType.ScreeningEvent,
2930
- superEventId: superEventId,
2931
- locationBranchCode: locationBranchCode // add query(2025-08-27~)
2932
- },
2933
- expectedStatusCodes: [http_status_1.NO_CONTENT]
2934
- })];
2922
+ case 0: return [4 /*yield*/, this.fetch({
2923
+ uri: "/eventSellerMakesOffer",
2924
+ method: 'PUT',
2925
+ body: params,
2926
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
2927
+ })];
2935
2928
  case 1:
2936
2929
  _a.sent();
2937
2930
  return [2 /*return*/];
@@ -2963,7 +2956,7 @@ var EventService = /** @class */ (function (_super) {
2963
2956
  }(service_1.Service));
2964
2957
  exports.EventService = EventService;
2965
2958
 
2966
- },{"../factory":166,"../service":171,"http-status":456}],23:[function(require,module,exports){
2959
+ },{"../service":171,"http-status":456}],23:[function(require,module,exports){
2967
2960
  "use strict";
2968
2961
  var __extends = (this && this.__extends) || (function () {
2969
2962
  var extendStatics = function (d, b) {
@@ -21394,6 +21387,17 @@ var __extends = (this && this.__extends) || (function () {
21394
21387
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
21395
21388
  };
21396
21389
  })();
21390
+ var __assign = (this && this.__assign) || function () {
21391
+ __assign = Object.assign || function(t) {
21392
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
21393
+ s = arguments[i];
21394
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
21395
+ t[p] = s[p];
21396
+ }
21397
+ return t;
21398
+ };
21399
+ return __assign.apply(this, arguments);
21400
+ };
21397
21401
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
21398
21402
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
21399
21403
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -21430,41 +21434,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
21430
21434
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
21431
21435
  }
21432
21436
  };
21433
- var __rest = (this && this.__rest) || function (s, e) {
21434
- var t = {};
21435
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
21436
- t[p] = s[p];
21437
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
21438
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
21439
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
21440
- t[p[i]] = s[p[i]];
21441
- }
21442
- return t;
21443
- };
21444
21437
  Object.defineProperty(exports, "__esModule", { value: true });
21445
21438
  exports.EventService = void 0;
21446
21439
  var factory = require("../../factory");
21447
21440
  var index_1 = require("../../index");
21448
21441
  var service_1 = require("../../service");
21449
- function createUpsertParams(params) {
21450
- var _a, _b, _c, _d;
21451
- if (!Array.isArray(params.attributes) || params.attributes.length === 0) {
21452
- throw new factory.errors.ArgumentNull('body');
21453
- }
21454
- var superEventId = (_b = (_a = params.attributes[0]) === null || _a === void 0 ? void 0 : _a.superEvent) === null || _b === void 0 ? void 0 : _b.id;
21455
- var locationBranchCode = (_d = (_c = params.attributes[0]) === null || _c === void 0 ? void 0 : _c.location) === null || _d === void 0 ? void 0 : _d.branchCode;
21456
- if (typeof superEventId !== 'string' || superEventId === '') {
21457
- throw new factory.errors.ArgumentNull('superEvent.id');
21458
- }
21459
- if (typeof locationBranchCode !== 'string' || locationBranchCode === '') {
21460
- throw new factory.errors.ArgumentNull('location.branchCode');
21461
- }
21462
- var upsertParams = params.attributes.map(function (_a) {
21463
- var location = _a.location, superEvent = _a.superEvent, identifier = _a.identifier, typeOf = _a.typeOf, project = _a.project, createFields = __rest(_a, ["location", "superEvent", "identifier", "typeOf", "project"]);
21464
- return createFields;
21465
- });
21466
- return { upsertParams: upsertParams, superEventId: superEventId, locationBranchCode: locationBranchCode };
21467
- }
21468
21442
  /**
21469
21443
  * イベントサービス
21470
21444
  */
@@ -21476,6 +21450,7 @@ var EventService = /** @class */ (function (_super) {
21476
21450
  /**
21477
21451
  * イベント冪等複数作成
21478
21452
  * イベント識別子をキーにして、存在しなければ作成する
21453
+ * アプリケーションオファーは設定されない
21479
21454
  */
21480
21455
  EventService.prototype.createIfNotExistByIdentifier = function (params, options) {
21481
21456
  return __awaiter(this, void 0, void 0, function () {
@@ -21493,7 +21468,8 @@ var EventService = /** @class */ (function (_super) {
21493
21468
  })];
21494
21469
  case 2:
21495
21470
  eventService = _b.sent();
21496
- return [4 /*yield*/, eventService.createIfNotExistByIdentifier(params, options)];
21471
+ return [4 /*yield*/, eventService.createIfNotExistByIdentifier(params, __assign(__assign({}, options), { disableOverwriteMakesOffer: true // force disableOverwriteMakesOffer(2025-10-28~)
21472
+ }))];
21497
21473
  case 3:
21498
21474
  _b.sent();
21499
21475
  return [2 /*return*/];
@@ -21505,6 +21481,7 @@ var EventService = /** @class */ (function (_super) {
21505
21481
  * 識別子によるイベント複数更新
21506
21482
  * 識別子のイベントが存在しなければNotFound
21507
21483
  * 座席有無は変更できない
21484
+ * アプリケーションオファーは変更できない
21508
21485
  */
21509
21486
  EventService.prototype.updateEventsByIdentifier = function (params, options) {
21510
21487
  return __awaiter(this, void 0, void 0, function () {
@@ -21522,7 +21499,8 @@ var EventService = /** @class */ (function (_super) {
21522
21499
  })];
21523
21500
  case 2:
21524
21501
  eventService = _b.sent();
21525
- return [4 /*yield*/, eventService.updateEventsByIdentifier(params, options)];
21502
+ return [4 /*yield*/, eventService.updateEventsByIdentifier(params, __assign(__assign({}, options), { disableOverwriteMakesOffer: true // force disableOverwriteMakesOffer(2025-10-28~)
21503
+ }))];
21526
21504
  case 3:
21527
21505
  _b.sent();
21528
21506
  return [2 /*return*/];
@@ -21531,50 +21509,32 @@ var EventService = /** @class */ (function (_super) {
21531
21509
  });
21532
21510
  };
21533
21511
  /**
21534
- * イベント冪等複数作成
21535
- * 特定の追加特性をキーにして、存在しなければ作成する
21536
- * 存在すれば、一部属性を更新する(eventStatus,superEvent,offers.seller.makesOffer)
21512
+ * イベントのアプリケーションオファー編集(識別子によるイベント複数編集)
21513
+ * 識別子のイベントが存在しなければNotFound
21514
+ */
21515
+ EventService.prototype.updateEventsSellerMakesOfferByIdentifier = function (
21516
+ /**
21517
+ * max: 10
21537
21518
  */
21538
- EventService.prototype.upsertManyByAdditionalProperty = function (params) {
21519
+ params) {
21539
21520
  return __awaiter(this, void 0, void 0, function () {
21540
- var _a, upsertParams, superEventId, locationBranchCode, _b, auth, endpoint, project, seller, chevreAdmin, eventService;
21541
- return __generator(this, function (_c) {
21542
- switch (_c.label) {
21521
+ var _a, auth, endpoint, project, seller, disableAutoRetry, chevreAdmin, eventService;
21522
+ return __generator(this, function (_b) {
21523
+ switch (_b.label) {
21543
21524
  case 0:
21544
- _a = createUpsertParams(params), upsertParams = _a.upsertParams, superEventId = _a.superEventId, locationBranchCode = _a.locationBranchCode;
21545
- _b = this.options, auth = _b.auth, endpoint = _b.endpoint, project = _b.project, seller = _b.seller;
21546
- return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint })];
21525
+ _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry;
21526
+ return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
21547
21527
  case 1:
21548
- chevreAdmin = _c.sent();
21528
+ chevreAdmin = _b.sent();
21549
21529
  return [4 /*yield*/, chevreAdmin.createEventInstance({
21550
21530
  project: project,
21551
21531
  seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
21552
21532
  })];
21553
21533
  case 2:
21554
- eventService = _c.sent();
21555
- return [4 /*yield*/, eventService.upsertManyByAdditionalProperty(upsertParams, {
21556
- filter: { name: params.filter.name },
21557
- update: false,
21558
- superEventId: superEventId,
21559
- locationBranchCode: locationBranchCode
21560
- })];
21534
+ eventService = _b.sent();
21535
+ return [4 /*yield*/, eventService.updateEventsSellerMakesOfferByIdentifier(params)];
21561
21536
  case 3:
21562
- _c.sent();
21563
- return [4 /*yield*/, new Promise(function (resolve) {
21564
- setTimeout(function () { resolve(); },
21565
- // tslint:disable-next-line:no-magic-numbers
21566
- 1000);
21567
- })];
21568
- case 4:
21569
- _c.sent();
21570
- return [4 /*yield*/, eventService.upsertManyByAdditionalProperty(upsertParams, {
21571
- filter: { name: params.filter.name },
21572
- update: true,
21573
- superEventId: superEventId,
21574
- locationBranchCode: locationBranchCode
21575
- })];
21576
- case 5:
21577
- _c.sent();
21537
+ _b.sent();
21578
21538
  return [2 /*return*/];
21579
21539
  }
21580
21540
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "12.6.0-alpha.3",
3
+ "version": "12.6.0-alpha.5",
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-alpha.5",
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,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);