@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
package/package.json
CHANGED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { IPaymentServiceWithoutCredentials, IProductModel, IProductWithoutCredentials, ISearchProductModelConditions } from '../../chevre/product';
|
|
2
|
-
import * as factory from '../../factory';
|
|
3
|
-
import { IAdditionalOptions, IOptions, Service } from '../../service';
|
|
4
|
-
declare type ISearchProductsResult = IProductWithoutCredentials | IPaymentServiceWithoutCredentials;
|
|
5
|
-
/**
|
|
6
|
-
* プロダクトサービス
|
|
7
|
-
*/
|
|
8
|
-
export declare class ProductService extends Service {
|
|
9
|
-
constructor(options: IAdditionalOptions & Pick<IOptions, 'auth' | 'endpoint' | 'transporter' | 'project' | 'defaultPath'>);
|
|
10
|
-
/**
|
|
11
|
-
* プロダクトタイプ指定で検索する
|
|
12
|
-
*/
|
|
13
|
-
search(params: Omit<factory.product.ISearchConditions, 'project' | 'typeOf'> & {
|
|
14
|
-
typeOf: {
|
|
15
|
-
/**
|
|
16
|
-
* プロダクトタイプ
|
|
17
|
-
*/
|
|
18
|
-
$eq: factory.product.ProductType.EventService | factory.product.ProductType.Product | factory.product.ProductType.MembershipService | factory.product.ProductType.PaymentCard | factory.service.paymentService.PaymentServiceType.CreditCard;
|
|
19
|
-
};
|
|
20
|
-
}): Promise<{
|
|
21
|
-
data: ISearchProductsResult[];
|
|
22
|
-
}>;
|
|
23
|
-
/**
|
|
24
|
-
* プロダクトオファー検索
|
|
25
|
-
*/
|
|
26
|
-
searchOffers(params: {
|
|
27
|
-
limit?: number;
|
|
28
|
-
page?: number;
|
|
29
|
-
itemOffered: {
|
|
30
|
-
id: string;
|
|
31
|
-
};
|
|
32
|
-
seller?: {
|
|
33
|
-
id: string;
|
|
34
|
-
};
|
|
35
|
-
}): Promise<Omit<factory.product.ITicketOffer, 'availableAtOrFrom'>[]>;
|
|
36
|
-
/**
|
|
37
|
-
* 座席モデル検索
|
|
38
|
-
*/
|
|
39
|
-
searchProductModels(params: ISearchProductModelConditions): Promise<IProductModel[]>;
|
|
40
|
-
}
|
|
41
|
-
export {};
|
|
@@ -1,144 +0,0 @@
|
|
|
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 __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
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
38
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
39
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
40
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
41
|
-
function step(op) {
|
|
42
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
43
|
-
while (_) try {
|
|
44
|
-
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;
|
|
45
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
46
|
-
switch (op[0]) {
|
|
47
|
-
case 0: case 1: t = op; break;
|
|
48
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
49
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
50
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
51
|
-
default:
|
|
52
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
53
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
54
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
55
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
56
|
-
if (t[2]) _.ops.pop();
|
|
57
|
-
_.trys.pop(); continue;
|
|
58
|
-
}
|
|
59
|
-
op = body.call(thisArg, _);
|
|
60
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
61
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
-
exports.ProductService = void 0;
|
|
66
|
-
var http_status_1 = require("http-status");
|
|
67
|
-
var service_1 = require("../../service");
|
|
68
|
-
/**
|
|
69
|
-
* プロダクトサービス
|
|
70
|
-
*/
|
|
71
|
-
var ProductService = /** @class */ (function (_super) {
|
|
72
|
-
__extends(ProductService, _super);
|
|
73
|
-
function ProductService(options) {
|
|
74
|
-
return _super.call(this, __assign(__assign({}, options), { retryableStatusCodes: [http_status_1.BAD_GATEWAY, http_status_1.FORBIDDEN, http_status_1.UNAUTHORIZED] })) || this;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* プロダクトタイプ指定で検索する
|
|
78
|
-
*/
|
|
79
|
-
ProductService.prototype.search = function (params) {
|
|
80
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
81
|
-
var _this = this;
|
|
82
|
-
return __generator(this, function (_a) {
|
|
83
|
-
return [2 /*return*/, this.fetch({
|
|
84
|
-
uri: '/products',
|
|
85
|
-
method: 'GET',
|
|
86
|
-
qs: params,
|
|
87
|
-
expectedStatusCodes: [http_status_1.OK]
|
|
88
|
-
})
|
|
89
|
-
.then(function (response) { return __awaiter(_this, void 0, void 0, function () {
|
|
90
|
-
var _a;
|
|
91
|
-
return __generator(this, function (_b) {
|
|
92
|
-
switch (_b.label) {
|
|
93
|
-
case 0:
|
|
94
|
-
_a = {};
|
|
95
|
-
return [4 /*yield*/, response.json()];
|
|
96
|
-
case 1: return [2 /*return*/, (_a.data = _b.sent(),
|
|
97
|
-
_a)];
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}); })];
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* プロダクトオファー検索
|
|
106
|
-
*/
|
|
107
|
-
ProductService.prototype.searchOffers = function (params) {
|
|
108
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
109
|
-
var _this = this;
|
|
110
|
-
return __generator(this, function (_a) {
|
|
111
|
-
return [2 /*return*/, this.fetch({
|
|
112
|
-
uri: "/products/" + params.itemOffered.id + "/offers",
|
|
113
|
-
method: 'GET',
|
|
114
|
-
expectedStatusCodes: [http_status_1.OK],
|
|
115
|
-
qs: params
|
|
116
|
-
})
|
|
117
|
-
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
118
|
-
return [2 /*return*/, response.json()];
|
|
119
|
-
}); }); })];
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
};
|
|
123
|
-
/**
|
|
124
|
-
* 座席モデル検索
|
|
125
|
-
*/
|
|
126
|
-
ProductService.prototype.searchProductModels = function (params) {
|
|
127
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
128
|
-
var _this = this;
|
|
129
|
-
return __generator(this, function (_a) {
|
|
130
|
-
return [2 /*return*/, this.fetch({
|
|
131
|
-
uri: '/productModels',
|
|
132
|
-
method: 'GET',
|
|
133
|
-
qs: params,
|
|
134
|
-
expectedStatusCodes: [http_status_1.OK]
|
|
135
|
-
})
|
|
136
|
-
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
137
|
-
return [2 /*return*/, response.json()];
|
|
138
|
-
}); }); })];
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
};
|
|
142
|
-
return ProductService;
|
|
143
|
-
}(service_1.Service));
|
|
144
|
-
exports.ProductService = ProductService;
|