@cinerino/sdk 12.8.0 → 12.9.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.
@@ -6,8 +6,8 @@ import * as auth from '../../auth/authAsAdmin';
6
6
 
7
7
  const PROJECT_ID = String(process.env.PROJECT_ID);
8
8
  const SELLER_ID = '59d20831e53ebc2b4e774466';
9
- const OFFER_IDENTIFIER = '20251119eventOffer01';
10
- const itemOfferedId = '691d48de08422fdedd8b864a';
9
+ const OFFER_IDENTIFIER = '20251120eventOffer01';
10
+ const itemOfferedId = '691e5b3ba84891e2b630fca9';
11
11
 
12
12
  // tslint:disable-next-line:max-func-body-length
13
13
  async function main() {
@@ -37,6 +37,9 @@ async function main() {
37
37
  availableAtOrFrom: { identifier: 'SmartTheaterTXN' },
38
38
  validFrom,
39
39
  validThrough
40
+ // offeredBy: {
41
+ // identifier: 'DefaultTokenIssuer'
42
+ // }
40
43
  }
41
44
  ],
42
45
  {
@@ -52,6 +55,9 @@ async function main() {
52
55
  availableAtOrFrom: { identifier: 'SmartTheaterTXN' },
53
56
  validFrom,
54
57
  validThrough
58
+ // offeredBy: {
59
+ // identifier: 'DefaultTokenIssuer'
60
+ // }
55
61
  }
56
62
  ],
57
63
  {
@@ -34,7 +34,7 @@ async function main() {
34
34
  const today = moment()
35
35
  .tz('Asia/Tokyo')
36
36
  .format('YYYY-MM-DD');
37
- const startDate = moment(`${today}T14:00:00Z`)
37
+ const startDate = moment(`${today}T13:00:00Z`)
38
38
  .toDate();
39
39
  const endDate = moment(startDate)
40
40
  .add(1, 'hour')
@@ -5,7 +5,7 @@ import * as client from '../../../../lib/index';
5
5
  import { auth } from '../../auth/clientCredentials';
6
6
 
7
7
  const project = { id: String(process.env.PROJECT_ID) };
8
- const { EVENT_ID } = process.env;
8
+ const { EVENT_ID, SAMPLE_EVENT_OFFER_TOKEN } = process.env;
9
9
  const profile: client.factory.person.IProfile = {
10
10
  email: <string>process.env.TEST_PROFILE_EMAIL,
11
11
  givenName: 'Taro ##\n##\r##\n\n\n##\r\r\r##\r\n\r\n\r\n##',
@@ -372,7 +372,10 @@ async function authorizeSeatReservationByEvent(params: {
372
372
  const { ticketToken } = await offerService.issueEventServiceOfferTicket({
373
373
  audience: { id: transaction.id },
374
374
  eventId: screeningEvent.id,
375
- eventOfferId: '691d492f929e69df1e32b89d' // 拡張オファー使用の場合、オファーコードを指定する
375
+ eventOfferId: '691e5bb3929e69df1ec6e9a6', // 拡張オファー使用の場合、イベントオファーIDを指定する
376
+ ticketedOffer: {
377
+ ...(typeof SAMPLE_EVENT_OFFER_TOKEN === 'string') ? { token: SAMPLE_EVENT_OFFER_TOKEN } : undefined
378
+ }
376
379
  });
377
380
  console.log('offer ticket issued.', ticketToken);
378
381
 
@@ -15,17 +15,7 @@ export declare type ICreateParamsByIdentifier = Pick<factory.event.screeningEven
15
15
  /**
16
16
  * 識別子によるイベント編集パラメータ
17
17
  */
18
- export declare type IUpdateParamsByIdentifier = Pick<factory.event.screeningEvent.IUpdateByIdParams, 'additionalProperty' | 'doorTime' | 'endDate' | 'eventStatus' | 'maximumPhysicalAttendeeCapacity' | 'startDate'> & {
19
- identifier: string;
20
- offers: Pick<factory.event.screeningEvent.IOffer4update, 'eligibleQuantity' | 'unacceptedPaymentMethod' | 'itemOffered'> & {
21
- /**
22
- * アプリケーション設定
23
- */
24
- seller: Pick<factory.event.screeningEvent.ISeller4create, 'makesOffer'>;
25
- };
26
- location?: never;
27
- superEvent?: never;
28
- };
18
+ export declare type IUpdateParamsByIdentifier = factory.event.screeningEvent.IUpdateByIdentifierParams;
29
19
  export interface IUpdateEventSellerMakesOfferParamsByIdentifier {
30
20
  /**
31
21
  * イベント識別子
@@ -54,4 +54,12 @@ export declare class EventOfferService extends Service {
54
54
  findEventOffers(params: IFindParams): Promise<(Omit<factory.eventOffer.IEventOffer, 'project'> & {
55
55
  id: string;
56
56
  })[]>;
57
+ /**
58
+ * 有効なイベントオファートークンを発行する(開発使用目的)
59
+ */
60
+ issueEventOfferToken(params: {
61
+ id: string;
62
+ }): Promise<{
63
+ token: string;
64
+ }>;
57
65
  }
@@ -129,6 +129,26 @@ var EventOfferService = /** @class */ (function (_super) {
129
129
  });
130
130
  });
131
131
  };
132
+ /**
133
+ * 有効なイベントオファートークンを発行する(開発使用目的)
134
+ */
135
+ EventOfferService.prototype.issueEventOfferToken = function (params) {
136
+ return __awaiter(this, void 0, void 0, function () {
137
+ var id;
138
+ var _this = this;
139
+ return __generator(this, function (_a) {
140
+ id = params.id;
141
+ return [2 /*return*/, this.fetch({
142
+ uri: BASE_URI + "/" + encodeURIComponent(String(id)) + "/tokens",
143
+ method: 'POST',
144
+ expectedStatusCodes: [http_status_1.CREATED]
145
+ })
146
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
147
+ return [2 /*return*/, response.json()];
148
+ }); }); })];
149
+ });
150
+ });
151
+ };
132
152
  return EventOfferService;
