@cinerino/sdk 3.105.0-alpha.1 → 3.105.0-alpha.2
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.
|
@@ -6360,7 +6360,7 @@ var AwardService = /** @class */ (function (_super) {
|
|
|
6360
6360
|
uri: "/awards/authorize",
|
|
6361
6361
|
method: 'POST',
|
|
6362
6362
|
expectedStatusCodes: [http_status_1.CREATED],
|
|
6363
|
-
body: params
|
|
6363
|
+
body: params
|
|
6364
6364
|
})
|
|
6365
6365
|
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
6366
6366
|
return [2 /*return*/, response.json()];
|
|
@@ -8342,6 +8342,26 @@ var OrderService = /** @class */ (function (_super) {
|
|
|
8342
8342
|
});
|
|
8343
8343
|
});
|
|
8344
8344
|
};
|
|
8345
|
+
/**
|
|
8346
|
+
* 変更可能な属性を更新する
|
|
8347
|
+
*/
|
|
8348
|
+
OrderService.prototype.updateChageableAttributes = function (params) {
|
|
8349
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8350
|
+
return __generator(this, function (_a) {
|
|
8351
|
+
switch (_a.label) {
|
|
8352
|
+
case 0: return [4 /*yield*/, this.fetch({
|
|
8353
|
+
uri: "/orders/" + params.orderNumber,
|
|
8354
|
+
method: 'PATCH',
|
|
8355
|
+
body: params,
|
|
8356
|
+
expectedStatusCodes: [http_status_1.NO_CONTENT]
|
|
8357
|
+
})];
|
|
8358
|
+
case 1:
|
|
8359
|
+
_a.sent();
|
|
8360
|
+
return [2 /*return*/];
|
|
8361
|
+
}
|
|
8362
|
+
});
|
|
8363
|
+
});
|
|
8364
|
+
};
|
|
8345
8365
|
/**
|
|
8346
8366
|
* 注文を検索する
|
|
8347
8367
|
*/
|
|
@@ -11467,6 +11487,23 @@ var PlaceOrderTransactionService = /** @class */ (function (_super) {
|
|
|
11467
11487
|
});
|
|
11468
11488
|
});
|
|
11469
11489
|
};
|
|
11490
|
+
PlaceOrderTransactionService.prototype.updateObject = function (params) {
|
|
11491
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11492
|
+
return __generator(this, function (_a) {
|
|
11493
|
+
switch (_a.label) {
|
|
11494
|
+
case 0: return [4 /*yield*/, this.fetch({
|
|
11495
|
+
uri: "/transactions/" + this.typeOf + "/" + params.id + "/object",
|
|
11496
|
+
method: 'PATCH',
|
|
11497
|
+
expectedStatusCodes: [http_status_1.NO_CONTENT],
|
|
11498
|
+
body: params.object
|
|
11499
|
+
})];
|
|
11500
|
+
case 1:
|
|
11501
|
+
_a.sent();
|
|
11502
|
+
return [2 /*return*/];
|
|
11503
|
+
}
|
|
11504
|
+
});
|
|
11505
|
+
});
|
|
11506
|
+
};
|
|
11470
11507
|
/**
|
|
11471
11508
|
* 取引期限変更
|
|
11472
11509
|
*/
|
|
@@ -127,6 +127,11 @@ async function main() {
|
|
|
127
127
|
const publishOrderNumberReulst = await placeOrderService.publishOrderNumberIfNotExist({ id: transaction.id });
|
|
128
128
|
console.log(publishOrderNumberReulst.orderNumber);
|
|
129
129
|
|
|
130
|
+
await placeOrderService.updateObject({
|
|
131
|
+
id: transaction.id,
|
|
132
|
+
object: { name: 'order from samples' }
|
|
133
|
+
});
|
|
134
|
+
|
|
130
135
|
// 取引を中止する場合はコチラ↓
|
|
131
136
|
// console.log('取引を中止します...');
|
|
132
137
|
// await placeOrderService.cancel({ id: transaction.id });
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// tslint:disable:no-implicit-dependencies no-console no-magic-numbers
|
|
2
|
+
import * as client from '../../../lib/';
|
|
3
|
+
import * as auth from '../auth/authAsAdmin';
|
|
4
|
+
|
|
5
|
+
const project = { id: process.env.PROJECT_ID };
|
|
6
|
+
|
|
7
|
+
async function main() {
|
|
8
|
+
const authClient = await auth.login();
|
|
9
|
+
await authClient.refreshAccessToken();
|
|
10
|
+
const loginTicket = authClient.verifyIdToken({});
|
|
11
|
+
console.log('username is', loginTicket.getUsername());
|
|
12
|
+
|
|
13
|
+
const orderService = new client.chevre.service.Order({
|
|
14
|
+
endpoint: <string>process.env.CHEVRE_ENDPOINT,
|
|
15
|
+
auth: authClient,
|
|
16
|
+
project
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
await orderService.updateChageableAttributes({
|
|
20
|
+
orderNumber: 'SSK8-6423943-4357426',
|
|
21
|
+
name: 'xxx'
|
|
22
|
+
});
|
|
23
|
+
console.log('order updated');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
main()
|
|
27
|
+
.then(() => {
|
|
28
|
+
console.log('main processed.');
|
|
29
|
+
})
|
|
30
|
+
.catch(console.error);
|
package/lib/bundle.js
CHANGED
|
@@ -6360,7 +6360,7 @@ var AwardService = /** @class */ (function (_super) {
|
|
|
6360
6360
|
uri: "/awards/authorize",
|
|
6361
6361
|
method: 'POST',
|
|
6362
6362
|
expectedStatusCodes: [http_status_1.CREATED],
|
|
6363
|
-
body: params
|
|
6363
|
+
body: params
|
|
6364
6364
|
})
|
|
6365
6365
|
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
6366
6366
|
return [2 /*return*/, response.json()];
|
|
@@ -8342,6 +8342,26 @@ var OrderService = /** @class */ (function (_super) {
|
|
|
8342
8342
|
});
|
|
8343
8343
|
});
|
|
8344
8344
|
};
|
|
8345
|
+
/**
|
|
8346
|
+
* 変更可能な属性を更新する
|
|
8347
|
+
*/
|
|
8348
|
+
OrderService.prototype.updateChageableAttributes = function (params) {
|
|
8349
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8350
|
+
return __generator(this, function (_a) {
|
|
8351
|
+
switch (_a.label) {
|
|
8352
|
+
case 0: return [4 /*yield*/, this.fetch({
|
|
8353
|
+
uri: "/orders/" + params.orderNumber,
|
|
8354
|
+
method: 'PATCH',
|
|
8355
|
+
body: params,
|
|
8356
|
+
expectedStatusCodes: [http_status_1.NO_CONTENT]
|
|
8357
|
+
})];
|
|
8358
|
+
case 1:
|
|
8359
|
+
_a.sent();
|
|
8360
|
+
return [2 /*return*/];
|
|
8361
|
+
}
|
|
8362
|
+
});
|
|
8363
|
+
});
|
|
8364
|
+
};
|
|
8345
8365
|
/**
|
|
8346
8366
|
* 注文を検索する
|
|
8347
8367
|
*/
|
|
@@ -11379,6 +11399,23 @@ var PlaceOrderTransactionService = /** @class */ (function (_super) {
|
|
|
11379
11399
|
});
|
|
11380
11400
|
});
|
|
11381
11401
|
};
|
|
11402
|
+
PlaceOrderTransactionService.prototype.updateObject = function (params) {
|
|
11403
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11404
|
+
return __generator(this, function (_a) {
|
|
11405
|
+
switch (_a.label) {
|
|
11406
|
+
case 0: return [4 /*yield*/, this.fetch({
|
|
11407
|
+
uri: "/transactions/" + this.typeOf + "/" + params.id + "/object",
|
|
11408
|
+
method: 'PATCH',
|
|
11409
|
+
expectedStatusCodes: [http_status_1.NO_CONTENT],
|
|
11410
|
+
body: params.object
|
|
11411
|
+
})];
|
|
11412
|
+
case 1:
|
|
11413
|
+
_a.sent();
|
|
11414
|
+
return [2 /*return*/];
|
|
11415
|
+
}
|
|
11416
|
+
});
|
|
11417
|
+
});
|
|
11418
|
+
};
|
|
11382
11419
|
/**
|
|
11383
11420
|
* 取引期限変更
|
|
11384
11421
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cinerino/sdk",
|
|
3
|
-
"version": "3.105.0-alpha.
|
|
3
|
+
"version": "3.105.0-alpha.2",
|
|
4
4
|
"description": "Cinerino SDK",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"browser": {
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"watchify": "^3.11.1"
|
|
98
98
|
},
|
|
99
99
|
"dependencies": {
|
|
100
|
-
"@cinerino/api-abstract-client": "3.105.0-alpha.
|
|
100
|
+
"@cinerino/api-abstract-client": "3.105.0-alpha.3",
|
|
101
101
|
"debug": "^3.2.6",
|
|
102
102
|
"http-status": "^1.4.2",
|
|
103
103
|
"idtoken-verifier": "^2.0.3",
|