@cinerino/sdk 10.21.0-alpha.8 → 10.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/example/playground/public/lib/bundle.js +1662 -943
  2. package/example/src/chevre/searchProjects.ts +17 -1
  3. package/example/src/cloud/transaction/processPlaceOrderByCreditCard3DS.ts +50 -3
  4. package/example/src/cloud/transaction/processPlaceOrderUsingMemberProgramTier.ts +517 -0
  5. package/example/src/findEventById.ts +12 -3
  6. package/lib/abstract/chevre/event.d.ts +3 -0
  7. package/lib/abstract/chevreAdmin/advanceBookingRequirement.d.ts +19 -0
  8. package/lib/abstract/chevreAdmin/{assetTransaction/refund.js → advanceBookingRequirement.js} +41 -37
  9. package/lib/abstract/chevreAdmin/assetTransaction/cancelReservation.d.ts +0 -13
  10. package/lib/abstract/chevreAdmin/assetTransaction/cancelReservation.js +9 -70
  11. package/lib/abstract/chevreAdmin/assetTransaction/pay.d.ts +0 -5
  12. package/lib/abstract/chevreAdmin/assetTransaction/pay.js +32 -51
  13. package/lib/abstract/chevreAdmin/eventOffer.d.ts +32 -0
  14. package/lib/abstract/chevreAdmin/eventOffer.js +169 -0
  15. package/lib/abstract/chevreAdmin/identity.d.ts +2 -2
  16. package/lib/abstract/chevreAdmin/identityProvider.d.ts +1 -1
  17. package/lib/abstract/chevreAdmin/identityProvider.js +2 -2
  18. package/lib/abstract/chevreAdmin/issuer.d.ts +12 -2
  19. package/lib/abstract/chevreAdmin/memberProgram.d.ts +38 -2
  20. package/lib/abstract/chevreAdmin/memberProgram.js +31 -4
  21. package/lib/abstract/chevreAdmin/offerCatalog.d.ts +8 -3
  22. package/lib/abstract/chevreAdmin/offerCatalogItem.d.ts +4 -3
  23. package/lib/abstract/chevreAdmin/paymentService.d.ts +18 -5
  24. package/lib/abstract/chevreAdmin/paymentServiceChannel.d.ts +2 -2
  25. package/lib/abstract/chevreAdmin/paymentServiceChannel.js +2 -2
  26. package/lib/abstract/chevreAdmin/pendingReservation.d.ts +58 -0
  27. package/lib/abstract/chevreAdmin/pendingReservation.js +104 -0
  28. package/lib/abstract/chevreAdmin/task.d.ts +2 -6
  29. package/lib/abstract/chevreAdmin/task.js +12 -13
  30. package/lib/abstract/chevreAdmin/webSite.d.ts +23 -0
  31. package/lib/abstract/chevreAdmin/webSite.js +138 -0
  32. package/lib/abstract/chevreAdmin.d.ts +36 -9
  33. package/lib/abstract/chevreAdmin.js +81 -20
  34. package/lib/abstract/chevrePay/payment/factory.d.ts +5 -5
  35. package/lib/abstract/cinerino/service/event.d.ts +7 -3
  36. package/lib/abstract/cinerino/service/event.js +24 -18
  37. package/lib/bundle.js +1716 -960
  38. package/package.json +2 -2
  39. package/example/src/chevre/assetTransaction/processCancelReservation.ts +0 -61
  40. package/example/src/chevre/assetTransaction/processPayMovieTicket.ts +0 -101
  41. package/example/src/chevre/assetTransaction/processPublishPaymentUrl.ts +0 -95
  42. package/example/src/chevre/assetTransaction/processRefundCreditCard.ts +0 -76
  43. package/lib/abstract/chevreAdmin/assetTransaction/refund.d.ts +0 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "10.21.0-alpha.8",
3
+ "version": "10.21.0",
4
4
  "description": "Cinerino SDK",
5
5
  "main": "./lib/index.js",
6
6
  "browser": {
@@ -92,7 +92,7 @@
92
92
  "watchify": "^3.11.1"
93
93
  },
