@cinerino/sdk 10.21.0-alpha.31 → 10.21.0-alpha.33

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.
@@ -37,7 +37,23 @@ async function main() {
37
37
  }
38
38
  },
39
39
  // tslint:disable-next-line:no-magic-numbers
40
- 40
40
+ 1
41
+ );
42
+ setInterval(
43
+ async () => {
44
+ i += 1;
45
+ try {
46
+ const searchProjectsResult = await meService.searchProjects({
47
+ limit: 10,
48
+ page: 1
49
+ });
50
+ console.log(searchProjectsResult.data.length, 'projects returned', i);
51
+ } catch (error) {
52
+ console.error(error, i);
53
+ }
54
+ },
55
+ // tslint:disable-next-line:no-magic-numbers
56
+ 1
41
57
  );
42
58
  }
43
59
 
@@ -0,0 +1,49 @@
1
+ import * as factory from '../factory';
2
+ import { Service } from '../service';
3
+ interface IReservationPackage {
4
+ typeOf: factory.reservationType.ReservationPackage;
5
+ bookingTime: Date;
6
+ dateCreated: Date;
7
+ dateModified?: Date;
8
+ numSeats: number;
9
+ reservationFor: {
10
+ id: string;
11
+ startDate: Date;
12
+ };
13
+ reservationNumber: string;
14
+ expires: Date;
15
+ subReservationCount: number;
16
+ }
17
+ /**
18
+ * 保留予約サービス
19
+ */
20
+ export declare class PendingReservationService extends Service {
21
+ /**
22
+ * 保留予約検索
23
+ */
24
+ find(params: {
25
+ /**
26
+ * min: 1
27
+ * max: 20
28
+ */
29
+ limit: number;
30
+ /**
31
+ * min: 1
32
+ */
33
+ page: number;
34
+ reservationFor?: {
35
+ id?: {
36
+ $eq?: string;
37
+ };
38
+ };
39
+ reservationNumber?: {
40
+ $eq?: string;
41
+ };
42
+ subReservation?: {
43
+ identifier?: {
44
+ $eq?: string;
45
+ };
46
+ };
47
+ }): Promise<IReservationPackage[]>;
48
+ }
49
+ export {};
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (_) try {
33
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ Object.defineProperty(exports, "__esModule", { value: true });
54
+ exports.PendingReservationService = void 0;
55
+ var http_status_1 = require("http-status");
56
+ var service_1 = require("../service");
57
+ /**
58
+ * 保留予約サービス
59
+ */
60
+ var PendingReservationService = /** @class */ (function (_super) {
61
+ __extends(PendingReservationService, _super);
62
+ function PendingReservationService() {
63
+ return _super !== null && _super.apply(this, arguments) || this;
64
+ }
65
+ /**
66
+ * 保留予約検索
67
+ */
68
+ PendingReservationService.prototype.find = function (params) {
69
+ return __awaiter(this, void 0, void 0, function () {
70
+ var _this = this;
71
+ return __generator(this, function (_a) {
72
+ return [2 /*return*/, this.fetch({
73
+ uri: '/pendingReservations',
74
+ method: 'GET',
75
+ qs: params,
76
+ expectedStatusCodes: [http_status_1.OK]
77
+ })
78
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
79
+ return [2 /*return*/, response.json()];
80
+ }); }); })];
81
+ });
82
+ });
83
+ };
84
+ return PendingReservationService;
85
+ }(service_1.Service));
86
+ exports.PendingReservationService = PendingReservationService;
@@ -43,6 +43,7 @@ import type { OrderService } from './chevreAdmin/order';
43
43
  import type { OwnershipInfoService } from './chevreAdmin/ownershipInfo';
44
44
  import type { PaymentProductService } from './chevreAdmin/paymentService';
45
45
  import type { PaymentServiceChannelService } from './chevreAdmin/paymentServiceChannel';
46
+ import type { PendingReservationService } from './chevreAdmin/pendingReservation';
46
47
  import type { PermissionService } from './chevreAdmin/permission';
47
48
  import type { PermitService } from './chevreAdmin/permit';
48
49
  import type { PersonService } from './chevreAdmin/person';
@@ -307,6 +308,13 @@ export declare namespace service {
307
308
  namespace PaymentServiceChannel {
308
309
  let svc: typeof PaymentServiceChannelService | undefined;
309
310
  }
311
+ /**
312
+ * 保留予約サービス
313
+ */
314
+ type PendingReservation = PendingReservationService;
315
+ namespace PendingReservation {
316
+ let svc: typeof PendingReservationService | undefined;
317
+ }
310
318
  /**
311
319
  * 権限サービス
312
320
  */
@@ -597,6 +605,7 @@ export declare class ChevreAdmin {
597
605
  createOwnershipInfoInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<OwnershipInfoService>;
598
606
  createPaymentProductInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<PaymentProductService>;
599
607
  createPaymentServiceChannelInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<PaymentServiceChannelService>;
608
+ createPendingReservationInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<PendingReservationService>;
600
609
  createPermissionInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<PermissionService>;
601
610
  createPermitInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<PermitService>;
602
611
  createPersonInstance(params: Pick<IOptions, 'project'>): Promise<PersonService>;
@@ -152,6 +152,9 @@ var service;
152
152
  var PaymentServiceChannel;
153
153
  (function (PaymentServiceChannel) {
154
154
  })(PaymentServiceChannel = service.PaymentServiceChannel || (service.PaymentServiceChannel = {}));
155
+ var PendingReservation;
156
+ (function (PendingReservation) {
157
+ })(PendingReservation = service.PendingReservation || (service.PendingReservation = {}));
155
158
  var Permission;
156
159
  (function (Permission) {
157
160
  })(Permission = service.Permission || (service.Permission = {}));
@@ -857,6 +860,23 @@ var ChevreAdmin = /** @class */ (function () {
857
860
  });
858
861
  });
859
862
  };
863
+ ChevreAdmin.prototype.createPendingReservationInstance = function (params) {
864
+ return __awaiter(this, void 0, void 0, function () {
865
+ var _a;
866
+ return __generator(this, function (_b) {
867
+ switch (_b.label) {
868
+ case 0:
869
+ if (!(service.PendingReservation.svc === undefined)) return [3 /*break*/, 2];
870
+ _a = service.PendingReservation;
871
+ return [4 /*yield*/, Promise.resolve().then(function () { return require('./chevreAdmin/pendingReservation'); })];
872
+ case 1:
873
+ _a.svc = (_b.sent()).PendingReservationService;
874
+ _b.label = 2;
875
+ case 2: return [2 /*return*/, new service.PendingReservation.svc(__assign(__assign(__assign({}, this.options), params), { retryableStatusCodes: [] }))];
876
+ }
877
+ });
878
+ });
879
+ };
860
880
  ChevreAdmin.prototype.createPermissionInstance = function (params) {
861
881
  return __awaiter(this, void 0, void 0, function () {
862
882
  var _a;