@cinerino/sdk 12.0.0-alpha.1 → 12.0.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.
@@ -0,0 +1,43 @@
1
+ // tslint:disable:no-implicit-dependencies no-console
2
+ import * as client from '../../../../lib/index';
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 client.auth.ClientCredentials.createInstance({
9
+ // domain: <string>process.env.CHEVRE_AUTHORIZE_SERVER_DOMAIN,
10
+ // clientId: <string>process.env.CHEVRE_CLIENT_ID,
11
+ // clientSecret: <string>process.env.CHEVRE_CLIENT_SECRET,
12
+ // scopes: [],
13
+ // state: ''
14
+ // });
15
+ const authClient = await auth.login();
16
+ await authClient.refreshAccessToken();
17
+ const loginTicket = authClient.verifyIdToken({});
18
+ console.log('username is', loginTicket.getUsername());
19
+
20
+ const chevre = await client.loadChevre({
21
+ endpoint: <string>process.env.CHEVRE_ENDPOINT,
22
+ auth: authClient
23
+ });
24
+
25
+ const sellerService = await chevre.createSellerInstance({
26
+ project: { id: PROJECT_ID }
27
+ });
28
+
29
+ const result = await sellerService.search({
30
+ page: 1,
31
+ limit: 10,
32
+ // branchCode: { $eq: '002' },
33
+ $projection: {}
34
+ });
35
+ console.log(result);
36
+ console.log(result.length, 'sellers returned');
37
+ }
38
+
39
+ main()
40
+ .then(() => {
41
+ console.log('success!');
42
+ })
43
+ .catch(console.error);
@@ -7,9 +7,8 @@ const PROJECT_ID = String(process.env.PROJECT_ID);
7
7
  async function main() {
8
8
  const creativeWorkService = await (await loadCloudSearch({
9
9
  endpoint: <string>process.env.API_ENDPOINT,
10
- auth: await auth(),
11
- // defaultPath: '/secondary',
12
- disableAutoRetry: true
10
+ auth: await auth()
11
+ // defaultPath: '/secondary'
13
12
  })).createCreativeWorkInstance({
14
13
  project: { id: PROJECT_ID },
15
14
  seller: { id: '' }
@@ -1,6 +1,6 @@
1
1
  import * as factory from '../factory';
2
2
  import { Service } from '../service';
3
- export declare type IProductWithoutCredentials = Pick<factory.product.IProduct, 'description' | 'name' | 'productID' | 'serviceType' | 'typeOf'> & {
3
+ export declare type IProductAsFindResult = Pick<factory.product.IProduct, 'description' | 'name' | 'productID' | 'serviceType' | 'typeOf' | 'additionalProperty'> & {
4
4
  id: string;
5
5
  };
6
6
  declare type IPriceComponent = Pick<factory.place.seat.IPriceComponent, 'name' | 'price'>;
@@ -58,7 +58,7 @@ export declare class ProductService extends Service {
58
58
  /**
59
59
  * プロダクトタイプ指定でプロダクトを検索する
60
60
  */
61
- findProducts(params: IFindParams): Promise<IProductWithoutCredentials[]>;
61
+ findProducts(params: IFindParams): Promise<IProductAsFindResult[]>;
62
62
  /**
63
63
  * オファー検索
64
64
  */
@@ -1,14 +1,14 @@
1
- import { IFindParams, IProductModel, IProductWithoutCredentials, ISearchProductModelConditions } from '../../chevre/product';
1
+ import { IFindParams, IProductAsFindResult, IProductModel, ISearchProductModelConditions } from '../../chevre/product';
2
2
  import * as factory from '../../factory';
3
3
  import { Service } from '../../service';
4
4
  /**
5
- * プロダクトサービス
5
+ * プロダクト(興行、アドオンなど)サービス
6
6
  */
7
7
  export declare class ProductService extends Service {
8
8
  /**
9
9
  * プロダクトタイプ指定でプロダクトを検索する
10
10
  */
11
- search(params: IFindParams): Promise<IProductWithoutCredentials[]>;
11
+ search(params: IFindParams): Promise<IProductAsFindResult[]>;
12
12
  /**
13
13
  * プロダクトオファー検索
14
14
  */
@@ -18,7 +18,7 @@ export declare class ProductService extends Service {
18
18
  itemOffered: {
19
19
  id: string;
20
20
  };
21
- seller?: {
21
+ seller: {
22
22
  id: string;
23
23
  };
24
24
  }): Promise<Omit<factory.product.ITicketOffer, 'availableAtOrFrom'>[]>;
@@ -55,7 +55,7 @@ exports.ProductService = void 0;
55
55
  var http_status_1 = require("http-status");
56
56
  var service_1 = require("../../service");
57
57
  /**
58
- * プロダクトサービス
58
+ * プロダクト(興行、アドオンなど)サービス
59
59
  */
60
60
  var ProductService = /** @class */ (function (_super) {
61
61
  __extends(ProductService, _super);
@@ -91,13 +91,15 @@ var ProductService = /** @class */ (function (_super) {
91
91
  */
92
92
  ProductService.prototype.searchOffers = function (params) {
93
93
  return __awaiter(this, void 0, void 0, function () {
94
+ var limit, page, itemOffered, seller;
94
95
  var _this = this;
95
96
  return __generator(this, function (_a) {
97
+ limit = params.limit, page = params.page, itemOffered = params.itemOffered, seller = params.seller;
96
98
  return [2 /*return*/, this.fetch({
97
99
  uri: "/products/" + params.itemOffered.id + "/offers",
98
100
  method: 'GET',
99
101
  expectedStatusCodes: [http_status_1.OK],
100
- qs: params
102
+ qs: { limit: limit, page: page, itemOffered: itemOffered, seller: seller }
101
103
  })
102
104
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
103
105
  return [2 /*return*/, response.json()];
@@ -110,12 +112,14 @@ var ProductService = /** @class */ (function (_super) {
110
112
  */
111
113
  ProductService.prototype.searchProductModels = function (params) {
112
114
  return __awaiter(this, void 0, void 0, function () {
115
+ var category, limit, page;
113
116
  var _this = this;
114
117
  return __generator(this, function (_a) {
118
+ category = params.category, limit = params.limit, page = params.page;
115
119
  return [2 /*return*/, this.fetch({
116
120
  uri: '/productModels',
117
121
  method: 'GET',
118
- qs: params,
122
+ qs: { category: category, limit: limit, page: page },
119
123
  expectedStatusCodes: [http_status_1.OK]
120
124
  })
121
125
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
package/lib/bundle.js CHANGED
@@ -23909,7 +23909,7 @@ exports.ProductService = void 0;
23909
23909
  var http_status_1 = require("http-status");
23910
23910
  var service_1 = require("../../service");
23911
23911
  /**
23912
- * プロダクトサービス
23912
+ * プロダクト(興行、アドオンなど)サービス
23913
23913
  */
23914
23914
  var ProductService = /** @class */ (function (_super) {
23915
23915
  __extends(ProductService, _super);
@@ -23945,13 +23945,15 @@ var ProductService = /** @class */ (function (_super) {
23945
23945
  */
23946
23946
  ProductService.prototype.searchOffers = function (params) {
23947
23947
  return __awaiter(this, void 0, void 0, function () {
23948
+ var limit, page, itemOffered, seller;
23948
23949
  var _this = this;
23949
23950
  return __generator(this, function (_a) {
23951
+ limit = params.limit, page = params.page, itemOffered = params.itemOffered, seller = params.seller;
23950
23952
  return [2 /*return*/, this.fetch({
23951
23953
  uri: "/products/" + params.itemOffered.id + "/offers",
23952
23954
  method: 'GET',
23953
23955
  expectedStatusCodes: [http_status_1.OK],
23954
- qs: params
23956
+ qs: { limit: limit, page: page, itemOffered: itemOffered, seller: seller }
23955
23957
  })
23956
23958
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
23957
23959
  return [2 /*return*/, response.json()];
@@ -23964,12 +23966,14 @@ var ProductService = /** @class */ (function (_super) {
23964
23966
  */
23965
23967
  ProductService.prototype.searchProductModels = function (params) {
23966
23968
  return __awaiter(this, void 0, void 0, function () {
23969
+ var category, limit, page;
23967
23970
  var _this = this;
23968
23971
  return __generator(this, function (_a) {
23972
+ category = params.category, limit = params.limit, page = params.page;
23969
23973
  return [2 /*return*/, this.fetch({
23970
23974
  uri: '/productModels',
23971
23975
  method: 'GET',
23972
- qs: params,
23976
+ qs: { category: category, limit: limit, page: page },
23973
23977
  expectedStatusCodes: [http_status_1.OK]
23974
23978
  })
23975
23979
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "12.0.0-alpha.1",
3
+ "version": "12.0.0",
4
4
  "description": "Cinerino SDK",
5
5
  "main": "./lib/index.js",
6
6
  "browser": {
@@ -92,7 +92,7 @@
92
92
  "watchify": "^3.11.1"
93
93
  },
94
94
  "dependencies": {
95
- "@chevre/factory": "4.396.0",
95
+ "@chevre/factory": "4.397.0-alpha.0",
96
96
  "debug": "3.2.7",
97
97
  "http-status": "1.7.4",
98
98
  "idtoken-verifier": "2.0.3",