@cinerino/sdk 12.5.0-alpha.7 → 12.5.0-alpha.8

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.
@@ -10,6 +10,3 @@ export declare type IPaymentServiceByProvider = Pick<factory.service.paymentServ
10
10
  */
11
11
  export declare type ISearchPaymentServiceConditions = Pick<factory.service.paymentService.ISearchConditions, 'limit' | 'page' | 'sort' | 'typeOf'>;
12
12
  export declare type IPaymentAccepted = Pick<factory.categoryCode.ICategoryCode, 'codeValue' | 'additionalProperty' | 'color' | 'image' | 'name'>;
13
- export declare type IMakesProductOffer = Pick<factory.product.IOffer, 'availabilityEnds' | 'availabilityStarts' | 'seller' | 'validFrom' | 'validThrough'> & {
14
- itemOffered: Pick<factory.product.IProduct, 'id' | 'name' | 'typeOf'>;
15
- };
@@ -1,2 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ // export type IMakesProductOffer = Pick<
4
+ // factory.product.IOffer,
5
+ // 'availabilityEnds' | 'availabilityStarts' | 'seller' | 'validFrom' | 'validThrough'
6
+ // > & {
7
+ // itemOffered: Pick<factory.product.IProduct, 'id' | 'name' | 'typeOf'>;
8
+ // };
@@ -1,16 +1,25 @@
1
1
  import * as factory from '../factory';
2
2
  import { Service } from '../service';
3
- export declare type IProductWithoutCredentials = Pick<factory.product.IProduct, 'additionalProperty' | 'description' | 'hasOfferCatalog' | 'id' | 'name' | 'productID' | 'project' | 'serviceOutput' | 'serviceType' | 'typeOf'>;
3
+ export declare type IProductWithoutCredentials = Pick<factory.product.IProduct, 'additionalProperty' | 'description' | 'hasOfferCatalog' | 'id' | 'name' | 'productID' | 'serviceOutput' | 'serviceType' | 'typeOf'>;
4
4
  export declare type IProductAsFindResult = IProductWithoutCredentials & {
5
5
  id: string;
6
+ project?: never;
6
7
  };
7
8
  export declare type IProductAsFindByIdResult = factory.product.IProduct & {
8
9
  id: string;
9
10
  };
