@cinerino/sdk 12.5.0-alpha.10 → 12.5.0-alpha.11

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.
@@ -0,0 +1,35 @@
1
+ // tslint:disable:no-implicit-dependencies no-console no-magic-numbers
2
+ import * as client from '../../../../lib/';
3
+ import * as auth from '../../auth/authAsAdmin';
4
+
5
+ const PROJECT_ID = String(process.env.PROJECT_ID);
6
+
7
+ async function main() {
8
+ const authClient = await auth.login();
9
+ await authClient.refreshAccessToken();
10
+ const loginTicket = authClient.verifyIdToken({});
11
+ console.log('username is', loginTicket.getUsername());
12
+
13
+ const productService = await (await client.loadChevreAdmin({
14
+ endpoint: <string>process.env.CHEVRE_ENDPOINT,
15
+ auth: authClient
16
+ })).createProductInstance({
17
+ project: { id: PROJECT_ID },
18
+ seller: { id: '' }
19
+ });
20
+
21
+ const data = await productService.findProductHasOfferCatalog({
22
+ limit: 10,
23
+ page: 1,
24
+ itemOfferedIds: ['656038908b1cd5ce629f5992']
25
+ });
26
+ // tslint:disable-next-line:no-null-keyword
27
+ console.dir(data, { depth: null });
28
+ console.log(data.length);
29
+ }
30
+
31
+ main()
32
+ .then(() => {
33
+ console.log('main processed.');
34
+ })
35
+ .catch(console.error);
@@ -1,9 +1,13 @@
1
1
  import * as factory from '../factory';
2
2
  import { Service } from '../service';
3
- declare type IProductWithoutCredentials = Pick<factory.product.IProduct, 'additionalProperty' | 'description' | 'id' | 'name' | 'productID' | 'serviceOutput' | 'serviceType' | 'typeOf'>;
4
- declare type IProductAsFindResult = IProductWithoutCredentials & {
3
+ declare type IProductAsFindResult = Pick<factory.product.IProduct, 'description' | 'id' | 'name' | 'productID' | 'serviceOutput' | 'serviceType' | 'typeOf'> & {
4
+ /**
5
+ * プロダクトID
6
+ */
5
7
  id: string;
6
8
  project?: never;
9
+ hasOfferCatalog?: never;
10
+ additionalProperty?: never;
7
11
  };
8
12
  export interface IFindParams {
9
13
  /**
@@ -45,6 +49,38 @@ export interface IFindParams {
45
49
  serviceOutputAmountCurrency?: string;
46
50
  additionalPropertyName?: string;
47
51
  }
52
+ interface IFindProductHasOfferCatalogParams {
53
+ /**
54
+ * max: 20
55
+ */
56
+ limit: number;
57
+ /**
58
+ * min: 1
59
+ */
60
+ page: number;
61
+ /**
62
+ * プロダクトIDリスト
63
+ */
64
+ itemOfferedIds?: string[];
65
+ }
66
+ interface IOfferCatalogAsFindResult {
67
+ /**
68
+ * カタログID
69
+ */
70
+ id: string;
71
+ /**
72
+ * 対象オファー
73
+ */
74
+ aggregateElement: {
75
+ itemOffered: {
76
+ /**
77
+ * プロダクトID
78
+ */
79
+ id: string;
80
+ typeOf: factory.product.ProductType;
81
+ };
82
+ };
83
+ }
48
84
  /**
49
85
  * プロダクトサービス
50
86
  */
@@ -61,5 +97,9 @@ export declare class ProductService extends Service {
61
97
  * 2025-10-14~
62
98
  */
63
99
  findProducts(params: IFindParams): Promise<IProductAsFindResult[]>;
100
+ /**
101
+ * プロダクトオファーカタログ検索
102
+ */
103
+ findProductHasOfferCatalog(params: IFindProductHasOfferCatalogParams): Promise<IOfferCatalogAsFindResult[]>;
64
104
  }
65
105
  export {};
@@ -55,6 +55,7 @@ exports.ProductService = void 0;
55
55
  var http_status_1 = require("http-status");
56
56
  var service_1 = require("../service");
57
57
  var BASE_URI = '/products';
58
+ var BASE_URI_HAS_OFFER_CATALOG = '/productHasOfferCatalog';
58
59
  /**
59
60
  * プロダクトサービス
60
61
  */
@@ -106,6 +107,25 @@ var ProductService = /** @class */ (function (_super) {
106
107
  });
107
108
  });
108
109
  };
110
+ /**
111
+ * プロダクトオファーカタログ検索
112
+ */
113
+ ProductService.prototype.findProductHasOfferCatalog = function (params) {
114
+ return __awaiter(this, void 0, void 0, function () {
115
+ var _this = this;
116
+ return __generator(this, function (_a) {
117
+ return [2 /*return*/, this.fetch({
118
+ uri: BASE_URI_HAS_OFFER_CATALOG,
119
+ method: 'GET',
120
+ qs: params,
121
+ expectedStatusCodes: [http_status_1.OK]
122
+ })
123
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
124
+ return [2 /*return*/, response.json()];
125
+ }); }); })];
126
+ });
127
+ });
128
+ };
109
129
  return ProductService;
110
130
  }(service_1.Service));
111
131
  exports.ProductService = ProductService;
package/lib/bundle.js CHANGED
@@ -4036,6 +4036,7 @@ exports.ProductService = void 0;
4036
4036
  var http_status_1 = require("http-status");
4037
4037
  var service_1 = require("../service");
4038
4038
  var BASE_URI = '/products';
4039
+ var BASE_URI_HAS_OFFER_CATALOG = '/productHasOfferCatalog';
4039
4040
  /**
4040
4041
  * プロダクトサービス
4041
4042
  */
@@ -4087,6 +4088,25 @@ var ProductService = /** @class */ (function (_super) {
4087
4088
  });
4088
4089
  });
4089
4090
  };
4091
+ /**
4092
+ * プロダクトオファーカタログ検索
4093
+ */
4094
+ ProductService.prototype.findProductHasOfferCatalog = function (params) {
4095
+ return __awaiter(this, void 0, void 0, function () {
4096
+ var _this = this;
4097
+ return __generator(this, function (_a) {
4098
+ return [2 /*return*/, this.fetch({
4099
+ uri: BASE_URI_HAS_OFFER_CATALOG,
4100
+ method: 'GET',
4101
+ qs: params,
4102
+ expectedStatusCodes: [http_status_1.OK]
4103
+ })
4104
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
4105
+ return [2 /*return*/, response.json()];
4106
+ }); }); })];
4107
+ });
4108
+ });
4109
+ };
4090
4110
  return ProductService;
4091
4111
  }(service_1.Service));
4092
4112
  exports.ProductService = ProductService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "12.5.0-alpha.10",
3
+ "version": "12.5.0-alpha.11",
4
4
  "description": "Cinerino SDK",
5
5
  "main": "./lib/index.js",
6
6
  "browser": {