@cinerino/sdk 12.0.0-alpha.1 → 12.1.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.
@@ -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
  */
@@ -13,9 +13,18 @@ declare type IUnset<T extends factory.eventType> = {
13
13
  */
14
14
  export declare class EventService extends Service {
15
15
  /**
16
- * イベント作成(NO_CONTENT)
16
+ * 上映イベント複数作成
17
17
  */
18
- createWithNoResponse<T extends factory.eventType.Event | factory.eventType.ScreeningEvent>(params: factory.event.ICreateParams<T>[]): Promise<void>;
18
+ createScreeningEvents(params: factory.event.ICreateParams<factory.eventType.ScreeningEvent>[], options: {
19
+ superEventId: string;
20
+ locationBranchCode: string;
21
+ }): Promise<void>;
22
+ /**
23
+ * イベント複数作成
24
+ */
25
+ createAnyEvents(params: factory.event.ICreateParams<factory.eventType.Event>[], options: {
26
+ locationBranchCode: string;
27
+ }): Promise<void>;
19
28
  /**
20
29
  * イベント検索
21
30
  */
@@ -53,6 +53,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
53
53
  Object.defineProperty(exports, "__esModule", { value: true });
54
54
  exports.EventService = void 0;
55
55
  var http_status_1 = require("http-status");
56
+ var factory = require("../factory");
56
57
  var service_1 = require("../service");
57
58
  /**
58
59
  * イベントサービス
@@ -63,19 +64,59 @@ var EventService = /** @class */ (function (_super) {
63
64
  return _super !== null && _super.apply(this, arguments) || this;
64
65
  }
65
66
  /**
66
- * イベント作成(NO_CONTENT)
67
+ * 上映イベント複数作成
67
68
  */
68
- EventService.prototype.createWithNoResponse = function (params) {
69
+ EventService.prototype.createScreeningEvents = function (params,
70
+ // add options(2025-08-26~)
71
+ options) {
69
72
  return __awaiter(this, void 0, void 0, function () {
73
+ var superEventId, locationBranchCode;
70
74
  return __generator(this, function (_a) {
71
75
  switch (_a.label) {
72
- case 0: return [4 /*yield*/, this.fetch({
73
- uri: '/events',
74
- method: 'POST',
75
- body: params,
76
- qs: { expectsNoContent: '1' },
77
- expectedStatusCodes: [http_status_1.NO_CONTENT]
78
- })];
76
+ case 0:
77
+ superEventId = options.superEventId, locationBranchCode = options.locationBranchCode;
78
+ return [4 /*yield*/, this.fetch({
79
+ uri: '/events',
80
+ method: 'POST',
81
+ body: params,
82
+ qs: {
83
+ expectsNoContent: '1',
84
+ typeOf: factory.eventType.ScreeningEvent,
85
+ superEventId: superEventId,
86
+ locationBranchCode: locationBranchCode
87
+ },
88
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
89
+ })];
90
+ case 1:
91
+ _a.sent();
92
+ return [2 /*return*/];
93
+ }
94
+ });
95
+ });
96
+ };
97
+ /**
98
+ * イベント複数作成
99
+ */
100
+ EventService.prototype.createAnyEvents = function (params,
101
+ // add options(2025-08-26~)
102
+ options) {
103
+ return __awaiter(this, void 0, void 0, function () {
104
+ var locationBranchCode;
105
+ return __generator(this, function (_a) {
106
+ switch (_a.label) {
107
+ case 0:
108
+ locationBranchCode = options.locationBranchCode;
109
+ return [4 /*yield*/, this.fetch({
110
+ uri: '/events',
111
+ method: 'POST',
112
+ body: params,
113
+ qs: {
114
+ expectsNoContent: '1',
115
+ typeOf: factory.eventType.Event,
116
+ locationBranchCode: locationBranchCode
117
+ },
118
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
119
+ })];
79
120
  case 1:
80
121
  _a.sent();
81
122
  return [2 /*return*/];
@@ -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
@@ -9471,6 +9471,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
9471
9471
  Object.defineProperty(exports, "__esModule", { value: true });
9472
9472
  exports.EventService = void 0;
9473
9473
  var http_status_1 = require("http-status");
9474
+ var factory = require("../factory");
9474
9475
  var service_1 = require("../service");
9475
9476
  /**
9476
9477
  * イベントサービス
@@ -9481,19 +9482,59 @@ var EventService = /** @class */ (function (_super) {
9481
9482
  return _super !== null && _super.apply(this, arguments) || this;
9482
9483
  }
9483
9484
  /**
9484
- * イベント作成(NO_CONTENT)
9485
+ * 上映イベント複数作成
9485
9486
  */
9486
- EventService.prototype.createWithNoResponse = function (params) {
9487
+ EventService.prototype.createScreeningEvents = function (params,
9488
+ // add options(2025-08-26~)
9489
+ options) {
9487
9490
  return __awaiter(this, void 0, void 0, function () {
9491
+ var superEventId, locationBranchCode;
9488
9492
  return __generator(this, function (_a) {
9489
9493
  switch (_a.label) {
9490
- case 0: return [4 /*yield*/, this.fetch({
9491
- uri: '/events',
9492
- method: 'POST',
9493
- body: params,
9494
- qs: { expectsNoContent: '1' },
9495
- expectedStatusCodes: [http_status_1.NO_CONTENT]
9496
- })];
9494
+ case 0:
9495
+ superEventId = options.superEventId, locationBranchCode = options.locationBranchCode;
9496
+ return [4 /*yield*/, this.fetch({
9497
+ uri: '/events',
9498
+ method: 'POST',
9499
+ body: params,
9500
+ qs: {
9501
+ expectsNoContent: '1',
9502
+ typeOf: factory.eventType.ScreeningEvent,
9503
+ superEventId: superEventId,
9504
+ locationBranchCode: locationBranchCode
9505
+ },
9506
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
9507
+ })];
9508
+ case 1:
9509
+ _a.sent();
9510
+ return [2 /*return*/];
9511
+ }
9512
+ });
9513
+ });
9514
+ };
9515
+ /**
9516
+ * イベント複数作成
9517
+ */
9518
+ EventService.prototype.createAnyEvents = function (params,
9519
+ // add options(2025-08-26~)
9520
+ options) {
9521
+ return __awaiter(this, void 0, void 0, function () {
9522
+ var locationBranchCode;
9523
+ return __generator(this, function (_a) {
9524
+ switch (_a.label) {
9525
+ case 0:
9526
+ locationBranchCode = options.locationBranchCode;
9527
+ return [4 /*yield*/, this.fetch({
9528
+ uri: '/events',
9529
+ method: 'POST',
9530
+ body: params,
9531
+ qs: {
9532
+ expectsNoContent: '1',
9533
+ typeOf: factory.eventType.Event,
9534
+ locationBranchCode: locationBranchCode
9535
+ },
9536
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
9537
+ })];
9497
9538
  case 1:
9498
9539
  _a.sent();
9499
9540
  return [2 /*return*/];
@@ -9566,7 +9607,7 @@ var EventService = /** @class */ (function (_super) {
9566
9607
  }(service_1.Service));
9567
9608
  exports.EventService = EventService;
9568
9609
 
9569
- },{"../service":163,"http-status":440}],64:[function(require,module,exports){
9610
+ },{"../factory":158,"../service":163,"http-status":440}],64:[function(require,module,exports){
9570
9611
  "use strict";
9571
9612
  var __extends = (this && this.__extends) || (function () {
9572
9613
  var extendStatics = function (d, b) {
@@ -23909,7 +23950,7 @@ exports.ProductService = void 0;
23909
23950
  var http_status_1 = require("http-status");
23910
23951
  var service_1 = require("../../service");
23911
23952
  /**
23912
- * プロダクトサービス
23953
+ * プロダクト(興行、アドオンなど)サービス
23913
23954
  */
23914
23955
  var ProductService = /** @class */ (function (_super) {
23915
23956
  __extends(ProductService, _super);
@@ -23945,13 +23986,15 @@ var ProductService = /** @class */ (function (_super) {
23945
23986
  */
23946
23987
  ProductService.prototype.searchOffers = function (params) {
23947
23988
  return __awaiter(this, void 0, void 0, function () {
23989
+ var limit, page, itemOffered, seller;
23948
23990
  var _this = this;
23949
23991
  return __generator(this, function (_a) {
23992
+ limit = params.limit, page = params.page, itemOffered = params.itemOffered, seller = params.seller;
23950
23993
  return [2 /*return*/, this.fetch({
23951
23994
  uri: "/products/" + params.itemOffered.id + "/offers",
23952
23995
  method: 'GET',
23953
23996
  expectedStatusCodes: [http_status_1.OK],
23954
- qs: params
23997
+ qs: { limit: limit, page: page, itemOffered: itemOffered, seller: seller }
23955
23998
  })
23956
23999
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
23957
24000
  return [2 /*return*/, response.json()];
@@ -23964,12 +24007,14 @@ var ProductService = /** @class */ (function (_super) {
23964
24007
  */
23965
24008
  ProductService.prototype.searchProductModels = function (params) {
23966
24009
  return __awaiter(this, void 0, void 0, function () {
24010
+ var category, limit, page;
23967
24011
  var _this = this;
23968
24012
  return __generator(this, function (_a) {
24013
+ category = params.category, limit = params.limit, page = params.page;
23969
24014
  return [2 /*return*/, this.fetch({
23970
24015
  uri: '/productModels',
23971
24016
  method: 'GET',
23972
- qs: params,
24017
+ qs: { category: category, limit: limit, page: page },
23973
24018
  expectedStatusCodes: [http_status_1.OK]
23974
24019
  })
23975
24020
  .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.1.0-alpha.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",