10
- declare type IKeyOfProjection = keyof factory.product.IProduct | '_id';
11
- declare type IProjection = {
11
+ declare type IFindKeyOfProjection = 'typeOf' | 'additionalProperty' | 'description' | 'hasOfferCatalog' | 'name' | 'productID' | 'serviceOutput' | 'serviceType';
12
+ declare type IFindProjection = {
13
+ [key in IFindKeyOfProjection]?: 1;
14
+ };
15
+ declare type IKeyOfProjection = keyof factory.product.IProduct;
16
+ declare type IFindByIdProjection = {
12
17
  [key in IKeyOfProjection]?: 1;
13
18
  };
19
+ export declare type IFindParams = Pick<factory.product.ISearchConditions, 'additionalPropertyMatch' | 'hasOfferCatalog' | 'id' | 'limit' | 'name' | 'page' | 'productID' | 'serviceOutput' | 'serviceType' | 'sort' | 'typeOf'> & {
20
+ $projection?: IFindProjection;
21
+ offers?: never;
22
+ };
14
23
  /**
15
24
  * プロダクトサービス
16
25
  */
@@ -31,13 +40,11 @@ export declare class ProductService extends Service {
31
40
  * プロダクト検索
32
41
  * 公開属性のみ
33
42
  */
34
- findProducts(params: Omit<factory.product.ISearchConditions, 'project'> & {
35
- $projection?: IProjection;
36
- }): Promise<IProductAsFindResult[]>;
43
+ findProducts(params: IFindParams): Promise<IProductAsFindResult[]>;
37
44
  findProductById(params: {
38
45
  id: string;
39
46
  } & {
40
- $projection?: IProjection;
47
+ $projection?: IFindByIdProjection;
41
48
  }): Promise<IProductAsFindByIdResult>;
42
49
  updateProduct(params: factory.product.ICreateParams & {
43
50
  id: string;
@@ -9,6 +9,3 @@ export declare type IProvidePaymentService = Pick<factory.service.paymentService
9
9
  provider: Pick<factory.service.paymentService.IProvider, 'id' | 'credentials'>;
10
10
  };
11
11
  export declare type IPaymentAccepted = Pick<factory.categoryCode.ICategoryCode, 'codeValue' | 'additionalProperty' | 'color' | 'image' | 'name'>;
12
- export declare type IMakesProductOffer = Pick<factory.product.IOffer, 'availabilityEnds' | 'availabilityStarts' | 'seller' | 'validFrom' | 'validThrough'> & {
13
- itemOffered: Pick<factory.product.IProduct, 'id' | 'name' | 'typeOf'>;
14
- };
@@ -1,2 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ // export type IMakesProductOffer = Pick<
4
+ // factory.product.IOffer,
5
+ // 'availabilityEnds' | 'availabilityStarts' | 'seller' | 'validFrom' | 'validThrough'
6
+ // > & {
7
+ // itemOffered: Pick<factory.product.IProduct, 'id' | 'name' | 'typeOf'>;
8
+ // };
@@ -1,6 +1,6 @@
1
1
  import * as factory from '../factory';
2
2
  import { IOptions, ISearchResult, IUnset, Service } from '../service';
3
- import { IMakesProductOffer, IPaymentAccepted, IProvidePaymentService } from './seller/factory';
3
+ import { IPaymentAccepted, IProvidePaymentService } from './seller/factory';
4
4
  declare type IKeyOfProjection = keyof factory.seller.ISeller;
5
5
  declare type IProjection = {
6
6
  [key in IKeyOfProjection]?: 1;
@@ -111,44 +111,6 @@ export declare class SellerService extends Service<IOptions> {
111
111
  id: string;
112
112
  provider: Pick<factory.service.paymentService.IProvider, 'id'>;
113
113
  }): Promise<void>;
114
- searchMakesProductOffer(params: {
115
- seller: {
116
- /**
117
- * 販売者ID
118
- */
119
- id: string;
120
- };
121
- /**
122
- * 検索条件
123
- */
124
- qs: {
125
- limit?: number;
126
- page?: number;
127
- itemOffered?: {
128
- id?: {
129
- $eq?: string;
130
- };
131
- };
132
- };
133
- }): Promise<ISearchResult<IMakesProductOffer[]>>;
134
- createMakesProductOffer(params: Pick<factory.product.IOffer, 'availabilityEnds' | 'availabilityStarts' | 'seller' | 'validFrom' | 'validThrough'> & {
135
- itemOffered: {
136
- id: string;
137
- };
138
- }): Promise<void>;
139
- updateMakesProductOffer(params: Pick<factory.product.IOffer, 'availabilityEnds' | 'availabilityStarts' | 'seller' | 'validFrom' | 'validThrough'> & {
140
- itemOffered: {
141
- id: string;
142
- };
143
- }): Promise<void>;
144
- deleteMakesProductOffer(params: {
145
- itemOffered: {
146
- id: string;
147
- };
148
- seller: {
149
- id: string;
150
- };
151
- }): Promise<void>;
152
114
  /**
153
115
  * IAMメンバー作成
154
116
  */
@@ -315,85 +315,70 @@ var SellerService = /** @class */ (function (_super) {
315
315
  });
316
316
  });
317
317
  };
