@cinerino/sdk 3.52.0-alpha.2 → 3.53.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.
@@ -2817,7 +2817,7 @@ exports.UnauthorizedError = UnauthorizedError;
2817
2817
  },{"../errorCode":74,"./chevre":78,"setprototypeof":289}],86:[function(require,module,exports){
2818
2818
  "use strict";
2819
2819
  Object.defineProperty(exports, "__esModule", { value: true });
2820
- exports.Unauthorized = exports.Chevre = exports.ServiceUnavailable = exports.RateLimitExceeded = exports.NotImplemented = exports.NotFound = exports.GatewayTimeout = exports.Forbidden = exports.ArgumentNull = exports.Argument = exports.AlreadyInUse = void 0;
2820
+ exports.Unauthorized = exports.ServiceUnavailable = exports.RateLimitExceeded = exports.NotImplemented = exports.NotFound = exports.GatewayTimeout = exports.Forbidden = exports.Chevre = exports.ArgumentNull = exports.Argument = exports.AlreadyInUse = void 0;
2821
2821
  /**
2822
2822
  * errors
2823
2823
  */
@@ -8102,14 +8102,34 @@ var OrderService = /** @class */ (function (_super) {
8102
8102
  /**
8103
8103
  * 注文取得
8104
8104
  */
8105
- OrderService.prototype.findByOrderNumber = function (params) {
8105
+ OrderService.prototype.findByOrderNumber = function (params, options) {
8106
8106
  return __awaiter(this, void 0, void 0, function () {
8107
8107
  var _this = this;
8108
8108
  return __generator(this, function (_a) {
8109
8109
  return [2 /*return*/, this.fetch({
8110
8110
  uri: "/orders/" + params.orderNumber,
8111
8111
  method: 'GET',
8112
- expectedStatusCodes: [http_status_1.OK]
8112
+ expectedStatusCodes: [http_status_1.OK],
8113
+ qs: options
8114
+ })
8115
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
8116
+ return [2 /*return*/, response.json()];
8117
+ }); }); })];
8118
+ });
8119
+ });
8120
+ };
8121
+ /**
8122
+ * 注文オファー検索
8123
+ */
8124
+ OrderService.prototype.searchAcceptedOffersByOrderNumber = function (params, conditions) {
8125
+ return __awaiter(this, void 0, void 0, function () {
8126
+ var _this = this;
8127
+ return __generator(this, function (_a) {
8128
+ return [2 /*return*/, this.fetch({
8129
+ uri: "/orders/" + params.orderNumber + "/acceptedOffers",
8130
+ method: 'GET',
8131
+ expectedStatusCodes: [http_status_1.OK],
8132
+ qs: conditions
8113
8133
  })
8114
8134
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
8115
8135
  return [2 /*return*/, response.json()];
@@ -13588,6 +13608,25 @@ var OrderService = /** @class */ (function (_super) {
13588
13608
  });
13589
13609
  });
13590
13610
  };
13611
+ /**
13612
+ * 注文オファー検索
13613
+ */
13614
+ OrderService.prototype.searchAcceptedOffersByOrderNumber = function (params, conditions) {
13615
+ return __awaiter(this, void 0, void 0, function () {
13616
+ var _this = this;
13617
+ return __generator(this, function (_a) {
13618
+ return [2 /*return*/, this.fetch({
13619
+ uri: "/orders/" + params.orderNumber + "/acceptedOffers",
13620
+ method: 'GET',
13621
+ expectedStatusCodes: [http_status_1.OK],
13622
+ qs: conditions
13623
+ })
13624
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
13625
+ return [2 /*return*/, response.json()];
13626
+ }); }); })];
13627
+ });
13628
+ });
13629
+ };
13591
13630
  return OrderService;
13592
13631
  }(service_1.Service));
13593
13632
  exports.OrderService = OrderService;
@@ -37,7 +37,6 @@ async function main() {
37
37
  customer: {
38
38
  telephone
39
39
  }
40
- // orderNumber: 'CIN8-6497443-8883376'
41
40
  });
42
41
  console.log(orders.length, 'orders found');
43
42
 
