@cinerino/sdk 11.2.0-alpha.4 → 12.0.0-alpha.0

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.
@@ -0,0 +1,35 @@
1
+ // tslint:disable:no-console
2
+ import { factory, 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 creativeWorkService = await (await loadCloudSearch({
9
+ endpoint: <string>process.env.API_ENDPOINT,
10
+ auth: await auth(),
11
+ defaultPath: '/secondary',
12
+ disableAutoRetry: true
13
+ })).createCreativeWorkInstance({
14
+ project: { id: PROJECT_ID },
15
+ seller: { id: '' }
16
+ });
17
+
18
+ const result = await creativeWorkService.findMovies({
19
+ limit: 3,
20
+ page: 1
21
+ // sort: {
22
+ // identifier: factory.sortType.Descending
23
+ // },
24
+ // identifier: { $in: ['00001'] }
25
+ });
26
+ // tslint:disable-next-line:no-null-keyword
27
+ console.dir(result, { depth: null });
28
+ console.log(result.length, 'movies');
29
+ }
30
+
31
+ main()
32
+ .then(() => {
33
+ console.log('success!');
34
+ })
35
+ .catch(console.error);
@@ -1,10 +1,12 @@
1
1
  import * as factory from '../factory';
2
2
  import { Service } from '../service';
3
+ export declare type IMovieAsFindResult = Pick<factory.creativeWork.movie.ICreativeWork, 'additionalProperty' | 'alternativeHeadline' | 'contentRating' | 'datePublished' | 'distributor' | 'duration' | 'headline' | 'identifier' | 'name' | 'project' | 'thumbnailUrl' | 'typeOf'>;
4
+ export declare type IFindParams = Pick<factory.creativeWork.movie.ISearchConditions, 'additionalProperty' | 'contentRating' | 'datePublishedFrom' | 'datePublishedThrough' | 'distributor' | 'id' | 'identifier' | 'limit' | 'name' | 'offers' | 'page' | 'sort'>;
3
5
  /**
4
6
  * コンテンツサービス
5
7
  */
6
8
  export declare class CreativeWorkService extends Service {
7
- searchMovies(params: Omit<factory.creativeWork.movie.ISearchConditions, 'project'>): Promise<{
8
- data: factory.creativeWork.movie.ICreativeWork[];
9
+ searchMovies(params: IFindParams): Promise<{
10
+ data: IMovieAsFindResult[];
9
11
  }>;
10
12
  }
@@ -3,7 +3,6 @@
3
3
  */
4
4
  import * as ServiceFactory from '../service';
5
5
  import { CategoryCodeService } from './service/categoryCode';
6
- import { CreativeWorkService } from './service/creativeWork';
7
6
  import { EmailMessageService } from './service/emailMessage';
8
7
  import { EventService } from './service/event';
9
8
  import { PlaceService } from './service/place';
@@ -26,11 +25,6 @@ export declare namespace service {
26
25
  */
27
26
  class CategoryCode extends CategoryCodeService {
28
27
  }
29
- /**
30
- * コンテンツサービス
31
- */
32
- class CreativeWork extends CreativeWorkService {
33
- }
34
28
  /**
35
29
  * Eメールメッセージサービス
36
30
  */
@@ -23,7 +23,6 @@ exports.service = void 0;
23
23
  var ServiceFactory = require("../service");
24
24
  // import * as OrderServiceFactory from '../chevreAsset/order/factory';
25
25
  var categoryCode_1 = require("./service/categoryCode");
26
- var creativeWork_1 = require("./service/creativeWork");
27
26
  var emailMessage_1 = require("./service/emailMessage");
28
27
  var event_1 = require("./service/event");
29
28
  var place_1 = require("./service/place");
@@ -56,17 +55,6 @@ var service;
56
55
  return CategoryCode;
57
56
  }(categoryCode_1.CategoryCodeService));
58
57
  service.CategoryCode = CategoryCode;
59
- /**
60
- * コンテンツサービス
61
- */
62
- var CreativeWork = /** @class */ (function (_super) {
63
- __extends(CreativeWork, _super);
64
- function CreativeWork() {
65
- return _super !== null && _super.apply(this, arguments) || this;
66
- }
67
- return CreativeWork;
68
- }(creativeWork_1.CreativeWorkService));
69
- service.CreativeWork = CreativeWork;
70
58
  /**
71
59
  * Eメールメッセージサービス
72
60
  */
@@ -0,0 +1,11 @@
1
+ import { IFindParams, IMovieAsFindResult } from '../../chevre/creativeWork';
2
+ import { Service } from '../../service';
3
+ /**
4
+ * コンテンツサービス
5
+ */
6
+ export declare class CreativeWorkService extends Service {
7
+ /**
8
+ * コンテンツ検索
9
+ */
10
+ findMovies(params: Pick<IFindParams, 'identifier' | 'limit' | 'page' | 'sort'>): Promise<Omit<IMovieAsFindResult, 'offers' | 'project'>[]>;
11
+ }
@@ -14,17 +14,6 @@ var __extends = (this && this.__extends) || (function () {
14
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
15
  };
16
16
  })();