318
- SellerService.prototype.searchMakesProductOffer = function (params) {
319
- var _a;
320
- return __awaiter(this, void 0, void 0, function () {
321
- var _this = this;
322
- return __generator(this, function (_b) {
323
- return [2 /*return*/, this.fetch({
324
- uri: "/sellers/" + ((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) + "/makesProductOffer",
325
- method: 'GET',
326
- qs: params.qs,
327
- expectedStatusCodes: [http_status_1.OK]
328
- })
329
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
330
- var _a;
331
- return __generator(this, function (_b) {
332
- switch (_b.label) {
333
- case 0:
334
- _a = {};
335
- return [4 /*yield*/, response.json()];
336
- case 1: return [2 /*return*/, (_a.data = _b.sent(),
337
- _a)];
338
- }
339
- });
340
- }); })];
341
- });
342
- });
343
- };
344
- SellerService.prototype.createMakesProductOffer = function (params) {
345
- var _a;
346
- return __awaiter(this, void 0, void 0, function () {
347
- return __generator(this, function (_b) {
348
- switch (_b.label) {
349
- case 0: return [4 /*yield*/, this.fetch({
350
- uri: "/sellers/" + String((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) + "/makesProductOffer",
351
- method: 'POST',
352
- body: params,
353
- expectedStatusCodes: [http_status_1.NO_CONTENT]
354
- })];
355
- case 1:
356
- _b.sent();
357
- return [2 /*return*/];
358
- }
359
- });
360
- });
361
- };
362
- SellerService.prototype.updateMakesProductOffer = function (params) {
363
- var _a;
364
- return __awaiter(this, void 0, void 0, function () {
365
- return __generator(this, function (_b) {
366
- switch (_b.label) {
367
- case 0: return [4 /*yield*/, this.fetch({
368
- uri: "/sellers/" + String((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) + "/makesProductOffer/" + params.itemOffered.id,
369
- method: 'PUT',
370
- body: params,
371
- expectedStatusCodes: [http_status_1.NO_CONTENT]
372
- })];
373
- case 1:
374
- _b.sent();
375
- return [2 /*return*/];
376
- }
377
- });
378
- });
379
- };
380
- SellerService.prototype.deleteMakesProductOffer = function (params) {
381
- var _a;
382
- return __awaiter(this, void 0, void 0, function () {
383
- return __generator(this, function (_b) {
384
- switch (_b.label) {
385
- case 0: return [4 /*yield*/, this.fetch({
386
- uri: "/sellers/" + ((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) + "/makesProductOffer/" + params.itemOffered.id,
387
- method: 'DELETE',
388
- expectedStatusCodes: [http_status_1.NO_CONTENT]
389
- })];
390
- case 1:
391
- _b.sent();
392
- return [2 /*return*/];
393
- }
394
- });
395
- });
396
- };
318
+ // public async searchMakesProductOffer(params: {
319
+ // seller: {
320
+ // /**
321
+ // * 販売者ID
322
+ // */
323
+ // id: string;
324
+ // };
325
+ // /**
326
+ // * 検索条件
327
+ // */
328
+ // qs: {
329
+ // limit?: number;
330
+ // page?: number;
331
+ // itemOffered?: { id?: { $eq?: string } };
332
+ // };
333
+ // }): Promise<ISearchResult<IMakesProductOffer[]>> {
334
+ // return this.fetch({
335
+ // uri: `/sellers/${params.seller?.id}/makesProductOffer`,
336
+ // method: 'GET',
337
+ // qs: params.qs,
338
+ // expectedStatusCodes: [OK]
339
+ // })
340
+ // .then(async (response) => {
341
+ // return {
342
+ // data: await response.json()
343
+ // };
344
+ // });
345
+ // }
346
+ // public async createMakesProductOffer(params: Pick<
347
+ // factory.product.IOffer,
348
+ // 'availabilityEnds' | 'availabilityStarts' | 'seller' | 'validFrom' | 'validThrough'
349
+ // > & {
350
+ // itemOffered: { id: string };
351
+ // }): Promise<void> {
352
+ // await this.fetch({
353
+ // uri: `/sellers/${String(params.seller?.id)}/makesProductOffer`,
354
+ // method: 'POST',
355
+ // body: params,
356
+ // expectedStatusCodes: [NO_CONTENT]
357
+ // });
358
+ // }
359
+ // public async updateMakesProductOffer(params: Pick<
360
+ // factory.product.IOffer,
361
+ // 'availabilityEnds' | 'availabilityStarts' | 'seller' | 'validFrom' | 'validThrough'
362
+ // > & {
363
+ // itemOffered: { id: string };
364
+ // }): Promise<void> {
365
+ // await this.fetch({
366
+ // uri: `/sellers/${String(params.seller?.id)}/makesProductOffer/${params.itemOffered.id}`,
367
+ // method: 'PUT',
368
+ // body: params,
369
+ // expectedStatusCodes: [NO_CONTENT]
370
+ // });
371
+ // }
372
+ // public async deleteMakesProductOffer(params: {
373
+ // itemOffered: { id: string };
374
+ // seller: { id: string };
375
+ // }): Promise<void> {
376
+ // await this.fetch({
377
+ // uri: `/sellers/${params.seller?.id}/makesProductOffer/${params.itemOffered.id}`,
378
+ // method: 'DELETE',
379
+ // expectedStatusCodes: [NO_CONTENT]
380
+ // });
381
+ // }
397
382
  /**
398
383
  * IAMメンバー作成
399
384
  */
package/lib/bundle.js CHANGED
@@ -16013,85 +16013,70 @@ var SellerService = /** @class */ (function (_super) {
16013
16013
  });
16014
16014
  });
16015
16015
  };
