@cinerino/sdk 18.3.0-alpha.9 → 18.4.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.
@@ -77,7 +77,7 @@ export interface IFindSubEventsParams {
77
77
  /**
78
78
  * イベントのサブカタログ検索結果
79
79
  */
80
- export type ISearchOfferCatalogItemResult = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'additionalProperty' | 'relatedOffer'> & {
80
+ export type ISearchOfferCatalogItemResult = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'relatedOffer'> & {
81
81
  /**
82
82
  * カタログ内インデックス
83
83
  */
@@ -1,16 +1,11 @@
1
1
  import type { ISearchWithReservationForIdResult } from '../chevreConsole/aggregateReservation';
2
2
  import { factory } from '../factory';
3
- import { ISearchOfferCatalogItemAvailabilityResult, ISearchOfferCatalogItemResult, ISeatAsEventOffer, IFindParamsLegacy, IFindSubEventsParams } from './event/factory';
3
+ import { ISearchOfferCatalogItemAvailabilityResult, ISearchOfferCatalogItemResult, ISeatAsEventOffer, IFindSubEventsParams } from './event/factory';
4
4
  import { Service } from '../service';
5
5
  /**
6
6
  * イベントサービス
7
7
  */
8
8
  export declare class EventService extends Service {
9
- /**
10
- * イベント検索
11
- * @deprecated use findSubEvents(2026-10-14~)
12
- */
13
- projectFieldsDeprecated(params: IFindParamsLegacy): Promise<factory.event.screeningEvent.IEvent[]>;
14
9
  /**
15
10
  * イベント検索
16
11
  */
@@ -7,19 +7,6 @@ const service_1 = require("../service");
7
7
  * イベントサービス
8
8
  */
9
9
  class EventService extends service_1.Service {
10
- /**
11
- * イベント検索
12
- * @deprecated use findSubEvents(2026-10-14~)
13
- */
14
- async projectFieldsDeprecated(params) {
15
- return this.fetch({
16
- uri: '/events',
17
- method: 'GET',
18
- qs: params,
19
- expectedStatusCodes: [http_status_1.status.OK]
20
- })
21
- .then(async (response) => response.json());
22
- }
23
10
  /**
24
11
  * イベント検索
25
12
  */
@@ -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;
@@ -1,6 +1,6 @@
1
1
  import { factory } from '../factory';
2
2
  import { Service } from '../service';
3
- type IOfferCatalogAsSearchResult = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered' | 'additionalProperty' | 'relatedOffer'> & {
3
+ type IOfferCatalogAsSearchResult = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered' | 'relatedOffer'> & {
4
4
  /**
5
5
  * アイテム数
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import { factory } from '../factory';
2
2
  import { Service } from '../service';
3
- type IOfferCatalogAsSearchResult = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered' | 'additionalProperty'> & {
3
+ type IOfferCatalogAsSearchResult = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered'> & {
4
4
  /**
5
5
  * アイテム数
6
6
  */
@@ -13,7 +13,7 @@ type IOfferCatalogAsSearchResult = Pick<factory.offerCatalog.IOfferCatalog, 'id'
13
13
  type IItemAsOffer = Pick<factory.unitPriceOffer.IUnitPriceOffer, 'id' | 'identifier' | 'name' | 'alternateName' | 'priceSpecification' | 'typeOf'> & {
14
14
  sortIndex?: number;
15
15
  };
16
- type IItemAsOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'typeOf' | 'identifier' | 'itemOffered' | 'additionalProperty' | 'relatedOffer'> & {
16
+ type IItemAsOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'typeOf' | 'identifier' | 'itemOffered' | 'relatedOffer'> & {
17
17
  sortIndex?: number;
18
18
  };
19
19
  type IItemListElement = IItemAsOffer | IItemAsOfferCatalog;
@@ -1,6 +1,6 @@
1
1
  import { factory } from '../factory';
2
2
  import { Service } from '../service';
3
- type IOfferCatalogAsSearchResult = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered' | 'additionalProperty' | 'relatedOffer'> & {
3
+ type IOfferCatalogAsSearchResult = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered' | 'relatedOffer'> & {
4
4
  /**
5
5
  * アイテム数
6
6
  */
@@ -0,0 +1,11 @@
1
+ import { IFindParams, IUnitPriceOfferAsFindResult } from '../../chevre/offer/factory';
2
+ import { Service } from '../../service';
3
+ /**
4
+ * 単価オファーサービス
5
+ */
6
+ export declare class OfferService extends Service {
7
+ /**
8
+ * 単価オファー検索
9
+ */
10
+ findUnitPriceOffers(params: Pick<IFindParams, 'limit' | 'page' | 'ids'>): Promise<IUnitPriceOfferAsFindResult[]>;
11
+ }
@@ -0,0 +1,24 @@
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
+ const { limit, page, ids } = params;
15
+ return this.fetch({
16
+ uri: '/offers',
17
+ method: 'GET',
18
+ qs: { limit, page, ids },
19
+ expectedStatusCodes: [http_status_1.status.OK]
20
+ })
21
+ .then(async (response) => response.json());
22
+ }
23
+ }
24
+ exports.OfferService = OfferService;
@@ -3,6 +3,7 @@ import type { CreativeWorkService } from './search/creativeWork';
3
3
  import type { EventService } from './search/event';
4
4
  import type { EventOfferService } from './search/eventOffer';
5
5
  import type { EventSeriesService } from './search/eventSeries';
6
+ import type { OfferService } from './search/offer';
6
7
  import type { PlaceService } from './search/place';
7
8
  import type { ProductService } from './search/product';
8
9
  import type { SeatOfferService } from './search/seatOffer';
@@ -38,6 +39,13 @@ export declare namespace service {
38
39
  namespace EventOffer {
39
40
  let svc: typeof EventOfferService | undefined;
40
41
  }
42
+ /**
43
+ * 単価オファーサービス
44
+ */
45
+ type Offer = OfferService;
46
+ namespace Offer {
47
+ let svc: typeof OfferService | undefined;
48
+ }
41
49
  /**
42
50
  * 施設サービス
43
51
  */
@@ -70,6 +78,10 @@ export declare class CloudSearch {
70
78
  * コンテンツサービスインスタンス生成
71
79
  */
72
80
  createCreativeWorkInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<CreativeWorkService>;
81
+ /**
82
+ * 単価オファーサービスインスタンス生成
83
+ */
84
+ createOfferInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<OfferService>;
73
85
  /**
74
86
  * プロダクトサービスインスタンス生成
75
87
  */
@@ -52,6 +52,9 @@ var service;
52
52
  let EventOffer;
53
53
  (function (EventOffer) {
54
54
  })(EventOffer = service.EventOffer || (service.EventOffer = {}));
55
+ let Offer;
56
+ (function (Offer) {
57
+ })(Offer = service.Offer || (service.Offer = {}));
55
58
  let Place;
56
59
  (function (Place) {
57
60
  })(Place = service.Place || (service.Place = {}));
@@ -83,6 +86,18 @@ class CloudSearch {
83
86
  retryableStatusCodes: defaultRetryableStatusCodes
84
87
  });
85
88
  }
89
+ /**
90
+ * 単価オファーサービスインスタンス生成
91
+ */
92
+ async createOfferInstance(params) {
93
+ if (service.Offer.svc === undefined) {
94
+ service.Offer.svc = (await Promise.resolve().then(() => __importStar(require('./search/offer.js')))).OfferService;
95
+ }
96
+ return new service.Offer.svc({
97
+ ...this.options, ...params,
98
+ retryableStatusCodes: defaultRetryableStatusCodes
99
+ });
100
+ }
86
101
  /**
87
102
  * プロダクトサービスインスタンス生成
88
103
  */
@@ -67,6 +67,7 @@ class DefaultTransporter {
67
67
  // Headers インスタンス化して大文字・小文字を吸収する
68
68
  const headers = new Headers(options.headers);
69
69
  const currentUserAgent = headers.get('user-agent');
70
+ /* istanbul ignore else -- @preserve */
70
71
  if (!currentUserAgent) {
71
72
  headers.set('user-agent', DefaultTransporter.USER_AGENT);
72
73
  }
@@ -1,11 +1,15 @@
1
1
  import { ICredentials } from './credentials';
2
- import { OAuth2client } from './oAuth2client';
2
+ import { OAuth2client, IIAPHeaderGenerator } from './oAuth2client';
3
3
  export interface IOptions {
4
4
  domain: string;
5
5
  clientId: string;
6
6
  clientSecret: string;
7
7
  scopes: string[];
8
8
  state: string;
9
+ /**
10
+ * Google IAP認証ヘッダー生成関数
11
+ */
12
+ iapHeaderGenerator?: IIAPHeaderGenerator;
9
13
  }
10
14
  /**
11
15
  * クライアント認証OAuthクライアント
@@ -16,6 +16,7 @@ interface IPreFetchParams {
16
16
  type IPreFetch = (params: IPreFetchParams) => Promise<{
17
17
  options: RequestInit;
18
18
  }>;
19
+ export type IIAPHeaderGenerator = () => Promise<string>;
19
20
  export interface IOptions {
20
21
  domain: string;
21
22
  clientId?: string;
@@ -29,6 +30,10 @@ export interface IOptions {
29
30
  nonce?: string | null;
30
31
  audience?: string;
31
32
  tokenIssuer?: string;
33
+ /**
34
+ * Google IAP認証ヘッダー生成関数
35
+ */
36
+ iapHeaderGenerator?: IIAPHeaderGenerator;
32
37
  }
33
38
  export interface IVerifyIdTokenOptions {
34
39
  audience?: string | string[];
@@ -243,7 +243,6 @@ class OAuth2client {
243
243
  ) {
244
244
  // Callbacks will close over this to ensure that we only retry once
245
245
  let retry = true;
246
- options.headers = (options.headers === undefined || options.headers === null) ? {} : options.headers;
247
246
  let result;
248
247
  let numberOfTry = 0;
249
248
  while (result === undefined) {
@@ -252,8 +251,22 @@ class OAuth2client {
252
251
  if (numberOfTry > exports.MAX_RETRY_NUM) {
253
252
  retry = false;
254
253
  }
255
- options.headers.Authorization = `Bearer ${await this.getAccessToken()}`;
256
- result = await this.makeFetch(url, options, expectedStatusCodes);
254
+ // Headers インスタンスに正規化してプロパティ欠落を防止
255
+ const headers = new Headers((options.headers === undefined || options.headers === null) ? {} : options.headers);
256
+ // options.headers = (options.headers === undefined || options.headers === null) ? {} : options.headers;
257
+ // support IAP(2026-11-04~)
258
+ /* istanbul ignore if */
259
+ if (typeof this.options.iapHeaderGenerator === 'function') {
260
+ headers.set('Proxy-Authorization', `${await this.options.iapHeaderGenerator()}`);
261
+ }
262
+ headers.set('Authorization', `Bearer ${await this.getAccessToken()}`);
263
+ // (options.headers as Record<string, string>).Authorization = `Bearer ${await this.getAccessToken()}`;
264
+ // options に正規化した headers を戻す
265
+ const makeFetchOptions = {
266
+ ...options,
267
+ headers
268
+ };
269
+ result = await this.makeFetch(url, makeFetchOptions, expectedStatusCodes);
257
270
  break;
258
271
  }
259
272
  catch (error) {