@cinerino/sdk 12.12.1 → 12.13.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/example/src/chevre/admic/syncEventSeries.ts +44 -0
- package/example/src/chevre/admic/syncEvents.ts +46 -0
- package/example/src/chevre/admin/adminAcceptedPaymentMethods.ts +85 -21
- package/example/src/chevre/{adminScreeningEventSeries.ts → admin/adminEventSeries.ts} +4 -4
- package/example/src/cloud/transaction/authorizeCreditCardAsyncForcibly.ts +6 -0
- package/example/src/cloud/transaction/processPlaceOrderByCreditCard3DS.ts +28 -5
- package/example/src/cloud/transaction/processPlaceOrderCOAEventByCreditCard.ts +4 -2
- package/example/src/cloud/transaction/processPlaceOrderUsingMemberProgramTier.ts +2 -1
- package/example/src/cloud/transaction/processPlaceOrderUsingTicketIssuedThroughCreditCard.ts +2 -1
- package/lib/abstract/chevreAdmic/sync.d.ts +22 -0
- package/lib/abstract/chevreAdmic/sync.js +102 -0
- package/lib/abstract/chevreAdmic.d.ts +17 -0
- package/lib/abstract/chevreAdmic.js +83 -0
- package/lib/abstract/chevreAdmin/eventSeries.d.ts +25 -0
- package/lib/abstract/chevreAdmin/eventSeries.js +22 -2
- package/lib/abstract/chevreConsole/eventSeries.d.ts +2 -1
- package/lib/abstract/chevreConsole/eventSeries.js +2 -1
- package/lib/abstract/chevrePay/payment.d.ts +12 -0
- package/lib/abstract/chevrePay/payment.js +10 -6
- package/lib/abstract/cloud/pay/payment.d.ts +12 -0
- package/lib/abstract/cloud/pay/payment.js +26 -16
- package/lib/abstract/index.d.ts +3 -1
- package/lib/abstract/index.js +24 -1
- package/lib/bundle.js +926 -674
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -1
- package/package.json +2 -2
- package/example/src/chevre/transaction/processPlaceOrderCOA.ts +0 -403
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
// tslint:disable-next-line:no-implicit-dependencies
|
|
3
|
+
import * as client from '../../../../lib/index';
|
|
4
|
+
import * as auth from '../../auth/authAsAdmin';
|
|
5
|
+
|
|
6
|
+
const PROJECT_ID = String(process.env.PROJECT_ID);
|
|
7
|
+
const SELLER_ID = '59d20831e53ebc2b4e774466';
|
|
8
|
+
|
|
9
|
+
// tslint:disable-next-line:max-func-body-length
|
|
10
|
+
async function main() {
|
|
11
|
+
const authClient = await auth.login();
|
|
12
|
+
await authClient.refreshAccessToken();
|
|
13
|
+
const loginTicket = authClient.verifyIdToken({});
|
|
14
|
+
console.log('username is', loginTicket.getUsername());
|
|
15
|
+
|
|
16
|
+
const syncService = await (await client.loadChevreAdmic({
|
|
17
|
+
endpoint: <string>process.env.CHEVRE_ENDPOINT,
|
|
18
|
+
auth: authClient
|
|
19
|
+
})).createSyncInstance({
|
|
20
|
+
project: { id: PROJECT_ID },
|
|
21
|
+
seller: { id: SELLER_ID }
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const result = await syncService.syncEventSeries({
|
|
25
|
+
locationBranchCode: '120',
|
|
26
|
+
// locationBranchCode: 'xxx',
|
|
27
|
+
/**
|
|
28
|
+
* 指定するタイトルコード
|
|
29
|
+
*/
|
|
30
|
+
titleCode: '80001',
|
|
31
|
+
// titleCode: 'xxx',
|
|
32
|
+
/**
|
|
33
|
+
* 指定するタイトル枝番
|
|
34
|
+
*/
|
|
35
|
+
titleBranchNum: '0'
|
|
36
|
+
});
|
|
37
|
+
console.log(result);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
main()
|
|
41
|
+
.then(() => {
|
|
42
|
+
console.log('success!');
|
|
43
|
+
})
|
|
44
|
+
.catch(console.error);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
// tslint:disable-next-line:no-implicit-dependencies
|
|
3
|
+
import * as client from '../../../../lib/index';
|
|
4
|
+
import * as auth from '../../auth/authAsAdmin';
|
|
5
|
+
|
|
6
|
+
const PROJECT_ID = String(process.env.PROJECT_ID);
|
|
7
|
+
const SELLER_ID = '59d20831e53ebc2b4e774466';
|
|
8
|
+
|
|
9
|
+
// tslint:disable-next-line:max-func-body-length
|
|
10
|
+
async function main() {
|
|
11
|
+
const authClient = await auth.login();
|
|
12
|
+
await authClient.refreshAccessToken();
|
|
13
|
+
const loginTicket = authClient.verifyIdToken({});
|
|
14
|
+
console.log('username is', loginTicket.getUsername());
|
|
15
|
+
|
|
16
|
+
const syncService = await (await client.loadChevreAdmic({
|
|
17
|
+
endpoint: <string>process.env.CHEVRE_ENDPOINT,
|
|
18
|
+
auth: authClient
|
|
19
|
+
})).createSyncInstance({
|
|
20
|
+
project: { id: PROJECT_ID },
|
|
21
|
+
seller: { id: SELLER_ID }
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const result = await syncService.syncEvents({
|
|
25
|
+
locationBranchCode: '120',
|
|
26
|
+
// locationBranchCode: 'xxx',
|
|
27
|
+
roomCode: '30',
|
|
28
|
+
/**
|
|
29
|
+
* 指定するタイトルコード
|
|
30
|
+
*/
|
|
31
|
+
titleCode: '99100',
|
|
32
|
+
// titleCode: 'xxx',
|
|
33
|
+
/**
|
|
34
|
+
* 指定するタイトル枝番
|
|
35
|
+
*/
|
|
36
|
+
titleBranchNum: '0',
|
|
37
|
+
startDate: new Date()
|
|
38
|
+
});
|
|
39
|
+
console.log(result);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
main()
|
|
43
|
+
.then(() => {
|
|
44
|
+
console.log('success!');
|
|
45
|
+
})
|
|
46
|
+
.catch(console.error);
|
|
@@ -5,10 +5,12 @@ import * as client from '../../../../lib/index';
|
|
|
5
5
|
import * as auth from '../../auth/authAsAdmin';
|
|
6
6
|
|
|
7
7
|
const PROJECT_ID = String(process.env.PROJECT_ID);
|
|
8
|
-
const SELLER_ID = '
|
|
9
|
-
const OFFER_IDENTIFIER = '20251204eventOffer01';
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const SELLER_ID = '59d20831e53ebc2b4e774466';
|
|
9
|
+
// const OFFER_IDENTIFIER = '20251204eventOffer01';
|
|
10
|
+
// /**
|
|
11
|
+
// * 決済サービスID
|
|
12
|
+
// */
|
|
13
|
+
// const PAYMENT_METHOD_ID = '5f9a52994f3709000abe6417';
|
|
12
14
|
|
|
13
15
|
// tslint:disable-next-line:max-func-body-length
|
|
14
16
|
async function main() {
|
|
@@ -17,6 +19,13 @@ async function main() {
|
|
|
17
19
|
const loginTicket = authClient.verifyIdToken({});
|
|
18
20
|
console.log('username is', loginTicket.getUsername());
|
|
19
21
|
|
|
22
|
+
const adminEventSeriesService = await (await client.loadChevreAdmin({
|
|
23
|
+
endpoint: <string>process.env.CHEVRE_ENDPOINT,
|
|
24
|
+
auth: authClient
|
|
25
|
+
})).createEventSeriesInstance({
|
|
26
|
+
project: { id: PROJECT_ID },
|
|
27
|
+
seller: { id: SELLER_ID }
|
|
28
|
+
});
|
|
20
29
|
const acceptedPaymentMethodService = await (await client.loadChevreAdmin({
|
|
21
30
|
endpoint: <string>process.env.CHEVRE_ENDPOINT,
|
|
22
31
|
auth: authClient
|
|
@@ -24,7 +33,64 @@ async function main() {
|
|
|
24
33
|
project: { id: PROJECT_ID },
|
|
25
34
|
seller: { id: SELLER_ID }
|
|
26
35
|
});
|
|
36
|
+
const adminPaymentProductService = await (await client.loadChevreAdmin({
|
|
37
|
+
endpoint: <string>process.env.CHEVRE_ENDPOINT,
|
|
38
|
+
auth: authClient
|
|
39
|
+
})).createPaymentProductInstance({
|
|
40
|
+
project: { id: PROJECT_ID },
|
|
41
|
+
seller: { id: SELLER_ID }
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// 施設コンテンツの対応決済方法管理を有効にする
|
|
45
|
+
await adminEventSeriesService.upsertByVersion([
|
|
46
|
+
{
|
|
47
|
+
eventStatus: client.factory.eventStatusType.EventScheduled,
|
|
48
|
+
videoFormat: [],
|
|
49
|
+
kanaName: '',
|
|
50
|
+
startDate: moment('2023-12-09T12:00:00Z')
|
|
51
|
+
.toDate(),
|
|
52
|
+
endDate: moment('2034-12-09T15:00:00Z')
|
|
53
|
+
.toDate(),
|
|
54
|
+
typeOf: client.factory.eventType.ScreeningEventSeries,
|
|
55
|
+
duration: 'PT2H',
|
|
56
|
+
name: { ja: '対応決済方法管理のペット', en: 'Pet(adminAcceptedPaymentMethod)' },
|
|
57
|
+
location: {
|
|
58
|
+
id: '5bfb841d5a78d7948369979a'
|
|
59
|
+
},
|
|
60
|
+
workPerformed: {
|
|
61
|
+
identifier: '1622100',
|
|
62
|
+
version: '99'
|
|
63
|
+
},
|
|
64
|
+
offers: {
|
|
65
|
+
typeOf: client.factory.offerType.AggregateOffer // 対応決済方法管理を有効にする
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
]);
|
|
69
|
+
|
|
70
|
+
const eventSeries = (await adminEventSeriesService.findEventSeries({
|
|
71
|
+
limit: 1,
|
|
72
|
+
page: 1,
|
|
73
|
+
locationId: '5bfb841d5a78d7948369979a',
|
|
74
|
+
workPerformedIdentifier: '1622100',
|
|
75
|
+
workPerformedVersion: '99'
|
|
76
|
+
}))
|
|
77
|
+
.shift();
|
|
78
|
+
console.log(eventSeries);
|
|
79
|
+
if (eventSeries === undefined) {
|
|
80
|
+
throw new Error('eventSeries not found');
|
|
81
|
+
}
|
|
82
|
+
// return;
|
|
83
|
+
const itemOfferedId = eventSeries.id;
|
|
84
|
+
|
|
85
|
+
// 対応させたい決済サービス検索
|
|
86
|
+
const paymentServices = await adminPaymentProductService.findPaymentServices({
|
|
87
|
+
limit: 20,
|
|
88
|
+
page: 1
|
|
89
|
+
});
|
|
90
|
+
console.log(paymentServices);
|
|
91
|
+
console.log(paymentServices.length, 'paymentServices found');
|
|
27
92
|
|
|
93
|
+
// 対応させたい決済サービス全てについて対応決済方法を作成
|
|
28
94
|
const now = new Date();
|
|
29
95
|
const validFrom = moment(now)
|
|
30
96
|
.toDate();
|
|
@@ -32,14 +98,13 @@ async function main() {
|
|
|
32
98
|
.add(1, 'minutes')
|
|
33
99
|
.toDate();
|
|
34
100
|
await acceptedPaymentMethodService.createAcceptedPaymentMethodsByIdentifier(
|
|
35
|
-
|
|
36
|
-
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
],
|
|
101
|
+
paymentServices.map((paymentService) => ({
|
|
102
|
+
identifier: `Accept${paymentService.serviceType.codeValue}`,
|
|
103
|
+
validFrom,
|
|
104
|
+
validThrough,
|
|
105
|
+
acceptedPaymentMethod: { id: paymentService.id }
|
|
106
|
+
|
|
107
|
+
})),
|
|
43
108
|
{
|
|
44
109
|
itemOfferedId,
|
|
45
110
|
itemOfferedTypeOf: client.factory.eventType.ScreeningEventSeries
|
|
@@ -48,14 +113,13 @@ async function main() {
|
|
|
48
113
|
console.log('created.');
|
|
49
114
|
|
|
50
115
|
await acceptedPaymentMethodService.updateAcceptedPaymentMethodsByIdentifier(
|
|
51
|
-
|
|
52
|
-
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
],
|
|
116
|
+
paymentServices.map((paymentService) => ({
|
|
117
|
+
identifier: `Accept${paymentService.serviceType.codeValue}`,
|
|
118
|
+
validFrom,
|
|
119
|
+
validThrough,
|
|
120
|
+
acceptedPaymentMethod: { id: paymentService.id }
|
|
121
|
+
|
|
122
|
+
})),
|
|
59
123
|
{
|
|
60
124
|
itemOfferedId,
|
|
61
125
|
itemOfferedTypeOf: client.factory.eventType.ScreeningEventSeries
|
|
@@ -64,7 +128,7 @@ async function main() {
|
|
|
64
128
|
console.log('updated.');
|
|
65
129
|
|
|
66
130
|
const offers = await acceptedPaymentMethodService.findAcceptedPaymentMethods({
|
|
67
|
-
limit:
|
|
131
|
+
limit: 20,
|
|
68
132
|
page: 1,
|
|
69
133
|
// itemOfferedId: '691511df7d9f0e2df3d6dcf7'
|
|
70
134
|
itemOfferedId: itemOfferedId
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// tslint:disable:no-console
|
|
2
2
|
// tslint:disable-next-line:no-implicit-dependencies
|
|
3
3
|
import * as moment from 'moment';
|
|
4
|
-
import { factory, loadChevreAdmin } from '
|
|
5
|
-
import * as auth from '
|
|
4
|
+
import { factory, loadChevreAdmin } from '../../../../lib/index';
|
|
5
|
+
import * as auth from '../../auth/authAsAdmin';
|
|
6
6
|
|
|
7
7
|
const project = { id: String(process.env.PROJECT_ID) };
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ async function main() {
|
|
|
12
12
|
const loginTicket = authClient.verifyIdToken({});
|
|
13
13
|
console.log('username is', loginTicket.getUsername());
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const adminEventSeriesService = await (await loadChevreAdmin({
|
|
16
16
|
endpoint: <string>process.env.CHEVRE_ENDPOINT,
|
|
17
17
|
auth: authClient
|
|
18
18
|
})).createEventSeriesInstance({
|
|
@@ -20,7 +20,7 @@ async function main() {
|
|
|
20
20
|
seller: { id: '' }
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
await
|
|
23
|
+
await adminEventSeriesService.upsertByVersion([
|
|
24
24
|
{
|
|
25
25
|
eventStatus: factory.eventStatusType.EventScheduled,
|
|
26
26
|
videoFormat: [
|
|
@@ -19,6 +19,12 @@ export function authorizeCreditCardAsyncForcibly(params: {
|
|
|
19
19
|
typeOf: client.factory.transactionType.PlaceOrder;
|
|
20
20
|
id: string;
|
|
21
21
|
};
|
|
22
|
+
instrumentOptions: {
|
|
23
|
+
/**
|
|
24
|
+
* 対応決済方法オファーIDリスト
|
|
25
|
+
*/
|
|
26
|
+
acceptedPaymentMethodOfferIds: string[];
|
|
27
|
+
};
|
|
22
28
|
}) {
|
|
23
29
|
return async (repos: {
|
|
24
30
|
paymentService: client.cloudPay.service.Payment;
|
|
@@ -173,9 +173,17 @@ async function main() {
|
|
|
173
173
|
issuedThrough: { id: paymentServiceId },
|
|
174
174
|
ticketToken,
|
|
175
175
|
eventIdsAsOrderedItem: eventIds
|
|
176
|
+
// eventIdsAsOrderedItem: []
|
|
177
|
+
// eventIdsAsOrderedItem: ['xx', 'xx']
|
|
178
|
+
// eventIdsAsOrderedItem: ['xx', 'xxx']
|
|
176
179
|
// eventIdsAsOrderedItem: ['xxx', ...eventIds] // 存在しないイベントを指定すれば決済採用失敗
|
|
177
180
|
},
|
|
178
|
-
purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
|
|
181
|
+
purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder },
|
|
182
|
+
instrumentOptions: {
|
|
183
|
+
acceptedPaymentMethodOfferIds: [
|
|
184
|
+
'693e43e6929e69df1e88b189'
|
|
185
|
+
] // TODO
|
|
186
|
+
}
|
|
179
187
|
})({ paymentService });
|
|
180
188
|
console.log('paymentUrl published.', paymentMethodId, paymentUrl);
|
|
181
189
|
|
|
@@ -192,7 +200,8 @@ async function main() {
|
|
|
192
200
|
issuedThrough: { id: paymentServiceId },
|
|
193
201
|
eventIdsAsOrderedItem: eventIds
|
|
194
202
|
},
|
|
195
|
-
purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
|
|
203
|
+
purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder },
|
|
204
|
+
instrumentOptions: { acceptedPaymentMethodOfferIds: [] }
|
|
196
205
|
})({ paymentService });
|
|
197
206
|
console.log('paymentUrl published.', publishPaymentUrlAsyncForciblySecondResult);
|
|
198
207
|
} catch (error) {
|
|
@@ -227,10 +236,18 @@ async function main() {
|
|
|
227
236
|
ticketToken,
|
|
228
237
|
name: 'samplePaymentMethodName',
|
|
229
238
|
additionalProperty: [{ name: 'samplePropertyName', value: 'samplePropertyValue' }],
|
|
230
|
-
|
|
231
|
-
eventIdsAsOrderedItem: []
|
|
239
|
+
eventIdsAsOrderedItem: eventIds
|
|
240
|
+
// eventIdsAsOrderedItem: []
|
|
241
|
+
// eventIdsAsOrderedItem: ['', '']
|
|
242
|
+
// eventIdsAsOrderedItem: ['xx', 'xx']
|
|
243
|
+
// eventIdsAsOrderedItem: ['xx', 'xxx']
|
|
232
244
|
},
|
|
233
|
-
purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
|
|
245
|
+
purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder },
|
|
246
|
+
instrumentOptions: {
|
|
247
|
+
acceptedPaymentMethodOfferIds: [
|
|
248
|
+
'693e43e6929e69df1e88b189'
|
|
249
|
+
] // TODO
|
|
250
|
+
}
|
|
234
251
|
})({ paymentService });
|
|
235
252
|
console.log('credit card payment authorized', creditCardPaymentAuth.id);
|
|
236
253
|
|
|
@@ -505,6 +522,12 @@ function publishPaymentUrlAsyncForcibly(params: {
|
|
|
505
522
|
typeOf: client.factory.transactionType.PlaceOrder;
|
|
506
523
|
id: string;
|
|
507
524
|
};
|
|
525
|
+
instrumentOptions: {
|
|
526
|
+
/**
|
|
527
|
+
* 対応決済方法オファーIDリスト
|
|
528
|
+
*/
|
|
529
|
+
acceptedPaymentMethodOfferIds: string[];
|
|
530
|
+
};
|
|
508
531
|
}) {
|
|
509
532
|
return async (repos: {
|
|
510
533
|
paymentService: client.cloudPay.service.Payment;
|
|
@@ -127,7 +127,8 @@ async function main() {
|
|
|
127
127
|
issuedThrough: { id: PAYMENT_SERVICE_ID },
|
|
128
128
|
eventIdsAsOrderedItem: [screeningEvent.id]
|
|
129
129
|
},
|
|
130
|
-
purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
|
|
130
|
+
purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder },
|
|
131
|
+
instrumentOptions: { acceptedPaymentMethodOfferIds: [] }
|
|
131
132
|
})({ paymentService });
|
|
132
133
|
console.log('credit card payment authorized', creditCardPaymentAuth.id);
|
|
133
134
|
// throw new Error('force error');
|
|
@@ -153,7 +154,8 @@ async function main() {
|
|
|
153
154
|
issuedThrough: { id: PAYMENT_SERVICE_ID },
|
|
154
155
|
eventIdsAsOrderedItem: [screeningEvent.id]
|
|
155
156
|
},
|
|
156
|
-
purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
|
|
157
|
+
purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder },
|
|
158
|
+
instrumentOptions: { acceptedPaymentMethodOfferIds: [] }
|
|
157
159
|
})({ paymentService });
|
|
158
160
|
console.log('credit card payment authorized', creditCardPaymentAuth.id);
|
|
159
161
|
|
|
@@ -187,7 +187,8 @@ async function main() {
|
|
|
187
187
|
issuedThrough: { id: paymentServiceId },
|
|
188
188
|
eventIdsAsOrderedItem: authorizeSeatReservationResults.map(({ eventId }) => eventId)
|
|
189
189
|
},
|
|
190
|
-
purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
|
|
190
|
+
purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder },
|
|
191
|
+
instrumentOptions: { acceptedPaymentMethodOfferIds: [] }
|
|
191
192
|
})({ paymentService });
|
|
192
193
|
console.log('credit card payment authorized', creditCardPaymentAuth.id);
|
|
193
194
|
|
package/example/src/cloud/transaction/processPlaceOrderUsingTicketIssuedThroughCreditCard.ts
CHANGED
|
@@ -209,7 +209,8 @@ async function main() {
|
|
|
209
209
|
ticketToken, // メンバーシップチケットを指定
|
|
210
210
|
eventIdsAsOrderedItem: [EVENT_ID]
|
|
211
211
|
},
|
|
212
|
-
purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder }
|
|
212
|
+
purpose: { id: transaction.id, typeOf: client.factory.transactionType.PlaceOrder },
|
|
213
|
+
instrumentOptions: { acceptedPaymentMethodOfferIds: [] }
|
|
213
214
|
})({ paymentService });
|
|
214
215
|
console.log('credit card payment authorized', creditCardPaymentAuth.id);
|
|
215
216
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Service } from '../service';
|
|
2
|
+
/**
|
|
3
|
+
* 同期サービス
|
|
4
|
+
*/
|
|
5
|
+
export declare class SyncService extends Service {
|
|
6
|
+
syncEventSeries(params: {
|
|
7
|
+
locationBranchCode: string;
|
|
8
|
+
titleCode: string;
|
|
9
|
+
titleBranchNum: string;
|
|
10
|
+
}): Promise<{
|
|
11
|
+
id: string;
|
|
12
|
+
}>;
|
|
13
|
+
syncEvents(params: {
|
|
14
|
+
locationBranchCode: string;
|
|
15
|
+
roomCode: string;
|
|
16
|
+
titleCode: string;
|
|
17
|
+
titleBranchNum: string;
|
|
18
|
+
startDate: Date;
|
|
19
|
+
}): Promise<{
|
|
20
|
+
id: string;
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.SyncService = void 0;
|
|
55
|
+
var http_status_1 = require("http-status");
|
|
56
|
+
// import * as factory from '../factory';
|
|
57
|
+
var service_1 = require("../service");
|
|
58
|
+
/**
|
|
59
|
+
* 同期サービス
|
|
60
|
+
*/
|
|
61
|
+
var SyncService = /** @class */ (function (_super) {
|
|
62
|
+
__extends(SyncService, _super);
|
|
63
|
+
function SyncService() {
|
|
64
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
65
|
+
}
|
|
66
|
+
SyncService.prototype.syncEventSeries = function (params) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
68
|
+
var _this = this;
|
|
69
|
+
return __generator(this, function (_a) {
|
|
70
|
+
return [2 /*return*/, this.fetch({
|
|
71
|
+
uri: '/tasks/syncEventSeries',
|
|
72
|
+
method: 'POST',
|
|
73
|
+
body: params,
|
|
74
|
+
qs: {},
|
|
75
|
+
expectedStatusCodes: [http_status_1.ACCEPTED]
|
|
76
|
+
})
|
|
77
|
+
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
78
|
+
return [2 /*return*/, response.json()];
|
|
79
|
+
}); }); })];
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
SyncService.prototype.syncEvents = function (params) {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
85
|
+
var _this = this;
|
|
86
|
+
return __generator(this, function (_a) {
|
|
87
|
+
return [2 /*return*/, this.fetch({
|
|
88
|
+
uri: '/tasks/syncEvents',
|
|
89
|
+
method: 'POST',
|
|
90
|
+
body: params,
|
|
91
|
+
qs: {},
|
|
92
|
+
expectedStatusCodes: [http_status_1.ACCEPTED]
|
|
93
|
+
})
|
|
94
|
+
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
95
|
+
return [2 /*return*/, response.json()];
|
|
96
|
+
}); }); })];
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
return SyncService;
|
|
101
|
+
}(service_1.Service));
|
|
102
|
+
exports.SyncService = SyncService;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IAdditionalOptions, IOptions, IUnset as IUnsetOnService } from './service';
|
|
2
|
+
import type { SyncService } from './chevreAdmic/sync';
|
|
3
|
+
export declare namespace service {
|
|
4
|
+
type IUnset = IUnsetOnService;
|
|
5
|
+
type Sync = SyncService;
|
|
6
|
+
namespace Sync {
|
|
7
|
+
let svc: typeof SyncService | undefined;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* COA管理サービス
|
|
12
|
+
*/
|
|
13
|
+
export declare class ChevreAdmic {
|
|
14
|
+
options: Pick<IOptions, 'auth' | 'endpoint' | 'disableAutoRetry'>;
|
|
15
|
+
constructor(options: Pick<IOptions, 'auth' | 'endpoint' | 'disableAutoRetry'>);
|
|
16
|
+
createSyncInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<SyncService>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (_) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.ChevreAdmic = exports.service = void 0;
|
|
51
|
+
var service;
|
|
52
|
+
(function (service) {
|
|
53
|
+
var Sync;
|
|
54
|
+
(function (Sync) {
|
|
55
|
+
})(Sync = service.Sync || (service.Sync = {}));
|
|
56
|
+
})(service = exports.service || (exports.service = {}));
|
|
57
|
+
/**
|
|
58
|
+
* COA管理サービス
|
|
59
|
+
*/
|
|
60
|
+
var ChevreAdmic = /** @class */ (function () {
|
|
61
|
+
function ChevreAdmic(options) {
|
|
62
|
+
this.options = options;
|
|
63
|
+
}
|
|
64
|
+
ChevreAdmic.prototype.createSyncInstance = function (params) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
66
|
+
var _a;
|
|
67
|
+
return __generator(this, function (_b) {
|
|
68
|
+
switch (_b.label) {
|
|
69
|
+
case 0:
|
|
70
|
+
if (!(service.Sync.svc === undefined)) return [3 /*break*/, 2];
|
|
71
|
+
_a = service.Sync;
|
|
72
|
+
return [4 /*yield*/, Promise.resolve().then(function () { return require('./chevreAdmic/sync'); })];
|
|
73
|
+
case 1:
|
|
74
|
+
_a.svc = (_b.sent()).SyncService;
|
|
75
|
+
_b.label = 2;
|
|
76
|
+
case 2: return [2 /*return*/, new service.Sync.svc(__assign(__assign(__assign({}, this.options), params), { retryableStatusCodes: [] }))];
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
return ChevreAdmic;
|
|
82
|
+
}());
|
|
83
|
+
exports.ChevreAdmic = ChevreAdmic;
|
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
import * as factory from '../factory';
|
|
2
2
|
import { Service } from '../service';
|
|
3
|
+
export interface IFindParams {
|
|
4
|
+
/**
|
|
5
|
+
* max: 20
|
|
6
|
+
*/
|
|
7
|
+
limit: number;
|
|
8
|
+
page: number;
|
|
9
|
+
id?: string;
|
|
10
|
+
/**
|
|
11
|
+
* 施設ID
|
|
12
|
+
*/
|
|
13
|
+
locationId?: string;
|
|
14
|
+
/**
|
|
15
|
+
* コンテンツコード
|
|
16
|
+
*/
|
|
17
|
+
workPerformedIdentifier?: string;
|
|
18
|
+
/**
|
|
19
|
+
* バージョン
|
|
20
|
+
*/
|
|
21
|
+
workPerformedVersion?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare type IEventSeriesAsFindResult = Pick<factory.eventSeries.IEvent, 'additionalProperty' | 'alternativeHeadline' | 'description' | 'dubLanguage' | 'duration' | 'endDate' | 'headline' | 'kanaName' | 'location' | 'name' | 'offers' | 'organizer' | 'soundFormat' | 'startDate' | 'subtitleLanguage' | 'typeOf' | 'videoFormat' | 'workPerformed' | 'id'>;
|
|
3
24
|
/**
|
|
4
25
|
* 施設コンテンツサービス
|
|
5
26
|
*/
|
|
@@ -9,4 +30,8 @@ export declare class EventSeriesService extends Service {
|
|
|
9
30
|
* 存在しなければ作成し、存在すれば置換
|
|
10
31
|
*/
|
|
11
32
|
upsertByVersion(params: factory.eventSeries.ICreateParams[]): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* 施設コンテンツ検索
|
|
35
|
+
*/
|
|
36
|
+
findEventSeries(params: IFindParams): Promise<IEventSeriesAsFindResult[]>;
|
|
12
37
|
}
|