94
94
  "dependencies": {
95
- "@chevre/factory": "4.393.0-alpha.6",
95
+ "@chevre/factory": "4.394.0-alpha.5",
96
96
  "debug": "3.2.7",
97
97
  "http-status": "1.7.4",
98
98
  "idtoken-verifier": "2.0.3",
@@ -1,61 +0,0 @@
1
- // tslint:disable:no-implicit-dependencies no-console no-magic-numbers
2
- import * as moment from 'moment';
3
-
4
- import * as client from '../../../../lib/';
5
-
6
- const project = { id: 'cinerino' };
7
-
8
- async function main() {
9
- const auth = await client.auth.ClientCredentials.createInstance({
10
- domain: <string>process.env.CHEVRE_AUTHORIZE_SERVER_DOMAIN,
11
- clientId: <string>process.env.CHEVRE_CLIENT_ID,
12
- clientSecret: <string>process.env.CHEVRE_CLIENT_SECRET,
13
- scopes: [],
14
- state: ''
15
- });
16
- const cancelReservationService = await (await client.loadChevreAdmin({
17
- endpoint: <string>process.env.CHEVRE_ENDPOINT,
18
- auth: auth
19
- })).createCancelReservationAssetTransactionInstance({
20
- project,
21
- seller: { id: '' }
22
- });
23
-
24
- console.log('starting transaction...');
25
- const transaction = await cancelReservationService.start({
26
- transactionNumber: 'xxx',
27
- agent: {
28
- name: 'agent name'
29
- },
30
- object: {
31
- // reservation: {
32
- // id: 'CIN135916265720083-0'
33
- // },
34
- reservation: {
35
- reservationNumber: 'xxx'
36
- }
37
- },
38
- expires: moment()
39
- .add(5, 'minutes')
40
- .toDate()
41
- });
42
- console.log('transaction started', transaction.id);
43
-
44
- await wait(1000);
45
-
46
- // 確定
47
- const result = await cancelReservationService.confirm({
48
- id: transaction.id
49
- });
50
- console.log('transaction confirmed', result);
51
- }
52
-
53
- async function wait(waitInMilliseconds: number) {
54
- return new Promise((resolve) => setTimeout(resolve, waitInMilliseconds));
55
- }
56
-
57
- main()
58
- .then(() => {
59
- console.log('main processed.');
60
- })
61
- .catch(console.error);
@@ -1,101 +0,0 @@
1
- // tslint:disable:no-implicit-dependencies no-console no-magic-numbers
2
- import * as moment from 'moment';
3
-
4
- import * as client from '../../../../lib/';
5
-
6
- const project = { id: 'cinerino' };
7
-
8
- async function main() {
9
- const auth = await client.auth.ClientCredentials.createInstance({
10
- domain: <string>process.env.CHEVRE_AUTHORIZE_SERVER_DOMAIN,
11
- clientId: <string>process.env.CHEVRE_CLIENT_ID,
12
- clientSecret: <string>process.env.CHEVRE_CLIENT_SECRET,
13
- scopes: [],
14
- state: ''
15
- });
16
-
17
- const payService = await (await client.loadChevreAdmin({
18
- endpoint: <string>process.env.CHEVRE_ENDPOINT,
19
- auth: auth
20
- })).createPayAssetTransactionInstance({
21
- project,
22
- seller: { id: '' }
23
- });
24
-
25
- const sellerService = await (await client.loadChevre({
26
- endpoint: <string>process.env.CHEVRE_ENDPOINT,
27
- auth: auth
28
- })).createSellerInstance({
29
- project
30
- });
31
-
32
- const searchSellersResult = await sellerService.search({ limit: 1, $projection: {} });
33
- const seller = searchSellersResult[0];
34
-
35
- const transactionNumber = `CIN${(new Date()).valueOf()}`;
36
- const paymentMethodType = 'MovieTicket';
37
-
38
- console.log('starting transaction...transactionNumber:', transactionNumber);
39
- const transaction = await payService.start({
40
- // iss: '',
41
- project: { typeOf: client.factory.organizationType.Project, id: project.id },
42
- typeOf: client.factory.assetTransactionType.Pay,
43
- transactionNumber: transactionNumber,
44
- agent: { typeOf: client.factory.personType.Person, name: 'サンプル決済者名称', id: 'id' },
45
- recipient: { typeOf: seller.typeOf, id: String(seller.id) },
46
- object: {
47
- typeOf: client.factory.service.paymentService.PaymentServiceType.MovieTicket,
48
- id: '',
49
- paymentMethod: {
50
- identifier: paymentMethodType,
51
- amount: 0,
52
- additionalProperty: [],
53
- movieTickets: [
54
- {
55
- typeOf: paymentMethodType,
56
- identifier: '2343314517',
57
- accessCode: '1234',
58
- category: { codeValue: '' }, // 情報空でよし
59
- serviceType: '01',
60
- serviceOutput: {
61
- reservationFor: {
62
- typeOf: client.factory.eventType.ScreeningEvent,
63
- id: '7k9ayn1y9'
64
- },
65
- reservedTicket: {
66
- ticketedSeat: {
67
- seatSection: 'Default',
68
- seatNumber: 'B-1',
69
- seatRow: '',
70
- seatingType: [],
71
- typeOf: client.factory.placeType.Seat
72
- }
73
- }
74
- }
75
- }
76
- ]
77
- }
78
- },
79
- expires: moment()
80
- .add(5, 'minutes')
81
- .toDate()
82
- });
83
- console.log('transaction started', transaction.id);
84
-
85
- // 確定
86
- await payService.confirm({
87
- transactionNumber: transactionNumber,
88
- potentialActions: {
89
- pay: {
90
- purpose: { typeOf: client.factory.order.OrderType.Order, orderNumber: `CIN${(new Date()).valueOf()}`, confirmationNumber: `CIN${(new Date()).valueOf()}` }
91
- }
92
- }
93
- });
94
- console.log('transaction confirmed');
95
- }
96
-
97
- main()
98
- .then(() => {
99
- console.log('main processed.');
100
- })
101
- .catch(console.error);
@@ -1,95 +0,0 @@
1
- // tslint:disable:no-implicit-dependencies no-console no-magic-numbers
2
- import * as moment from 'moment';
3
-
4
- import * as client from '../../../../lib/';
5
-
6
- const project = { id: 'cinerino' };
7
-
8
- async function main() {
9
- const auth = await client.auth.ClientCredentials.createInstance({
10
- domain: <string>process.env.CHEVRE_AUTHORIZE_SERVER_DOMAIN,
11
- clientId: <string>process.env.CHEVRE_CLIENT_ID,
12
- clientSecret: <string>process.env.CHEVRE_CLIENT_SECRET,
13
- scopes: [],
14
- state: ''
15
- });
16
-
17
- const payService = await (await client.loadChevreAdmin({
18
- endpoint: <string>process.env.CHEVRE_ENDPOINT,
19
- auth: auth
20
- })).createPayAssetTransactionInstance({
21
- project,
22
- seller: { id: '' }
23
- });
24
-
25
- const sellerService = await (await client.loadChevre({
26
- endpoint: <string>process.env.CHEVRE_ENDPOINT,
27
- auth: auth
28
- })).createSellerInstance({
29
- project
30
- });
31
-
32
- const searchSellersResult = await sellerService.search({ limit: 1, $projection: {} });
33
- const seller = searchSellersResult[0];
34
-
35
- const transactionNumber = `CIN${(new Date()).valueOf()}`;
36
- const paymentMethodType = 'PayPay';
37
-
38
- console.log('starting transaction...transactionNumber:', transactionNumber);
39
- const publishResult = await payService.publishPaymentUrl({
40
- // iss: '',
41
- project: { id: project.id, typeOf: client.factory.organizationType.Project },
42
- typeOf: client.factory.assetTransactionType.Pay,
43
- transactionNumber: transactionNumber,
44
- agent: { typeOf: client.factory.personType.Person, name: 'サンプル決済者名称', id: 'id' },
45
- recipient: { typeOf: seller.typeOf, id: String(seller.id) },
46
- object: {
47
- typeOf: client.factory.service.paymentService.PaymentServiceType.CreditCard,
48
- id: '',
49
- paymentMethod: {
50
- identifier: paymentMethodType,
51
- amount: 10,
52
- // additionalProperty: [{ name: 'sampleName', value: 'sampleValue' }],
53
- // method: '1',
54
- creditCard: {
55
- token: 'token'
56
- // cardNo: '4111111111111111',
57
- // expire: '2411',
58
- // holderName: 'A B'
59
- }
60
- // name: 'クレカ'
61
- }
62
- },
63
- expires: moment()
64
- .add(1, 'minutes')
65
- .toDate()
66
- });
67
- console.log('publishResult:', publishResult);
68
-
69
- console.log('invalidating...');
70
- await payService.invalidatePaymentUrl({
71
- project: { id: project.id, typeOf: client.factory.organizationType.Project },
72
- typeOf: client.factory.actionType.RefundAction,
73
- agent: { typeOf: seller.typeOf, id: String(seller.id) },
74
- recipient: { typeOf: client.factory.personType.Person, name: 'サンプル決済者名称', id: 'xxx' },
75
- object: [{
76
- typeOf: client.factory.service.paymentService.PaymentServiceType.CreditCard,
77
- id: '',
78
- paymentMethod: {
79
- additionalProperty: [],
80
- name: paymentMethodType,
81
- typeOf: paymentMethodType,
82
- paymentMethodId: publishResult.paymentMethodId
83
- },
84
- refundFee: 0
85
- }],
86
- purpose: { typeOf: client.factory.transactionType.PlaceOrder, id: 'xxx' }
87
- });
88
- console.log('invalidated');
89
- }
90
-
91
- main()
92
- .then(() => {
93
- console.log('main processed.');
94
- })
95
- .catch(console.error);
@@ -1,76 +0,0 @@
1
- // tslint:disable:no-implicit-dependencies no-console no-magic-numbers
2
- import * as moment from 'moment';
3
-
4
- import * as client from '../../../../lib/';
5
-
6
- const project = { id: 'cinerino' };
7
-
8
- async function main() {
9
- const auth = await client.auth.ClientCredentials.createInstance({
10
- domain: <string>process.env.CHEVRE_AUTHORIZE_SERVER_DOMAIN,
11
- clientId: <string>process.env.CHEVRE_CLIENT_ID,
12
- clientSecret: <string>process.env.CHEVRE_CLIENT_SECRET,
13
- scopes: [],
14
- state: ''
15
- });
16
-
17
- const refundService = await (await client.loadChevreAdmin({
18
- endpoint: <string>process.env.CHEVRE_ENDPOINT,
19
- auth: auth
20
- })).createRefundAssetTransactionInstance({
21
- project,
22
- seller: { id: '' }
23
- });
24
-
25
- const sellerService = await (await client.loadChevre({
26
- endpoint: <string>process.env.CHEVRE_ENDPOINT,
27
- auth: auth
28
- })).createSellerInstance({
29
- project
30
- });
31
-
32
- const searchSellersResult = await sellerService.search({ limit: 1, $projection: {} });
33
- const seller = searchSellersResult[0];
34
-
35
- const transactionNumber = `CIN${(new Date()).valueOf()}`;
36
- const paymentMethodType = 'CreditCard';
37
-
38
- console.log('starting transaction...transactionNumber:', transactionNumber);
39
- const transaction = await refundService.start({
40
- project: { typeOf: client.factory.organizationType.Project, id: project.id },
41
- typeOf: client.factory.assetTransactionType.Refund,
42
- transactionNumber: transactionNumber,
43
- agent: {
44
- typeOf: seller.typeOf,
45
- name: String((<client.factory.multilingualString>seller.name)?.ja),
46
- id: String(seller.id)
47
- },
48
- recipient: { typeOf: client.factory.personType.Person, name: 'サンプル決済者名称', id: 'id' },
49
- object: {
50
- typeOf: client.factory.service.paymentService.PaymentServiceType.CreditCard,
51
- id: '',
52
- paymentMethod: {
53
- typeOf: paymentMethodType,
54
- paymentMethodId: 'CIN438268608702343',
55
- name: '',
56
- additionalProperty: []
57
- }
58
- },
59
- expires: moment()
60
- .add(5, 'minutes')
61
- .toDate()
62
- });
63
- console.log('transaction started', transaction);
64
-
65
- // 確定
66
- await refundService.confirm({
67
- transactionNumber: transactionNumber
68
- });
69
- console.log('transaction confirmed');
70
- }
71
-
72
- main()
73
- .then(() => {
74
- console.log('main processed.');
75
- })
76
- .catch(console.error);
@@ -1,24 +0,0 @@
1
- import * as factory from '../../factory';
2
- import { Service } from '../../service';
3
- /**
4
- * 返金取引サービス
5
- */
6
- export declare class RefundAssetTransactionService extends Service {
7
- /**
8
- * 取引開始
9
- */
10
- start(params: factory.assetTransaction.refund.IStartParamsWithoutDetail): Promise<{
11
- id: string;
12
- }>;
13
- /**
14
- * 取引確定
15
- */
16
- confirm(params: factory.assetTransaction.refund.IConfirmParams): Promise<void>;
17
- /**
18
- * 取引中止
19
- */
20
- cancel(params: {
21
- id?: string;
22
- transactionNumber?: string;
23
- }): Promise<void>;
24
- }