17
- var __assign = (this && this.__assign) || function () {
18
- __assign = Object.assign || function(t) {
19
- for (var s, i = 1, n = arguments.length; i < n; i++) {
20
- s = arguments[i];
21
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
- t[p] = s[p];
23
- }
24
- return t;
25
- };
26
- return __assign.apply(this, arguments);
27
- };
28
17
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
18
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
19
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -70,13 +59,16 @@ var service_1 = require("../../service");
70
59
  */
71
60
  var CreativeWorkService = /** @class */ (function (_super) {
72
61
  __extends(CreativeWorkService, _super);
73
- function CreativeWorkService(options) {
74
- return _super.call(this, __assign(__assign({}, options), { retryableStatusCodes: [http_status_1.BAD_GATEWAY, http_status_1.FORBIDDEN, http_status_1.UNAUTHORIZED] })) || this;
62
+ function CreativeWorkService() {
63
+ return _super !== null && _super.apply(this, arguments) || this;
75
64
  }
65
+ // constructor(options: IAdditionalOptions & Pick<IOptions, 'auth' | 'endpoint' | 'transporter' | 'project' | 'defaultPath'>) {
66
+ // super({ ...options, retryableStatusCodes: [BAD_GATEWAY, FORBIDDEN, UNAUTHORIZED] });
67
+ // }
76
68
  /**
77
69
  * コンテンツ検索
78
70
  */
79
- CreativeWorkService.prototype.searchMovies = function (params) {
71
+ CreativeWorkService.prototype.findMovies = function (params) {
80
72
  return __awaiter(this, void 0, void 0, function () {
81
73
  var _this = this;
82
74
  return __generator(this, function (_a) {
@@ -86,18 +78,9 @@ var CreativeWorkService = /** @class */ (function (_super) {
86
78
  qs: params,
87
79
  expectedStatusCodes: [http_status_1.OK]
88
80
  })
89
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
90
- var _a;
91
- return __generator(this, function (_b) {
92
- switch (_b.label) {
93
- case 0:
94
- _a = {};
95
- return [4 /*yield*/, response.json()];
96
- case 1: return [2 /*return*/, (_a.data = _b.sent(),
97
- _a)];
98
- }
99
- });
100
- }); })];
81
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
82
+ return [2 /*return*/, response.json()];
83
+ }); }); })];
101
84
  });
102
85
  });
103
86
  };
@@ -1,10 +1,18 @@
1
1
  import { IAdditionalOptions, IOptions } from '../service';
2
+ import type { CreativeWorkService } from './search/creativeWork';
2
3
  import type { PaymentProductService } from './search/paymentService';
3
4
  import type { ProductService } from './search/product';
4
5
  /**
5
6
  * publicリソース検索サービス群
6
7
  */
