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

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.
@@ -0,0 +1,150 @@
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
+ // tslint:disable-next-line:max-func-body-length
14
+ async function main() {
15
+ const authClient = await auth.login();
16
+ await authClient.refreshAccessToken();
17
+ const loginTicket = authClient.verifyIdToken({});
18
+ console.log('username is', loginTicket.getUsername());
19
+
20
+ const eventService = await (await client.loadChevreAdmin({
21
+ endpoint: <string>process.env.CHEVRE_ENDPOINT,
22
+ auth: authClient
23
+ })).createEventInstance({
24
+ project: { id: PROJECT_ID },
25
+ seller: { id: SELLER_ID }
26
+ });
27
+
28
+ const today = moment()
29
+ .tz('Asia/Tokyo')
30
+ .format('YYYY-MM-DD');
31
+ const identifier = `fromSamples${moment()
32
+ .format('YYYYMMDDTHHmm')}`;
33
+ await eventService.createIfNotExistByIdentifier(
34
+ [
35
+ {
36
+ identifier,
37
+ doorTime: moment(`${today}T13:00:00Z`)
38
+ .toDate(),
39
+ startDate: moment(`${today}T13:00:00Z`)
40
+ .toDate(),
41
+ endDate: moment(`${today}T14:00:00Z`)
42
+ .toDate(),
43
+ eventStatus: client.factory.eventStatusType.EventScheduled,
44
+ additionalProperty: [
45
+ { name: ADDITIONAL_PROPERTY_NAME, value: identifier }
46
+ ],
47
+ maximumPhysicalAttendeeCapacity: 3,
48
+ offers: {
49
+ unacceptedPaymentMethod: [],
50
+ eligibleQuantity: {
51
+ maxValue: 6
52
+ },
53
+ itemOffered: {
54
+ id: EVENT_SERVICE_ID
55
+ },
56
+ seller: {
57
+ makesOffer: [
58
+ {
59
+ typeOf: client.factory.offerType.Offer,
60
+ availableAtOrFrom: { id: AVAILABLE_AT_OR_FROM_ID }, // <-販売アプリケーションIDを指定する
61
+ availabilityStarts: moment(`${today}T00:00:00+09:00`)
62
+ .toDate(),
63
+ availabilityEnds: moment(`${today}T14:00:00Z`)
64
+ .toDate(),
65
+ validFrom: moment(`${today}T00:00:00+09:00`)
66
+ .toDate(),
67
+ validThrough: moment(`${today}T14:00:00Z`)
68
+ .toDate()
69
+ }
70
+ ]
71
+ // makesOfferDefaultを指定するとmakesOfferよりも優先される
72
+ // makesOfferDefault: {
73
+ // typeOf: client.factory.offerType.Offer,
74
+ // availabilityStarts: moment('2024-05-11T00:00:00.000Z')
75
+ // .toDate(),
76
+ // availabilityEnds: moment('2024-05-12T00:00:00.000Z')
77
+ // .toDate(),
78
+ // validFrom: moment('2024-05-11T00:00:00.000Z')
79
+ // .toDate(),
80
+ // validThrough: moment('2024-05-12T00:00:00.000Z')
81
+ // .toDate()
82
+ // }
83
+ }
84
+ }
85
+ }
86
+ ],
87
+ {
88
+ locationBranchCode: '10',
89
+ superEventId: '7k9ayl8hc',
90
+ hasTicketedSeat: true,
91
+ typeOf: client.factory.eventType.ScreeningEvent
92
+ }
93
+ );
94
+ console.log('created.');
95
+
96
+ await eventService.updateEventsByIdentifier(
97
+ [
98
+ {
99
+ identifier,
100
+ doorTime: moment(`${today}T13:00:00Z`)
101
+ .toDate(),
102
+ startDate: moment(`${today}T13:00:00Z`)
103
+ .toDate(),
104
+ endDate: moment(`${today}T14:00:00Z`)
105
+ .toDate(),
106
+ eventStatus: client.factory.eventStatusType.EventScheduled,
107
+ additionalProperty: [
108
+ { name: ADDITIONAL_PROPERTY_NAME, value: identifier }
109
+ ],
110
+ maximumPhysicalAttendeeCapacity: 3,
111
+ offers: {
112
+ unacceptedPaymentMethod: [],
113
+ eligibleQuantity: {
114
+ maxValue: 6
115
+ },
116
+ itemOffered: {
117
+ id: EVENT_SERVICE_ID
118
+ },
119
+ seller: {
120
+ 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
+ }
133
+ ]
134
+ }
135
+ }
136
+ }
137
+ ],
138
+ {
139
+ typeOf: client.factory.eventType.ScreeningEvent
140
+ }
141
+ );
142
+ console.log('updated.');
143
+
144
+ }
145
+
146
+ main()
147
+ .then(() => {
148
+ console.log('success!');
149
+ })
150
+ .catch(console.error);
@@ -0,0 +1,103 @@
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
+
6
+ const PROJECT_ID = String(process.env.PROJECT_ID);
7
+ const SELLER_ID = '5a392dfdfca1c8737fb6da42';
8
+ const EVENT_SERVICE_ID = '630b139e4dd0621c0496a30c';
9
+ const AVAILABLE_AT_OR_FROM_ID = '51qbjcfr72h62m06vtv5kkhgje';
10
+ const ADDITIONAL_PROPERTY_NAME = 'oldEventId';
11
+ const SUPER_EVENT_ID = '7kaf1djmz';
12
+ const LOCATION_BRANCH_CODE = '01';
13
+
14
+ // tslint:disable-next-line:max-func-body-length
15
+ async function main() {
16
+ const authClient = await client.auth.ClientCredentials.createInstance({
17
+ domain: <string>process.env.CHEVRE_AUTHORIZE_SERVER_DOMAIN,
18
+ clientId: <string>process.env.CHEVRE_CLIENT_ID,
19
+ clientSecret: <string>process.env.CHEVRE_CLIENT_SECRET,
20
+ scopes: [],
21
+ state: ''
22
+ });
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
+ const identifier = '250909001001010900';
36
+ await eventService.createIfNotExistByIdentifier(
37
+ [
38
+ {
39
+ identifier,
40
+ doorTime: moment(`${today}T13:00:00Z`)
41
+ .toDate(),
42
+ startDate: moment(`${today}T13:00:00Z`)
43
+ .toDate(),
44
+ endDate: moment(`${today}T14:00:00Z`)
45
+ .toDate(),
46
+ eventStatus: client.factory.eventStatusType.EventScheduled,
47
+ additionalProperty: [
48
+ { name: ADDITIONAL_PROPERTY_NAME, value: identifier }
49
+ ],
50
+ offers: {
51
+ unacceptedPaymentMethod: [],
52
+ eligibleQuantity: {
53
+ maxValue: 6
54
+ },
55
+ itemOffered: {
56
+ id: EVENT_SERVICE_ID
57
+ },
58
+ seller: {
59
+ makesOffer: [
60
+ {
61
+ typeOf: client.factory.offerType.Offer,
62
+ availableAtOrFrom: { id: AVAILABLE_AT_OR_FROM_ID }, // <-販売アプリケーションIDを指定する
63
+ availabilityStarts: moment(`${today}T00:00:00+09:00`)
64
+ .toDate(),
65
+ availabilityEnds: moment(`${today}T14:00:00Z`)
66
+ .toDate(),
67
+ validFrom: moment(`${today}T00:00:00+09:00`)
68
+ .toDate(),
69
+ validThrough: moment(`${today}T14:00:00Z`)
70
+ .toDate()
71
+ }
72
+ ]
73
+ // makesOfferDefaultを指定するとmakesOfferよりも優先される
74
+ // makesOfferDefault: {
75
+ // typeOf: client.factory.offerType.Offer,
76
+ // availabilityStarts: moment('2024-05-11T00:00:00.000Z')
77
+ // .toDate(),
78
+ // availabilityEnds: moment('2024-05-12T00:00:00.000Z')
79
+ // .toDate(),
80
+ // validFrom: moment('2024-05-11T00:00:00.000Z')
81
+ // .toDate(),
82
+ // validThrough: moment('2024-05-12T00:00:00.000Z')
83
+ // .toDate()
84
+ // }
85
+ }
86
+ }
87
+ }
88
+ ],
89
+ {
90
+ locationBranchCode: LOCATION_BRANCH_CODE,
91
+ superEventId: SUPER_EVENT_ID,
92
+ hasTicketedSeat: true,
93
+ typeOf: client.factory.eventType.ScreeningEvent
94
+ }
95
+ );
96
+ console.log('created.');
97
+ }
98
+
99
+ main()
100
+ .then(() => {
101
+ console.log('success!');
102
+ })
103
+ .catch(console.error);
@@ -0,0 +1,102 @@
1
+ // tslint:disable:no-console
2
+ // tslint:disable-next-line:no-implicit-dependencies
3
+ import * as moment from 'moment-timezone';
4
+ import * as client from '../../../../lib/index';
5
+ // import * as auth from '../../auth/authAsAdmin';
6
+ import { auth } from '../../auth/clientCredentials';
7
+
8
+ const PROJECT_ID = String(process.env.PROJECT_ID);
9
+ const SELLER_ID = '5a392dfdfca1c8737fb6da42';
10
+ const EVENT_SERVICE_ID = '630b139e4dd0621c0496a30c';
11
+ const AVAILABLE_AT_OR_FROM_ID = '51qbjcfr72h62m06vtv5kkhgje';
12
+ const ADDITIONAL_PROPERTY_NAME = 'oldEventId';
13
+ const SUPER_EVENT_ID = '7kaf1djmz';
14
+ const LOCATION_BRANCH_CODE = '01';
15
+
16
+ // tslint:disable-next-line:max-func-body-length
17
+ async function main() {
18
+ // const authClient = await auth.login();
19
+ // await authClient.refreshAccessToken();
20
+ // const loginTicket = authClient.verifyIdToken({});
21
+ // console.log('username is', loginTicket.getUsername());
22
+
23
+ const eventService = await (await client.loadCloudAdmin({
24
+ endpoint: <string>process.env.API_ADMIN_ENDPOINT,
25
+ auth: await auth()
26
+ })).createEventInstance({
27
+ project: { id: PROJECT_ID },
28
+ seller: { id: SELLER_ID }
29
+ });
30
+
31
+ const today = moment()
32
+ .tz('Asia/Tokyo')
33
+ .format('YYYY-MM-DD');
34
+ const identifier = '250909001001010900';
35
+ await eventService.createIfNotExistByIdentifier(
36
+ [
37
+ {
38
+ identifier,
39
+ doorTime: moment(`${today}T13:00:00Z`)
40
+ .toDate(),
41
+ startDate: moment(`${today}T13:00:00Z`)
42
+ .toDate(),
43
+ endDate: moment(`${today}T14:00:00Z`)
44
+ .toDate(),
45
+ eventStatus: client.factory.eventStatusType.EventScheduled,
46
+ additionalProperty: [
47
+ { name: ADDITIONAL_PROPERTY_NAME, value: identifier }
48
+ ],
49
+ offers: {
50
+ unacceptedPaymentMethod: [],
51
+ eligibleQuantity: {
52
+ maxValue: 6
53
+ },
54
+ itemOffered: {
55
+ id: EVENT_SERVICE_ID
56
+ },
57
+ seller: {
58
+ makesOffer: [
59
+ {
60
+ typeOf: client.factory.offerType.Offer,
61
+ availableAtOrFrom: { id: AVAILABLE_AT_OR_FROM_ID }, // <-販売アプリケーションIDを指定する
62
+ availabilityStarts: moment(`${today}T00:00:00+09:00`)
63
+ .toDate(),
64
+ availabilityEnds: moment(`${today}T14:00:00Z`)
65
+ .toDate(),
66
+ validFrom: moment(`${today}T00:00:00+09:00`)
67
+ .toDate(),
68
+ validThrough: moment(`${today}T14:00:00Z`)
69
+ .toDate()
70
+ }
71
+ ]
72
+ // makesOfferDefaultを指定するとmakesOfferよりも優先される
73
+ // makesOfferDefault: {
74
+ // typeOf: client.factory.offerType.Offer,
75
+ // availabilityStarts: moment('2024-05-11T00:00:00.000Z')
76
+ // .toDate(),
77
+ // availabilityEnds: moment('2024-05-12T00:00:00.000Z')
78
+ // .toDate(),
79
+ // validFrom: moment('2024-05-11T00:00:00.000Z')
80
+ // .toDate(),
81
+ // validThrough: moment('2024-05-12T00:00:00.000Z')
82
+ // .toDate()
83
+ // }
84
+ }
85
+ }
86
+ }
87
+ ],
88
+ {
89
+ locationBranchCode: LOCATION_BRANCH_CODE,
90
+ superEventId: SUPER_EVENT_ID,
91
+ hasTicketedSeat: true,
92
+ typeOf: client.factory.eventType.ScreeningEvent
93
+ }
94
+ );
95
+ console.log('created.');
96
+ }
97
+
98
+ main()
99
+ .then(() => {
100
+ console.log('success!');
101
+ })
102
+ .catch(console.error);
@@ -14,9 +14,9 @@ async function main() {
14
14
  seller: { id: '' }
15
15
  });
