@cinerino/sdk 16.3.0-alpha.9 → 16.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.
@@ -1,8 +1,7 @@
1
1
  import { factory } from '../factory';
2
2
  import { Service } from '../service';
3
- export interface IProjection {
4
- $projection?: Record<string, 1>;
5
- }
3
+ export type IFindParams = Pick<factory.customer.ISearchConditions, 'additionalProperty' | 'branchCode' | 'id' | 'limit' | 'name' | 'page' | 'sort'>;
4
+ export type ICustomerAsFindResult = Pick<factory.customer.ICustomer, 'additionalProperty' | 'branchCode' | 'id' | 'name' | 'typeOf' | 'url'>;
6
5
  /**
7
6
  * 顧客サービス
8
7
  */
@@ -10,5 +9,5 @@ export declare class CustomerService extends Service {
10
9
  /**
11
10
  * 顧客検索
12
11
  */
13
- search(params: Omit<factory.customer.ISearchConditions, 'project'> & IProjection): Promise<factory.customer.ICustomer[]>;
12
+ findCustomers(params: IFindParams): Promise<ICustomerAsFindResult[]>;
14
13
  }
@@ -10,7 +10,7 @@ class CustomerService extends service_1.Service {
10
10
  /**
11
11
  * 顧客検索
12
12
  */
13
- async search(params) {
13
+ async findCustomers(params) {
14
14
  return this.fetch({
15
15
  uri: '/customers',
16
16
  method: 'GET',
@@ -38,9 +38,7 @@ class OrderService extends service_1.Service {
38
38
  /**
39
39
  * イベントIDと確認番号で検索
40
40
  */
41
- async findByEventAndConfirmationNumber(params
42
- // & IProjectionSearchConditions // discontinue(2024-07-24~)
43
- ) {
41
+ async findByEventAndConfirmationNumber(params) {
44
42
  return this.fetch({
45
43
  uri: '/orders/findByEventAndConfirmationNumber',
46
44
  method: 'POST',
@@ -1,22 +1,24 @@
1
1
  import { factory } from '../factory';
2
- import { ISearchResult, Service } from '../service';
2
+ import { Service } from '../service';
3
3
  export interface IProjectionSearchConditions {
4
4
  $projection?: {
5
5
  [key in keyof factory.unitPriceOffer.IUnitPriceOffer]?: 0 | 1;
6
6
  };
7
7
  }
8
+ type IAggregateOfferAsFindResult = Pick<factory.aggregateOffer.IAggregateOffer, 'id' | 'offers' | 'typeOf'>;
8
9
  /**
9
10
  * 集計オファーサービス
10
11
  */
11
12
  export declare class AggregateOfferService extends Service {
12
13
  /**
13
- * オファー検索
14
+ * 集計オファー検索
14
15
  */
15
- search(params: Omit<factory.unitPriceOffer.ISearchConditions, 'project'> & IProjectionSearchConditions): Promise<ISearchResult<factory.aggregateOffer.IAggregateOffer[]>>;
16
+ findAggregateOffers(params: Omit<factory.unitPriceOffer.ISearchConditions, 'project'> & IProjectionSearchConditions): Promise<IAggregateOfferAsFindResult[]>;
16
17
  /**
17
18
  * 集計オファー削除
18
19
  */
19
- deleteById(params: {
20
+ deleteAggregateOfferById(params: {
20
21
  id: string;
21
22
  }): Promise<void>;
22
23
  }
24
+ export {};
@@ -8,25 +8,21 @@ const service_1 = require("../service");
8
8
  */
9
9
  class AggregateOfferService extends service_1.Service {
10
10
  /**
11
- * オファー検索
11
+ * 集計オファー検索
12
12
  */
13
- async search(params) {
13
+ async findAggregateOffers(params) {
14
14
  return this.fetch({
15
15
  uri: '/aggregateOffers',
16
16
  method: 'GET',
17
17
  qs: params,
18
18
  expectedStatusCodes: [http_status_1.status.OK]
19
19
  })
20
- .then(async (response) => {
21
- return {
22
- data: await response.json()
23
- };
24
- });
20
+ .then(async (response) => response.json());
25
21
  }
26
22
  /**
27
23
  * 集計オファー削除
28
24
  */
29
- async deleteById(params) {
25
+ async deleteAggregateOfferById(params) {
30
26
  await this.fetch({
31
27
  uri: `/aggregateOffers/${encodeURIComponent(String(params.id))}`,
32
28
  method: 'DELETE',
@@ -1,10 +1,6 @@
1
1
  import { ICheckMovieTicketResult } from '../../chevrePay/payment/factory';
2
2
  import { factory } from '../../factory';
3
3
  import { Service } from '../../service';
4
- export interface IPublishPaymentUrlResult {
5
- paymentMethodId: string;
6
- paymentUrl: string;
7
- }
8
4
  /**
9
5
  * 決済取引サービス
10
6
  */
@@ -1,8 +1,6 @@
1
1
  import { factory } from '../factory';
2
2
  import { IUnset, Service } from '../service';
3
- export interface IProjection {
4
- $projection?: Record<string, 1>;
5
- }
3
+ type IAddParams = Pick<factory.customer.ICustomer, 'additionalProperty' | 'branchCode' | 'name' | 'url'>;
6
4
  /**
7
5
  * 顧客サービス
8
6
  */
@@ -10,20 +8,21 @@ export declare class CustomerService extends Service {
10
8
  /**
11
9
  * 顧客作成
12
10
  */
13
- create(params: factory.customer.ICustomer): Promise<{
11
+ addCustomer(params: IAddParams): Promise<{
14
12
  id: string;
15
13
  }>;
16
14
  /**
17
15
  * 顧客編集
18
16
  */
19
- update(params: {
17
+ updateCustomerById(params: {
20
18
  id: string;
21
- attributes: factory.customer.ICustomer & IUnset;
19
+ attributes: IAddParams & IUnset;
22
20
  }): Promise<void>;
23
21
  /**
24
22
  * 顧客削除
25
23
  */
26
- deleteById(params: {
24
+ deleteCustomerById(params: {
27
25
  id: string;
28
26
  }): Promise<void>;
29
27
  }
28
+ export {};
@@ -10,7 +10,7 @@ class CustomerService extends service_1.Service {
10
10
  /**
11
11
  * 顧客作成
12
12
  */
13
- async create(params) {
13
+ async addCustomer(params) {
14
14
  return this.fetch({
15
15
  uri: '/customers',
16
16
  method: 'POST',
@@ -22,7 +22,7 @@ class CustomerService extends service_1.Service {
22
22
  /**
23
23
  * 顧客編集
24
24
  */
25
- async update(params) {
25
+ async updateCustomerById(params) {
26
26
  await this.fetch({
27
27
  uri: `/customers/${params.id}`,
28
28
  method: 'PUT',
@@ -33,7 +33,7 @@ class CustomerService extends service_1.Service {
33
33
  /**
34
34
  * 顧客削除
35
35
  */
36
- async deleteById(params) {
36
+ async deleteCustomerById(params) {
37
37
  await this.fetch({
38
38
  uri: `/customers/${params.id}`,
39
39
  method: 'DELETE',
@@ -47,7 +47,12 @@ export type IPublishPaymentUrlObject = Pick<factory.action.authorize.paymentMeth
47
47
  */
48
48
  eventIdsAsOrderedItem: string[];
49
49
  };
50
- export type IPublishPaymentUrlResult = Pick<factory.action.accept.pay.IResult, 'paymentMethodId' | 'paymentUrl'>;
50
+ export type IPublishPaymentUrlResult = Pick<factory.action.accept.pay.IResult, 'paymentMethodId'> & {
51
+ /**
52
+ * 外部決済URL
53
+ */
54
+ paymentUrl: string;
55
+ };
51
56
  export interface IFindAuthorizeActionResult {
52
57
  /**
53
58
  * 承認アクションID
@@ -37,13 +37,6 @@ export declare class PaymentService extends Service {
37
37
  authorizeCreditCard(params: {
38
38
  object: IAuthorizeCreditCardObject;
39
39
  purpose: IPurpose;
40
- instrumentOptions: {
41
- /**
42
- * 対応決済方法オファーIDリスト
43
- * 最大20件
44
- */
45
- acceptedPaymentMethodOfferIds: string[];
46
- };
47
40
  }): Promise<IAuthorizeResult>;
48
41
  /**
49
42
  * 決済カード決済承認
@@ -53,13 +46,6 @@ export declare class PaymentService extends Service {
53
46
  ticketToken: string;
54
47
  };
55
48
  purpose: IPurpose;
56
- instrumentOptions: {
57
- /**
58
- * 対応決済方法オファーIDリスト
59
- * 最大20件
60
- */
61
- acceptedPaymentMethodOfferIds: string[];
62
- };
63
49
  }, options: {
64
50
  /**
65
51
  * 決済カード認証アクションID
@@ -74,13 +60,6 @@ export declare class PaymentService extends Service {
74
60
  ticketToken: string;
75
61
  };
76
62
  purpose: IPurpose;
77
- instrumentOptions: {
78
- /**
79
- * 対応決済方法オファーIDリスト
80
- * 最大20件
81
- */
82
- acceptedPaymentMethodOfferIds: string[];
83
- };
84
63
  }): Promise<{
85
64
  /**
86
65
  * task ID
@@ -71,9 +71,8 @@ class PaymentService extends service_1.Service {
71
71
  * クレジットカード決済承認
72
72
  */
73
73
  async authorizeCreditCard(params) {
74
- const { object, purpose, instrumentOptions } = params;
74
+ const { object, purpose } = params;
75
75
  const { amount, issuedThrough, paymentMethod, creditCard, method, paymentMethodId, name, additionalProperty, ticketToken, eventIdsAsOrderedItem } = object;
76
- const { acceptedPaymentMethodOfferIds } = instrumentOptions;
77
76
  // paymentMethodId or ticketToken required(2025-12-06~)
78
77
  if ((typeof paymentMethodId !== 'string' || paymentMethodId === '')
79
78
  && (typeof ticketToken !== 'string' || ticketToken === '')) {
@@ -103,8 +102,7 @@ class PaymentService extends service_1.Service {
103
102
  ...(Array.isArray(additionalProperty)) ? { additionalProperty } : undefined,
104
103
  ...(Array.isArray(eventIdsAsOrderedItem)) ? { eventIdsAsOrderedItem } : undefined
105
104
  },
106
- purpose,
107
- instrumentOptions: { acceptedPaymentMethodOfferIds }
105
+ purpose
108
106
  },
109
107
  qs: {
110
108
  async: true,
@@ -117,9 +115,8 @@ class PaymentService extends service_1.Service {
117
115
  * 決済カード決済承認
118
116
  */
119
117
  async authorizeMovieTicket(params, options) {
120
- const { object, purpose, instrumentOptions } = params;
118
+ const { object, purpose } = params;
121
119
  const { issuedThrough, paymentMethod, movieTickets, name, additionalProperty, ticketToken } = object;
122
- const { acceptedPaymentMethodOfferIds } = instrumentOptions;
123
120
  const { checkedActionId } = options;
124
121
  return this.fetch({
125
122
  uri: `/payment/${factory_1.factory.service.paymentService.PaymentServiceType.MovieTicket}/authorize`,
@@ -133,8 +130,7 @@ class PaymentService extends service_1.Service {
133
130
  ...(typeof ticketToken === 'string') ? { ticketToken } : undefined,
134
131
  ...(Array.isArray(additionalProperty)) ? { additionalProperty } : undefined
135
132
  },
136
- purpose,
137
- instrumentOptions: { acceptedPaymentMethodOfferIds }
133
+ purpose
138
134
  },
139
135
  qs: {
140
136
  checkedActionId,
@@ -148,9 +144,8 @@ class PaymentService extends service_1.Service {
148
144
  * 決済ロケーション発行(非同期)
149
145
  */
150
146
  async publishCreditCardPaymentUrl(params) {
151
- const { object, purpose, instrumentOptions } = params;
147
+ const { object, purpose } = params;
152
148
  const { amount, creditCard, issuedThrough, paymentMethod, method, ticketToken, eventIdsAsOrderedItem } = object;
153
- const { acceptedPaymentMethodOfferIds } = instrumentOptions;
154
149
  if (typeof ticketToken !== 'string' || ticketToken === '') {
155
150
  throw new factory_1.factory.errors.ArgumentNull('object.ticketToken'); // required(2025-12-06~)
156
151
  }
@@ -170,8 +165,7 @@ class PaymentService extends service_1.Service {
170
165
  ...(typeof ticketToken === 'string') ? { ticketToken } : undefined,
171
166
  ...(Array.isArray(eventIdsAsOrderedItem)) ? { eventIdsAsOrderedItem } : undefined
172
167
  },
173
- purpose,
174
- instrumentOptions: { acceptedPaymentMethodOfferIds }
168
+ purpose
175
169
  },
176
170
  qs: {
177
171
  async: true,
@@ -1,18 +1,6 @@
1
1
  import { factory } from '../../factory';
2
2
  import { IAdditionalOptions, IOptions, ISearchResult, Service } from '../../service';
3
- export type IEmailMessage = factory.creativeWork.message.email.ICreativeWork;
4
- export interface ISearchConditions {
5
- limit?: number;
6
- page?: number;
7
- identifier?: {
8
- $eq?: string;
9
- };
10
- about?: {
11
- identifier?: {
12
- $eq?: factory.creativeWork.message.email.AboutIdentifier;
13
- };
14
- };
15
- }
3
+ export type IEmailMessage = Pick<factory.creativeWork.message.email.ICreativeWork, 'about' | 'id' | 'sender' | 'text'>;
16
4
  /**
17
5
  * Eメールメッセージサービス
18
6
  */
@@ -21,5 +9,5 @@ export declare class EmailMessageService extends Service {
21
9
  /**
22
10
  * 検索
23
11
  */
24
- search(params: ISearchConditions): Promise<ISearchResult<IEmailMessage[]>>;
12
+ search(): Promise<ISearchResult<IEmailMessage[]>>;
25
13
  }
@@ -13,11 +13,11 @@ class EmailMessageService extends service_1.Service {
13
13
  /**
14
14
  * 検索
15
15
  */
16
- async search(params) {
16
+ async search() {
17
17
  return this.fetch({
18
18
  uri: '/emailMessages',
19
19
  method: 'GET',
20
- qs: params,
20
+ // qs: params,
21
21
  expectedStatusCodes: [http_status_1.status.OK]
22
22
  })
23
23
  .then(async (response) => {
@@ -1,5 +1,5 @@
1
- import { factory } from '../../factory';
2
1
  import { Service } from '../../service';
2
+ import type { IFindParams, ICustomerAsFindResult } from '../../chevreAdmin/customer';
3
3
  /**
4
4
  * 顧客サービス
5
5
  */
@@ -7,5 +7,5 @@ export declare class CustomerService extends Service {
7
7
  /**
8
8
  * 顧客検索
9
9
  */
10
- search(params: Omit<factory.customer.ISearchConditions, 'project'>): Promise<factory.customer.ICustomer[]>;
10
+ search(params: IFindParams): Promise<ICustomerAsFindResult[]>;
11
11
  }
@@ -7,41 +7,17 @@ const service_1 = require("../../service");
7
7
  * 顧客サービス
8
8
  */
9
9
  class CustomerService extends service_1.Service {
10
- // public async findById(params: {
11
- // id: string;
12
- // }): Promise<factory.customer.ICustomer> {
13
- // // return this.fetch({
14
- // // uri: `/customers/${params.id}`,
15
- // // method: 'GET',
16
- // // expectedStatusCodes: [status.OK]
17
- // // })
18
- // // .then(async (response) => response.json());
19
- // const { auth, endpoint, project, seller } = this.options;
20
- // const chevreAdmin = await loadChevreAdmin({ auth, endpoint });
21
- // const customerService = await chevreAdmin.createCustomerInstance({
22
- // project,
23
- // seller: { id: (typeof seller?.id === 'string') ? seller.id : '' }
24
- // });
25
- // return customerService.findById({ id: params.id });
26
- // }
27
10
  /**
28
11
  * 顧客検索
29
12
  */
30
13
  async search(params) {
31
- // return this.fetch({
32
- // uri: '/customers',
33
- // method: 'GET',
34
- // qs: params,
35
- // expectedStatusCodes: [status.OK]
36
- // })
37
- // .then(async (response) => response.json());
38
14
  const { auth, endpoint, project, seller } = this.options;
39
15
  const chevreAdmin = await (0, index_1.loadChevreAdmin)({ auth, endpoint });
40
16
  const customerService = await chevreAdmin.createCustomerInstance({
41
17
  project,
42
18
  seller: { id: (typeof seller?.id === 'string') ? seller.id : '' }
43
19
  });
44
- return customerService.search(params);
20
+ return customerService.findCustomers(params);
45
21
  }
46
22
  }
47
23
  exports.CustomerService = CustomerService;
@@ -43,7 +43,7 @@ export declare class OrderService extends Service {
43
43
  orderNumber?: string;
44
44
  }): Promise<IOrderAsFindByConfirmationNumberResult[]>;
45
45
  /**
46
- * イベントIDと確認番号で検索
46
+ * [ttts専用]イベントIDと確認番号で検索
47
47
  */
48
48
  findByEventAndConfirmationNumber(params: {
49
49
  /**
@@ -53,8 +53,11 @@ export declare class OrderService extends Service {
53
53
  /**
54
54
  * 購入者情報
55
55
  */
56
- customer?: {
57
- telephone?: string;
56
+ customer: {
57
+ /**
58
+ * 下4桁
59
+ */
60
+ telephone: string;
58
61
  };
59
62
  event: {
60
63
  id: {
@@ -55,7 +55,7 @@ class OrderService extends service_1.Service {
55
55
  });
56
56
  }
57
57
  /**
58
- * イベントIDと確認番号で検索
58
+ * [ttts専用]イベントIDと確認番号で検索
59
59
  */
60
60
  async findByEventAndConfirmationNumber(params) {
61
61
  const { auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes } = this.options;
@@ -70,7 +70,6 @@ class OrderService extends service_1.Service {
70
70
  });
71
71
  return orderService.findByEventAndConfirmationNumber({
72
72
  confirmationNumber, event,
73
- // $projection: DEFAULT_PROJECTION, // fixed on server side(2024-07-22~)
74
73
  ...(typeof customer?.telephone === 'string') ? { customer } : undefined
75
74
  });
76
75
  }
@@ -18,13 +18,6 @@ export declare class PaymentService extends Service {
18
18
  authorizeCreditCardAsync(params: {
19
19
  object: IAuthorizeCreditCardObject;
20
20
  purpose: IPurpose;
21
- instrumentOptions?: {
22
- /**
23
- * 対応決済方法オファーIDリスト
24
- * 最大20件
25
- */
26
- acceptedPaymentMethodOfferIds?: string[];
27
- };
28
21
  }, options?: {
29
22
  /**
30
23
  * min: 1000 ms
@@ -42,13 +35,6 @@ export declare class PaymentService extends Service {
42
35
  authorizeMovieTicketAsync(params: {
43
36
  object: IAuthorizeMovieTicketObject;
44
37
  purpose: IPurpose;
45
- instrumentOptions?: {
46
- /**
47
- * 対応決済方法オファーIDリスト
48
- * 最大20件
49
- */
50
- acceptedPaymentMethodOfferIds?: string[];
51
- };
52
38
  }, options: {
53
39
  /**
54
40
  * レイテンシ増加時の最大待機時間(milliseconds)
@@ -71,13 +57,6 @@ export declare class PaymentService extends Service {
71
57
  publishCreditCardPaymentUrlAsync(params: {
72
58
  object: IPublishPaymentUrlObject;
73
59
  purpose: IPurpose;
74
- instrumentOptions?: {
75
- /**
76
- * 対応決済方法オファーIDリスト
77
- * 最大20件
78
- */
79
- acceptedPaymentMethodOfferIds?: string[];
80
- };
81
60
  }, options?: {
82
61
  /**
83
62
  * min: 1000 ms
@@ -38,7 +38,6 @@ class PaymentService extends service_1.Service {
38
38
  */
39
39
  async authorizeCreditCardAsync(params, options) {
40
40
  const { object, purpose } = params;
41
- const acceptedPaymentMethodOfferIds = params.instrumentOptions?.acceptedPaymentMethodOfferIds;
42
41
  const intervalAfterIssueTicketInMS = options?.intervalAfterIssueTicketInMS;
43
42
  const { auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes } = this.options;
44
43
  const chevrePay = await (0, index_1.loadChevrePay)({ auth, endpoint, disableAutoRetry });
@@ -61,10 +60,7 @@ class PaymentService extends service_1.Service {
61
60
  ...object,
62
61
  ticketToken
63
62
  },
64
- purpose,
65
- instrumentOptions: {
66
- acceptedPaymentMethodOfferIds: (Array.isArray(acceptedPaymentMethodOfferIds)) ? acceptedPaymentMethodOfferIds : []
67
- }
63
+ purpose
68
64
  }
69
65
  // { async: true }
70
66
  );
@@ -74,7 +70,6 @@ class PaymentService extends service_1.Service {
74
70
  */
75
71
  async authorizeMovieTicketAsync(params, options) {
76
72
  const { object, purpose } = params;
77
- const acceptedPaymentMethodOfferIds = params.instrumentOptions?.acceptedPaymentMethodOfferIds;
78
73
  const { checkedActionId } = options;
79
74
  const { auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes } = this.options;
80
75
  const chevrePay = await (0, index_1.loadChevrePay)({ auth, endpoint, disableAutoRetry });
@@ -94,10 +89,7 @@ class PaymentService extends service_1.Service {
94
89
  ...object,
95
90
  ticketToken
96
91
  },
97
- purpose,
98
- instrumentOptions: {
99
- acceptedPaymentMethodOfferIds: (Array.isArray(acceptedPaymentMethodOfferIds)) ? acceptedPaymentMethodOfferIds : []
100
- }
92
+ purpose
101
93
  }, { checkedActionId });
102
94
  }
103
95
  /**
@@ -105,7 +97,6 @@ class PaymentService extends service_1.Service {
105
97
  */
106
98
  async publishCreditCardPaymentUrlAsync(params, options) {
107
99
  const { object, purpose } = params;
108
- const acceptedPaymentMethodOfferIds = params.instrumentOptions?.acceptedPaymentMethodOfferIds;
109
100
  const intervalAfterIssueTicketInMS = options?.intervalAfterIssueTicketInMS;
110
101
  const { auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes } = this.options;
111
102
  const chevrePay = await (0, index_1.loadChevrePay)({ auth, endpoint, disableAutoRetry });
@@ -132,10 +123,7 @@ class PaymentService extends service_1.Service {
132
123
  ...object,
133
124
  ticketToken
134
125
  },
135
- purpose,
136
- instrumentOptions: {
137
- acceptedPaymentMethodOfferIds: (Array.isArray(acceptedPaymentMethodOfferIds)) ? acceptedPaymentMethodOfferIds : []
138
- }
126
+ purpose
139
127
  });
140
128
  }
141
129
  /**