@@ -56,9 +55,9 @@ async function main() {
56
55
  console.log('QR code published.', code);
57
56
  // ここまでエンドユーザー
58
57
 
59
- const orderItem = order.acceptedOffers[0].itemOffered;
58
+ const orderItem = order.acceptedOffers?.shift()?.itemOffered;
60
59
  // 注文アイテムが予約の場合
61
- if (orderItem.typeOf === client.factory.reservationType.EventReservation) {
60
+ if (orderItem?.typeOf === client.factory.reservationType.EventReservation) {
62
61
  const reservationId = orderItem.id;
63
62
 
64
63
  // ここから管理者ユーザー
@@ -0,0 +1,38 @@
1
+ // tslint:disable:no-console
2
+ /**
3
+ * 注文オファー検索
4
+ */
5
+ // tslint:disable-next-line:no-implicit-dependencies
6
+ import * as client from '../../lib/index';
7
+ import * as auth from './auth/authAsAdmin';
8
+
9
+ async function main() {
10
+ const authClient = await auth.login();
11
+ await authClient.refreshAccessToken();
12
+ const loginTicket = authClient.verifyIdToken({});
13
+ console.log('username is', loginTicket.getUsername());
14
+
15
+ const orderService = new client.service.Order({
16
+ endpoint: <string>process.env.API_ENDPOINT,
17
+ auth: authClient,
18
+ project: { id: 'cinerino' }
19
+ });
20
+
21
+ const acceptedOffers = await orderService.searchAcceptedOffersByOrderNumber(
22
+ {
23
+ orderNumber: 'xxx'
24
+ },
25
+ {
26
+ limit: 10,
27
+ page: 1
28
+ }
29
+ );
30
+ console.log(acceptedOffers);
31
+ console.log(acceptedOffers.length, 'acceptedOffers found');
32
+ }
33
+
34
+ main()
35
+ .then(() => {
36
+ console.log('success!');
37
+ })
38
+ .catch(console.error);
package/lib/bundle.js CHANGED
@@ -2817,7 +2817,7 @@ var ErrorCode;
2817
2817
  },{}],86:[function(require,module,exports){
2818
2818
  "use strict";
2819
2819
  Object.defineProperty(exports, "__esModule", { value: true });
2820
- exports.Unauthorized = exports.Chevre = exports.ServiceUnavailable = exports.RateLimitExceeded = exports.NotImplemented = exports.NotFound = exports.GatewayTimeout = exports.Forbidden = exports.ArgumentNull = exports.Argument = exports.AlreadyInUse = void 0;
2820
+ exports.Unauthorized = exports.ServiceUnavailable = exports.RateLimitExceeded = exports.NotImplemented = exports.NotFound = exports.GatewayTimeout = exports.Forbidden = exports.Chevre = exports.ArgumentNull = exports.Argument = exports.AlreadyInUse = void 0;
2821
2821
  /**
2822
2822
  * errors
2823
2823
  */
@@ -8102,14 +8102,34 @@ var OrderService = /** @class */ (function (_super) {
8102
8102
  /**
8103
8103
  * 注文取得
8104
8104
  */
8105
- OrderService.prototype.findByOrderNumber = function (params) {
8105
+ OrderService.prototype.findByOrderNumber = function (params, options) {
8106
8106
  return __awaiter(this, void 0, void 0, function () {
8107
8107
  var _this = this;
8108
8108
  return __generator(this, function (_a) {
8109
8109
  return [2 /*return*/, this.fetch({
8110
8110
  uri: "/orders/" + params.orderNumber,
8111
8111
  method: 'GET',
8112
- expectedStatusCodes: [http_status_1.OK]
8112
+ expectedStatusCodes: [http_status_1.OK],
8113
+ qs: options
8114
+ })
8115
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
8116
+ return [2 /*return*/, response.json()];
8117
+ }); }); })];
8118
+ });
8119
+ });
8120
+ };
8121
+ /**
8122
+ * 注文オファー検索
8123
+ */
8124
+ OrderService.prototype.searchAcceptedOffersByOrderNumber = function (params, conditions) {
8125
+ return __awaiter(this, void 0, void 0, function () {
8126
+ var _this = this;
8127
+ return __generator(this, function (_a) {
8128
+ return [2 /*return*/, this.fetch({
8129
+ uri: "/orders/" + params.orderNumber + "/acceptedOffers",
8130
+ method: 'GET',
8131
+ expectedStatusCodes: [http_status_1.OK],
8132
+ qs: conditions
8113
8133
  })
8114
8134
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
8115
8135
  return [2 /*return*/, response.json()];
@@ -13588,6 +13608,25 @@ var OrderService = /** @class */ (function (_super) {
13588
13608
  });
13589
13609
  });
13590
13610
  };
13611
+ /**
13612
+ * 注文オファー検索
13613
+ */
13614
+ OrderService.prototype.searchAcceptedOffersByOrderNumber = function (params, conditions) {
13615
+ return __awaiter(this, void 0, void 0, function () {
13616
+ var _this = this;
13617
+ return __generator(this, function (_a) {
13618
+ return [2 /*return*/, this.fetch({
13619
+ uri: "/orders/" + params.orderNumber + "/acceptedOffers",
13620
+ method: 'GET',
13621
+ expectedStatusCodes: [http_status_1.OK],
13622
+ qs: conditions
13623
+ })
13624
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
13625
+ return [2 /*return*/, response.json()];
13626
+ }); }); })];
13627
+ });
13628
+ });
13629
+ };
13591
13630
  return OrderService;
13592
13631
  }(service_1.Service));
13593
13632
  exports.OrderService = OrderService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "3.52.0-alpha.2",
3
+ "version": "3.53.0",
4
4
  "description": "Cinerino SDK",
5
5
  "main": "./lib/index.js",
6
6
  "browser": {
@@ -97,7 +97,7 @@
97
97
  "watchify": "^3.11.1"
98
98
  },
99
99
  "dependencies": {
100
- "@cinerino/api-abstract-client": "3.52.0-alpha.2",
100
+ "@cinerino/api-abstract-client": "3.53.0",
101
101
  "debug": "^3.2.6",
102
102
  "http-status": "^1.4.2",
103
103
  "idtoken-verifier": "^2.0.3",