@cinerino/sdk 12.7.0 → 12.8.0-alpha.1
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.
|
@@ -5,6 +5,8 @@ import * as auth from '../../auth/authAsAdmin';
|
|
|
5
5
|
|
|
6
6
|
const PROJECT_ID = String(process.env.PROJECT_ID);
|
|
7
7
|
const SELLER_ID = '59d20831e53ebc2b4e774466';
|
|
8
|
+
const OFFER_IDENTIFIER = '20251115eventOffer01';
|
|
9
|
+
const itemOfferedId = '69151228ad580da66c8b5068';
|
|
8
10
|
|
|
9
11
|
// tslint:disable-next-line:max-func-body-length
|
|
10
12
|
async function main() {
|
|
@@ -21,56 +23,42 @@ async function main() {
|
|
|
21
23
|
seller: { id: SELLER_ID }
|
|
22
24
|
});
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// ],
|
|
40
|
-
// {
|
|
41
|
-
// itemOfferedIdentifier,
|
|
42
|
-
// offeredById: SELLER_ID
|
|
43
|
-
// }
|
|
44
|
-
// );
|
|
45
|
-
// console.log('created.');
|
|
26
|
+
const now = new Date();
|
|
27
|
+
await eventOfferService.createEventOfferByIdentifier(
|
|
28
|
+
[
|
|
29
|
+
{
|
|
30
|
+
identifier: OFFER_IDENTIFIER,
|
|
31
|
+
availableAtOrFrom: { identifier: 'SmartTheaterTXN' },
|
|
32
|
+
validFrom: now,
|
|
33
|
+
validThrough: now
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
{
|
|
37
|
+
itemOfferedId
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
console.log('created.');
|
|
46
41
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
// ],
|
|
62
|
-
// {
|
|
63
|
-
// itemOfferedIdentifier,
|
|
64
|
-
// offeredById: SELLER_ID
|
|
65
|
-
// }
|
|
66
|
-
// );
|
|
67
|
-
// console.log('updated.');
|
|
42
|
+
await eventOfferService.updateEventOfferByIdentifier(
|
|
43
|
+
[
|
|
44
|
+
{
|
|
45
|
+
identifier: OFFER_IDENTIFIER,
|
|
46
|
+
availableAtOrFrom: { identifier: 'SmartTheaterTXN' },
|
|
47
|
+
validFrom: now,
|
|
48
|
+
validThrough: now
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
{
|
|
52
|
+
itemOfferedId
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
console.log('updated.');
|
|
68
56
|
|
|
69
57
|
const offers = await eventOfferService.findEventOffers({
|
|
70
58
|
limit: 10,
|
|
71
59
|
page: 1,
|
|
72
60
|
// itemOfferedId: '691511df7d9f0e2df3d6dcf7'
|
|
73
|
-
itemOfferedId:
|
|
61
|
+
itemOfferedId: itemOfferedId
|
|
74
62
|
});
|
|
75
63
|
// tslint:disable-next-line:no-null-keyword
|
|
76
64
|
console.dir(offers, { depth: null });
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import * as factory from '../factory';
|
|
2
2
|
import { Service } from '../service';
|
|
3
|
+
export declare type ICreatingEventOffer = Pick<factory.eventOffer.IEventOffer, 'identifier' | 'offeredBy' | 'validFrom' | 'validThrough' | 'availableAtOrFrom'>;
|
|
3
4
|
export interface IFindParams {
|
|
4
5
|
/**
|
|
5
6
|
* max: 20
|
|
6
7
|
*/
|
|
7
8
|
limit: number;
|
|
8
9
|
page: number;
|
|
10
|
+
/**
|
|
11
|
+
* アプリケーションコード
|
|
12
|
+
*/
|
|
13
|
+
availableAtOrFromIdentifier?: string;
|
|
9
14
|
/**
|
|
10
15
|
* イベントID
|
|
11
16
|
*/
|
|
@@ -30,12 +35,22 @@ export declare class EventOfferService extends Service {
|
|
|
30
35
|
/**
|
|
31
36
|
* max: 20
|
|
32
37
|
*/
|
|
33
|
-
params:
|
|
38
|
+
params: ICreatingEventOffer[], options: {
|
|
39
|
+
/**
|
|
40
|
+
* イベントID
|
|
41
|
+
*/
|
|
42
|
+
itemOfferedId: string;
|
|
43
|
+
}): Promise<void>;
|
|
34
44
|
updateEventOfferByIdentifier(
|
|
35
45
|
/**
|
|
36
46
|
* max: 20
|
|
37
47
|
*/
|
|
38
|
-
params:
|
|
48
|
+
params: ICreatingEventOffer[], options: {
|
|
49
|
+
/**
|
|
50
|
+
* イベントID
|
|
51
|
+
*/
|
|
52
|
+
itemOfferedId: string;
|
|
53
|
+
}): Promise<void>;
|
|
39
54
|
findEventOffers(params: IFindParams): Promise<(Omit<factory.eventOffer.IEventOffer, 'project'> & {
|
|
40
55
|
id: string;
|
|
41
56
|
})[]>;
|
|
@@ -69,20 +69,20 @@ var EventOfferService = /** @class */ (function (_super) {
|
|
|
69
69
|
*/
|
|
70
70
|
params, options) {
|
|
71
71
|
return __awaiter(this, void 0, void 0, function () {
|
|
72
|
-
var
|
|
73
|
-
return __generator(this, function (
|
|
74
|
-
switch (
|
|
72
|
+
var itemOfferedId;
|
|
73
|
+
return __generator(this, function (_a) {
|
|
74
|
+
switch (_a.label) {
|
|
75
75
|
case 0:
|
|
76
|
-
|
|
76
|
+
itemOfferedId = options.itemOfferedId;
|
|
77
77
|
return [4 /*yield*/, this.fetch({
|
|
78
78
|
uri: BASE_URI,
|
|
79
79
|
method: 'POST',
|
|
80
80
|
body: params,
|
|
81
|
-
qs: {},
|
|
81
|
+
qs: { itemOfferedId: itemOfferedId },
|
|
82
82
|
expectedStatusCodes: [http_status_1.NO_CONTENT]
|
|
83
83
|
})];
|
|
84
84
|
case 1:
|
|
85
|
-
|
|
85
|
+
_a.sent();
|
|
86
86
|
return [2 /*return*/];
|
|
87
87
|
}
|
|
88
88
|
});
|
|
@@ -94,20 +94,20 @@ var EventOfferService = /** @class */ (function (_super) {
|
|
|
94
94
|
*/
|
|
95
95
|
params, options) {
|
|
96
96
|
return __awaiter(this, void 0, void 0, function () {
|
|
97
|
-
var
|
|
98
|
-
return __generator(this, function (
|
|
99
|
-
switch (
|
|
97
|
+
var itemOfferedId;
|
|
98
|
+
return __generator(this, function (_a) {
|
|
99
|
+
switch (_a.label) {
|
|
100
100
|
case 0:
|
|
101
|
-
|
|
101
|
+
itemOfferedId = options.itemOfferedId;
|
|
102
102
|
return [4 /*yield*/, this.fetch({
|
|
103
103
|
uri: BASE_URI,
|
|
104
104
|
method: 'PUT',
|
|
105
105
|
body: params,
|
|
106
|
-
qs: {},
|
|
106
|
+
qs: { itemOfferedId: itemOfferedId },
|
|
107
107
|
expectedStatusCodes: [http_status_1.NO_CONTENT]
|
|
108
108
|
})];
|
|
109
109
|
case 1:
|
|
110
|
-
|
|
110
|
+
_a.sent();
|
|
111
111
|
return [2 /*return*/];
|
|
112
112
|
}
|
|
113
113
|
});
|
package/lib/bundle.js
CHANGED
|
@@ -3031,20 +3031,20 @@ var EventOfferService = /** @class */ (function (_super) {
|
|
|
3031
3031
|
*/
|
|
3032
3032
|
params, options) {
|
|
3033
3033
|
return __awaiter(this, void 0, void 0, function () {
|
|
3034
|
-
var
|
|
3035
|
-
return __generator(this, function (
|
|
3036
|
-
switch (
|
|
3034
|
+
var itemOfferedId;
|
|
3035
|
+
return __generator(this, function (_a) {
|
|
3036
|
+
switch (_a.label) {
|
|
3037
3037
|
case 0:
|
|
3038
|
-
|
|
3038
|
+
itemOfferedId = options.itemOfferedId;
|
|
3039
3039
|
return [4 /*yield*/, this.fetch({
|
|
3040
3040
|
uri: BASE_URI,
|
|
3041
3041
|
method: 'POST',
|
|
3042
3042
|
body: params,
|
|
3043
|
-
qs: {},
|
|
3043
|
+
qs: { itemOfferedId: itemOfferedId },
|
|
3044
3044
|
expectedStatusCodes: [http_status_1.NO_CONTENT]
|
|
3045
3045
|
})];
|
|
3046
3046
|
case 1:
|
|
3047
|
-
|
|
3047
|
+
_a.sent();
|
|
3048
3048
|
return [2 /*return*/];
|
|
3049
3049
|
}
|
|
3050
3050
|
});
|
|
@@ -3056,20 +3056,20 @@ var EventOfferService = /** @class */ (function (_super) {
|
|
|
3056
3056
|
*/
|
|
3057
3057
|
params, options) {
|
|
3058
3058
|
return __awaiter(this, void 0, void 0, function () {
|
|
3059
|
-
var
|
|
3060
|
-
return __generator(this, function (
|
|
3061
|
-
switch (
|
|
3059
|
+
var itemOfferedId;
|
|
3060
|
+
return __generator(this, function (_a) {
|
|
3061
|
+
switch (_a.label) {
|
|
3062
3062
|
case 0:
|
|
3063
|
-
|
|
3063
|
+
itemOfferedId = options.itemOfferedId;
|
|
3064
3064
|
return [4 /*yield*/, this.fetch({
|
|
3065
3065
|
uri: BASE_URI,
|
|
3066
3066
|
method: 'PUT',
|
|
3067
3067
|
body: params,
|
|
3068
|
-
qs: {},
|
|
3068
|
+
qs: { itemOfferedId: itemOfferedId },
|
|
3069
3069
|
expectedStatusCodes: [http_status_1.NO_CONTENT]
|
|
3070
3070
|
})];
|
|
3071
3071
|
case 1:
|
|
3072
|
-
|
|
3072
|
+
_a.sent();
|
|
3073
3073
|
return [2 /*return*/];
|
|
3074
3074
|
}
|
|
3075
3075
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cinerino/sdk",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.8.0-alpha.1",
|
|
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.
|
|
96
|
+
"@chevre/factory": "5.2.0-alpha.11",
|
|
97
97
|
"debug": "3.2.7",
|
|
98
98
|
"http-status": "1.7.4",
|
|
99
99
|
"idtoken-verifier": "2.0.3",
|