@cinerino/sdk 5.5.0 → 5.6.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.
@@ -42,6 +42,30 @@ async function main() {
42
42
  description: { en: '', ja: 'xxx' },
43
43
  // hasMerchantReturnPolicy: [],
44
44
  identifier: '20231218'
45
+ },
46
+ {
47
+ // additionalProperty: [],
48
+ alternateName: { en: '', ja: 'xxx' },
49
+ availability: factory.itemAvailability.InStock,
50
+ // availableAtOrFrom: [],
51
+ itemOffered: {
52
+ typeOf: factory.product.ProductType.EventService
53
+ },
54
+ name: { ja: 'xxx', en: 'xxx' },
55
+ priceSpecification: {
56
+ price: 1,
57
+ referenceQuantity: {
58
+ typeOf: 'QuantitativeValue',
59
+ value: 1,
60
+ unitCode: factory.unitCode.C62
61
+ },
62
+ accounting: {
63
+ accountsReceivable: 1
64
+ }
65
+ },
66
+ description: { en: '', ja: 'xxx' },
67
+ // hasMerchantReturnPolicy: [],
68
+ identifier: '2023121802'
45
69
  }
46
70
  ]);
47
71
  console.log('upserted');
@@ -0,0 +1,15 @@
1
+ import * as factory from '../factory';
2
+ import { Service } from '../service';
3
+ /**
4
+ * サブカタログサービス
5
+ */
6
+ export declare class OfferCatalogItemService extends Service {
7
+ /**
8
+ * コードによる冪等置換
9
+ */
10
+ upsertByIdentifier(
11
+ /**
12
+ * 最大長:20
13
+ */
14
+ params: Pick<factory.offerCatalog.IOfferCatalog, 'additionalProperty' | 'description' | 'identifier' | 'itemListElement' | 'itemOffered' | 'name' | 'relatedOffer'>[]): Promise<void>;
15
+ }
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (_) try {
33
+ 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;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ Object.defineProperty(exports, "__esModule", { value: true });
54
+ exports.OfferCatalogItemService = void 0;
55
+ var http_status_1 = require("http-status");
56
+ var service_1 = require("../service");
57
+ /**
58
+ * サブカタログサービス
59
+ */
60
+ var OfferCatalogItemService = /** @class */ (function (_super) {
61
+ __extends(OfferCatalogItemService, _super);
62
+ function OfferCatalogItemService() {
63
+ return _super !== null && _super.apply(this, arguments) || this;
64
+ }
65
+ /**
66
+ * コードによる冪等置換
67
+ */
68
+ OfferCatalogItemService.prototype.upsertByIdentifier = function (
69
+ /**
70
+ * 最大長:20
71
+ */
72
+ params) {
73
+ return __awaiter(this, void 0, void 0, function () {
74
+ return __generator(this, function (_a) {
75
+ switch (_a.label) {
76
+ case 0: return [4 /*yield*/, this.fetch({
77
+ uri: '/offerCatalogItems',
78
+ method: 'PUT',
79
+ body: params,
80
+ qs: {},
81
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
82
+ })];
83
+ case 1:
84
+ _a.sent();
85
+ return [2 /*return*/];
86
+ }
87
+ });
88
+ });
89
+ };
90
+ return OfferCatalogItemService;
91
+ }(service_1.Service));
92
+ exports.OfferCatalogItemService = OfferCatalogItemService;
@@ -3,6 +3,7 @@ import type { CreativeWorkService } from './admin/creativeWork';
3
3
  import type { EventService } from './admin/event';
4
4
  import type { OfferService } from './admin/offer';
5
5
  import type { OfferCatalogService } from './admin/offerCatalog';
6
+ import type { OfferCatalogItemService } from './admin/offerCatalogItem';
6
7
  export declare namespace service {
7
8
  type IUnset = IUnsetOnService;
8
9
  /**
@@ -29,10 +30,17 @@ export declare namespace service {
29
30
  /**
30
31
  * カタログサービス
31
32
  */
32
- type OffeCatalogr = OfferCatalogService;
33
+ type OfferCatalog = OfferCatalogService;
33
34
  namespace OfferCatalog {
34
35
  let svc: typeof OfferCatalogService | undefined;
35
36
  }
37
+ /**
38
+ * サブカタログサービス
39
+ */
40
+ type OfferCatalogItem = OfferCatalogItemService;
41
+ namespace OfferCatalogItem {
42
+ let svc: typeof OfferCatalogItemService | undefined;
43
+ }
36
44
  }
37
45
  /**
38
46
  * 管理サービス
@@ -44,4 +52,5 @@ export declare class Admin {
44
52
  createEventInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<EventService>;
45
53
  createOfferInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<OfferService>;
46
54
  createOfferCatalogInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<OfferCatalogService>;
55
+ createOfferCatalogItemInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<OfferCatalogItemService>;
47
56
  }
@@ -62,6 +62,9 @@ var service;
62
62
  var OfferCatalog;
63
63
  (function (OfferCatalog) {
64
64
  })(OfferCatalog = service.OfferCatalog || (service.OfferCatalog = {}));
65
+ var OfferCatalogItem;
66
+ (function (OfferCatalogItem) {
67
+ })(OfferCatalogItem = service.OfferCatalogItem || (service.OfferCatalogItem = {}));
65
68
  })(service = exports.service || (exports.service = {}));
66
69
  /**
67
70
  * 管理サービス
@@ -138,6 +141,23 @@ var Admin = /** @class */ (function () {
138
141
  });
139
142
  });