7
8
  export declare namespace service {
9
+ /**
10
+ * コンテンツサービス
11
+ */
12
+ type CreativeWork = CreativeWorkService;
13
+ namespace CreativeWork {
14
+ let svc: typeof CreativeWorkService | undefined;
15
+ }
8
16
  /**
9
17
  * 決済商品サービス
10
18
  */
@@ -26,6 +34,10 @@ export declare namespace service {
26
34
  export declare class CloudSearch {
27
35
  options: Pick<IOptions, 'auth' | 'endpoint' | 'disableAutoRetry' | 'defaultPath'>;
28
36
  constructor(options: Pick<IOptions, 'auth' | 'endpoint' | 'disableAutoRetry' | 'defaultPath'>);
37
+ /**
38
+ * コンテンツサービスインスタンス生成
39
+ */
40
+ createCreativeWorkInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<CreativeWorkService>;
29
41
  /**
30
42
  * 決済商品サービスインスタンス生成
31
43
  */
@@ -55,6 +55,9 @@ var http_status_1 = require("http-status");
55
55
  */
56
56
  var service;
57
57
  (function (service) {
58
+ var CreativeWork;
59
+ (function (CreativeWork) {
60
+ })(CreativeWork = service.CreativeWork || (service.CreativeWork = {}));
58
61
  var PaymentProduct;
59
62
  (function (PaymentProduct) {
60
63
  })(PaymentProduct = service.PaymentProduct || (service.PaymentProduct = {}));
@@ -70,6 +73,26 @@ var CloudSearch = /** @class */ (function () {
70
73
  function CloudSearch(options) {
71
74
  this.options = options;
72
75
  }
76
+ /**
77
+ * コンテンツサービスインスタンス生成
78
+ */
79
+ CloudSearch.prototype.createCreativeWorkInstance = function (params) {
80
+ return __awaiter(this, void 0, void 0, function () {
81
+ var _a;
82
+ return __generator(this, function (_b) {
83
+ switch (_b.label) {
84
+ case 0:
85
+ if (!(service.CreativeWork.svc === undefined)) return [3 /*break*/, 2];
86
+ _a = service.CreativeWork;
87
+ return [4 /*yield*/, Promise.resolve().then(function () { return require('./search/creativeWork'); })];
88
+ case 1:
89
+ _a.svc = (_b.sent()).CreativeWorkService;
90
+ _b.label = 2;
91
+ case 2: return [2 /*return*/, new service.CreativeWork.svc(__assign(__assign(__assign({}, this.options), params), { retryableStatusCodes: defaultRetryableStatusCodes }))];
92
+ }
93
+ });
94
+ });
95
+ };
73
96
  /**
74
97
  * 決済商品サービスインスタンス生成
75
98
  */
package/lib/bundle.js CHANGED
@@ -18741,7 +18741,6 @@ exports.service = void 0;
18741
18741
  var ServiceFactory = require("../service");
18742
18742
  // import * as OrderServiceFactory from '../chevreAsset/order/factory';
18743
18743
  var categoryCode_1 = require("./service/categoryCode");
18744
- var creativeWork_1 = require("./service/creativeWork");
18745
18744
  var emailMessage_1 = require("./service/emailMessage");
18746
18745
  var event_1 = require("./service/event");
18747
18746
  var place_1 = require("./service/place");
@@ -18774,17 +18773,6 @@ var service;
18774
18773
  return CategoryCode;
18775
18774
  }(categoryCode_1.CategoryCodeService));
18776
18775
  service.CategoryCode = CategoryCode;
18777
- /**
18778
- * コンテンツサービス
18779
- */
18780
- var CreativeWork = /** @class */ (function (_super) {
18781
- __extends(CreativeWork, _super);
18782
- function CreativeWork() {
18783
- return _super !== null && _super.apply(this, arguments) || this;
18784
- }
18785
- return CreativeWork;
18786
- }(creativeWork_1.CreativeWorkService));
18787
- service.CreativeWork = CreativeWork;
18788
18776
  /**
18789
18777
  * Eメールメッセージサービス
18790
18778
  */
@@ -18845,7 +18833,7 @@ var service;
18845
18833
  service.Seller = Seller;
18846
18834
  })(service = exports.service || (exports.service = {}));
18847
18835
 
18848
- },{"../service":163,"./service/categoryCode":121,"./service/creativeWork":122,"./service/emailMessage":123,"./service/event":124,"./service/place":125,"./service/place/hasPOS":126,"./service/seller":127}],121:[function(require,module,exports){
18836
+ },{"../service":163,"./service/categoryCode":121,"./service/emailMessage":122,"./service/event":123,"./service/place":124,"./service/place/hasPOS":125,"./service/seller":126}],121:[function(require,module,exports){
18849
18837
  "use strict";
18850
18838
  var __extends = (this && this.__extends) || (function () {
18851
18839
  var extendStatics = function (d, b) {
@@ -19018,114 +19006,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
19018
19006
  }
19019
19007
  };
19020
19008
  Object.defineProperty(exports, "__esModule", { value: true });
19021
- exports.CreativeWorkService = void 0;
19022
- var http_status_1 = require("http-status");
19023
- var service_1 = require("../../service");
19024
- /**
19025
- * コンテンツサービス
19026
- */
19027
- var CreativeWorkService = /** @class */ (function (_super) {
19028
- __extends(CreativeWorkService, _super);
19029
- function CreativeWorkService(options) {
19030
- return _super.call(this, __assign(__assign({}, options), { retryableStatusCodes: [http_status_1.BAD_GATEWAY, http_status_1.FORBIDDEN, http_status_1.UNAUTHORIZED] })) || this;
19031
- }
19032
- /**
19033
- * コンテンツ検索
19034
- */
19035
- CreativeWorkService.prototype.searchMovies = function (params) {
19036
- return __awaiter(this, void 0, void 0, function () {
19037
- var _this = this;
19038
- return __generator(this, function (_a) {
19039
- return [2 /*return*/, this.fetch({
19040
- uri: '/creativeWorks/movie',
19041
- method: 'GET',
19042
- qs: params,
19043
- expectedStatusCodes: [http_status_1.OK]
19044
- })
19045
- .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
19046
- var _a;
19047
- return __generator(this, function (_b) {
19048
- switch (_b.label) {
19049
- case 0:
19050
- _a = {};
19051
- return [4 /*yield*/, response.json()];
19052
- case 1: return [2 /*return*/, (_a.data = _b.sent(),
19053
- _a)];
19054
- }
19055
- });
19056
- }); })];
19057
- });
19058
- });
19059
- };
19060
- return CreativeWorkService;
19061
- }(service_1.Service));
19062
- exports.CreativeWorkService = CreativeWorkService;
19063
-
19064
- },{"../../service":163,"http-status":440}],123:[function(require,module,exports){
19065
- "use strict";
19066
- var __extends = (this && this.__extends) || (function () {
19067
- var extendStatics = function (d, b) {
19068
- extendStatics = Object.setPrototypeOf ||
19069
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19070
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
19071
- return extendStatics(d, b);
19072
- };
19073
- return function (d, b) {
19074
- if (typeof b !== "function" && b !== null)
19075
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
19076
- extendStatics(d, b);
19077
- function __() { this.constructor = d; }
19078
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
19079
- };
19080
- })();
19081
- var __assign = (this && this.__assign) || function () {
19082
- __assign = Object.assign || function(t) {
19083
- for (var s, i = 1, n = arguments.length; i < n; i++) {
19084
- s = arguments[i];
19085
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
19086
- t[p] = s[p];
19087
- }
19088
- return t;
19089
- };
19090
- return __assign.apply(this, arguments);
19091
- };
19092
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
19093
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19094
- return new (P || (P = Promise))(function (resolve, reject) {
19095
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19096
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19097
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19098
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19099
- });
19100
- };
19101
- var __generator = (this && this.__generator) || function (thisArg, body) {
19102
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
19103
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
19104
- function verb(n) { return function (v) { return step([n, v]); }; }
19105
- function step(op) {
19106
- if (f) throw new TypeError("Generator is already executing.");
19107
- while (_) try {
19108
- 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;
19109
- if (y = 0, t) op = [op[0] & 2, t.value];
19110
- switch (op[0]) {
19111
- case 0: case 1: t = op; break;
19112
- case 4: _.label++; return { value: op[1], done: false };
19113
- case 5: _.label++; y = op[1]; op = [0]; continue;
19114
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
19115
- default:
19116
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
19117
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
19118
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
19119
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
19120
- if (t[2]) _.ops.pop();
19121
- _.trys.pop(); continue;
19122
- }
19123
- op = body.call(thisArg, _);
19124
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
19125
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
19126
- }
19127
- };
19128
- Object.defineProperty(exports, "__esModule", { value: true });
19129
19009
  exports.EmailMessageService = void 0;
19130
19010
  var http_status_1 = require("http-status");
19131
19011
  var service_1 = require("../../service");
@@ -19169,7 +19049,7 @@ var EmailMessageService = /** @class */ (function (_super) {
19169
19049
  }(service_1.Service));
19170
19050
  exports.EmailMessageService = EmailMessageService;
19171
19051
 
19172
- },{"../../service":163,"http-status":440}],124:[function(require,module,exports){
19052
+ },{"../../service":163,"http-status":440}],123:[function(require,module,exports){
19173
19053
  "use strict";
19174
19054
  var __extends = (this && this.__extends) || (function () {
19175
19055
  var extendStatics = function (d, b) {
@@ -19570,7 +19450,7 @@ var EventService = /** @class */ (function (_super) {
19570
19450
  }(service_1.Service));
19571
19451
  exports.EventService = EventService;
19572
19452
 
19573
- },{"../../factory":158,"../../service":163,"http-status":440}],125:[function(require,module,exports){
19453
+ },{"../../factory":158,"../../service":163,"http-status":440}],124:[function(require,module,exports){
19574
19454
  "use strict";
19575
19455
  var __extends = (this && this.__extends) || (function () {
19576
19456
  var extendStatics = function (d, b) {
@@ -19763,7 +19643,7 @@ var PlaceService = /** @class */ (function (_super) {
19763
19643
  }(service_1.Service));
19764
19644
  exports.PlaceService = PlaceService;
19765
19645
 
19766
- },{"../../factory":158,"../../service":163,"http-status":440}],126:[function(require,module,exports){
19646
+ },{"../../factory":158,"../../service":163,"http-status":440}],125:[function(require,module,exports){
19767
19647
  "use strict";
19768
19648
  var __extends = (this && this.__extends) || (function () {
19769
19649
  var extendStatics = function (d, b) {
@@ -19863,7 +19743,7 @@ var HasPOSService = /** @class */ (function (_super) {
19863
19743
  }(service_1.Service));
19864
19744
  exports.HasPOSService = HasPOSService;
19865
19745
 
19866
- },{"../../../factory":158,"../../../service":163,"http-status":440}],127:[function(require,module,exports){
19746
+ },{"../../../factory":158,"../../../service":163,"http-status":440}],126:[function(require,module,exports){
19867
19747
  "use strict";
19868
19748
  var __extends = (this && this.__extends) || (function () {
19869
19749
  var extendStatics = function (d, b) {
@@ -20051,7 +19931,7 @@ var SellerService = /** @class */ (function (_super) {
20051
19931
  }(service_1.Service));
20052
19932
  exports.SellerService = SellerService;
20053
19933
 
20054
- },{"../../service":163,"http-status":440}],128:[function(require,module,exports){
19934
+ },{"../../service":163,"http-status":440}],127:[function(require,module,exports){
20055
19935
  "use strict";
20056
19936
  var __assign = (this && this.__assign) || function () {
20057
19937
  __assign = Object.assign || function(t) {
@@ -20364,7 +20244,7 @@ var CloudAdmin = /** @class */ (function () {
20364
20244
  }());
20365
20245
  exports.CloudAdmin = CloudAdmin;
20366
20246
 
20367
- },{"./admin/creativeWork":129,"./admin/customer":130,"./admin/event":131,"./admin/me":132,"./admin/note":133,"./admin/offer":134,"./admin/offerCatalog":135,"./admin/offerCatalogItem":136,"./admin/order":137,"./admin/product":138,"./admin/reservation":139,"./admin/seller":140}],129:[function(require,module,exports){
20247
+ },{"./admin/creativeWork":128,"./admin/customer":129,"./admin/event":130,"./admin/me":131,"./admin/note":132,"./admin/offer":133,"./admin/offerCatalog":134,"./admin/offerCatalogItem":135,"./admin/order":136,"./admin/product":137,"./admin/reservation":138,"./admin/seller":139}],128:[function(require,module,exports){
20368
20248
  "use strict";
20369
20249
  var __extends = (this && this.__extends) || (function () {
20370
20250
  var extendStatics = function (d, b) {
@@ -20464,7 +20344,7 @@ var CreativeWorkService = /** @class */ (function (_super) {
20464
20344
  }(service_1.Service));
20465
20345
  exports.CreativeWorkService = CreativeWorkService;
20466
20346
 
20467
- },{"../../index":159,"../../service":163}],130:[function(require,module,exports){
20347
+ },{"../../index":159,"../../service":163}],129:[function(require,module,exports){
20468
20348
  "use strict";
20469
20349
  var __extends = (this && this.__extends) || (function () {
20470
20350
  var extendStatics = function (d, b) {
@@ -20574,7 +20454,7 @@ var CustomerService = /** @class */ (function (_super) {
20574
20454
  }(service_1.Service));
20575
20455
  exports.CustomerService = CustomerService;
20576
20456
 
20577
- },{"../../index":159,"../../service":163}],131:[function(require,module,exports){
20457
+ },{"../../index":159,"../../service":163}],130:[function(require,module,exports){
20578
20458
  "use strict";
20579
20459
  var __extends = (this && this.__extends) || (function () {
20580
20460
  var extendStatics = function (d, b) {
@@ -20769,7 +20649,7 @@ var EventService = /** @class */ (function (_super) {
20769
20649
  }(service_1.Service));
20770
20650
  exports.EventService = EventService;
20771
20651
 
20772
- },{"../../factory":158,"../../index":159,"../../service":163}],132:[function(require,module,exports){
20652
+ },{"../../factory":158,"../../index":159,"../../service":163}],131:[function(require,module,exports){
20773
20653
  "use strict";
20774
20654
  var __extends = (this && this.__extends) || (function () {
20775
20655
  var extendStatics = function (d, b) {
@@ -20891,7 +20771,7 @@ var MeService = /** @class */ (function (_super) {
20891
20771
  }(service_1.Service));
20892
20772
  exports.MeService = MeService;
20893
20773
 
20894
- },{"../../index":159,"../../service":163}],133:[function(require,module,exports){
20774
+ },{"../../index":159,"../../service":163}],132:[function(require,module,exports){
20895
20775
  "use strict";
20896
20776
  var __extends = (this && this.__extends) || (function () {
20897
20777
  var extendStatics = function (d, b) {
@@ -21059,7 +20939,7 @@ var NoteService = /** @class */ (function (_super) {
21059
20939
  }(service_1.Service));
21060
20940
  exports.NoteService = NoteService;
21061
20941
 
21062
- },{"../../index":159,"../../service":163}],134:[function(require,module,exports){
20942
+ },{"../../index":159,"../../service":163}],133:[function(require,module,exports){
21063
20943
  "use strict";
21064
20944
  var __extends = (this && this.__extends) || (function () {
21065
20945
  var extendStatics = function (d, b) {
@@ -21248,7 +21128,7 @@ var OfferService = /** @class */ (function (_super) {
21248
21128
  }(service_1.Service));
21249
21129
  exports.OfferService = OfferService;
21250
21130
 
21251
- },{"../../factory":158,"../../index":159,"../../service":163}],135:[function(require,module,exports){
21131
+ },{"../../factory":158,"../../index":159,"../../service":163}],134:[function(require,module,exports){
21252
21132
  "use strict";
21253
21133
  var __extends = (this && this.__extends) || (function () {
21254
21134
  var extendStatics = function (d, b) {
@@ -21357,7 +21237,7 @@ var OfferCatalogService = /** @class */ (function (_super) {
21357
21237
  }(service_1.Service));
21358
21238
  exports.OfferCatalogService = OfferCatalogService;
21359
21239
 
21360
- },{"../../factory":158,"../../index":159,"../../service":163}],136:[function(require,module,exports){
21240
+ },{"../../factory":158,"../../index":159,"../../service":163}],135:[function(require,module,exports){
21361
21241
  "use strict";
21362
21242
  var __extends = (this && this.__extends) || (function () {
21363
21243
  var extendStatics = function (d, b) {
@@ -21492,7 +21372,7 @@ var OfferCatalogItemService = /** @class */ (function (_super) {
21492
21372
  }(service_1.Service));
21493
21373
  exports.OfferCatalogItemService = OfferCatalogItemService;
21494
21374
 
21495
- },{"../../index":159,"../../service":163}],137:[function(require,module,exports){
21375
+ },{"../../index":159,"../../service":163}],136:[function(require,module,exports){
21496
21376
  "use strict";
21497
21377
  var __extends = (this && this.__extends) || (function () {
21498
21378
  var extendStatics = function (d, b) {
@@ -21731,7 +21611,7 @@ var OrderService = /** @class */ (function (_super) {
21731
21611
  }(service_1.Service));
21732
21612
  exports.OrderService = OrderService;
21733
21613
 
21734
- },{"../../factory":158,"../../index":159,"../../service":163}],138:[function(require,module,exports){
21614
+ },{"../../factory":158,"../../index":159,"../../service":163}],137:[function(require,module,exports){
21735
21615
  "use strict";
21736
21616
  var __extends = (this && this.__extends) || (function () {
21737
21617
  var extendStatics = function (d, b) {
@@ -21839,7 +21719,7 @@ var ProductService = /** @class */ (function (_super) {
21839
21719
  }(service_1.Service));
21840
21720
  exports.ProductService = ProductService;
21841
21721
 
21842
- },{"../../factory":158,"../../index":159,"../../service":163}],139:[function(require,module,exports){
21722
+ },{"../../factory":158,"../../index":159,"../../service":163}],138:[function(require,module,exports){
21843
21723
  "use strict";
21844
21724
  var __extends = (this && this.__extends) || (function () {
21845
21725
  var extendStatics = function (d, b) {
@@ -22067,7 +21947,7 @@ var ReservationService = /** @class */ (function (_super) {
22067
21947
  }(service_1.Service));
22068
21948
  exports.ReservationService = ReservationService;
22069
21949
 
22070
- },{"../../factory":158,"../../index":159,"../../service":163}],140:[function(require,module,exports){
21950
+ },{"../../factory":158,"../../index":159,"../../service":163}],139:[function(require,module,exports){
22071
21951
  "use strict";
22072
21952
  var __extends = (this && this.__extends) || (function () {
22073
21953
  var extendStatics = function (d, b) {
@@ -22156,7 +22036,7 @@ var SellerService = /** @class */ (function (_super) {
22156
22036
  }(service_1.Service));
22157
22037
  exports.SellerService = SellerService;
22158
22038
 
22159
- },{"../../index":159,"../../service":163}],141:[function(require,module,exports){
22039
+ },{"../../index":159,"../../service":163}],140:[function(require,module,exports){
22160
22040
  "use strict";
22161
22041
  var __assign = (this && this.__assign) || function () {
22162
22042
  __assign = Object.assign || function(t) {
@@ -22333,7 +22213,7 @@ var CloudAsset = /** @class */ (function () {
22333
22213
  }());
22334
22214
  exports.CloudAsset = CloudAsset;
22335
22215
 
22336
- },{"../chevreAsset/order/factory":34,"./asset/delivery":142,"./asset/order":143,"./asset/reservation":144,"./asset/token":145,"http-status":440}],142:[function(require,module,exports){
22216
+ },{"../chevreAsset/order/factory":34,"./asset/delivery":141,"./asset/order":142,"./asset/reservation":143,"./asset/token":144,"http-status":440}],141:[function(require,module,exports){
22337
22217
  "use strict";
22338
22218
  var __extends = (this && this.__extends) || (function () {
22339
22219
  var extendStatics = function (d, b) {
@@ -22440,7 +22320,7 @@ var DeliveryService = /** @class */ (function (_super) {
22440
22320
  }(service_1.Service));
22441
22321
  exports.DeliveryService = DeliveryService;
22442
22322
 
22443
- },{"../../index":159,"../../service":163}],143:[function(require,module,exports){
22323
+ },{"../../index":159,"../../service":163}],142:[function(require,module,exports){
22444
22324
  "use strict";
22445
22325
  var __extends = (this && this.__extends) || (function () {
22446
22326
  var extendStatics = function (d, b) {
@@ -22742,7 +22622,7 @@ var OrderService = /** @class */ (function (_super) {
22742
22622
  }(service_1.Service));
22743
22623
  exports.OrderService = OrderService;
22744
22624
 
22745
- },{"../../index":159,"../../service":163}],144:[function(require,module,exports){
22625
+ },{"../../index":159,"../../service":163}],143:[function(require,module,exports){
22746
22626
  "use strict";
22747
22627
  var __extends = (this && this.__extends) || (function () {
22748
22628
  var extendStatics = function (d, b) {
@@ -22868,7 +22748,7 @@ var ReservationService = /** @class */ (function (_super) {
22868
22748
  }(service_1.Service));
22869
22749
  exports.ReservationService = ReservationService;
22870
22750
 
22871
- },{"../../index":159,"../../service":163}],145:[function(require,module,exports){
22751
+ },{"../../index":159,"../../service":163}],144:[function(require,module,exports){
22872
22752
  "use strict";
22873
22753
  var __extends = (this && this.__extends) || (function () {
22874
22754
  var extendStatics = function (d, b) {
@@ -22901,7 +22781,7 @@ var TokenService = /** @class */ (function (_super) {
22901
22781
  }(service_1.Service));
22902
22782
  exports.TokenService = TokenService;
22903
22783
 
22904
- },{"../../service":163}],146:[function(require,module,exports){
22784
+ },{"../../service":163}],145:[function(require,module,exports){
22905
22785
  "use strict";
22906
22786
  var __assign = (this && this.__assign) || function () {
22907
22787
  __assign = Object.assign || function(t) {
@@ -23002,7 +22882,7 @@ var CloudPay = /** @class */ (function () {
23002
22882
  }());
23003
22883
  exports.CloudPay = CloudPay;
23004
22884
 
23005
- },{"../chevrePay/payment/factory":111,"./pay/payment":147,"http-status":440}],147:[function(require,module,exports){
22885
+ },{"../chevrePay/payment/factory":111,"./pay/payment":146,"http-status":440}],146:[function(require,module,exports){
23006
22886
  "use strict";
23007
22887
  var __extends = (this && this.__extends) || (function () {
23008
22888
  var extendStatics = function (d, b) {
@@ -23647,7 +23527,7 @@ var PaymentService = /** @class */ (function (_super) {
23647
23527
  }(service_1.Service));
23648
23528
  exports.PaymentService = PaymentService;
23649
23529
 
23650
- },{"../../factory":158,"../../index":159,"../../service":163,"http-status":440}],148:[function(require,module,exports){
23530
+ },{"../../factory":158,"../../index":159,"../../service":163,"http-status":440}],147:[function(require,module,exports){
23651
23531
  "use strict";
23652
23532
  var __assign = (this && this.__assign) || function () {
23653
23533
  __assign = Object.assign || function(t) {
@@ -23705,6 +23585,9 @@ var http_status_1 = require("http-status");
23705
23585
  */
23706
23586
  var service;
23707
23587
  (function (service) {
23588
+ var CreativeWork;
23589
+ (function (CreativeWork) {
23590
+ })(CreativeWork = service.CreativeWork || (service.CreativeWork = {}));
23708
23591
  var PaymentProduct;
23709
23592
  (function (PaymentProduct) {
23710
23593
  })(PaymentProduct = service.PaymentProduct || (service.PaymentProduct = {}));
@@ -23720,6 +23603,26 @@ var CloudSearch = /** @class */ (function () {
23720
23603
  function CloudSearch(options) {
23721
23604
  this.options = options;
23722
23605
  }
23606
+ /**
23607
+ * コンテンツサービスインスタンス生成
23608
+ */
23609
+ CloudSearch.prototype.createCreativeWorkInstance = function (params) {
23610
+ return __awaiter(this, void 0, void 0, function () {
23611
+ var _a;
23612
+ return __generator(this, function (_b) {
23613
+ switch (_b.label) {
23614
+ case 0:
23615
+ if (!(service.CreativeWork.svc === undefined)) return [3 /*break*/, 2];
23616
+ _a = service.CreativeWork;
23617
+ return [4 /*yield*/, Promise.resolve().then(function () { return require('./search/creativeWork'); })];
23618
+ case 1:
23619
+ _a.svc = (_b.sent()).CreativeWorkService;
23620
+ _b.label = 2;
23621
+ case 2: return [2 /*return*/, new service.CreativeWork.svc(__assign(__assign(__assign({}, this.options), params), { retryableStatusCodes: defaultRetryableStatusCodes }))];
23622
+ }
23623
+ });
23624
+ });
23625
+ };
23723
23626
  /**
23724
23627
  * 決済商品サービスインスタンス生成
23725
23628
  */
@@ -23764,7 +23667,98 @@ var CloudSearch = /** @class */ (function () {
23764
23667
  }());
23765
23668
  exports.CloudSearch = CloudSearch;
23766
23669
 
23767
- },{"./search/paymentService":149,"./search/product":150,"http-status":440}],149:[function(require,module,exports){
23670
+ },{"./search/creativeWork":148,"./search/paymentService":149,"./search/product":150,"http-status":440}],148:[function(require,module,exports){
23671
+ "use strict";
23672
+ var __extends = (this && this.__extends) || (function () {
23673
+ var extendStatics = function (d, b) {
23674
+ extendStatics = Object.setPrototypeOf ||
23675
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
23676
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
23677
+ return extendStatics(d, b);
23678
+ };
23679
+ return function (d, b) {
23680
+ if (typeof b !== "function" && b !== null)
23681
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
23682
+ extendStatics(d, b);
23683
+ function __() { this.constructor = d; }
23684
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
23685
+ };
23686
+ })();
23687
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
23688
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
23689
+ return new (P || (P = Promise))(function (resolve, reject) {
23690
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
23691
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
23692
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23693
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
23694
+ });
23695
+ };
23696
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23697
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23698
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23699
+ function verb(n) { return function (v) { return step([n, v]); }; }
23700
+ function step(op) {
23701
+ if (f) throw new TypeError("Generator is already executing.");
23702
+ while (_) try {
23703
+ 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;
23704
+ if (y = 0, t) op = [op[0] & 2, t.value];
23705
+ switch (op[0]) {
23706
+ case 0: case 1: t = op; break;
23707
+ case 4: _.label++; return { value: op[1], done: false };
23708
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23709
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
23710
+ default:
23711
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
23712
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
23713
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
23714
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
23715
+ if (t[2]) _.ops.pop();
23716
+ _.trys.pop(); continue;
23717
+ }
23718
+ op = body.call(thisArg, _);
23719
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
23720
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
23721
+ }
23722
+ };
23723
+ Object.defineProperty(exports, "__esModule", { value: true });
23724
+ exports.CreativeWorkService = void 0;
23725
+ var http_status_1 = require("http-status");
23726
+ var service_1 = require("../../service");
23727
+ /**
23728
+ * コンテンツサービス
23729
+ */
23730
+ var CreativeWorkService = /** @class */ (function (_super) {
23731
+ __extends(CreativeWorkService, _super);
23732
+ function CreativeWorkService() {
23733
+ return _super !== null && _super.apply(this, arguments) || this;
23734
+ }
23735
+ // constructor(options: IAdditionalOptions & Pick<IOptions, 'auth' | 'endpoint' | 'transporter' | 'project' | 'defaultPath'>) {
23736
+ // super({ ...options, retryableStatusCodes: [BAD_GATEWAY, FORBIDDEN, UNAUTHORIZED] });
23737
+ // }
23738
+ /**
23739
+ * コンテンツ検索
23740
+ */
23741
+ CreativeWorkService.prototype.findMovies = function (params) {
23742
+ return __awaiter(this, void 0, void 0, function () {
23743
+ var _this = this;
23744
+ return __generator(this, function (_a) {
23745
+ return [2 /*return*/, this.fetch({
23746
+ uri: '/creativeWorks/movie',
23747
+ method: 'GET',
23748
+ qs: params,
23749
+ expectedStatusCodes: [http_status_1.OK]
23750
+ })
23751
+ .then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
23752
+ return [2 /*return*/, response.json()];
23753
+ }); }); })];
23754
+ });
23755
+ });
23756
+ };
23757
+ return CreativeWorkService;
23758
+ }(service_1.Service));
23759
+ exports.CreativeWorkService = CreativeWorkService;
23760
+
23761
+ },{"../../service":163,"http-status":440}],149:[function(require,module,exports){
23768
23762
  "use strict";
23769
23763
  var __extends = (this && this.__extends) || (function () {
23770
23764
  var extendStatics = function (d, b) {
@@ -25719,7 +25713,7 @@ exports.loadWaiterAdmin = loadWaiterAdmin;
25719
25713
  // export class StubAuth extends StubAuthClient { }
25720
25714
  // }
25721
25715
 
25722
- },{"./chevre":3,"./chevreAdmin":15,"./chevreAsset":32,"./chevreConsole":40,"./chevrePay":109,"./chevreTxc":112,"./chevreTxn":114,"./cinerino/default":120,"./cloud/admin":128,"./cloud/asset":141,"./cloud/pay":146,"./cloud/search":148,"./cloud/txc":151,"./cloud/txn":154,"./factory":158,"./pecorino":160,"./transporters":164,"./waiterAdmin":165}],160:[function(require,module,exports){
25716
+ },{"./chevre":3,"./chevreAdmin":15,"./chevreAsset":32,"./chevreConsole":40,"./chevrePay":109,"./chevreTxc":112,"./chevreTxn":114,"./cinerino/default":120,"./cloud/admin":127,"./cloud/asset":140,"./cloud/pay":145,"./cloud/search":147,"./cloud/txc":151,"./cloud/txn":154,"./factory":158,"./pecorino":160,"./transporters":164,"./waiterAdmin":165}],160:[function(require,module,exports){
25723
25717
  "use strict";
25724
25718
  var __extends = (this && this.__extends) || (function () {
25725
25719
  var extendStatics = function (d, b) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "11.2.0-alpha.4",
3
+ "version": "12.0.0-alpha.0",
4
4
  "description": "Cinerino SDK",
5
5
  "main": "./lib/index.js",
6
6
  "browser": {
@@ -92,7 +92,7 @@
92
92
  "watchify": "^3.11.1"
93
93
  },
94
94
  "dependencies": {
95
- "@chevre/factory": "4.396.0-alpha.8",
95
+ "@chevre/factory": "4.396.0",
96
96
  "debug": "3.2.7",
97
97
  "http-status": "1.7.4",
98
98
  "idtoken-verifier": "2.0.3",
@@ -1,32 +0,0 @@
1
- // tslint:disable:no-implicit-dependencies no-console
2
- import * as client from '../../lib/index';
3
- import { auth } from './auth/clientCredentials';
4
-
5
- const PROJECT_ID = String(process.env.PROJECT_ID);
6
-
7
- async function main() {
8
- const creativeWorkService = new (await client.loadService()).CreativeWork({
9
- endpoint: <string>process.env.API_ENDPOINT,
10
- auth: await auth(),
11
- project: { id: PROJECT_ID },
12
- seller: { id: '' }
13
- });
14
-
15
- const { data } = await creativeWorkService.searchMovies({
16
- limit: 3,
17
- page: 1,
18
- sort: {
19
- identifier: client.factory.sortType.Descending
20
- },
21
- identifier: { $in: ['00001', '00002'] }
22
- });
23
- // tslint:disable-next-line:no-null-keyword
24
- console.dir(data, { depth: null });
25
- console.log(data.length, 'movies');
26
- }
27
-
28
- main()
29
- .then(() => {
30
- console.log('success!');
31
- })
32
- .catch(console.error);
@@ -1,12 +0,0 @@
1
- import * as factory from '../../factory';
2
- import { IAdditionalOptions, IOptions, ISearchResult, Service } from '../../service';
3
- /**
4
- * コンテンツサービス
5
- */
6
- export declare class CreativeWorkService extends Service {
7
- constructor(options: IAdditionalOptions & Pick<IOptions, 'auth' | 'endpoint' | 'transporter' | 'project' | 'defaultPath'>);
8
- /**
9
- * コンテンツ検索
10
- */
11
- searchMovies(params: Pick<factory.creativeWork.movie.ISearchConditions, 'identifier' | 'limit' | 'page' | 'sort'>): Promise<ISearchResult<Omit<factory.creativeWork.movie.ICreativeWork, 'offers' | 'project'>[]>>;
12
- }