@cinerino/sdk 11.2.0-alpha.2 → 11.2.0-alpha.4
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 +397 -551
- package/example/src/cloud/search/findProducts.ts +2 -2
- package/example/src/searchMovies.ts +32 -0
- package/lib/abstract/chevre/product.d.ts +16 -14
- package/lib/abstract/chevre/product.js +25 -23
- package/lib/abstract/cinerino/default.d.ts +0 -6
- package/lib/abstract/cinerino/default.js +0 -12
- package/lib/abstract/cinerino/service/creativeWork.d.ts +1 -1
- package/lib/abstract/cloud/search/product.d.ts +3 -12
- package/lib/abstract/cloud/search/product.js +4 -2
- package/lib/bundle.js +399 -553
- package/package.json +1 -1
- package/lib/abstract/cinerino/service/product.d.ts +0 -41
- package/lib/abstract/cinerino/service/product.js +0 -144
|
@@ -15,9 +15,9 @@ async function main() {
|
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
const result = await productService.search({
|
|
18
|
-
limit:
|
|
18
|
+
limit: 2,
|
|
19
19
|
page: 1,
|
|
20
|
-
typeOf:
|
|
20
|
+
typeOf: factory.product.ProductType.EventService
|
|
21
21
|
});
|
|
22
22
|
console.log(result);
|
|
23
23
|
console.log(result.length, 'data found');
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// tslint:disable:no-implicit-dependencies no-console
|
|
2
|
+
import * as client from '../../lib/index';
|
|
3
|
+
import { auth } from './auth/clientCredentials';
|
|
4
|
+
|
|
5
|
+
const PROJECT_ID = String(process.env.PROJECT_ID);
|
|
6
|
+
|
|
7
|
+
async function main() {
|
|
8
|
+
const creativeWorkService = new (await client.loadService()).CreativeWork({
|
|
9
|
+
endpoint: <string>process.env.API_ENDPOINT,
|
|
10
|
+
auth: await auth(),
|
|
11
|
+
project: { id: PROJECT_ID },
|
|
12
|
+
seller: { id: '' }
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const { data } = await creativeWorkService.searchMovies({
|
|
16
|
+
limit: 3,
|
|
17
|
+
page: 1,
|
|
18
|
+
sort: {
|
|
19
|
+
identifier: client.factory.sortType.Descending
|
|
20
|
+
},
|
|
21
|
+
identifier: { $in: ['00001', '00002'] }
|
|
22
|
+
});
|
|
23
|
+
// tslint:disable-next-line:no-null-keyword
|
|
24
|
+
console.dir(data, { depth: null });
|
|
25
|
+
console.log(data.length, 'movies');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
main()
|
|
29
|
+
.then(() => {
|
|
30
|
+
console.log('success!');
|
|
31
|
+
})
|
|
32
|
+
.catch(console.error);
|
|
@@ -3,9 +3,6 @@ import { Service } from '../service';
|
|
|
3
3
|
export declare type IProductWithoutCredentials = Pick<factory.product.IProduct, 'description' | 'name' | 'productID' | 'serviceType' | 'typeOf'> & {
|
|
4
4
|
id: string;
|
|
5
5
|
};
|
|
6
|
-
export declare type IPaymentServiceWithoutCredentials = Omit<factory.service.paymentService.IService, 'availableChannel' | 'project'> & {
|
|
7
|
-
id: string;
|
|
8
|
-
};
|
|
9
6
|
declare type IPriceComponent = Pick<factory.place.seat.IPriceComponent, 'name' | 'price'>;
|
|
10
7
|
interface IPriceSpecification {
|
|
11
8
|
/**
|
|
@@ -44,19 +41,24 @@ export interface ISearchProductModelConditions {
|
|
|
44
41
|
};
|
|
45
42
|
}
|
|
46
43
|
/**
|
|
47
|
-
*
|
|
44
|
+
* プロダクト検索条件
|
|
45
|
+
*/
|
|
46
|
+
export interface IFindParams {
|
|
47
|
+
typeOf: factory.product.ProductType;
|
|
48
|
+
/**
|
|
49
|
+
* max: 100
|
|
50
|
+
*/
|
|
51
|
+
limit: number;
|
|
52
|
+
page: number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* プロダクト(興行、アドオンなど)サービス
|
|
48
56
|
*/
|
|
49
57
|
export declare class ProductService extends Service {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}): Promise<IProductWithoutCredentials[]>;
|
|
55
|
-
searchPaymentServices(params: Omit<factory.product.ISearchConditions, 'project' | 'typeOf'> & {
|
|
56
|
-
typeOf: {
|
|
57
|
-
$eq: factory.service.paymentService.PaymentServiceType.CreditCard;
|
|
58
|
-
};
|
|
59
|
-
}): Promise<IPaymentServiceWithoutCredentials[]>;
|
|
58
|
+
/**
|
|
59
|
+
* プロダクトタイプ指定でプロダクトを検索する
|
|
60
|
+
*/
|
|
61
|
+
findProducts(params: IFindParams): Promise<IProductWithoutCredentials[]>;
|
|
60
62
|
/**
|
|
61
63
|
* オファー検索
|
|
62
64
|
*/
|
|
@@ -66,41 +66,26 @@ exports.ProductService = void 0;
|
|
|
66
66
|
var http_status_1 = require("http-status");
|
|
67
67
|
var service_1 = require("../service");
|
|
68
68
|
/**
|
|
69
|
-
*
|
|
69
|
+
* プロダクト(興行、アドオンなど)サービス
|
|
70
70
|
*/
|
|
71
71
|
var ProductService = /** @class */ (function (_super) {
|
|
72
72
|
__extends(ProductService, _super);
|
|
73
73
|
function ProductService() {
|
|
74
74
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
75
75
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
var _this = this;
|
|
81
|
-
return __generator(this, function (_a) {
|
|
82
|
-
return [2 /*return*/, this.fetch({
|
|
83
|
-
uri: '/products',
|
|
84
|
-
method: 'GET',
|
|
85
|
-
qs: params,
|
|
86
|
-
expectedStatusCodes: [http_status_1.OK]
|
|
87
|
-
})
|
|
88
|
-
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
89
|
-
return [2 /*return*/, response.json()];
|
|
90
|
-
}); }); })];
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
ProductService.prototype.searchPaymentServices = function (params
|
|
95
|
-
// & IProjectionSearchConditions // discontinue(2024-10-21~)
|
|
96
|
-
) {
|
|
76
|
+
/**
|
|
77
|
+
* プロダクトタイプ指定でプロダクトを検索する
|
|
78
|
+
*/
|
|
79
|
+
ProductService.prototype.findProducts = function (params) {
|
|
97
80
|
return __awaiter(this, void 0, void 0, function () {
|
|
81
|
+
var typeOf, limit, page;
|
|
98
82
|
var _this = this;
|
|
99
83
|
return __generator(this, function (_a) {
|
|
84
|
+
typeOf = params.typeOf, limit = params.limit, page = params.page;
|
|
100
85
|
return [2 /*return*/, this.fetch({
|
|
101
86
|
uri: '/products',
|
|
102
87
|
method: 'GET',
|
|
103
|
-
qs:
|
|
88
|
+
qs: { typeOf: typeOf, limit: limit, page: page },
|
|
104
89
|
expectedStatusCodes: [http_status_1.OK]
|
|
105
90
|
})
|
|
106
91
|
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
@@ -109,6 +94,23 @@ var ProductService = /** @class */ (function (_super) {
|
|
|
109
94
|
});
|
|
110
95
|
});
|
|
111
96
|
};
|
|
97
|
+
// discontinue(2025-08-20~)
|
|
98
|
+
// public async searchPaymentServices(params: Omit<factory.product.ISearchConditions, 'project' | 'typeOf'> & {
|
|
99
|
+
// // 必須化(2023-12-18~)
|
|
100
|
+
// typeOf: {
|
|
101
|
+
// $eq: factory.service.paymentService.PaymentServiceType.CreditCard;
|
|
102
|
+
// };
|
|
103
|
+
// }
|
|
104
|
+
// // & IProjectionSearchConditions // discontinue(2024-10-21~)
|
|
105
|
+
// ): Promise<IPaymentServiceWithoutCredentials[]> {
|
|
106
|
+
// return this.fetch({
|
|
107
|
+
// uri: '/products',
|
|
108
|
+
// method: 'GET',
|
|
109
|
+
// qs: params,
|
|
110
|
+
// expectedStatusCodes: [OK]
|
|
111
|
+
// })
|
|
112
|
+
// .then(async (response) => response.json());
|
|
113
|
+
// }
|
|
112
114
|
/**
|
|
113
115
|
* オファー検索
|
|
114
116
|
*/
|
|
@@ -8,7 +8,6 @@ import { EmailMessageService } from './service/emailMessage';
|
|
|
8
8
|
import { EventService } from './service/event';
|
|
9
9
|
import { PlaceService } from './service/place';
|
|
10
10
|
import { HasPOSService } from './service/place/hasPOS';
|
|
11
|
-
import { ProductService } from './service/product';
|
|
12
11
|
import { SellerService } from './service/seller';
|
|
13
12
|
/**
|
|
14
13
|
* パブリックリソースサービス群
|
|
@@ -54,11 +53,6 @@ export declare namespace service {
|
|
|
54
53
|
class HasPOS extends HasPOSService {
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
|
-
/**
|
|
58
|
-
* プロダクトサービス
|
|
59
|
-
*/
|
|
60
|
-
class Product extends ProductService {
|
|
61
|
-
}
|
|
62
56
|
/**
|
|
63
57
|
* 販売者サービス
|
|
64
58
|
*/
|
|
@@ -28,7 +28,6 @@ var emailMessage_1 = require("./service/emailMessage");
|
|
|
28
28
|
var event_1 = require("./service/event");
|
|
29
29
|
var place_1 = require("./service/place");
|
|
30
30
|
var hasPOS_1 = require("./service/place/hasPOS");
|
|
31
|
-
var product_1 = require("./service/product");
|
|
32
31
|
var seller_1 = require("./service/seller");
|
|
33
32
|
/**
|
|
34
33
|
* パブリックリソースサービス群
|
|
@@ -115,17 +114,6 @@ var service;
|
|
|
115
114
|
}(hasPOS_1.HasPOSService));
|
|
116
115
|
place.HasPOS = HasPOS;
|
|
117
116
|
})(place = service.place || (service.place = {}));
|
|
118
|
-
/**
|
|
119
|
-
* プロダクトサービス
|
|
120
|
-
*/
|
|
121
|
-
var Product = /** @class */ (function (_super) {
|
|
122
|
-
__extends(Product, _super);
|
|
123
|
-
function Product() {
|
|
124
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
125
|
-
}
|
|
126
|
-
return Product;
|
|
127
|
-
}(product_1.ProductService));
|
|
128
|
-
service.Product = Product;
|
|
129
117
|
/**
|
|
130
118
|
* 販売者サービス
|
|
131
119
|
*/
|
|
@@ -8,5 +8,5 @@ export declare class CreativeWorkService extends Service {
|
|
|
8
8
|
/**
|
|
9
9
|
* コンテンツ検索
|
|
10
10
|
*/
|
|
11
|
-
searchMovies(params:
|
|
11
|
+
searchMovies(params: Pick<factory.creativeWork.movie.ISearchConditions, 'identifier' | 'limit' | 'page' | 'sort'>): Promise<ISearchResult<Omit<factory.creativeWork.movie.ICreativeWork, 'offers' | 'project'>[]>>;
|
|
12
12
|
}
|
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IFindParams, IProductModel, IProductWithoutCredentials, ISearchProductModelConditions } from '../../chevre/product';
|
|
2
2
|
import * as factory from '../../factory';
|
|
3
3
|
import { Service } from '../../service';
|
|
4
|
-
declare type ISearchProductsResult = IProductWithoutCredentials | IPaymentServiceWithoutCredentials;
|
|
5
4
|
/**
|
|
6
5
|
* プロダクトサービス
|
|
7
6
|
*/
|
|
8
7
|
export declare class ProductService extends Service {
|
|
9
8
|
/**
|
|
10
|
-
*
|
|
9
|
+
* プロダクトタイプ指定でプロダクトを検索する
|
|
11
10
|
*/
|
|
12
|
-
search(params:
|
|
13
|
-
typeOf: {
|
|
14
|
-
/**
|
|
15
|
-
* プロダクトタイプ
|
|
16
|
-
*/
|
|
17
|
-
$eq: factory.product.ProductType.EventService | factory.product.ProductType.Product | factory.product.ProductType.MembershipService | factory.product.ProductType.PaymentCard;
|
|
18
|
-
};
|
|
19
|
-
}): Promise<ISearchProductsResult[]>;
|
|
11
|
+
search(params: IFindParams): Promise<IProductWithoutCredentials[]>;
|
|
20
12
|
/**
|
|
21
13
|
* プロダクトオファー検索
|
|
22
14
|
*/
|
|
@@ -35,4 +27,3 @@ export declare class ProductService extends Service {
|
|
|
35
27
|
*/
|
|
36
28
|
searchProductModels(params: ISearchProductModelConditions): Promise<IProductModel[]>;
|
|
37
29
|
}
|
|
38
|
-
export {};
|
|
@@ -66,16 +66,18 @@ var ProductService = /** @class */ (function (_super) {
|
|
|
66
66
|
// super({ ...options, retryableStatusCodes: [BAD_GATEWAY, FORBIDDEN, UNAUTHORIZED] });
|
|
67
67
|
// }
|
|
68
68
|
/**
|
|
69
|
-
*
|
|
69
|
+
* プロダクトタイプ指定でプロダクトを検索する
|
|
70
70
|
*/
|
|
71
71
|
ProductService.prototype.search = function (params) {
|
|
72
72
|
return __awaiter(this, void 0, void 0, function () {
|
|
73
|
+
var typeOf, limit, page;
|
|
73
74
|
var _this = this;
|
|
74
75
|
return __generator(this, function (_a) {
|
|
76
|
+
typeOf = params.typeOf, limit = params.limit, page = params.page;
|
|
75
77
|
return [2 /*return*/, this.fetch({
|
|
76
78
|
uri: '/products',
|
|
77
79
|
method: 'GET',
|
|
78
|
-
qs:
|
|
80
|
+
qs: { typeOf: typeOf, limit: limit, page: page },
|
|
79
81
|
expectedStatusCodes: [http_status_1.OK]
|
|
80
82
|
})
|
|
81
83
|
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|