@cinerino/sdk 3.33.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
@@ -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
@@ -12528,6 +12528,36 @@ var OfferService = /** @class */ (function (_super) {
12528
12528
  function OfferService() {
12529
12529
  return _super !== null && _super.apply(this, arguments) || this;
12530
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
+ };
12531
12561
  /**
12532
12562
  * 入金オファー承認
12533
12563
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "3.33.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.33.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",