@cinerino/sdk 11.0.0-alpha.4 → 11.0.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.
- package/example/playground/public/lib/bundle.js +1202 -858
- package/example/src/chevre/searchEventSeries.ts +1 -1
- package/example/src/cloud/transaction/processPlaceOrderByCreditCard3DS.ts +19 -1
- package/example/src/st/{processPlaceOrderByPOS.ts → v1/processPlaceOrderByPOS.ts} +1 -1
- package/example/src/st/v1/searchEventSeats.ts +47 -0
- package/example/src/st/{searchEventSeries.ts → v1/searchEventSeries.ts} +1 -1
- package/example/src/st/v1/searchEvents.ts +59 -0
- package/example/src/st/{searchMovies.ts → v1/searchMovies.ts} +1 -1
- package/example/src/st/{searchSellers.ts → v1/searchSellers.ts} +1 -1
- package/lib/abstract/chevreAdmin/seller.d.ts +2 -8
- package/lib/abstract/chevreAdmin/seller.js +5 -1
- package/lib/abstract/chevreConsole/action.d.ts +3 -1
- package/lib/abstract/cloud/admin/seller.d.ts +1 -1
- package/lib/abstract/cloud/admin/seller.js +1 -12
- package/lib/bundle.js +10 -13
- package/package.json +2 -2
- package/example/src/st/searchEventSeats.ts +0 -49
- package/example/src/st/searchEvents.ts +0 -47
|
@@ -203,7 +203,25 @@ async function main() {
|
|
|
203
203
|
|
|
204
204
|
console.log('confirming transaction...');
|
|
205
205
|
|
|
206
|
-
let confirmResult = await placeOrderService.confirmWithMiminalResponse({
|
|
206
|
+
let confirmResult = await placeOrderService.confirmWithMiminalResponse({
|
|
207
|
+
id: transaction.id,
|
|
208
|
+
sendEmailMessage: true,
|
|
209
|
+
potentialActions: {
|
|
210
|
+
order: {
|
|
211
|
+
potentialActions: {
|
|
212
|
+
sendOrder: {
|
|
213
|
+
potentialActions: {
|
|
214
|
+
sendEmailMessage: [
|
|
215
|
+
{
|
|
216
|
+
object: { template: '| Date/Time of T' }
|
|
217
|
+
}
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
});
|
|
207
225
|
console.log('transaction confirmed', confirmResult);
|
|
208
226
|
|
|
209
227
|
// 何度確定をコールしても冪等
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// tslint:disable:no-console no-implicit-dependencies no-magic-numbers
|
|
2
|
+
import * as client from '../../../../lib/index';
|
|
3
|
+
|
|
4
|
+
const eventId = 'cmcv6incg';
|
|
5
|
+
|
|
6
|
+
let auth: client.auth.ClientCredentials | undefined;
|
|
7
|
+
|
|
8
|
+
async function main() {
|
|
9
|
+
if (auth === undefined) {
|
|
10
|
+
auth = await client.auth.ClientCredentials.createInstance({
|
|
11
|
+
domain: <string>process.env.ST_AUTHORIZE_SERVER_DOMAIN,
|
|
12
|
+
clientId: <string>process.env.ST_CLIENT_ID,
|
|
13
|
+
clientSecret: <string>process.env.ST_CLIENT_SECRET,
|
|
14
|
+
scopes: [],
|
|
15
|
+
state: 'teststate'
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
console.log('座席を検索しています...');
|
|
20
|
+
const qs = new URLSearchParams({
|
|
21
|
+
limit: '10',
|
|
22
|
+
page: '1'
|
|
23
|
+
}).toString();
|
|
24
|
+
const response = await fetch(
|
|
25
|
+
`${<string>process.env.ST_API_ENDPOINT}/events/ScreeningEvent/${eventId}/seats?${qs}`, {
|
|
26
|
+
method: 'GET',
|
|
27
|
+
headers: {
|
|
28
|
+
authorization: `Bearer ${await auth.getAccessToken()}`
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
});
|
|
32
|
+
if (!response.ok) {
|
|
33
|
+
console.dir(await response.json());
|
|
34
|
+
throw new Error('Network response was not ok');
|
|
35
|
+
}
|
|
36
|
+
const data = await response.json();
|
|
37
|
+
// tslint:disable-next-line:no-null-keyword
|
|
38
|
+
console.dir(data, { depth: null });
|
|
39
|
+
console.log(data.length, 'data found.');
|
|
40
|
+
}
|
|
41
|
+
main()
|
|
42
|
+
.then(() => {
|
|
43
|
+
console.log('main processed.');
|
|
44
|
+
})
|
|
45
|
+
.catch((err) => {
|
|
46
|
+
console.error(err);
|
|
47
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// tslint:disable:no-console no-implicit-dependencies no-magic-numbers
|
|
2
|
+
import * as moment from 'moment';
|
|
3
|
+
|
|
4
|
+
import * as client from '../../../../lib/index';
|
|
5
|
+
|
|
6
|
+
let auth: client.auth.ClientCredentials | undefined;
|
|
7
|
+
|
|
8
|
+
async function main() {
|
|
9
|
+
if (auth === undefined) {
|
|
10
|
+
auth = await client.auth.ClientCredentials.createInstance({
|
|
11
|
+
domain: <string>process.env.ST_AUTHORIZE_SERVER_DOMAIN,
|
|
12
|
+
clientId: <string>process.env.ST_CLIENT_ID,
|
|
13
|
+
clientSecret: <string>process.env.ST_CLIENT_SECRET,
|
|
14
|
+
scopes: [],
|
|
15
|
+
state: 'teststate'
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
console.log('イベントを検索しています...');
|
|
20
|
+
const qs = new URLSearchParams({
|
|
21
|
+
limit: '10',
|
|
22
|
+
page: '1',
|
|
23
|
+
startFrom: moment()
|
|
24
|
+
.toISOString(),
|
|
25
|
+
startThrough: moment()
|
|
26
|
+
.add(1, 'days')
|
|
27
|
+
.toISOString()
|
|
28
|
+
}).toString();
|
|
29
|
+
const response = await fetch(
|
|
30
|
+
`${<string>process.env.ST_API_ENDPOINT}/events/ScreeningEvent?${qs}`, {
|
|
31
|
+
method: 'GET',
|
|
32
|
+
headers: {
|
|
33
|
+
authorization: `Bearer ${await auth.getAccessToken()}`
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
});
|
|
37
|
+
if (!response.ok) {
|
|
38
|
+
console.dir(await response.json());
|
|
39
|
+
throw new Error('Network response was not ok');
|
|
40
|
+
}
|
|
41
|
+
const data = await response.json();
|
|
42
|
+
// tslint:disable-next-line:no-null-keyword
|
|
43
|
+
// console.dir(data, { depth: null });
|
|
44
|
+
console.log(data.length, 'data found.');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
setInterval(
|
|
48
|
+
() => {
|
|
49
|
+
main()
|
|
50
|
+
.then(() => {
|
|
51
|
+
console.log('main processed.');
|
|
52
|
+
})
|
|
53
|
+
.catch((err) => {
|
|
54
|
+
console.error(err);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
},
|
|
58
|
+
500
|
|
59
|
+
);
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import * as factory from '../factory';
|
|
2
2
|
import { IOptions, Service } from '../service';
|
|
3
|
-
declare type IKeyOfProjection = keyof Omit<factory.seller.ISeller, 'makesOffer' | 'paymentAccepted'>;
|
|
4
|
-
declare type IProjection = {
|
|
5
|
-
[key in IKeyOfProjection]?: 0;
|
|
6
|
-
};
|
|
7
3
|
/**
|
|
8
4
|
* 販売者サービス
|
|
9
5
|
*/
|
|
10
6
|
export declare class SellerService extends Service<IOptions> {
|
|
11
7
|
/**
|
|
12
|
-
*
|
|
8
|
+
* プロジェクトの販売者を検索する
|
|
13
9
|
*/
|
|
14
|
-
search(params:
|
|
10
|
+
search(params: Pick<factory.seller.ISearchConditions, 'limit' | 'page'> & {
|
|
15
11
|
limit: number;
|
|
16
12
|
page: number;
|
|
17
|
-
$projection: IProjection;
|
|
18
13
|
}): Promise<Pick<factory.seller.ISeller, 'additionalProperty' | 'branchCode' | 'id' | 'name' | 'project' | 'telephone' | 'typeOf' | 'url'>[]>;
|
|
19
14
|
}
|
|
20
|
-
export {};
|
|
@@ -54,6 +54,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
54
54
|
exports.SellerService = void 0;
|
|
55
55
|
var http_status_1 = require("http-status");
|
|
56
56
|
var service_1 = require("../service");
|
|
57
|
+
// type IKeyOfProjection = keyof Omit<factory.seller.ISeller, 'makesOffer' | 'paymentAccepted'>;
|
|
58
|
+
// type IProjection = {
|
|
59
|
+
// [key in IKeyOfProjection]?: 0;
|
|
60
|
+
// };
|
|
57
61
|
/**
|
|
58
62
|
* 販売者サービス
|
|
59
63
|
*/
|
|
@@ -63,7 +67,7 @@ var SellerService = /** @class */ (function (_super) {
|
|
|
63
67
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
64
68
|
}
|
|
65
69
|
/**
|
|
66
|
-
*
|
|
70
|
+
* プロジェクトの販売者を検索する
|
|
67
71
|
*/
|
|
68
72
|
SellerService.prototype.search = function (params) {
|
|
69
73
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -8,7 +8,9 @@ export declare class ActionService extends Service {
|
|
|
8
8
|
/**
|
|
9
9
|
* アクション検索
|
|
10
10
|
*/
|
|
11
|
-
search<T extends factory.actionType>(params: factory.action.ISearchConditions
|
|
11
|
+
search<T extends factory.actionType>(params: Omit<factory.action.ISearchConditions, 'typeOf'> & {
|
|
12
|
+
typeOf?: factory.actionType;
|
|
13
|
+
}): Promise<ISearchResult<IAction<T>[]>>;
|
|
12
14
|
findById<T extends factory.actionType>(params: {
|
|
13
15
|
id: string;
|
|
14
16
|
typeOf: T;
|
|
@@ -4,7 +4,7 @@ import { IOptions, Service } from '../../service';
|
|
|
4
4
|
* 販売者サービス
|
|
5
5
|
*/
|
|
6
6
|
export declare class SellerService extends Service<IOptions> {
|
|
7
|
-
search(params:
|
|
7
|
+
search(params: Pick<factory.seller.ISearchConditions, 'limit' | 'page'> & {
|
|
8
8
|
limit: number;
|
|
9
9
|
page: number;
|
|
10
10
|
}): Promise<Pick<factory.seller.ISeller, 'additionalProperty' | 'branchCode' | 'id' | 'name' | 'telephone' | 'typeOf' | 'url'>[]>;
|
|
@@ -14,17 +14,6 @@ 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
|
-
};
|
|
28
17
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
18
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
19
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -88,7 +77,7 @@ var SellerService = /** @class */ (function (_super) {
|
|
|
88
77
|
})];
|
|
89
78
|
case 2:
|
|
90
79
|
sellerService = _b.sent();
|
|
91
|
-
return [2 /*return*/, sellerService.search(
|
|
80
|
+
return [2 /*return*/, sellerService.search(params)];
|
|
92
81
|
}
|
|
93
82
|
});
|
|
94
83
|
});
|
package/lib/bundle.js
CHANGED
|
@@ -3696,6 +3696,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3696
3696
|
exports.SellerService = void 0;
|
|
3697
3697
|
var http_status_1 = require("http-status");
|
|
3698
3698
|
var service_1 = require("../service");
|
|
3699
|
+
// type IKeyOfProjection = keyof Omit<factory.seller.ISeller, 'makesOffer' | 'paymentAccepted'>;
|
|
3700
|
+
// type IProjection = {
|
|
3701
|
+
// [key in IKeyOfProjection]?: 0;
|
|
3702
|
+
// };
|
|
3699
3703
|
/**
|
|
3700
3704
|
* 販売者サービス
|
|
3701
3705
|
*/
|
|
@@ -3705,7 +3709,7 @@ var SellerService = /** @class */ (function (_super) {
|
|
|
3705
3709
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
3706
3710
|
}
|
|
3707
3711
|
/**
|
|
3708
|
-
*
|
|
3712
|
+
* プロジェクトの販売者を検索する
|
|
3709
3713
|
*/
|
|
3710
3714
|
SellerService.prototype.search = function (params) {
|
|
3711
3715
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -22514,17 +22518,6 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
22514
22518
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
22515
22519
|
};
|
|
22516
22520
|
})();
|
|
22517
|
-
var __assign = (this && this.__assign) || function () {
|
|
22518
|
-
__assign = Object.assign || function(t) {
|
|
22519
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
22520
|
-
s = arguments[i];
|
|
22521
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22522
|
-
t[p] = s[p];
|
|
22523
|
-
}
|
|
22524
|
-
return t;
|
|
22525
|
-
};
|
|
22526
|
-
return __assign.apply(this, arguments);
|
|
22527
|
-
};
|
|
22528
22521
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22529
22522
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
22530
22523
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -22588,7 +22581,7 @@ var SellerService = /** @class */ (function (_super) {
|
|
|
22588
22581
|
})];
|
|
22589
22582
|
case 2:
|
|
22590
22583
|
sellerService = _b.sent();
|
|
22591
|
-
return [2 /*return*/, sellerService.search(
|
|
22584
|
+
return [2 /*return*/, sellerService.search(params)];
|
|
22592
22585
|
}
|
|
22593
22586
|
});
|
|
22594
22587
|
});
|
|
@@ -30511,6 +30504,10 @@ var RoleName;
|
|
|
30511
30504
|
RoleName["SellersOwner"] = "sellers.owner";
|
|
30512
30505
|
RoleName["SellersInventoryManager"] = "sellers.inventoryManager";
|
|
30513
30506
|
RoleName["SellersIAMRoleAdmin"] = "sellers.iam.roleAdmin";
|
|
30507
|
+
/**
|
|
30508
|
+
* adminapisの在庫管理ロール
|
|
30509
|
+
*/
|
|
30510
|
+
RoleName["AdminInventoryManager"] = "admin.inventoryManager";
|
|
30514
30511
|
})(RoleName = exports.RoleName || (exports.RoleName = {}));
|
|
30515
30512
|
|
|
30516
30513
|
},{}],333:[function(require,module,exports){
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cinerino/sdk",
|
|
3
|
-
"version": "11.0.0-alpha.
|
|
3
|
+
"version": "11.0.0-alpha.6",
|
|
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.395.0-alpha.
|
|
95
|
+
"@chevre/factory": "4.395.0-alpha.3",
|
|
96
96
|
"debug": "3.2.7",
|
|
97
97
|
"http-status": "1.7.4",
|
|
98
98
|
"idtoken-verifier": "2.0.3",
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// tslint:disable:no-console no-implicit-dependencies no-magic-numbers
|
|
2
|
-
import * as httpStatus from 'http-status';
|
|
3
|
-
|
|
4
|
-
import * as client from '../../../lib/index';
|
|
5
|
-
|
|
6
|
-
const eventId = '220406001001010900';
|
|
7
|
-
|
|
8
|
-
// tslint:disable-next-line:max-func-body-length
|
|
9
|
-
async function main() {
|
|
10
|
-
const auth = await client.auth.ClientCredentials.createInstance({
|
|
11
|
-
domain: <string>process.env.ST_AUTHORIZE_SERVER_DOMAIN,
|
|
12
|
-
clientId: <string>process.env.ST_CLIENT_ID,
|
|
13
|
-
clientSecret: <string>process.env.ST_CLIENT_SECRET,
|
|
14
|
-
scopes: [],
|
|
15
|
-
state: 'teststate'
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const sellerService = new (await client.loadService()).Seller({
|
|
19
|
-
endpoint: <string>process.env.ST_API_ENDPOINT,
|
|
20
|
-
auth: auth,
|
|
21
|
-
project: { id: '' }
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
console.log('座席を検索しています...');
|
|
25
|
-
const searchResult = await sellerService.fetch({
|
|
26
|
-
uri: `/events/ScreeningEvent/${eventId}/seats`,
|
|
27
|
-
method: 'GET',
|
|
28
|
-
qs: {
|
|
29
|
-
limit: 10
|
|
30
|
-
},
|
|
31
|
-
expectedStatusCodes: [httpStatus.OK]
|
|
32
|
-
})
|
|
33
|
-
.then(async (response) => {
|
|
34
|
-
return {
|
|
35
|
-
data: await response.json()
|
|
36
|
-
};
|
|
37
|
-
});
|
|
38
|
-
console.log(searchResult.data);
|
|
39
|
-
console.log(searchResult.data.length);
|
|
40
|
-
console.log(searchResult.data[0]?.offers);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
main()
|
|
44
|
-
.then(() => {
|
|
45
|
-
console.log('main processed.');
|
|
46
|
-
})
|
|
47
|
-
.catch((err) => {
|
|
48
|
-
console.error(err);
|
|
49
|
-
});
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// tslint:disable:no-console no-implicit-dependencies no-magic-numbers
|
|
2
|
-
import * as httpStatus from 'http-status';
|
|
3
|
-
import * as moment from 'moment';
|
|
4
|
-
|
|
5
|
-
import * as client from '../../../lib/index';
|
|
6
|
-
|
|
7
|
-
// tslint:disable-next-line:max-func-body-length
|
|
8
|
-
async function main() {
|
|
9
|
-
const auth = await client.auth.ClientCredentials.createInstance({
|
|
10
|
-
domain: <string>process.env.ST_AUTHORIZE_SERVER_DOMAIN,
|
|
11
|
-
clientId: <string>process.env.ST_CLIENT_ID,
|
|
12
|
-
clientSecret: <string>process.env.ST_CLIENT_SECRET,
|
|
13
|
-
scopes: [],
|
|
14
|
-
state: 'teststate'
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
const sellerService = new (await client.loadService()).Seller({
|
|
18
|
-
endpoint: <string>process.env.ST_API_ENDPOINT,
|
|
19
|
-
auth: auth,
|
|
20
|
-
project: { id: '' }
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
console.log('イベントを検索しています...');
|
|
24
|
-
const searchResult = await sellerService.fetch({
|
|
25
|
-
uri: '/events/ScreeningEvent',
|
|
26
|
-
method: 'GET',
|
|
27
|
-
qs: {
|
|
28
|
-
limit: 100,
|
|
29
|
-
startFrom: new Date(),
|
|
30
|
-
startThrough: moment()
|
|
31
|
-
.add(1, 'days')
|
|
32
|
-
.toDate()
|
|
33
|
-
},
|
|
34
|
-
expectedStatusCodes: [httpStatus.OK]
|
|
35
|
-
})
|
|
36
|
-
.then(async (response) => response.json());
|
|
37
|
-
console.log(searchResult);
|
|
38
|
-
console.log(searchResult.length);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
main()
|
|
42
|
-
.then(() => {
|
|
43
|
-
console.log('main processed.');
|
|
44
|
-
})
|
|
45
|
-
.catch((err) => {
|
|
46
|
-
console.error(err);
|
|
47
|
-
});
|