@cinerino/sdk 3.32.0-alpha.1 → 3.33.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.
package/CHANGELOG.md CHANGED
@@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
8
8
 
9
9
  ### Added
10
10
 
11
+ - Cinerinoにオファー検索を追加
12
+
11
13
  ### Changed
12
14
 
13
15
  - update @chevre/factory
@@ -16,10 +18,19 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
16
18
 
17
19
  ### Removed
18
20
 
21
+ - 非推奨口座開設サービスを廃止
22
+
19
23
  ### Fixed
20
24
 
21
25
  ### Security
22
26
 
27
+ ## v3.32.0 - 2022-01-13
28
+
29
+ ### Changed
30
+
31
+ - Chevre注文配送をNO_CONTENTに対応
32
+ - update @chevre/factory
33
+
23
34
  ## v3.31.1 - 2022-01-01
24
35
 
25
36
  ### Changed
@@ -0,0 +1,37 @@
1
+ // tslint:disable:no-console
2
+ /**
3
+ * オファー検索
4
+ */
5
+ // tslint:disable-next-line:no-implicit-dependencies
6
+ // import * as moment from 'moment';
7
+ import * as client from '../../lib/index';
8
+ import * as auth from './auth/authAsAdmin';
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 offerService = new client.service.Offer({
17
+ endpoint: <string>process.env.API_ENDPOINT,
18
+ auth: authClient,
19
+ project: { id: 'cinerino' }
20
+ });
21
+
22
+ const { data } = await offerService.search({
23
+ limit: 10,
24
+ page: 1,
25
+ id: {
26
+ $in: []
27
+ }
28
+ });
29
+ console.log(data);
30
+ console.log(data.length, 'offers returned');
31
+ }
32
+
33
+ main()
34
+ .then(() => {
35
+ console.log('success!');
36
+ })
37
+ .catch(console.error);
package/lib/bundle.js CHANGED
@@ -2915,8 +2915,10 @@ var RefundTypeEnumeration;
2915
2915
  })(RefundTypeEnumeration = exports.RefundTypeEnumeration || (exports.RefundTypeEnumeration = {}));
2916
2916
  var ReturnFeesEnumeration;
2917
2917
  (function (ReturnFeesEnumeration) {
2918
+ ReturnFeesEnumeration["FreeReturn"] = "FreeReturn";
2918
2919
  ReturnFeesEnumeration["OriginalShippingFees"] = "OriginalShippingFees";
2919
2920
  ReturnFeesEnumeration["RestockingFees"] = "RestockingFees";
2921
+ ReturnFeesEnumeration["ReturnFeesCustomerResponsibility"] = "ReturnFeesCustomerResponsibility";
2920
2922
  ReturnFeesEnumeration["ReturnShippingFees"] = "ReturnShippingFees";
2921
2923
  })(ReturnFeesEnumeration = exports.ReturnFeesEnumeration || (exports.ReturnFeesEnumeration = {}));
2922
2924
  /**
@@ -12526,6 +12528,36 @@ var OfferService = /** @class */ (function (_super) {
12526
12528
  function OfferService() {
12527
12529
  return _super !== null && _super.apply(this, arguments) || this;
12528
12530
  }
12531
+ /**
12532
+ * オファー検索
12533
+ */
12534
+ OfferService.prototype.search = function (
12535
+ // params: factory.offer.ISearchConditions
12536
+ params) {
12537
+ return __awaiter(this, void 0, void 0, function () {
12538
+ var _this = this;
12539
+ return __generator(this, function (_a) {
12540
+ return [2 /*return*/, this.fetch({
12541
+ uri: '/offers',
12542
+ method: 'GET',
12543
+ qs: params,
12544
+ expectedStatusCodes: [http_status_1.OK]
12545
+ })
12546
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
12547
+ var _a;
12548
+ return __generator(this, function (_b) {
12549
+ switch (_b.label) {
12550
+ case 0:
12551
+ _a = {};
12552
+ return [4 /*yield*/, response.json()];
12553
+ case 1: return [2 /*return*/, (_a.data = _b.sent(),
12554
+ _a)];
12555
+ }
12556
+ });
12557
+ }); })];
12558
+ });
12559
+ });
12560
+ };
12529
12561
  /**
12530
12562
  * 入金オファー承認
12531
12563
  */