16
16
  const orders = await orderService.findByConfirmationNumber({
17
- confirmationNumber: '96678',
17
+ confirmationNumber: '74441',
18
18
  customer: {
19
- telephone: '+819012345678'
19
+ telephone: '+819011111111'
20
20
  }
21
21
  });
22
22
  // tslint:disable-next-line:no-null-keyword
@@ -6,6 +6,7 @@ import { auth } from './auth/clientCredentials';
6
6
  const PROJECT_ID = String(process.env.PROJECT_ID);
7
7
 
8
8
  async function main() {
9
+ const now = new Date();
9
10
  const eventService = new (await client.loadService()).Event({
10
11
  endpoint: <string>process.env.API_ENDPOINT,
11
12
  auth: await auth(),
@@ -17,17 +18,18 @@ async function main() {
17
18
  page: 1,
18
19
  limit: 1,
19
20
  typeOf: client.factory.eventType.ScreeningEvent,
20
- startFrom: new Date(),
21
- startThrough: moment()
21
+ startFrom: now,
22
+ startThrough: moment(now)
22
23
  .add(1, 'days')
23
24
  .toDate(),
24
25
  sort: {
25
26
  startDate: client.factory.sortType.Ascending
26
27
  },
27
- sellerMakesOfferAvailableAtIn: ['xx', 'xxx']
28
+ sellerMakesOfferAvailableAtIn: ['xx', 'xxx'],
29
+ identifiers: ['x', 'x']
28
30
  });
29
31
  // tslint:disable-next-line:no-null-keyword
30
- // console.dir(data.at(0), { depth: null });
32
+ console.dir(data.at(0), { depth: null });
31
33
  // tslint:disable-next-line:no-null-keyword
32
34
  // console.dir(data.at(0)?.offers?.seller.makesOffer, { depth: null });
33
35
  console.log(data.length, 'events');
@@ -3,10 +3,51 @@ import { Service } from '../service';
3
3
  declare type ISendEmailMessageOnEventUpdated = Pick<factory.action.transfer.send.message.email.IAttributes, 'purpose' | 'recipient'> & {
4
4
  object: factory.action.transfer.send.message.email.IObjectAsEmailMessage;
5
5
  };
6
+ export declare type ICreateParamsByIdentifier = Pick<factory.event.ICreateParams<factory.eventType.ScreeningEvent>, 'additionalProperty' | 'doorTime' | 'endDate' | 'eventStatus' | 'maximumPhysicalAttendeeCapacity' | 'offers' | 'startDate'> & {
7
+ identifier: string;
8
+ offers: Pick<factory.event.screeningEvent.IOffers4create, 'eligibleQuantity' | 'seller' | 'unacceptedPaymentMethod'> & {
9
+ itemOffered: Pick<factory.event.screeningEvent.IItemOffered, 'id'>;
10
+ };
11
+ };
12
+ export declare type IUpdateParamsByIdentifier = Pick<factory.event.IUpdateParams<factory.eventType.ScreeningEvent>, 'additionalProperty' | 'doorTime' | 'endDate' | 'eventStatus' | 'maximumPhysicalAttendeeCapacity' | 'offers' | 'startDate'> & {
13
+ identifier: string;
14
+ offers: Pick<factory.event.screeningEvent.IOffers4create, 'eligibleQuantity' | 'seller' | 'unacceptedPaymentMethod'> & {
15
+ itemOffered: Pick<factory.event.screeningEvent.IItemOffered, 'id'>;
16
+ };
17
+ location?: never;
18
+ superEvent?: never;
19
+ };
6
20
  /**
7
21
  * イベントサービス
8
22
  */
9
23
  export declare class EventService extends Service {
24
+ /**
25
+ * イベント冪等複数作成
26
+ * イベントコードをキーにして、存在しなければ作成する
27
+ */
28
+ createIfNotExistByIdentifier(params: ICreateParamsByIdentifier[], options: {
29
+ /**
30
+ * 施設コンテンツID
31
+ */
32
+ superEventId: string;
33
+ /**
34
+ * ルームコード
35
+ */
36
+ locationBranchCode: string;
37
+ /**
38
+ * 座席有無
39
+ */
40
+ hasTicketedSeat: boolean;
41
+ typeOf: factory.eventType.ScreeningEvent;
42
+ }): Promise<void>;
43
+ /**
44
+ * 識別子によるイベント複数更新
45
+ * 識別子のイベントが存在しなければNotFound
46
+ * 座席有無は変更できない
47
+ */
48
+ updateEventsByIdentifier(params: IUpdateParamsByIdentifier[], options: {
49
+ typeOf: factory.eventType.ScreeningEvent;
50
+ }): Promise<void>;
10
51
  /**
11
52
  * イベント冪等複数作成
12
53
  * 特定の追加特性をキーにして、存在しなければ作成する
@@ -63,6 +63,60 @@ var EventService = /** @class */ (function (_super) {
63
63
  function EventService() {
64
64
  return _super !== null && _super.apply(this, arguments) || this;
65
65
  }
66
+ /**
67
+ * イベント冪等複数作成
68
+ * イベントコードをキーにして、存在しなければ作成する
69
+ */
70
+ EventService.prototype.createIfNotExistByIdentifier = function (params, options) {
71
+ return __awaiter(this, void 0, void 0, function () {
72
+ var superEventId, locationBranchCode, hasTicketedSeat, typeOf;
73
+ return __generator(this, function (_a) {
74
+ switch (_a.label) {
75
+ case 0:
76
+ superEventId = options.superEventId, locationBranchCode = options.locationBranchCode, hasTicketedSeat = options.hasTicketedSeat, typeOf = options.typeOf;
77
+ return [4 /*yield*/, this.fetch({
78
+ uri: '/events',
79
+ method: 'POST',
80
+ body: params,
81
+ qs: { superEventId: superEventId, locationBranchCode: locationBranchCode, hasTicketedSeat: hasTicketedSeat, typeOf: typeOf },
82
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
83
+ })];
84
+ case 1:
85
+ _a.sent();
86
+ return [2 /*return*/];
87
+ }
88
+ });
89
+ });
90
+ };
91
+ /**
92
+ * 識別子によるイベント複数更新
93
+ * 識別子のイベントが存在しなければNotFound
94
+ * 座席有無は変更できない
95
+ */
96
+ EventService.prototype.updateEventsByIdentifier = function (params, options) {
97
+ return __awaiter(this, void 0, void 0, function () {
98
+ var typeOf;
99
+ return __generator(this, function (_a) {
100
+ switch (_a.label) {
101
+ case 0:
102
+ typeOf = options.typeOf;
103
+ return [4 /*yield*/, this.fetch({
104
+ uri: '/events',
105
+ method: 'PUT',
106
+ body: params,
107
+ qs: {
108
+ typeOf: typeOf,
109
+ updateBy: 'identifier'
110
+ },
111
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
112
+ })];
113
+ case 1:
114
+ _a.sent();
115
+ return [2 /*return*/];
116
+ }
117
+ });
118
+ });
119
+ };
66
120
  /**
67
121
  * イベント冪等複数作成
68
122
  * 特定の追加特性をキーにして、存在しなければ作成する
@@ -136,8 +136,8 @@ export declare namespace service {
136
136
  * 管理サービス
137
137
  */
138
138
  export declare class ChevreAdmin {
139
- options: Pick<IOptions, 'auth' | 'endpoint'>;
140
- constructor(options: Pick<IOptions, 'auth' | 'endpoint'>);
139
+ options: Pick<IOptions, 'auth' | 'endpoint' | 'disableAutoRetry'>;
140
+ constructor(options: Pick<IOptions, 'auth' | 'endpoint' | 'disableAutoRetry'>);
141
141
  createAuthorizationInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<AuthorizationService>;
142
142
  createCreativeWorkInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<CreativeWorkService>;
143
143
  createCustomerInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<CustomerService>;
@@ -1,5 +1,6 @@
1
1
  import * as factory from '../../factory';
2
2
  import { Service } from '../../service';
3
+ import { ICreateParamsByIdentifier, IUpdateParamsByIdentifier } from '../../chevreAdmin/event';
3
4
  declare type ISendEmailMessageOnEventUpdated = Pick<factory.action.transfer.send.message.email.IAttributes, 'purpose' | 'recipient'> & {
4
5
  object: factory.action.transfer.send.message.email.IObjectAsEmailMessage;
5
6
  };
@@ -23,6 +24,33 @@ declare type ICreateScreeningEventParams = Omit<factory.event.ICreateParams<fact
23
24
  * イベントサービス
24
25
  */
25
26
  export declare class EventService extends Service {
27
+ /**
28
+ * イベント冪等複数作成
29
+ * イベントコードをキーにして、存在しなければ作成する
30
+ */
31
+ createIfNotExistByIdentifier(params: ICreateParamsByIdentifier[], options: {
32
+ /**
33
+ * 施設コンテンツID
34
+ */
35
+ superEventId: string;
36
+ /**
37
+ * ルームコード
38
+ */
39
+ locationBranchCode: string;
40
+ /**
41
+ * 座席有無
42
+ */
43
+ hasTicketedSeat: boolean;
44
+ typeOf: factory.eventType.ScreeningEvent;
45
+ }): Promise<void>;
46
+ /**
47
+ * 識別子によるイベント複数更新
48
+ * 識別子のイベントが存在しなければNotFound
49
+ * 座席有無は変更できない
50
+ */
51
+ updateEventsByIdentifier(params: IUpdateParamsByIdentifier[], options: {
52
+ typeOf: factory.eventType.ScreeningEvent;
53
+ }): Promise<void>;
26
54
  /**
27
55
  * イベント冪等複数作成
28
56
  * 特定の追加特性をキーにして、存在しなければ作成する
@@ -93,6 +93,63 @@ var EventService = /** @class */ (function (_super) {
93
93
  function EventService() {
94
94
  return _super !== null && _super.apply(this, arguments) || this;
95
95
  }
96
+ /**
97
+ * イベント冪等複数作成
98
+ * イベントコードをキーにして、存在しなければ作成する
99
+ */
100
+ EventService.prototype.createIfNotExistByIdentifier = function (params, options) {
101
+ return __awaiter(this, void 0, void 0, function () {
102
+ var _a, auth, endpoint, project, seller, chevreAdmin, eventService;
103
+ return __generator(this, function (_b) {
104
+ switch (_b.label) {
105
+ case 0:
106
+ _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller;
107
+ return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint })];
108
+ case 1:
109
+ chevreAdmin = _b.sent();
110
+ return [4 /*yield*/, chevreAdmin.createEventInstance({
111
+ project: project,
112
+ seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
113
+ })];
114
+ case 2:
115
+ eventService = _b.sent();
116
+ return [4 /*yield*/, eventService.createIfNotExistByIdentifier(params, options)];
117
+ case 3:
118
+ _b.sent();
119
+ return [2 /*return*/];
120
+ }
121
+ });
122
+ });
123
+ };
124
+ /**
125
+ * 識別子によるイベント複数更新
126
+ * 識別子のイベントが存在しなければNotFound
127
+ * 座席有無は変更できない
128
+ */
129
+ EventService.prototype.updateEventsByIdentifier = function (params, options) {
130
+ return __awaiter(this, void 0, void 0, function () {
131
+ var _a, auth, endpoint, project, seller, disableAutoRetry, chevreAdmin, eventService;
132
+ return __generator(this, function (_b) {
133
+ switch (_b.label) {
134
+ case 0:
135
+ _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry;
136
+ return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
137
+ case 1:
138
+ chevreAdmin = _b.sent();
139
+ return [4 /*yield*/, chevreAdmin.createEventInstance({
140
+ project: project,
141
+ seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
142
+ })];
143
+ case 2:
144
+ eventService = _b.sent();
145
+ return [4 /*yield*/, eventService.updateEventsByIdentifier(params, options)];
146
+ case 3:
147
+ _b.sent();
148
+ return [2 /*return*/];
149
+ }
150
+ });
151
+ });
152
+ };
96
153
  /**
97
154
  * イベント冪等複数作成
98
155
  * 特定の追加特性をキーにして、存在しなければ作成する
@@ -102,8 +102,8 @@ export declare namespace service {
102
102
  * 管理サービス
103
103
  */
104
104
  export declare class CloudAdmin {
105
- options: Pick<IOptions, 'auth' | 'endpoint'>;
106
- constructor(options: Pick<IOptions, 'auth' | 'endpoint'>);
105
+ options: Pick<IOptions, 'auth' | 'endpoint' | 'disableAutoRetry'>;
106
+ constructor(options: Pick<IOptions, 'auth' | 'endpoint' | 'disableAutoRetry'>);
107
107
  createCreativeWorkInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<CreativeWorkService>;
108
108
  createCustomerInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<CustomerService>;
109
109
  createEventInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<EventService>;
package/lib/bundle.js CHANGED
@@ -2569,6 +2569,60 @@ var EventService = /** @class */ (function (_super) {
2569
2569
  function EventService() {
2570
2570
  return _super !== null && _super.apply(this, arguments) || this;
2571
2571
  }
2572
+ /**
2573
+ * イベント冪等複数作成
2574
+ * イベントコードをキーにして、存在しなければ作成する
2575
+ */
2576
+ EventService.prototype.createIfNotExistByIdentifier = function (params, options) {
2577
+ return __awaiter(this, void 0, void 0, function () {
2578
+ var superEventId, locationBranchCode, hasTicketedSeat, typeOf;
2579
+ return __generator(this, function (_a) {
2580
+ switch (_a.label) {
2581
+ case 0:
2582
+ superEventId = options.superEventId, locationBranchCode = options.locationBranchCode, hasTicketedSeat = options.hasTicketedSeat, typeOf = options.typeOf;
2583
+ return [4 /*yield*/, this.fetch({
2584
+ uri: '/events',
2585
+ method: 'POST',
2586
+ body: params,
2587
+ qs: { superEventId: superEventId, locationBranchCode: locationBranchCode, hasTicketedSeat: hasTicketedSeat, typeOf: typeOf },
2588
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
2589
+ })];
2590
+ case 1:
2591
+ _a.sent();
2592
+ return [2 /*return*/];
2593
+ }
2594
+ });
2595
+ });
2596
+ };
2597
+ /**
2598
+ * 識別子によるイベント複数更新
2599
+ * 識別子のイベントが存在しなければNotFound
2600
+ * 座席有無は変更できない
2601
+ */
2602
+ EventService.prototype.updateEventsByIdentifier = function (params, options) {
2603
+ return __awaiter(this, void 0, void 0, function () {
2604
+ var typeOf;
2605
+ return __generator(this, function (_a) {
2606
+ switch (_a.label) {
2607
+ case 0:
2608
+ typeOf = options.typeOf;
2609
+ return [4 /*yield*/, this.fetch({
2610
+ uri: '/events',
2611
+ method: 'PUT',
2612
+ body: params,
2613
+ qs: {
2614
+ typeOf: typeOf,
2615
+ updateBy: 'identifier'
2616
+ },
2617
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
2618
+ })];
2619
+ case 1:
2620
+ _a.sent();
2621
+ return [2 /*return*/];
2622
+ }
2623
+ });
2624
+ });
2625
+ };
2572
2626
  /**
2573
2627
  * イベント冪等複数作成
2574
2628
  * 特定の追加特性をキーにして、存在しなければ作成する
@@ -20773,6 +20827,63 @@ var EventService = /** @class */ (function (_super) {
20773
20827
  function EventService() {
20774
20828
  return _super !== null && _super.apply(this, arguments) || this;
20775
20829
  }
20830
+ /**
20831
+ * イベント冪等複数作成
20832
+ * イベントコードをキーにして、存在しなければ作成する
20833
+ */
20834
+ EventService.prototype.createIfNotExistByIdentifier = function (params, options) {
20835
+ return __awaiter(this, void 0, void 0, function () {
20836
+ var _a, auth, endpoint, project, seller, chevreAdmin, eventService;
20837
+ return __generator(this, function (_b) {
20838
+ switch (_b.label) {
20839
+ case 0:
20840
+ _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller;
20841
+ return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint })];
20842
+ case 1:
20843
+ chevreAdmin = _b.sent();
20844
+ return [4 /*yield*/, chevreAdmin.createEventInstance({
20845
+ project: project,
20846
+ seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
20847
+ })];
20848
+ case 2:
20849
+ eventService = _b.sent();
20850
+ return [4 /*yield*/, eventService.createIfNotExistByIdentifier(params, options)];
20851
+ case 3:
20852
+ _b.sent();
20853
+ return [2 /*return*/];
20854
+ }
20855
+ });
20856
+ });
20857
+ };
20858
+ /**
20859
+ * 識別子によるイベント複数更新
20860
+ * 識別子のイベントが存在しなければNotFound
20861
+ * 座席有無は変更できない
20862
+ */
20863
+ EventService.prototype.updateEventsByIdentifier = function (params, options) {
20864
+ return __awaiter(this, void 0, void 0, function () {
20865
+ var _a, auth, endpoint, project, seller, disableAutoRetry, chevreAdmin, eventService;
20866
+ return __generator(this, function (_b) {
20867
+ switch (_b.label) {
20868
+ case 0:
20869
+ _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry;
20870
+ return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
20871
+ case 1:
20872
+ chevreAdmin = _b.sent();
20873
+ return [4 /*yield*/, chevreAdmin.createEventInstance({
20874
+ project: project,
20875
+ seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
20876
+ })];
20877
+ case 2:
20878
+ eventService = _b.sent();
20879
+ return [4 /*yield*/, eventService.updateEventsByIdentifier(params, options)];
20880
+ case 3:
20881
+ _b.sent();
20882
+ return [2 /*return*/];
20883
+ }
20884
+ });
20885
+ });
20886
+ };
20776
20887
  /**
20777
20888
  * イベント冪等複数作成
20778
20889
  * 特定の追加特性をキーにして、存在しなければ作成する
@@ -30730,35 +30841,8 @@ var RoleName;
30730
30841
  })(RoleName = exports.RoleName || (exports.RoleName = {}));
30731
30842
 
30732
30843
  },{}],335:[function(require,module,exports){
30733
- "use strict";
30734
- Object.defineProperty(exports, "__esModule", { value: true });
30735
- // export interface ISchedule4ttts extends Pick<IEventWithSchedule, 'id' | 'offers' | 'project' | 'superEvent'> {
30736
- // eventSchedule?: never;
30737
- // duration: number;
30738
- // noPerformanceTimes: string[];
30739
- // /**
30740
- // * 作成対象時間: 9,10,11など
30741
- // */
30742
- // hours: string[];
30743
- // /**
30744
- // * ['00', '15', '30', '45']
30745
- // */
30746
- // minutes: string[];
30747
- // /**
30748
- // * ['1', '2', '3', '4']
30749
- // */
30750
- // tours: string[];
30751
- // /**
30752
- // * 作成開始が今日から何日後か
30753
- // */
30754
- // // start: number;
30755
- // /**
30756
- // * 何日分作成するか
30757
- // */
30758
- // days: number;
30759
- // }
30760
-
30761
- },{}],336:[function(require,module,exports){
30844
+ arguments[4][34][0].apply(exports,arguments)
30845
+ },{"dup":34}],336:[function(require,module,exports){
30762
30846
  arguments[4][34][0].apply(exports,arguments)
30763
30847
  },{"dup":34}],337:[function(require,module,exports){
30764
30848
  arguments[4][34][0].apply(exports,arguments)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "12.3.0-alpha.4",
3
+ "version": "12.3.0-alpha.6",
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.3",
96
+ "@chevre/factory": "4.398.0-alpha.6",
97
97
  "debug": "3.2.7",
98
98
  "http-status": "1.7.4",
99
99
  "idtoken-verifier": "2.0.3",