@cinerino/sdk 18.3.0-alpha.10 → 18.3.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,17 @@
1
+ import { factory } from '../../factory';
2
+ export interface IFindParams {
3
+ /**
4
+ * max: 20
5
+ * min: 1
6
+ */
7
+ limit: number;
8
+ /**
9
+ * min: 1
10
+ */
11
+ page: number;
12
+ /**
13
+ * IDリストを最大10件まで指定可能
14
+ */
15
+ ids?: string[];
16
+ }
17
+ export type IUnitPriceOfferAsFindResult = Pick<factory.unitPriceOffer.IUnitPriceOffer, 'id' | 'identifier' | 'description' | 'name' | 'color' | 'additionalProperty'>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { Service } from '../service';
2
+ import { IFindParams, IUnitPriceOfferAsFindResult } from './offer/factory';
3
+ /**
4
+ * 単価オファーサービス
5
+ */
6
+ export declare class OfferService extends Service {
7
+ /**
8
+ * 単価オファー検索
9
+ */
10
+ findUnitPriceOffers(params: IFindParams): Promise<IUnitPriceOfferAsFindResult[]>;
11
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OfferService = void 0;
4
+ const http_status_1 = require("http-status");
5
+ const service_1 = require("../service");
6
+ /**
7
+ * 単価オファーサービス
8
+ */
9
+ class OfferService extends service_1.Service {
10
+ /**
11
+ * 単価オファー検索
12
+ */
13
+ async findUnitPriceOffers(params) {
14
+ return this.fetch({
15
+ uri: '/offers',
16
+ method: 'GET',
17
+ qs: params,
18
+ expectedStatusCodes: [http_status_1.status.OK]
19
+ })
20
+ .then(async (response) => response.json());
21
+ }
22
+ }
23
+ exports.OfferService = OfferService;
@@ -4,6 +4,7 @@ import type { CreativeWorkService } from './chevre/creativeWork';
4
4
  import type { EventService } from './chevre/event';
5
5
  import type { EventOfferService } from './chevre/eventOffer';
6
6
  import type { EventSeriesService } from './chevre/eventSeries';
7
+ import type { OfferService } from './chevre/offer';
7
8
  import type { PlaceService } from './chevre/place';
8
9
  import type { ProductService } from './chevre/product';
9
10
  import type { SeatOfferService } from './chevre/seatOffer';
@@ -45,6 +46,13 @@ export declare namespace service {
45
46
  namespace EventSeries {
46
47
  let svc: typeof EventSeriesService | undefined;
47
48
  }
49
+ /**
50
+ * 単価オファーサービス
51
+ */
52
+ type Offer = OfferService;
53
+ namespace Offer {
54
+ let svc: typeof OfferService | undefined;
55
+ }
48
56
  /**
49
57
  * 施設サービス
50
58
  */
@@ -85,6 +93,7 @@ export declare class Chevre {
85
93
  createEventInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<EventService>;
86
94
  createEventOfferInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<EventOfferService>;
87
95
  createEventSeriesInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<EventSeriesService>;
96
+ createOfferInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<OfferService>;
88
97
  createPlaceInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<PlaceService>;
89
98
  createProductInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<ProductService>;
90
99
  createSeatOfferInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<SeatOfferService>;
@@ -51,6 +51,9 @@ var service;
51
51
  let EventSeries;
52
52
  (function (EventSeries) {
53
53
  })(EventSeries = service.EventSeries || (service.EventSeries = {}));
54
+ let Offer;
55
+ (function (Offer) {
56
+ })(Offer = service.Offer || (service.Offer = {}));
54
57
  let Place;
55
58
  (function (Place) {
56
59
  })(Place = service.Place || (service.Place = {}));
@@ -102,6 +105,12 @@ class Chevre {
102
105
  }
103
106
  return new service.EventSeries.svc({ ...this.options, ...params, retryableStatusCodes: [] });
104
107
  }
108
+ async createOfferInstance(params) {
109
+ if (service.Offer.svc === undefined) {
110
+ service.Offer.svc = (await Promise.resolve().then(() => __importStar(require('./chevre/offer.js')))).OfferService;
111
+ }
112
+ return new service.Offer.svc({ ...this.options, ...params, retryableStatusCodes: [] });
113
+ }
105
114
  async createPlaceInstance(params) {
106
115
  if (service.Place.svc === undefined) {
107
116
  service.Place.svc = (await Promise.resolve().then(() => __importStar(require('./chevre/place.js')))).PlaceService;