@@ -13616,26 +13648,31 @@ var PersonOwnershipInfoService = /** @class */ (function (_super) {
13616
13648
  /**
13617
13649
  * 口座開設
13618
13650
  */
13619
- PersonOwnershipInfoService.prototype.openAccount = function (params) {
13620
- return __awaiter(this, void 0, void 0, function () {
13621
- var id;
13622
- var _this = this;
13623
- return __generator(this, function (_a) {
13624
- id = (typeof params.id === 'string') ? params.id : 'me';
13625
- return [2 /*return*/, this.fetch({
13626
- uri: "/people/" + id + "/ownershipInfos/accounts/" + params.accountType,
13627
- method: 'POST',
13628
- body: {
13629
- name: params.name
13630
- },
13631
- expectedStatusCodes: [http_status_1.CREATED]
13632
- })
13633
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
13634
- return [2 /*return*/, response.json()];
13635
- }); }); })];
13636
- });
13637
- });
13638
- };
13651
+ // public async openAccount(params: {
13652
+ // /**
13653
+ // * 未指定の場合`me`がセットされます
13654
+ // */
13655
+ // id?: string;
13656
+ // /**
13657
+ // * 口座名義
13658
+ // */
13659
+ // name: string;
13660
+ // /**
13661
+ // * 口座タイプ
13662
+ // */
13663
+ // accountType: string;
13664
+ // }): Promise<factory.transaction.placeOrder.IResult> {
13665
+ // const id = (typeof params.id === 'string') ? params.id : 'me';
13666
+ // return this.fetch({
13667
+ // uri: `/people/${id}/ownershipInfos/accounts/${params.accountType}`,
13668
+ // method: 'POST',
13669
+ // body: {
13670
+ // name: params.name
13671
+ // },
13672
+ // expectedStatusCodes: [CREATED]
13673
+ // })
13674
+ // .then(async (response) => response.json());
13675
+ // }
13639
13676
  /**
13640
13677
  * 口座解約
13641
13678
  * 口座の状態を変更するだけで、ユーザーの所有する口座リストから削除はされません。
@@ -16005,7 +16042,7 @@ var parseObject = function (chain, val, options, valuesParsed) {
16005
16042
  ) {
16006
16043
  obj = [];
16007
16044
  obj[index] = leaf;
16008
- } else {
16045
+ } else if (cleanRoot !== '__proto__') {
16009
16046
  obj[cleanRoot] = leaf;
16010
16047
  }
16011
16048
  }
@@ -16214,7 +16251,7 @@ var stringify = function stringify(
16214
16251
  var tmpSc = sideChannel;
16215
16252
  var step = 0;
16216
16253
  var findFlag = false;
16217
- while ((tmpSc = tmpSc.get(sentinel)) !== undefined && !findFlag) {
16254
+ while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
16218
16255
  // Where object last appeared in the ref tree
16219
16256
  var pos = tmpSc.get(object);
16220
16257
  step += 1;
@@ -16276,7 +16313,7 @@ var stringify = function stringify(
16276
16313
  var objKeys;
16277
16314
  if (generateArrayPrefix === 'comma' && isArray(obj)) {
16278
16315
  // we need to join elements in
16279
- objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : undefined }];
16316
+ objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
16280
16317
  } else if (isArray(filter)) {
16281
16318
  objKeys = filter;
16282
16319
  } else {
@@ -16286,7 +16323,7 @@ var stringify = function stringify(
16286
16323
 
16287
16324
  for (var j = 0; j < objKeys.length; ++j) {
16288
16325
  var key = objKeys[j];
16289
- var value = typeof key === 'object' && key.value !== undefined ? key.value : obj[key];
16326
+ var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
16290
16327
 
16291
16328
  if (skipNulls && value === null) {
16292
16329
  continue;
@@ -16326,7 +16363,7 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
16326
16363
  return defaults;
16327
16364
  }
16328
16365
 
16329
- if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {
16366
+ if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
16330
16367
  throw new TypeError('Encoder has to be a function.');
16331
16368
  }
16332
16369
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "3.32.0-alpha.1",
3
+ "version": "3.33.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.32.0-alpha.1",
100
+ "@cinerino/api-abstract-client": "3.33.0-alpha.2",
101
101
  "debug": "^3.2.6",
102
102
  "http-status": "^1.4.2",
103
103
  "idtoken-verifier": "^2.0.3",