133
153
  }(service_1.Service));
134
154
  exports.EventOfferService = EventOfferService;
package/lib/bundle.js CHANGED
@@ -3197,6 +3197,26 @@ var EventOfferService = /** @class */ (function (_super) {
3197
3197
  });
3198
3198
  });
3199
3199
  };
3200
+ /**
3201
+ * 有効なイベントオファートークンを発行する(開発使用目的)
3202
+ */
3203
+ EventOfferService.prototype.issueEventOfferToken = function (params) {
3204
+ return __awaiter(this, void 0, void 0, function () {
3205
+ var id;
3206
+ var _this = this;
3207
+ return __generator(this, function (_a) {
3208
+ id = params.id;
3209
+ return [2 /*return*/, this.fetch({
3210
+ uri: BASE_URI + "/" + encodeURIComponent(String(id)) + "/tokens",
3211
+ method: 'POST',
3212
+ expectedStatusCodes: [http_status_1.CREATED]
3213
+ })
3214
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
3215
+ return [2 /*return*/, response.json()];
3216
+ }); }); })];
3217
+ });
3218
+ });
3219
+ };
3200
3220
  return EventOfferService;
3201
3221
  }(service_1.Service));
3202
3222
  exports.EventOfferService = EventOfferService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "12.8.0",
3
+ "version": "12.9.0-alpha.0",
4
4
  "description": "Cinerino SDK",
5
5
  "main": "./lib/index.js",
6
6
  "browser": {
@@ -93,7 +93,7 @@
93
93
  "watchify": "^3.11.1"
94
94
  },
95
95
  "dependencies": {
96
- "@chevre/factory": "5.2.0-alpha.15",
96
+ "@chevre/factory": "5.2.0",
97
97
  "debug": "3.2.7",
98
98
  "http-status": "1.7.4",
99
99
  "idtoken-verifier": "2.0.3",