16016
- SellerService.prototype.searchMakesProductOffer = function (params) {
16017
- var _a;
16018
- return __awaiter(this, void 0, void 0, function () {
16019
- var _this = this;
16020
- return __generator(this, function (_b) {
16021
- return [2 /*return*/, this.fetch({
16022
- uri: "/sellers/" + ((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) + "/makesProductOffer",
16023
- method: 'GET',
16024
- qs: params.qs,
16025
- expectedStatusCodes: [http_status_1.OK]
16026
- })
16027
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
16028
- var _a;
16029
- return __generator(this, function (_b) {
16030
- switch (_b.label) {
16031
- case 0:
16032
- _a = {};
16033
- return [4 /*yield*/, response.json()];
16034
- case 1: return [2 /*return*/, (_a.data = _b.sent(),
16035
- _a)];
16036
- }
16037
- });
16038
- }); })];
16039
- });
16040
- });
16041
- };
16042
- SellerService.prototype.createMakesProductOffer = function (params) {
16043
- var _a;
16044
- return __awaiter(this, void 0, void 0, function () {
16045
- return __generator(this, function (_b) {
16046
- switch (_b.label) {
16047
- case 0: return [4 /*yield*/, this.fetch({
16048
- uri: "/sellers/" + String((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) + "/makesProductOffer",
16049
- method: 'POST',
16050
- body: params,
16051
- expectedStatusCodes: [http_status_1.NO_CONTENT]
16052
- })];
16053
- case 1:
16054
- _b.sent();
16055
- return [2 /*return*/];
16056
- }
16057
- });
16058
- });
16059
- };
16060
- SellerService.prototype.updateMakesProductOffer = function (params) {
16061
- var _a;
16062
- return __awaiter(this, void 0, void 0, function () {
16063
- return __generator(this, function (_b) {
16064
- switch (_b.label) {
16065
- case 0: return [4 /*yield*/, this.fetch({
16066
- uri: "/sellers/" + String((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) + "/makesProductOffer/" + params.itemOffered.id,
16067
- method: 'PUT',
16068
- body: params,
16069
- expectedStatusCodes: [http_status_1.NO_CONTENT]
16070
- })];
16071
- case 1:
16072
- _b.sent();
16073
- return [2 /*return*/];
16074
- }
16075
- });
16076
- });
16077
- };
16078
- SellerService.prototype.deleteMakesProductOffer = function (params) {
16079
- var _a;
16080
- return __awaiter(this, void 0, void 0, function () {
16081
- return __generator(this, function (_b) {
16082
- switch (_b.label) {
16083
- case 0: return [4 /*yield*/, this.fetch({
16084
- uri: "/sellers/" + ((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) + "/makesProductOffer/" + params.itemOffered.id,
16085
- method: 'DELETE',
16086
- expectedStatusCodes: [http_status_1.NO_CONTENT]
16087
- })];
16088
- case 1:
16089
- _b.sent();
16090
- return [2 /*return*/];
16091
- }
16092
- });
16093
- });
16094
- };
16016
+ // public async searchMakesProductOffer(params: {
16017
+ // seller: {
16018
+ // /**
16019
+ // * 販売者ID
16020
+ // */
16021
+ // id: string;
16022
+ // };
16023
+ // /**
16024
+ // * 検索条件
16025
+ // */
16026
+ // qs: {
16027
+ // limit?: number;
16028
+ // page?: number;
16029
+ // itemOffered?: { id?: { $eq?: string } };
16030
+ // };
16031
+ // }): Promise<ISearchResult<IMakesProductOffer[]>> {
16032
+ // return this.fetch({
16033
+ // uri: `/sellers/${params.seller?.id}/makesProductOffer`,
16034
+ // method: 'GET',
16035
+ // qs: params.qs,
16036
+ // expectedStatusCodes: [OK]
16037
+ // })
16038
+ // .then(async (response) => {
16039
+ // return {
16040
+ // data: await response.json()
16041
+ // };
16042
+ // });
16043
+ // }
16044
+ // public async createMakesProductOffer(params: Pick<
16045
+ // factory.product.IOffer,
16046
+ // 'availabilityEnds' | 'availabilityStarts' | 'seller' | 'validFrom' | 'validThrough'
16047
+ // > & {
16048
+ // itemOffered: { id: string };
16049
+ // }): Promise<void> {
16050
+ // await this.fetch({
16051
+ // uri: `/sellers/${String(params.seller?.id)}/makesProductOffer`,
16052
+ // method: 'POST',
16053
+ // body: params,
16054
+ // expectedStatusCodes: [NO_CONTENT]
16055
+ // });
16056
+ // }
16057
+ // public async updateMakesProductOffer(params: Pick<
16058
+ // factory.product.IOffer,
16059
+ // 'availabilityEnds' | 'availabilityStarts' | 'seller' | 'validFrom' | 'validThrough'
16060
+ // > & {
16061
+ // itemOffered: { id: string };
16062
+ // }): Promise<void> {
16063
+ // await this.fetch({
16064
+ // uri: `/sellers/${String(params.seller?.id)}/makesProductOffer/${params.itemOffered.id}`,
16065
+ // method: 'PUT',
16066
+ // body: params,
16067
+ // expectedStatusCodes: [NO_CONTENT]
16068
+ // });
16069
+ // }
16070
+ // public async deleteMakesProductOffer(params: {
16071
+ // itemOffered: { id: string };
16072
+ // seller: { id: string };
16073
+ // }): Promise<void> {
16074
+ // await this.fetch({
16075
+ // uri: `/sellers/${params.seller?.id}/makesProductOffer/${params.itemOffered.id}`,
16076
+ // method: 'DELETE',
16077
+ // expectedStatusCodes: [NO_CONTENT]
16078
+ // });
16079
+ // }
16095
16080
  /**
16096
16081
  * IAMメンバー作成
16097
16082
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "12.5.0-alpha.7",
3
+ "version": "12.5.0-alpha.8",
4
4
  "description": "Cinerino SDK",
5
5
  "main": "./lib/index.js",
6
6
  "browser": {
@@ -93,7 +93,7 @@
93
93
  "watchify": "^3.11.1"
94
94
  },
95
95
  "dependencies": {
96
- "@chevre/factory": "5.1.0-alpha.0",
96
+ "@chevre/factory": "5.1.0-alpha.1",
97
97
  "debug": "3.2.7",
98
98
  "http-status": "1.7.4",
99
99
  "idtoken-verifier": "2.0.3",