@cinerino/sdk 12.3.0-alpha.1 → 12.3.0-alpha.10

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.
Files changed (34) hide show
  1. package/example/playground/public/lib/bundle.js +59 -24
  2. package/example/src/chevre/admin/adminCreateEventIfNotExistByIdentifier.ts +150 -0
  3. package/example/src/chevre/admin/adminCreateEventIfNotExistByIdentifierBySoftware.ts +103 -0
  4. package/example/src/chevre/admin/adminCreateNotesIfNotExistByIdentifier.ts +71 -0
  5. package/example/src/chevre/admin/adminProductOffersByIdentifier.ts +83 -0
  6. package/example/src/chevre/console/adminEvents.ts +3 -4
  7. package/example/src/cloud/admin/adminCreateEventIfNotExistByIdentifierBySoftware.ts +102 -0
  8. package/example/src/cloud/admin/adminUpsertManyEventsByAdditionalProperty.ts +19 -21
  9. package/example/src/cloud/findOrderByConfirmationNumber.ts +2 -2
  10. package/example/src/cloud/search/findProducts.ts +2 -1
  11. package/example/src/cloud/transaction/processPlaceOrderUsingMemberProgramTier.ts +10 -2
  12. package/example/src/searchEvents.ts +6 -4
  13. package/lib/abstract/chevreAdmin/event.d.ts +41 -0
  14. package/lib/abstract/chevreAdmin/event.js +54 -0
  15. package/lib/abstract/chevreAdmin/note.d.ts +50 -10
  16. package/lib/abstract/chevreAdmin/note.js +42 -19
  17. package/lib/abstract/chevreAdmin/noteAboutOrder.d.ts +21 -0
  18. package/lib/abstract/chevreAdmin/noteAboutOrder.js +120 -0
  19. package/lib/abstract/chevreAdmin/productOffer.d.ts +69 -0
  20. package/lib/abstract/{chevreConsole/eventOffer.js → chevreAdmin/productOffer.js} +46 -63
  21. package/lib/abstract/chevreAdmin.d.ts +20 -2
  22. package/lib/abstract/chevreAdmin.js +40 -0
  23. package/lib/abstract/chevreConsole/event.js +4 -3
  24. package/lib/abstract/chevreConsole.d.ts +0 -9
  25. package/lib/abstract/chevreConsole.js +0 -20
  26. package/lib/abstract/cloud/admin/event.d.ts +45 -11
  27. package/lib/abstract/cloud/admin/event.js +100 -12
  28. package/lib/abstract/cloud/admin/{note.d.ts → noteAboutOrder.d.ts} +17 -3
  29. package/lib/abstract/cloud/admin/{note.js → noteAboutOrder.js} +18 -13
  30. package/lib/abstract/cloud/admin.d.ts +8 -8
  31. package/lib/abstract/cloud/admin.js +8 -8
  32. package/lib/bundle.js +1276 -949
  33. package/package.json +3 -2
  34. package/lib/abstract/chevreConsole/eventOffer.d.ts +0 -32
@@ -50,11 +50,41 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
50
50
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
51
  }
52
52
  };
53
+ var __rest = (this && this.__rest) || function (s, e) {
54
+ var t = {};
55
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
56
+ t[p] = s[p];
57
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
58
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
59
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
60
+ t[p[i]] = s[p[i]];
61
+ }
62
+ return t;
63
+ };
53
64
  Object.defineProperty(exports, "__esModule", { value: true });
54
65
  exports.EventService = void 0;
55
66
  var factory = require("../../factory");
56
67
  var index_1 = require("../../index");
57
68
  var service_1 = require("../../service");
