@cinerino/sdk 5.4.0 → 5.5.0-alpha.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.
@@ -18,7 +18,11 @@ export declare class ProductService extends Service {
18
18
  /**
19
19
  * 検索
20
20
  */
21
- search(params: Omit<factory.product.ISearchConditions, 'project'> & IProjectionSearchConditions): Promise<{
21
+ search(params: Omit<factory.product.ISearchConditions, 'project'> & {
22
+ typeOf: {
23
+ $eq: string;
24
+ };
25
+ } & IProjectionSearchConditions): Promise<{
22
26
  data: ISearchProductsResult[];
23
27
  }>;
24
28
  /**
@@ -1,6 +1,5 @@
1
1
  import * as factory from '../factory';
2
2
  import { Service } from '../service';
3
- export declare type IProduct = Omit<factory.product.IProduct, 'offers'> | Omit<factory.service.paymentService.IService, 'provider'>;
4
3
  export declare type IProductWithoutCredentials = Omit<factory.product.IProduct, 'availableChannel' | 'offers'>;
5
4
  export declare type IPaymentServiceWithoutCredentials = Omit<factory.service.paymentService.IService, 'availableChannel' | 'provider'>;
6
5
  export declare type ISearchProductsResult = IProductWithoutCredentials | IPaymentServiceWithoutCredentials;
@@ -34,21 +33,43 @@ export declare class ProductService extends Service {
34
33
  id: string;
35
34
  }>;
36
35
  /**
37
- * 検索
36
+ * プロダクト検索
38
37
  */
39
- search(params: Omit<factory.product.ISearchConditions, 'project'> & IProjectionSearchConditions): Promise<{
40
- data: ISearchProductsResult[];
38
+ searchProducts(params: Omit<factory.product.ISearchConditions, 'project'> & {
39
+ typeOf?: {
40
+ $eq?: factory.product.ProductType;
41
+ $in?: factory.product.ProductType[];
42
+ };
43
+ } & IProjectionSearchConditions): Promise<{
44
+ data: IProductWithoutCredentials[];
41
45
  }>;
42
- findById(params: {
46
+ /**
47
+ * 決済サービス検索
48
+ */
49
+ searchPaymentServices(params: Omit<factory.product.ISearchConditions, 'project'> & {
50
+ typeOf?: {
51
+ $eq?: factory.service.paymentService.PaymentServiceType;
52
+ $in?: factory.service.paymentService.PaymentServiceType[];
53
+ };
54
+ } & IProjectionSearchConditions): Promise<{
55
+ data: IPaymentServiceWithoutCredentials[];
56
+ }>;
57
+ findProductById(params: {
43
58
  id: string;
44
- } & IProjectionSearchConditions): Promise<IProduct>;
59
+ } & IProjectionSearchConditions): Promise<Omit<factory.product.IProduct, 'offers'>>;
60
+ findPaymentServiceById(params: {
61
+ id: string;
62
+ } & IProjectionSearchConditions): Promise<Omit<factory.service.paymentService.IService, 'provider'>>;
45
63
  updateProduct(params: factory.product.ICreateParams & {
46
64
  id: string;
47
65
  }): Promise<void>;
48
66
  updatePaymentService(params: Omit<factory.service.paymentService.IService, 'provider'> & {
49
67
  id: string;
50
68
  }): Promise<void>;
51
- deleteById(params: {
69
+ deleteProductById(params: {
70
+ id: string;
71
+ }): Promise<void>;
72
+ deletePaymentServiceById(params: {
52
73
  id: string;
53
74
  }): Promise<void>;
54
75
  }
@@ -100,7 +100,7 @@ var ProductService = /** @class */ (function (_super) {
100
100
  var _this = this;
101
101
  return __generator(this, function (_a) {
102
102
  return [2 /*return*/, this.fetch({
103
- uri: '/products',
103
+ uri: '/paymentServices',
104
104
  method: 'POST',
105
105
  body: params,
106
106
  expectedStatusCodes: [http_status_1.CREATED]
@@ -132,9 +132,9 @@ var ProductService = /** @class */ (function (_super) {
132
132
  });
133
133
  };
134
134
  /**
135
- * 検索
135
+ * プロダクト検索
136
136
  */
137
- ProductService.prototype.search = function (params) {
137
+ ProductService.prototype.searchProducts = function (params) {
138
138
  return __awaiter(this, void 0, void 0, function () {
139
139
  var _this = this;
140
140
  return __generator(this, function (_a) {
@@ -159,7 +159,35 @@ var ProductService = /** @class */ (function (_super) {
159
159
  });
160
160
  });
161
161
  };
162
- ProductService.prototype.findById = function (params) {
162
+ /**
163
+ * 決済サービス検索
164
+ */
165
+ ProductService.prototype.searchPaymentServices = function (params) {
166
+ return __awaiter(this, void 0, void 0, function () {
167
+ var _this = this;
168
+ return __generator(this, function (_a) {
169
+ return [2 /*return*/, this.fetch({
170
+ uri: '/paymentServices',
171
+ method: 'GET',
172
+ qs: params,
173
+ expectedStatusCodes: [http_status_1.OK]
174
+ })
175
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
176
+ var _a;
177
+ return __generator(this, function (_b) {
178
+ switch (_b.label) {
179
+ case 0:
180
+ _a = {};
181
+ return [4 /*yield*/, response.json()];
182
+ case 1: return [2 /*return*/, (_a.data = _b.sent(),
183
+ _a)];
184
+ }
185
+ });
186
+ }); })];
187
+ });
188
+ });
189
+ };
190
+ ProductService.prototype.findProductById = function (params) {
163
191
  return __awaiter(this, void 0, void 0, function () {
164
192
  var id, query;
165
193
  var _this = this;
@@ -177,6 +205,24 @@ var ProductService = /** @class */ (function (_super) {
177
205
  });
178
206
  });
179
207
  };
208
+ ProductService.prototype.findPaymentServiceById = function (params) {
209
+ return __awaiter(this, void 0, void 0, function () {
210
+ var id, query;
211
+ var _this = this;
212
+ return __generator(this, function (_a) {
213
+ id = params.id, query = __rest(params, ["id"]);
214
+ return [2 /*return*/, this.fetch({
215
+ uri: "/paymentServices/" + encodeURIComponent(String(id)),
216
+ method: 'GET',
217
+ expectedStatusCodes: [http_status_1.OK],
218
+ qs: query
219
+ })
220
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
221
+ return [2 /*return*/, response.json()];
222
+ }); }); })];
223
+ });
224
+ });
225
+ };
180
226
  ProductService.prototype.updateProduct = function (params) {
181
227
  return __awaiter(this, void 0, void 0, function () {
182
228
  return __generator(this, function (_a) {
@@ -199,7 +245,7 @@ var ProductService = /** @class */ (function (_super) {
199
245
  return __generator(this, function (_a) {
200
246
  switch (_a.label) {
201
247
  case 0: return [4 /*yield*/, this.fetch({
202
- uri: "/products/" + encodeURIComponent(String(params.id)),
248
+ uri: "/paymentServices/" + encodeURIComponent(String(params.id)),
203
249
  method: 'PUT',
204
250
  body: params,
205
251
  expectedStatusCodes: [http_status_1.NO_CONTENT]
@@ -211,7 +257,7 @@ var ProductService = /** @class */ (function (_super) {
211
257
  });
212
258
  });
213
259
  };
214
- ProductService.prototype.deleteById = function (params) {
260
+ ProductService.prototype.deleteProductById = function (params) {
215
261
  return __awaiter(this, void 0, void 0, function () {
216
262
  return __generator(this, function (_a) {
217
263
  switch (_a.label) {
@@ -227,6 +273,22 @@ var ProductService = /** @class */ (function (_super) {
227
273
  });
228
274
  });
229
275
  };
276
+ ProductService.prototype.deletePaymentServiceById = function (params) {
277
+ return __awaiter(this, void 0, void 0, function () {
278
+ return __generator(this, function (_a) {
279
+ switch (_a.label) {
280
+ case 0: return [4 /*yield*/, this.fetch({
281
+ uri: "/paymentServices/" + encodeURIComponent(String(params.id)),
282
+ method: 'DELETE',
283
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
284
+ })];
285
+ case 1:
286
+ _a.sent();
287
+ return [2 /*return*/];
288
+ }
289
+ });
290
+ });
291
+ };
230
292
  return ProductService;
231
293
  }(service_1.Service));
232
294
  exports.ProductService = ProductService;
@@ -8,7 +8,14 @@ export declare class ProductService extends Service {
8
8
  /**
9
9
  * 検索
10
10
  */
11
- search(params: Omit<factory.product.ISearchConditions, 'project'>): Promise<{
11
+ search(params: Omit<factory.product.ISearchConditions, 'project'> & {
12
+ typeOf: {
13
+ /**
14
+ * プロダクトタイプあるいは決済サービスタイプ
15
+ */
16
+ $eq: string;
17
+ };
18
+ }): Promise<{
12
19
  data: ISearchProductsResult[];
13
20
  }>;
14
21
  /**
package/lib/bundle.js CHANGED
@@ -10890,7 +10890,7 @@ var ProductService = /** @class */ (function (_super) {
10890
10890
  var _this = this;
10891
10891
  return __generator(this, function (_a) {
10892
10892
  return [2 /*return*/, this.fetch({
10893
- uri: '/products',
10893
+ uri: '/paymentServices',
10894
10894
  method: 'POST',
10895
10895
  body: params,
10896
10896
  expectedStatusCodes: [http_status_1.CREATED]
@@ -10922,9 +10922,9 @@ var ProductService = /** @class */ (function (_super) {
10922
10922
  });
10923
10923
  };
10924
10924
  /**
10925
- * 検索
10925
+ * プロダクト検索
10926
10926
  */
10927
- ProductService.prototype.search = function (params) {
10927
+ ProductService.prototype.searchProducts = function (params) {
10928
10928
  return __awaiter(this, void 0, void 0, function () {
10929
10929
  var _this = this;
10930
10930
  return __generator(this, function (_a) {
@@ -10949,7 +10949,35 @@ var ProductService = /** @class */ (function (_super) {
10949
10949
  });
10950
10950
  });
10951
10951
  };
10952
- ProductService.prototype.findById = function (params) {
10952
+ /**
10953
+ * 決済サービス検索
10954
+ */
10955
+ ProductService.prototype.searchPaymentServices = function (params) {
10956
+ return __awaiter(this, void 0, void 0, function () {
10957
+ var _this = this;
10958
+ return __generator(this, function (_a) {
10959
+ return [2 /*return*/, this.fetch({
10960
+ uri: '/paymentServices',
10961
+ method: 'GET',
10962
+ qs: params,
10963
+ expectedStatusCodes: [http_status_1.OK]
10964
+ })
10965
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
10966
+ var _a;
10967
+ return __generator(this, function (_b) {
10968
+ switch (_b.label) {
10969
+ case 0:
10970
+ _a = {};
10971
+ return [4 /*yield*/, response.json()];
10972
+ case 1: return [2 /*return*/, (_a.data = _b.sent(),
10973
+ _a)];
10974
+ }
10975
+ });
10976
+ }); })];
10977
+ });
10978
+ });
10979
+ };
10980
+ ProductService.prototype.findProductById = function (params) {
10953
10981
  return __awaiter(this, void 0, void 0, function () {
10954
10982
  var id, query;
10955
10983
  var _this = this;
@@ -10967,6 +10995,24 @@ var ProductService = /** @class */ (function (_super) {
10967
10995
  });
10968
10996
  });
10969
10997
  };
10998
+ ProductService.prototype.findPaymentServiceById = function (params) {
10999
+ return __awaiter(this, void 0, void 0, function () {
11000
+ var id, query;
11001
+ var _this = this;
11002
+ return __generator(this, function (_a) {
11003
+ id = params.id, query = __rest(params, ["id"]);
11004
+ return [2 /*return*/, this.fetch({
11005
+ uri: "/paymentServices/" + encodeURIComponent(String(id)),
11006
+ method: 'GET',
11007
+ expectedStatusCodes: [http_status_1.OK],
11008
+ qs: query
11009
+ })
11010
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
11011
+ return [2 /*return*/, response.json()];
11012
+ }); }); })];
11013
+ });
11014
+ });
11015
+ };
10970
11016
  ProductService.prototype.updateProduct = function (params) {
10971
11017
  return __awaiter(this, void 0, void 0, function () {
10972
11018
  return __generator(this, function (_a) {
@@ -10989,7 +11035,7 @@ var ProductService = /** @class */ (function (_super) {
10989
11035
  return __generator(this, function (_a) {
10990
11036
  switch (_a.label) {
10991
11037
  case 0: return [4 /*yield*/, this.fetch({
10992
- uri: "/products/" + encodeURIComponent(String(params.id)),
11038
+ uri: "/paymentServices/" + encodeURIComponent(String(params.id)),
10993
11039
  method: 'PUT',
10994
11040
  body: params,
10995
11041
  expectedStatusCodes: [http_status_1.NO_CONTENT]
@@ -11001,7 +11047,7 @@ var ProductService = /** @class */ (function (_super) {
11001
11047
  });
11002
11048
  });
11003
11049
  };
11004
- ProductService.prototype.deleteById = function (params) {
11050
+ ProductService.prototype.deleteProductById = function (params) {
11005
11051
  return __awaiter(this, void 0, void 0, function () {
11006
11052
  return __generator(this, function (_a) {
11007
11053
  switch (_a.label) {
@@ -11017,6 +11063,22 @@ var ProductService = /** @class */ (function (_super) {
11017
11063
  });
11018
11064
  });
11019
11065
  };
11066
+ ProductService.prototype.deletePaymentServiceById = function (params) {
11067
+ return __awaiter(this, void 0, void 0, function () {
11068
+ return __generator(this, function (_a) {
11069
+ switch (_a.label) {
11070
+ case 0: return [4 /*yield*/, this.fetch({
11071
+ uri: "/paymentServices/" + encodeURIComponent(String(params.id)),
11072
+ method: 'DELETE',
11073
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
11074
+ })];
11075
+ case 1:
11076
+ _a.sent();
11077
+ return [2 /*return*/];
11078
+ }
11079
+ });
11080
+ });
11081
+ };
11020
11082
  return ProductService;
11021
11083
  }(service_1.Service));
11022
11084
  exports.ProductService = ProductService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "5.4.0",
3
+ "version": "5.5.0-alpha.0",
4
4
  "description": "Cinerino SDK",
5
5
  "main": "./lib/index.js",
6
6
  "browser": {
@@ -96,7 +96,7 @@
96
96
  "watchify": "^3.11.1"
97
97
  },
98
98
  "dependencies": {
99
- "@chevre/factory": "4.347.0-alpha.11",
99
+ "@chevre/factory": "4.347.0-alpha.12",
100
100
  "debug": "^3.2.6",
101
101
  "http-status": "^1.4.2",
102
102
  "idtoken-verifier": "^2.0.3",