140
143
  };
144
+ Admin.prototype.createOfferCatalogItemInstance = function (params) {
145
+ return __awaiter(this, void 0, void 0, function () {
146
+ var _a;
147
+ return __generator(this, function (_b) {
148
+ switch (_b.label) {
149
+ case 0:
150
+ if (!(service.OfferCatalogItem.svc === undefined)) return [3 /*break*/, 2];
151
+ _a = service.OfferCatalogItem;
152
+ return [4 /*yield*/, Promise.resolve().then(function () { return require('./admin/offerCatalogItem'); })];
153
+ case 1:
154
+ _a.svc = (_b.sent()).OfferCatalogItemService;
155
+ _b.label = 2;
156
+ case 2: return [2 /*return*/, new service.OfferCatalogItem.svc(__assign(__assign({}, this.options), params))];
157
+ }
158
+ });
159
+ });
160
+ };
141
161
  return Admin;
142
162
  }());
143
163
  exports.Admin = Admin;
@@ -17,7 +17,7 @@ export declare class ProductService extends Service {
17
17
  /**
18
18
  * 検索
19
19
  */
20
- search(params: Omit<factory.product.ISearchConditions, 'project'> & {
20
+ search(params: Omit<factory.product.ISearchConditions, 'project' | 'typeOf'> & {
21
21
  typeOf: {
22
22
  $eq: string;
23
23
  };
@@ -25,6 +25,7 @@ export declare class OfferCatalogItemService extends Service {
25
25
  update(params: Omit<factory.offerCatalog.IOfferCatalog, 'project' | 'typeOf'> & {
26
26
  id: string;
27
27
  }): Promise<void>;
28
+ upsertByIdentifier(params: Pick<factory.offerCatalog.IOfferCatalog, 'additionalProperty' | 'description' | 'identifier' | 'itemListElement' | 'itemOffered' | 'name' | 'relatedOffer'>[]): Promise<void>;
28
29
  /**
29
30
  * サブカタログ複数編集
30
31
  */
@@ -122,6 +122,24 @@ var OfferCatalogItemService = /** @class */ (function (_super) {
122
122
  });
123
123
  });
124
124
  };
125
+ OfferCatalogItemService.prototype.upsertByIdentifier = function (params) {
126
+ return __awaiter(this, void 0, void 0, function () {
127
+ return __generator(this, function (_a) {
128
+ switch (_a.label) {
129
+ case 0: return [4 /*yield*/, this.fetch({
130
+ uri: '/offerCatalogItems',
131
+ method: 'PUT',
132
+ body: params,
133
+ qs: {},
134
+ expectedStatusCodes: [http_status_1.NO_CONTENT]
135
+ })];
136
+ case 1:
137
+ _a.sent();
138
+ return [2 /*return*/];
139
+ }
140
+ });
141
+ });
142
+ };
125
143
  /**
126
144
  * サブカタログ複数編集
127
145
  */
@@ -19,12 +19,7 @@ export declare class PaymentProductService extends Service {
19
19
  /**
20
20
  * 決済サービス検索
21
21
  */
22
- searchPaymentServices(params: Omit<factory.product.ISearchConditions, 'project'> & {
23
- typeOf?: {
24
- $eq?: factory.service.paymentService.PaymentServiceType;
25
- $in?: factory.service.paymentService.PaymentServiceType[];
26
- };
27
- } & {
22
+ searchPaymentServices(params: Omit<factory.service.paymentService.ISearchConditions, 'project'> & {
28
23
  $projection?: IProjection;
29
24
  }): Promise<{
30
25
  data: IPaymentServiceWithoutCredentials[];
@@ -26,11 +26,6 @@ export declare class ProductService extends Service {
26
26
  * プロダクト検索
27
27
  */
28
28
  searchProducts(params: Omit<factory.product.ISearchConditions, 'project'> & {
29
- typeOf?: {
30
- $eq?: factory.product.ProductType;
31
- $in?: factory.product.ProductType[];
32
- };
33
- } & {
34
29
  $projection?: IProjection;
35
30
  }): Promise<{
36
31
  data: IProductWithoutCredentials[];
@@ -8,7 +8,7 @@ export declare class ProductService extends Service {
8
8
  /**
9
9
  * 検索
10
10
  */
11
- search(params: Omit<factory.product.ISearchConditions, 'project'> & {
11
+ search(params: Omit<factory.product.ISearchConditions, 'project' | 'typeOf'> & {
12
12
  typeOf: {
13
13
  /**
14
14
  * プロダクトタイプあるいは決済サービスタイプ