69
+ function createUpsertParams(params) {
70
+ var _a, _b, _c, _d;
71
+ if (!Array.isArray(params.attributes) || params.attributes.length === 0) {
72
+ throw new factory.errors.ArgumentNull('body');
73
+ }
74
+ var superEventId = (_b = (_a = params.attributes[0]) === null || _a === void 0 ? void 0 : _a.superEvent) === null || _b === void 0 ? void 0 : _b.id;
75
+ var locationBranchCode = (_d = (_c = params.attributes[0]) === null || _c === void 0 ? void 0 : _c.location) === null || _d === void 0 ? void 0 : _d.branchCode;
76
+ if (typeof superEventId !== 'string' || superEventId === '') {
77
+ throw new factory.errors.ArgumentNull('superEvent.id');
78
+ }
79
+ if (typeof locationBranchCode !== 'string' || locationBranchCode === '') {
80
+ throw new factory.errors.ArgumentNull('location.branchCode');
81
+ }
82
+ var upsertParams = params.attributes.map(function (_a) {
83
+ var location = _a.location, superEvent = _a.superEvent, identifier = _a.identifier, typeOf = _a.typeOf, project = _a.project, createFields = __rest(_a, ["location", "superEvent", "identifier", "typeOf", "project"]);
84
+ return createFields;
85
+ });
86
+ return { upsertParams: upsertParams, superEventId: superEventId, locationBranchCode: locationBranchCode };
87
+ }
58
88
  /**
59
89
  * イベントサービス
60
90
  */
