@cinerino/sdk 12.3.0-alpha.12 → 12.3.0-alpha.13
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.
- package/example/src/cloud/admin/adminProductOffersByIdentifier.ts +75 -0
- package/example/src/cloud/search/findProductOffers.ts +30 -0
- package/lib/abstract/chevreAdmin/noteAboutOrder.js +4 -3
- package/lib/abstract/chevreAdmin/productOffer.d.ts +14 -0
- package/lib/abstract/chevreAsset/order/factory.d.ts +5 -2
- package/lib/abstract/chevreAsset/order.d.ts +5 -5
- package/lib/abstract/cloud/admin/order.d.ts +2 -2
- package/lib/abstract/cloud/admin/productOffer.d.ts +40 -0
- package/lib/abstract/cloud/admin/productOffer.js +153 -0
- package/lib/abstract/cloud/admin.d.ts +9 -0
- package/lib/abstract/cloud/admin.js +20 -0
- package/lib/abstract/cloud/asset/order.d.ts +5 -5
- package/lib/abstract/cloud/search/productOffer.d.ts +11 -0
- package/lib/abstract/cloud/search/productOffer.js +89 -0
- package/lib/abstract/cloud/search.d.ts +12 -0
- package/lib/abstract/cloud/search.js +23 -0
- package/lib/bundle.js +693 -403
- package/package.json +1 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
// tslint:disable-next-line:no-implicit-dependencies
|
|
3
|
+
import * as moment from 'moment-timezone';
|
|
4
|
+
import * as client from '../../../../lib/index';
|
|
5
|
+
import * as auth from '../../auth/authAsAdmin';
|
|
6
|
+
|
|
7
|
+
const PROJECT_ID = String(process.env.PROJECT_ID);
|
|
8
|
+
const SELLER_ID = '';
|
|
9
|
+
|
|
10
|
+
async function main() {
|
|
11
|
+
const authClient = await auth.login();
|
|
12
|
+
await authClient.refreshAccessToken();
|
|
13
|
+
const loginTicket = authClient.verifyIdToken({});
|
|
14
|
+
console.log('username is', loginTicket.getUsername());
|
|
15
|
+
|
|
16
|
+
const productOfferService = await (await client.loadCloudAdmin({
|
|
17
|
+
endpoint: <string>process.env.API_ADMIN_ENDPOINT,
|
|
18
|
+
auth: authClient
|
|
19
|
+
})).createProductOfferInstance({
|
|
20
|
+
project: { id: PROJECT_ID },
|
|
21
|
+
seller: { id: SELLER_ID }
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const today = moment()
|
|
25
|
+
.tz('Asia/Tokyo')
|
|
26
|
+
.format('YYYY-MM-DD');
|
|
27
|
+
const identifier = '2025093001';
|
|
28
|
+
const itemOfferedIdentifier = '2025093001itemOfferedIdentifier';
|
|
29
|
+
await productOfferService.createValidForMemberTierByIdentifier(
|
|
30
|
+
[
|
|
31
|
+
{
|
|
32
|
+
identifier,
|
|
33
|
+
validFrom: moment(`${today}T13:00:00Z`)
|
|
34
|
+
.toDate(),
|
|
35
|
+
validThrough: moment(`${today}T14:00:00Z`)
|
|
36
|
+
.toDate(),
|
|
37
|
+
validForMemberTier: { identifier: 'bronze' }
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
{
|
|
41
|
+
itemOfferedIdentifier: itemOfferedIdentifier
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
console.log('created.');
|
|
45
|
+
|
|
46
|
+
await productOfferService.updateValidForMemberTierByIdentifier(
|
|
47
|
+
[
|
|
48
|
+
{
|
|
49
|
+
identifier,
|
|
50
|
+
validFrom: moment(`${today}T13:00:00Z`)
|
|
51
|
+
.toDate(),
|
|
52
|
+
validThrough: moment(`${today}T14:00:00Z`)
|
|
53
|
+
.toDate(),
|
|
54
|
+
validForMemberTier: { identifier: 'bronze' }
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
{
|
|
58
|
+
itemOfferedIdentifier: itemOfferedIdentifier
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
console.log('updated.');
|
|
62
|
+
|
|
63
|
+
const existingOffers = await productOfferService.findProductOffers({
|
|
64
|
+
limit: 10,
|
|
65
|
+
page: 1,
|
|
66
|
+
itemOfferedIdentifier
|
|
67
|
+
});
|
|
68
|
+
console.log(existingOffers.length, 'offers found.', existingOffers);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
main()
|
|
72
|
+
.then(() => {
|
|
73
|
+
console.log('success!');
|
|
74
|
+
})
|
|
75
|
+
.catch(console.error);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
import { loadCloudSearch } from '../../../../lib/';
|
|
3
|
+
import { auth } from '../../auth/clientCredentials';
|
|
4
|
+
|
|
5
|
+
const PROJECT_ID = String(process.env.PROJECT_ID);
|
|
6
|
+
|
|
7
|
+
async function main() {
|
|
8
|
+
const productOfferService = await (await loadCloudSearch({
|
|
9
|
+
endpoint: <string>process.env.API_ENDPOINT,
|
|
10
|
+
auth: await auth()
|
|
11
|
+
})).createProductOfferInstance({
|
|
12
|
+
project: { id: PROJECT_ID },
|
|
13
|
+
seller: { id: '' }
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const result = await productOfferService.findProductOffers({
|
|
17
|
+
limit: 10,
|
|
18
|
+
page: 1,
|
|
19
|
+
itemOfferedIdentifiers: ['xxx']
|
|
20
|
+
});
|
|
21
|
+
// tslint:disable-next-line:no-null-keyword
|
|
22
|
+
console.dir(result, { depth: null });
|
|
23
|
+
console.log(result.length, 'data found');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
main()
|
|
27
|
+
.then(() => {
|
|
28
|
+
console.log('success!');
|
|
29
|
+
})
|
|
30
|
+
.catch(console.error);
|
|
@@ -54,6 +54,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
54
54
|
exports.NoteAboutOrderService = void 0;
|
|
55
55
|
var http_status_1 = require("http-status");
|
|
56
56
|
var service_1 = require("../service");
|
|
57
|
+
var BASE_URI = '/orderNotes';
|
|
57
58
|
/**
|
|
58
59
|
* 注文メモサービス
|
|
59
60
|
*/
|
|
@@ -67,7 +68,7 @@ var NoteAboutOrderService = /** @class */ (function (_super) {
|
|
|
67
68
|
return __generator(this, function (_a) {
|
|
68
69
|
switch (_a.label) {
|
|
69
70
|
case 0: return [4 /*yield*/, this.fetch({
|
|
70
|
-
uri:
|
|
71
|
+
uri: BASE_URI,
|
|
71
72
|
method: 'PUT',
|
|
72
73
|
body: params,
|
|
73
74
|
expectedStatusCodes: [http_status_1.NO_CONTENT]
|
|
@@ -84,7 +85,7 @@ var NoteAboutOrderService = /** @class */ (function (_super) {
|
|
|
84
85
|
var _this = this;
|
|
85
86
|
return __generator(this, function (_a) {
|
|
86
87
|
return [2 /*return*/, this.fetch({
|
|
87
|
-
uri:
|
|
88
|
+
uri: BASE_URI,
|
|
88
89
|
method: 'GET',
|
|
89
90
|
qs: params,
|
|
90
91
|
expectedStatusCodes: [http_status_1.OK]
|
|
@@ -103,7 +104,7 @@ var NoteAboutOrderService = /** @class */ (function (_super) {
|
|
|
103
104
|
case 0:
|
|
104
105
|
text = body.text;
|
|
105
106
|
return [4 /*yield*/, this.fetch({
|
|
106
|
-
uri: "/
|
|
107
|
+
uri: BASE_URI + "/" + String(id),
|
|
107
108
|
method: 'PUT',
|
|
108
109
|
body: { text: text },
|
|
109
110
|
expectedStatusCodes: [http_status_1.NO_CONTENT]
|
|
@@ -6,10 +6,24 @@ export interface IFindParams {
|
|
|
6
6
|
*/
|
|
7
7
|
limit: number;
|
|
8
8
|
page: number;
|
|
9
|
+
/**
|
|
10
|
+
* プロダクトオファーコレクションコード
|
|
11
|
+
*/
|
|
9
12
|
itemOfferedIdentifier?: string;
|
|
13
|
+
/**
|
|
14
|
+
* プロダクトオファーコレクションコードリスト
|
|
15
|
+
* max length: 10
|
|
16
|
+
*/
|
|
10
17
|
itemOfferedIdentifiers?: string[];
|
|
18
|
+
/**
|
|
19
|
+
* プロダクトオファーコードリスト
|
|
20
|
+
* max length: 10
|
|
21
|
+
*/
|
|
11
22
|
identifiers?: string[];
|
|
12
23
|
id?: string;
|
|
24
|
+
/**
|
|
25
|
+
* 有効なメンバープログラムティアコード
|
|
26
|
+
*/
|
|
13
27
|
validForMemberTierIdentifier?: string;
|
|
14
28
|
}
|
|
15
29
|
/**
|
|
@@ -19,5 +19,8 @@ export declare type IAcceptedOffer = factory.order.IAcceptedOffer<factory.order.
|
|
|
19
19
|
/**
|
|
20
20
|
* 確認番号による照会結果としての注文
|
|
21
21
|
*/
|
|
22
|
-
export declare type IOrderAsFindByConfirmationNumberResult = Pick<factory.order.IOrder, 'confirmationNumber' | '
|
|
23
|
-
|
|
22
|
+
export declare type IOrderAsFindByConfirmationNumberResult = Pick<factory.order.IOrder, 'confirmationNumber' | 'dateReturned' | 'orderDate' | 'orderNumber' | 'orderStatus' | 'orderedItem' | 'paymentMethods' | 'price' | 'priceCurrency' | 'seller' | 'project' | 'typeOf'> & {
|
|
23
|
+
customer: {
|
|
24
|
+
id: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAcceptedOffer, IAuthorizeResult,
|
|
1
|
+
import { IAcceptedOffer, IAuthorizeResult, IOrderAsFindByConfirmationNumberResult } from './order/factory';
|
|
2
2
|
import { Service } from '../service';
|
|
3
3
|
/**
|
|
4
4
|
* 注文サービス
|
|
@@ -30,7 +30,7 @@ export declare class OrderService extends Service {
|
|
|
30
30
|
orderDateFrom?: Date;
|
|
31
31
|
orderDateThrough?: Date;
|
|
32
32
|
orderNumber?: string;
|
|
33
|
-
}): Promise<
|
|
33
|
+
}): Promise<IOrderAsFindByConfirmationNumberResult[]>;
|
|
34
34
|
/**
|
|
35
35
|
* イベントIDと確認番号で検索
|
|
36
36
|
*/
|
|
@@ -50,7 +50,7 @@ export declare class OrderService extends Service {
|
|
|
50
50
|
$in: string[];
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
-
}): Promise<
|
|
53
|
+
}): Promise<IOrderAsFindByConfirmationNumberResult[]>;
|
|
54
54
|
/**
|
|
55
55
|
* 予約番号と電話番号で注文情報を取得する(sskts専用)
|
|
56
56
|
*/
|
|
@@ -58,7 +58,7 @@ export declare class OrderService extends Service {
|
|
|
58
58
|
theaterCode: string;
|
|
59
59
|
confirmationNumber: string;
|
|
60
60
|
telephone: string;
|
|
61
|
-
}): Promise<
|
|
61
|
+
}): Promise<IOrderAsFindByConfirmationNumberResult[]>;
|
|
62
62
|
/**
|
|
63
63
|
* 注文番号と何かしらで注文照会
|
|
64
64
|
*/
|
|
@@ -67,7 +67,7 @@ export declare class OrderService extends Service {
|
|
|
67
67
|
customer?: {
|
|
68
68
|
telephone?: string;
|
|
69
69
|
};
|
|
70
|
-
}): Promise<
|
|
70
|
+
}): Promise<IOrderAsFindByConfirmationNumberResult>;
|
|
71
71
|
/**
|
|
72
72
|
* 注文配送
|
|
73
73
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as factory from '../../factory';
|
|
2
2
|
import { ISearchResult, Service } from '../../service';
|
|
3
|
-
import { IAcceptedOffer,
|
|
3
|
+
import { IAcceptedOffer, IOrderAsFindByConfirmationNumberResult, ISearchOrdersOptions } from '../../chevreAsset/order/factory';
|
|
4
4
|
import { IOrderAsSearchResult, IOrderAsSearchWithUnwindAcceptedOffersResult, IReturner, IUpdateChangeableAttributesParams } from '../../chevreConsole/order/factory';
|
|
5
5
|
/**
|
|
6
6
|
* 注文サービス
|
|
@@ -14,7 +14,7 @@ export declare class OrderService extends Service {
|
|
|
14
14
|
* 注文番号
|
|
15
15
|
*/
|
|
16
16
|
orderNumber: string;
|
|
17
|
-
}): Promise<
|
|
17
|
+
}): Promise<IOrderAsFindByConfirmationNumberResult>;
|
|
18
18
|
/**
|
|
19
19
|
* 注文を検索する
|
|
20
20
|
*/
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IFindParams } from '../../chevreAdmin/productOffer';
|
|
2
|
+
import * as factory from '../../factory';
|
|
3
|
+
import { Service } from '../../service';
|
|
4
|
+
/**
|
|
5
|
+
* プロダクトサービス
|
|
6
|
+
*/
|
|
7
|
+
export declare class ProductOfferService extends Service {
|
|
8
|
+
/**
|
|
9
|
+
* メンバープログラムティアで有効なプロダクトオファーを追加する
|
|
10
|
+
*/
|
|
11
|
+
createValidForMemberTierByIdentifier(
|
|
12
|
+
/**
|
|
13
|
+
* max: 20
|
|
14
|
+
*/
|
|
15
|
+
params: factory.productOffer.IAddValidForMemberTierParams[], options: {
|
|
16
|
+
/**
|
|
17
|
+
* プロダクトオファーコレクションコード
|
|
18
|
+
*/
|
|
19
|
+
itemOfferedIdentifier: string;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* メンバープログラムティアで有効なプロダクトオファーを編集する
|
|
23
|
+
*/
|
|
24
|
+
updateValidForMemberTierByIdentifier(
|
|
25
|
+
/**
|
|
26
|
+
* max: 20
|
|
27
|
+
*/
|
|
28
|
+
params: factory.productOffer.IAddValidForMemberTierParams[], options: {
|
|
29
|
+
/**
|
|
30
|
+
* プロダクトオファーコレクションコード
|
|
31
|
+
*/
|
|
32
|
+
itemOfferedIdentifier: string;
|
|
33
|
+
}): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* プロダクトオファーを検索する
|
|
36
|
+
*/
|
|
37
|
+
findProductOffers(params: IFindParams): Promise<(Omit<factory.productOffer.IProductOffer, 'project'> & {
|
|
38
|
+
id: string;
|
|
39
|
+
})[]>;
|
|
40
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
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.ProductOfferService = void 0;
|
|
55
|
+
var index_1 = require("../../index");
|
|
56
|
+
var service_1 = require("../../service");
|
|
57
|
+
/**
|
|
58
|
+
* プロダクトサービス
|
|
59
|
+
*/
|
|
60
|
+
var ProductOfferService = /** @class */ (function (_super) {
|
|
61
|
+
__extends(ProductOfferService, _super);
|
|
62
|
+
function ProductOfferService() {
|
|
63
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* メンバープログラムティアで有効なプロダクトオファーを追加する
|
|
67
|
+
*/
|
|
68
|
+
ProductOfferService.prototype.createValidForMemberTierByIdentifier = function (
|
|
69
|
+
/**
|
|
70
|
+
* max: 20
|
|
71
|
+
*/
|
|
72
|
+
params, options) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
74
|
+
var _a, auth, endpoint, project, seller, chevreAdmin, productOfferService;
|
|
75
|
+
return __generator(this, function (_b) {
|
|
76
|
+
switch (_b.label) {
|
|
77
|
+
case 0:
|
|
78
|
+
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller;
|
|
79
|
+
return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint })];
|
|
80
|
+
case 1:
|
|
81
|
+
chevreAdmin = _b.sent();
|
|
82
|
+
return [4 /*yield*/, chevreAdmin.createProductOfferInstance({
|
|
83
|
+
project: project,
|
|
84
|
+
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
|
|
85
|
+
})];
|
|
86
|
+
case 2:
|
|
87
|
+
productOfferService = _b.sent();
|
|
88
|
+
return [4 /*yield*/, productOfferService.createValidForMemberTierByIdentifier(params, options)];
|
|
89
|
+
case 3:
|
|
90
|
+
_b.sent();
|
|
91
|
+
return [2 /*return*/];
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* メンバープログラムティアで有効なプロダクトオファーを編集する
|
|
98
|
+
*/
|
|
99
|
+
ProductOfferService.prototype.updateValidForMemberTierByIdentifier = function (
|
|
100
|
+
/**
|
|
101
|
+
* max: 20
|
|
102
|
+
*/
|
|
103
|
+
params, options) {
|
|
104
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
105
|
+
var _a, auth, endpoint, project, seller, chevreAdmin, productOfferService;
|
|
106
|
+
return __generator(this, function (_b) {
|
|
107
|
+
switch (_b.label) {
|
|
108
|
+
case 0:
|
|
109
|
+
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller;
|
|
110
|
+
return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint })];
|
|
111
|
+
case 1:
|
|
112
|
+
chevreAdmin = _b.sent();
|
|
113
|
+
return [4 /*yield*/, chevreAdmin.createProductOfferInstance({
|
|
114
|
+
project: project,
|
|
115
|
+
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
|
|
116
|
+
})];
|
|
117
|
+
case 2:
|
|
118
|
+
productOfferService = _b.sent();
|
|
119
|
+
return [4 /*yield*/, productOfferService.updateValidForMemberTierByIdentifier(params, options)];
|
|
120
|
+
case 3:
|
|
121
|
+
_b.sent();
|
|
122
|
+
return [2 /*return*/];
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* プロダクトオファーを検索する
|
|
129
|
+
*/
|
|
130
|
+
ProductOfferService.prototype.findProductOffers = function (params) {
|
|
131
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
132
|
+
var _a, auth, endpoint, project, seller, chevreAdmin, productOfferService;
|
|
133
|
+
return __generator(this, function (_b) {
|
|
134
|
+
switch (_b.label) {
|
|
135
|
+
case 0:
|
|
136
|
+
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller;
|
|
137
|
+
return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint })];
|
|
138
|
+
case 1:
|
|
139
|
+
chevreAdmin = _b.sent();
|
|
140
|
+
return [4 /*yield*/, chevreAdmin.createProductOfferInstance({
|
|
141
|
+
project: project,
|
|
142
|
+
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
|
|
143
|
+
})];
|
|
144
|
+
case 2:
|
|
145
|
+
productOfferService = _b.sent();
|
|
146
|
+
return [2 /*return*/, productOfferService.findProductOffers(params)];
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
return ProductOfferService;
|
|
152
|
+
}(service_1.Service));
|
|
153
|
+
exports.ProductOfferService = ProductOfferService;
|
|
@@ -9,6 +9,7 @@ import type { OfferCatalogService } from './admin/offerCatalog';
|
|
|
9
9
|
import type { OfferCatalogItemService } from './admin/offerCatalogItem';
|
|
10
10
|
import type { OrderService } from './admin/order';
|
|
11
11
|
import type { ProductService } from './admin/product';
|
|
12
|
+
import type { ProductOfferService } from './admin/productOffer';
|
|
12
13
|
import type { ReservationService } from './admin/reservation';
|
|
13
14
|
import type { SellerService } from './admin/seller';
|
|
14
15
|
export declare namespace service {
|
|
@@ -83,6 +84,13 @@ export declare namespace service {
|
|
|
83
84
|
namespace Product {
|
|
84
85
|
let svc: typeof ProductService | undefined;
|
|
85
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* プロダクトオファーサービス
|
|
89
|
+
*/
|
|
90
|
+
type ProductOffer = ProductOfferService;
|
|
91
|
+
namespace ProductOffer {
|
|
92
|
+
let svc: typeof ProductOfferService | undefined;
|
|
93
|
+
}
|
|
86
94
|
/**
|
|
87
95
|
* 予約サービス
|
|
88
96
|
*/
|
|
@@ -114,6 +122,7 @@ export declare class CloudAdmin {
|
|
|
114
122
|
createOfferCatalogItemInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<OfferCatalogItemService>;
|
|
115
123
|
createOrderInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<OrderService>;
|
|
116
124
|
createProductInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<ProductService>;
|
|
125
|
+
createProductOfferInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<ProductOfferService>;
|
|
117
126
|
createReservationInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<ReservationService>;
|
|
118
127
|
createSellerInstance(params: Pick<IOptions, 'project'>): Promise<SellerService>;
|
|
119
128
|
}
|
|
@@ -80,6 +80,9 @@ var service;
|
|
|
80
80
|
var Product;
|
|
81
81
|
(function (Product) {
|
|
82
82
|
})(Product = service.Product || (service.Product = {}));
|
|
83
|
+
var ProductOffer;
|
|
84
|
+
(function (ProductOffer) {
|
|
85
|
+
})(ProductOffer = service.ProductOffer || (service.ProductOffer = {}));
|
|
83
86
|
var Reservation;
|
|
84
87
|
(function (Reservation) {
|
|
85
88
|
})(Reservation = service.Reservation || (service.Reservation = {}));
|
|
@@ -272,6 +275,23 @@ var CloudAdmin = /** @class */ (function () {
|
|
|
272
275
|
});
|
|
273
276
|
});
|
|
274
277
|
};
|
|
278
|
+
CloudAdmin.prototype.createProductOfferInstance = function (params) {
|
|
279
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
280
|
+
var _a;
|
|
281
|
+
return __generator(this, function (_b) {
|
|
282
|
+
switch (_b.label) {
|
|
283
|
+
case 0:
|
|
284
|
+
if (!(service.ProductOffer.svc === undefined)) return [3 /*break*/, 2];
|
|
285
|
+
_a = service.ProductOffer;
|
|
286
|
+
return [4 /*yield*/, Promise.resolve().then(function () { return require('./admin/productOffer'); })];
|
|
287
|
+
case 1:
|
|
288
|
+
_a.svc = (_b.sent()).ProductOfferService;
|
|
289
|
+
_b.label = 2;
|
|
290
|
+
case 2: return [2 /*return*/, new service.ProductOffer.svc(__assign(__assign(__assign({}, this.options), params), { retryableStatusCodes: defaultRetryableStatusCodes }))];
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
};
|
|
275
295
|
CloudAdmin.prototype.createReservationInstance = function (params) {
|
|
276
296
|
return __awaiter(this, void 0, void 0, function () {
|
|
277
297
|
var _a;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAcceptedOffer,
|
|
1
|
+
import { IAcceptedOffer, IOrderAsFindByConfirmationNumberResult } from '../../chevreAsset/order/factory';
|
|
2
2
|
import { Service } from '../../service';
|
|
3
3
|
/**
|
|
4
4
|
* 注文サービス
|
|
@@ -40,7 +40,7 @@ export declare class OrderService extends Service {
|
|
|
40
40
|
orderDateFrom?: Date;
|
|
41
41
|
orderDateThrough?: Date;
|
|
42
42
|
orderNumber?: string;
|
|
43
|
-
}): Promise<
|
|
43
|
+
}): Promise<IOrderAsFindByConfirmationNumberResult[]>;
|
|
44
44
|
/**
|
|
45
45
|
* イベントIDと確認番号で検索
|
|
46
46
|
*/
|
|
@@ -60,7 +60,7 @@ export declare class OrderService extends Service {
|
|
|
60
60
|
$in: string[];
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
|
-
}): Promise<
|
|
63
|
+
}): Promise<IOrderAsFindByConfirmationNumberResult[]>;
|
|
64
64
|
/**
|
|
65
65
|
* 予約番号と電話番号で注文情報を取得する(sskts専用)
|
|
66
66
|
*/
|
|
@@ -74,7 +74,7 @@ export declare class OrderService extends Service {
|
|
|
74
74
|
*/
|
|
75
75
|
confirmationNumber: string;
|
|
76
76
|
telephone: string;
|
|
77
|
-
}): Promise<
|
|
77
|
+
}): Promise<IOrderAsFindByConfirmationNumberResult[]>;
|
|
78
78
|
/**
|
|
79
79
|
* 注文番号と何かしらで注文照会
|
|
80
80
|
*/
|
|
@@ -83,7 +83,7 @@ export declare class OrderService extends Service {
|
|
|
83
83
|
customer?: {
|
|
84
84
|
telephone?: string;
|
|
85
85
|
};
|
|
86
|
-
}): Promise<
|
|
86
|
+
}): Promise<IOrderAsFindByConfirmationNumberResult>;
|
|
87
87
|
/**
|
|
88
88
|
* 注文承認
|
|
89
89
|
* 注文コードを発行する
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IFindParams, IProductOfferAsFindResult } from '../../chevre/productOffer';
|
|
2
|
+
import { Service } from '../../service';
|
|
3
|
+
/**
|
|
4
|
+
* プロダクトオファーサービス
|
|
5
|
+
*/
|
|
6
|
+
export declare class ProductOfferService extends Service {
|
|
7
|
+
/**
|
|
8
|
+
* プロダクトオファー(汎用的なオファー設定)を検索する
|
|
9
|
+
*/
|
|
10
|
+
findProductOffers(params: IFindParams): Promise<IProductOfferAsFindResult[]>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
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.ProductOfferService = void 0;
|
|
55
|
+
var http_status_1 = require("http-status");
|
|
56
|
+
var service_1 = require("../../service");
|
|
57
|
+
var BASE_URI = '/productOffers';
|
|
58
|
+
/**
|
|
59
|
+
* プロダクトオファーサービス
|
|
60
|
+
*/
|
|
61
|
+
var ProductOfferService = /** @class */ (function (_super) {
|
|
62
|
+
__extends(ProductOfferService, _super);
|
|
63
|
+
function ProductOfferService() {
|
|
64
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* プロダクトオファー(汎用的なオファー設定)を検索する
|
|
68
|
+
*/
|
|
69
|
+
ProductOfferService.prototype.findProductOffers = function (params) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
71
|
+
var limit, page, itemOfferedIdentifiers, identifiers, id, validForMemberTierIdentifier;
|
|
72
|
+
var _this = this;
|
|
73
|
+
return __generator(this, function (_a) {
|
|
74
|
+
limit = params.limit, page = params.page, itemOfferedIdentifiers = params.itemOfferedIdentifiers, identifiers = params.identifiers, id = params.id, validForMemberTierIdentifier = params.validForMemberTierIdentifier;
|
|
75
|
+
return [2 /*return*/, this.fetch({
|
|
76
|
+
uri: BASE_URI,
|
|
77
|
+
method: 'GET',
|
|
78
|
+
qs: { limit: limit, page: page, itemOfferedIdentifiers: itemOfferedIdentifiers, identifiers: identifiers, id: id, validForMemberTierIdentifier: validForMemberTierIdentifier },
|
|
79
|
+
expectedStatusCodes: [http_status_1.OK]
|
|
80
|
+
})
|
|
81
|
+
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
82
|
+
return [2 /*return*/, response.json()];
|
|
83
|
+
}); }); })];
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
return ProductOfferService;
|
|
88
|
+
}(service_1.Service));
|
|
89
|
+
exports.ProductOfferService = ProductOfferService;
|