@@ -65,10 +95,9 @@ var EventService = /** @class */ (function (_super) {
65
95
  }
66
96
  /**
67
97
  * イベント冪等複数作成
68
- * 特定の追加特性をキーにして、存在しなければ作成する
69
- * 存在すれば、一部属性を更新する(eventStatus,superEvent,offers.seller.makesOffer)
98
+ * イベントコードをキーにして、存在しなければ作成する
70
99
  */
71
- EventService.prototype.upsertManyByAdditionalProperty = function (params) {
100
+ EventService.prototype.createIfNotExistByIdentifier = function (params, options) {
72
101
  return __awaiter(this, void 0, void 0, function () {
73
102
  var _a, auth, endpoint, project, seller, chevreAdmin, eventService;
74
103
  return __generator(this, function (_b) {
@@ -84,29 +113,88 @@ var EventService = /** @class */ (function (_super) {
84
113
  })];
85
114
  case 2:
86
115
  eventService = _b.sent();
87
- return [4 /*yield*/, eventService.upsertManyByAdditionalProperty(params.attributes, {
116
+ return [4 /*yield*/, eventService.createIfNotExistByIdentifier(params, options)];
117
+ case 3:
118
+ _b.sent();
119
+ return [2 /*return*/];
120
+ }
121
+ });
122
+ });
123
+ };
124
+ /**
125
+ * 識別子によるイベント複数更新
126
+ * 識別子のイベントが存在しなければNotFound
127
+ * 座席有無は変更できない
128
+ */
129
+ EventService.prototype.updateEventsByIdentifier = function (params, options) {
130
+ return __awaiter(this, void 0, void 0, function () {
131
+ var _a, auth, endpoint, project, seller, disableAutoRetry, chevreAdmin, eventService;
132
+ return __generator(this, function (_b) {
133
+ switch (_b.label) {
134
+ case 0:
135
+ _a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry;
136
+ return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
137
+ case 1:
138
+ chevreAdmin = _b.sent();
139
+ return [4 /*yield*/, chevreAdmin.createEventInstance({
140
+ project: project,
141
+ seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
142
+ })];
143
+ case 2:
144
+ eventService = _b.sent();
145
+ return [4 /*yield*/, eventService.updateEventsByIdentifier(params, options)];
146
+ case 3:
147
+ _b.sent();
148
+ return [2 /*return*/];
149
+ }
150
+ });
151
+ });
152
+ };
153
+ /**
154
+ * イベント冪等複数作成
155
+ * 特定の追加特性をキーにして、存在しなければ作成する
156
+ * 存在すれば、一部属性を更新する(eventStatus,superEvent,offers.seller.makesOffer)
157
+ */
158
+ EventService.prototype.upsertManyByAdditionalProperty = function (params) {
159
+ return __awaiter(this, void 0, void 0, function () {
160
+ var _a, upsertParams, superEventId, locationBranchCode, _b, auth, endpoint, project, seller, chevreAdmin, eventService;
161
+ return __generator(this, function (_c) {
162
+ switch (_c.label) {
163
+ case 0:
164
+ _a = createUpsertParams(params), upsertParams = _a.upsertParams, superEventId = _a.superEventId, locationBranchCode = _a.locationBranchCode;
165
+ _b = this.options, auth = _b.auth, endpoint = _b.endpoint, project = _b.project, seller = _b.seller;
166
+ return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint })];
167
+ case 1:
168
+ chevreAdmin = _c.sent();
169
+ return [4 /*yield*/, chevreAdmin.createEventInstance({
170
+ project: project,
171
+ seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
172
+ })];
173
+ case 2:
174
+ eventService = _c.sent();
175
+ return [4 /*yield*/, eventService.upsertManyByAdditionalProperty(upsertParams, {
88
176
  filter: { name: params.filter.name },
89
177
  update: false,
90
- superEventId: params.options.superEventId,
91
- locationBranchCode: params.options.locationBranchCode
178
+ superEventId: superEventId,
179
+ locationBranchCode: locationBranchCode
92
180
  })];
93
181
  case 3:
94
- _b.sent();
182
+ _c.sent();
95
183
  return [4 /*yield*/, new Promise(function (resolve) {
96
184
  setTimeout(function () { resolve(); },
97
185
  // tslint:disable-next-line:no-magic-numbers
98
186
  1000);
99
187
  })];
100
188
  case 4:
101
- _b.sent();
102
- return [4 /*yield*/, eventService.upsertManyByAdditionalProperty(params.attributes, {
189
+ _c.sent();
190
+ return [4 /*yield*/, eventService.upsertManyByAdditionalProperty(upsertParams, {
103
191
  filter: { name: params.filter.name },
104
192
  update: true,
105
- superEventId: params.options.superEventId,
106
- locationBranchCode: params.options.locationBranchCode
193
+ superEventId: superEventId,
194
+ locationBranchCode: locationBranchCode
107
195
  })];
108
196
  case 5:
109
- _b.sent();
197
+ _c.sent();
110
198
  return [2 /*return*/];
111
199
  }
112
200
  });
@@ -8,9 +8,9 @@ declare type INoteAsSearchResult = Pick<INoteDigitalDocument, 'about' | 'id' | '
8
8
  id: string;
9
9
  };
10
10
  /**
11
- * メモサービス
11
+ * 注文メモサービス
12
12
  */
13
- export declare class NoteService extends Service {
13
+ export declare class NoteAboutOrderService extends Service {
14
14
  /**
15
15
  * メモ主題(about.id)とメモ識別子(identifier)に対して、存在しなければ作成する
16
16
  * 存在すれば何もしない
@@ -23,7 +23,21 @@ export declare class NoteService extends Service {
23
23
  * メモ検索
24
24
  * limit最大: 20
25
25
  */
26
- search(params: Pick<factory.creativeWork.noteDigitalDocument.ISearchConditions, 'about' | 'id' | 'identifier' | 'limit' | 'page' | 'sort'>): Promise<INoteAsSearchResult[]>;
26
+ search(params: {
27
+ limit: number;
28
+ page: number;
29
+ about?: {
30
+ id?: {
31
+ $eq?: string;
32
+ };
33
+ orderNumber?: {
34
+ $eq?: string;
35
+ };
36
+ };
37
+ identifier?: {
38
+ $eq?: string;
39
+ };
40
+ }): Promise<INoteAsSearchResult[]>;
27
41
  /**
28
42
  * メモコンテンツを更新する
29
43
  */
@@ -62,15 +62,15 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
62
62
  }
63
63
  };
64
64
  Object.defineProperty(exports, "__esModule", { value: true });
65
- exports.NoteService = void 0;
65
+ exports.NoteAboutOrderService = void 0;
66
66
  var index_1 = require("../../index");
67
67
  var service_1 = require("../../service");
68
68
  /**
69
- * メモサービス
69
+ * 注文メモサービス
70
70
  */
71
- var NoteService = /** @class */ (function (_super) {
72
- __extends(NoteService, _super);
73
- function NoteService() {
71
+ var NoteAboutOrderService = /** @class */ (function (_super) {
72
+ __extends(NoteAboutOrderService, _super);
73
+ function NoteAboutOrderService() {
74
74
  return _super !== null && _super.apply(this, arguments) || this;
75
75
  }
76
76
  /**
@@ -80,7 +80,7 @@ var NoteService = /** @class */ (function (_super) {
80
80
  * 識別子(identifier): 8~32文字の英字
81
81
  * コンテンツ(text)最大文字数: 512
82
82
  */
83
- NoteService.prototype.createByIdentifierIfNotExist = function (params) {
83
+ NoteAboutOrderService.prototype.createByIdentifierIfNotExist = function (params) {
84
84
  return __awaiter(this, void 0, void 0, function () {
85
85
  var _a, auth, endpoint, project, seller, chevreAdmin, noteService;
86
86
  return __generator(this, function (_b) {
@@ -90,7 +90,7 @@ var NoteService = /** @class */ (function (_super) {
90
90
  return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint })];
91
91
  case 1:
92
92
  chevreAdmin = _b.sent();
93
- return [4 /*yield*/, chevreAdmin.createNoteInstance({
93
+ return [4 /*yield*/, chevreAdmin.createNoteAboutOrderInstance({
94
94
  project: project,
95
95
  seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
96
96
  })];
@@ -108,7 +108,12 @@ var NoteService = /** @class */ (function (_super) {
108
108
  * メモ検索
109
109
  * limit最大: 20
110
110
  */
111
- NoteService.prototype.search = function (params) {
111
+ NoteAboutOrderService.prototype.search = function (params
112
+ // Pick<
113
+ // factory.creativeWork.noteDigitalDocument.ISearchConditions,
114
+ // 'about' | 'id' | 'identifier' | 'limit' | 'page' | 'sort'
115
+ // >
116
+ ) {
112
117
  return __awaiter(this, void 0, void 0, function () {
113
118
  var _a, auth, endpoint, project, seller, chevreAdmin, noteService;
114
119
  return __generator(this, function (_b) {
@@ -118,7 +123,7 @@ var NoteService = /** @class */ (function (_super) {
118
123
  return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint })];
119
124
  case 1:
120
125
  chevreAdmin = _b.sent();
121
- return [4 /*yield*/, chevreAdmin.createNoteInstance({
126
+ return [4 /*yield*/, chevreAdmin.createNoteAboutOrderInstance({
122
127
  project: project,
123
128
  seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
124
129
  })];
@@ -132,7 +137,7 @@ var NoteService = /** @class */ (function (_super) {
132
137
  /**
133
138
  * メモコンテンツを更新する
134
139
  */
135
- NoteService.prototype.updateById = function (
140
+ NoteAboutOrderService.prototype.updateById = function (
136
141
  /**
137
142
  * メモID
138
143
  */
@@ -147,7 +152,7 @@ var NoteService = /** @class */ (function (_super) {
147
152
  return [4 /*yield*/, index_1.loadChevreAdmin({ auth: auth, endpoint: endpoint })];
148
153
  case 1:
149
154
  chevreAdmin = _b.sent();
150
- return [4 /*yield*/, chevreAdmin.createNoteInstance({
155
+ return [4 /*yield*/, chevreAdmin.createNoteAboutOrderInstance({
151
156
  project: project,
152
157
  seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
153
158
  })];
@@ -161,6 +166,6 @@ var NoteService = /** @class */ (function (_super) {
161
166
  });
162
167
  });
163
168
  };
164
- return NoteService;
169
+ return NoteAboutOrderService;
165
170
  }(service_1.Service));
166
- exports.NoteService = NoteService;
171
+ exports.NoteAboutOrderService = NoteAboutOrderService;
@@ -3,7 +3,7 @@ import type { CreativeWorkService } from './admin/creativeWork';
3
3
  import type { CustomerService } from './admin/customer';
4
4
  import type { EventService } from './admin/event';
5
5
  import type { MeService } from './admin/me';
6
- import type { NoteService } from './admin/note';
6
+ import type { NoteAboutOrderService } from './admin/noteAboutOrder';
7
7
  import type { OfferService } from './admin/offer';
8
8
  import type { OfferCatalogService } from './admin/offerCatalog';
9
9
  import type { OfferCatalogItemService } from './admin/offerCatalogItem';
@@ -42,11 +42,11 @@ export declare namespace service {
42
42
  let svc: typeof MeService | undefined;
43
43
  }
44
44
  /**
45
- * メモサービス
45
+ * 注文メモサービス
46
46
  */
47
- type Note = NoteService;
48
- namespace Note {
49
- let svc: typeof NoteService | undefined;
47
+ type NoteAboutOrder = NoteAboutOrderService;
48
+ namespace NoteAboutOrder {
49
+ let svc: typeof NoteAboutOrderService | undefined;
50
50
  }
51
51
  /**
52
52
  * 単価オファーサービス
@@ -102,13 +102,13 @@ export declare namespace service {
102
102
  * 管理サービス
103
103
  */
104
104
  export declare class CloudAdmin {
105
- options: Pick<IOptions, 'auth' | 'endpoint'>;
106
- constructor(options: Pick<IOptions, 'auth' | 'endpoint'>);
105
+ options: Pick<IOptions, 'auth' | 'endpoint' | 'disableAutoRetry'>;
106
+ constructor(options: Pick<IOptions, 'auth' | 'endpoint' | 'disableAutoRetry'>);
107
107
  createCreativeWorkInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<CreativeWorkService>;
108
108
  createCustomerInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<CustomerService>;
109
109
  createEventInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<EventService>;
110
110
  createMeInstance(): Promise<MeService>;
111
- createNoteInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<NoteService>;
111
+ createNoteInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<NoteAboutOrderService>;
112
112
  createOfferInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<OfferService>;
113
113
  createOfferCatalogInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<OfferCatalogService>;
114
114
  createOfferCatalogItemInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<OfferCatalogItemService>;
@@ -62,9 +62,9 @@ var service;
62
62
  var Me;
63
63
  (function (Me) {
64
64
  })(Me = service.Me || (service.Me = {}));
65
- var Note;
66
- (function (Note) {
67
- })(Note = service.Note || (service.Note = {}));
65
+ var NoteAboutOrder;
66
+ (function (NoteAboutOrder) {
67
+ })(NoteAboutOrder = service.NoteAboutOrder || (service.NoteAboutOrder = {}));
68
68
  var Offer;
69
69
  (function (Offer) {
70
70
  })(Offer = service.Offer || (service.Offer = {}));
@@ -176,13 +176,13 @@ var CloudAdmin = /** @class */ (function () {
176
176
  return __generator(this, function (_b) {
177
177
  switch (_b.label) {
178
178
  case 0:
179
- if (!(service.Note.svc === undefined)) return [3 /*break*/, 2];
180
- _a = service.Note;
181
- return [4 /*yield*/, Promise.resolve().then(function () { return require('./admin/note'); })];
179
+ if (!(service.NoteAboutOrder.svc === undefined)) return [3 /*break*/, 2];
180
+ _a = service.NoteAboutOrder;
181
+ return [4 /*yield*/, Promise.resolve().then(function () { return require('./admin/noteAboutOrder'); })];
182
182
  case 1:
183
- _a.svc = (_b.sent()).NoteService;
183
+ _a.svc = (_b.sent()).NoteAboutOrderService;
184
184
  _b.label = 2;
185
- case 2: return [2 /*return*/, new service.Note.svc(__assign(__assign(__assign({}, this.options), params), { retryableStatusCodes: defaultRetryableStatusCodes }))];
185
+ case 2: return [2 /*return*/, new service.NoteAboutOrder.svc(__assign(__assign(__assign({}, this.options), params), { retryableStatusCodes: defaultRetryableStatusCodes }))];
186
186
  }
187
187
  });
188
188
  });