@chevre/domain 21.13.0-alpha.1 → 21.13.0-alpha.3
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/example/src/chevre/searchEvents.ts +4 -1
- package/example/src/chevre/task/executeTasks.ts +1 -1
- package/example/src/chevre/transaction/findPaymentCardPermit.ts +2 -2
- package/example/src/chevre/transaction/processReturnOrder.ts +1 -1
- package/lib/chevre/errorHandler.d.ts +2 -2
- package/lib/chevre/errorHandler.js +38 -19
- package/lib/chevre/factory/transaction.d.ts +42 -0
- package/lib/chevre/factory/transaction.js +2 -0
- package/lib/chevre/index.d.ts +5 -4
- package/lib/chevre/index.js +31 -11
- package/lib/chevre/repo/account.d.ts +1 -1
- package/lib/chevre/repo/accountTitle.d.ts +1 -1
- package/lib/chevre/repo/accountTransaction.d.ts +1 -1
- package/lib/chevre/repo/accountingReport.d.ts +1 -1
- package/lib/chevre/repo/accountingReport.js +1 -1
- package/lib/chevre/repo/action.d.ts +1 -1
- package/lib/chevre/repo/additionalProperty.d.ts +1 -1
- package/lib/chevre/repo/aggregateOffer.d.ts +1 -1
- package/lib/chevre/repo/aggregation.d.ts +1 -1
- package/lib/chevre/repo/assetTransaction.d.ts +1 -1
- package/lib/chevre/repo/categoryCode.d.ts +1 -1
- package/lib/chevre/repo/code.d.ts +1 -1
- package/lib/chevre/repo/comment.d.ts +1 -1
- package/lib/chevre/repo/creativeWork.d.ts +1 -1
- package/lib/chevre/repo/customer.d.ts +1 -1
- package/lib/chevre/repo/emailMessage.d.ts +1 -1
- package/lib/chevre/repo/event.js +2 -2
- package/lib/chevre/repo/member.d.ts +1 -1
- package/lib/chevre/repo/merchantReturnPolicy.d.ts +1 -1
- package/lib/chevre/repo/mongoose/writeConcern.d.ts +1 -1
- package/lib/chevre/repo/offerItemCondition.d.ts +1 -1
- package/lib/chevre/repo/order.d.ts +1 -1
- package/lib/chevre/repo/order.js +1 -1
- package/lib/chevre/repo/ownershipInfo.d.ts +1 -1
- package/lib/chevre/repo/ownershipInfo.js +1 -1
- package/lib/chevre/repo/permit.d.ts +1 -1
- package/lib/chevre/repo/place.d.ts +1 -1
- package/lib/chevre/repo/priceSpecification.d.ts +1 -1
- package/lib/chevre/repo/product.d.ts +1 -1
- package/lib/chevre/repo/project.d.ts +1 -1
- package/lib/chevre/repo/reservation.d.ts +1 -1
- package/lib/chevre/repo/role.d.ts +1 -1
- package/lib/chevre/repo/serviceOutput.d.ts +1 -1
- package/lib/chevre/repo/stockHolder.d.ts +2 -2
- package/lib/chevre/repo/task.d.ts +1 -1
- package/lib/chevre/repo/telemetry.d.ts +1 -1
- package/lib/chevre/repo/transaction.d.ts +1 -1
- package/lib/chevre/repo/trip.d.ts +1 -1
- package/lib/chevre/repository.d.ts +36 -27
- package/lib/chevre/repository.js +117 -48
- package/lib/chevre/service/assetTransaction/cancelReservation.js +2 -2
- package/lib/chevre/service/task.d.ts +2 -2
- package/lib/chevre/service/task.js +9 -3
- package/lib/chevre/service/transaction/moneyTransfer.d.ts +2 -4
- package/lib/chevre/service/transaction/placeOrderInProgress.d.ts +5 -32
- package/lib/chevre/service/transaction/placeOrderInProgress.js +2 -2
- package/lib/chevre/service/transaction/returnOrder.js +1 -1
- package/lib/chevre/service/transaction/validation.d.ts +1 -3
- package/lib/chevre/service.d.ts +75 -39
- package/lib/chevre/service.js +258 -39
- package/package.json +1 -1
- package/example/src/chevre/searchSendEmailActions.ts +0 -44
- package/example/src/chevre/searchTasks.ts +0 -31
- package/example/src/chevre/searchTransactions.ts +0 -25
- package/example/src/chevre/sendEmailMessage.ts +0 -80
- package/example/src/chevre/syncCatalogs2aggregateOffers.ts +0 -87
package/lib/chevre/service.d.ts
CHANGED
|
@@ -5,49 +5,85 @@ import * as AccountTransactionIdentifierFactory from './factory/accountTransacti
|
|
|
5
5
|
import * as EventFactory from './factory/event';
|
|
6
6
|
import * as OrderFactory from './factory/order';
|
|
7
7
|
import * as ReservedAgentIdentifireNamesFactory from './factory/reservedAgentIdentifireNames';
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
12
|
-
import * as
|
|
13
|
-
import * as
|
|
14
|
-
import * as
|
|
15
|
-
import * as
|
|
16
|
-
import * as
|
|
17
|
-
import * as
|
|
18
|
-
import * as
|
|
19
|
-
import * as
|
|
20
|
-
import * as
|
|
21
|
-
import * as
|
|
22
|
-
import * as
|
|
23
|
-
import * as
|
|
24
|
-
import * as
|
|
25
|
-
import * as
|
|
26
|
-
import * as
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export
|
|
37
|
-
|
|
8
|
+
import * as TransactionFactory from './factory/transaction';
|
|
9
|
+
import type * as AccountService from './service/account';
|
|
10
|
+
import type * as AccountTransactionService from './service/accountTransaction';
|
|
11
|
+
import type * as AggregationService from './service/aggregation';
|
|
12
|
+
import type * as AssetTransactionService from './service/assetTransaction';
|
|
13
|
+
import type * as CodeService from './service/code';
|
|
14
|
+
import type * as DeliveryService from './service/delivery';
|
|
15
|
+
import type * as EventService from './service/event';
|
|
16
|
+
import type * as IAMService from './service/iam';
|
|
17
|
+
import type * as NotificationService from './service/notification';
|
|
18
|
+
import type * as OfferService from './service/offer';
|
|
19
|
+
import type * as OrderService from './service/order';
|
|
20
|
+
import type * as AnyPaymentService from './service/payment/any';
|
|
21
|
+
import type * as PermitService from './service/permit';
|
|
22
|
+
import type * as ProjectService from './service/project';
|
|
23
|
+
import type * as ReportService from './service/report';
|
|
24
|
+
import type * as ReserveService from './service/reserve';
|
|
25
|
+
import type * as TaskService from './service/task';
|
|
26
|
+
import type * as TransactionService from './service/transaction';
|
|
27
|
+
export declare namespace account {
|
|
28
|
+
function createService(): Promise<typeof AccountService>;
|
|
29
|
+
}
|
|
30
|
+
export declare namespace accountTransaction {
|
|
31
|
+
function createService(): Promise<typeof AccountTransactionService>;
|
|
32
|
+
}
|
|
33
|
+
export declare namespace aggregation {
|
|
34
|
+
function createService(): Promise<typeof AggregationService>;
|
|
35
|
+
}
|
|
36
|
+
export declare namespace assetTransaction {
|
|
37
|
+
function createService(): Promise<typeof AssetTransactionService>;
|
|
38
|
+
}
|
|
39
|
+
export declare namespace code {
|
|
40
|
+
function createService(): Promise<typeof CodeService>;
|
|
41
|
+
}
|
|
42
|
+
export declare namespace delivery {
|
|
43
|
+
function createService(): Promise<typeof DeliveryService>;
|
|
44
|
+
}
|
|
45
|
+
export declare namespace event {
|
|
46
|
+
function createService(): Promise<typeof EventService>;
|
|
47
|
+
}
|
|
48
|
+
export declare namespace iam {
|
|
49
|
+
function createService(): Promise<typeof IAMService>;
|
|
50
|
+
}
|
|
51
|
+
export declare namespace notification {
|
|
52
|
+
function createService(): Promise<typeof NotificationService>;
|
|
53
|
+
}
|
|
54
|
+
export declare namespace offer {
|
|
55
|
+
function createService(): Promise<typeof OfferService>;
|
|
56
|
+
}
|
|
57
|
+
export declare namespace order {
|
|
58
|
+
function createService(): Promise<typeof OrderService>;
|
|
59
|
+
}
|
|
38
60
|
export declare namespace payment {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
export
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
export
|
|
47
|
-
|
|
61
|
+
namespace any {
|
|
62
|
+
function createService(): Promise<typeof AnyPaymentService>;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export declare namespace permit {
|
|
66
|
+
function createService(): Promise<typeof PermitService>;
|
|
67
|
+
}
|
|
68
|
+
export declare namespace project {
|
|
69
|
+
function createService(): Promise<typeof ProjectService>;
|
|
70
|
+
}
|
|
71
|
+
export declare namespace report {
|
|
72
|
+
function createService(): Promise<typeof ReportService>;
|
|
73
|
+
}
|
|
74
|
+
export declare namespace reserve {
|
|
75
|
+
function createService(): Promise<typeof ReserveService>;
|
|
76
|
+
}
|
|
77
|
+
export declare namespace task {
|
|
78
|
+
function createService(): Promise<typeof TaskService>;
|
|
79
|
+
}
|
|
80
|
+
export declare namespace transaction {
|
|
81
|
+
function createService(): Promise<typeof TransactionService>;
|
|
82
|
+
}
|
|
48
83
|
export declare namespace factory {
|
|
49
84
|
export import accountTransactionIdentifier = AccountTransactionIdentifierFactory;
|
|
50
85
|
export import event = EventFactory;
|
|
51
86
|
export import order = OrderFactory;
|
|
52
87
|
export import reservedAgentIdentifireNames = ReservedAgentIdentifireNamesFactory;
|
|
88
|
+
export import transaction = TransactionFactory;
|
|
53
89
|
}
|
package/lib/chevre/service.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.factory = exports.
|
|
12
|
+
exports.factory = exports.transaction = exports.task = exports.reserve = exports.report = exports.project = exports.permit = exports.payment = exports.order = exports.offer = exports.notification = exports.iam = exports.event = exports.delivery = exports.code = exports.assetTransaction = exports.aggregation = exports.accountTransaction = exports.account = void 0;
|
|
4
13
|
/**
|
|
5
14
|
* service module
|
|
6
15
|
*/
|
|
@@ -8,47 +17,255 @@ const AccountTransactionIdentifierFactory = require("./factory/accountTransactio
|
|
|
8
17
|
const EventFactory = require("./factory/event");
|
|
9
18
|
const OrderFactory = require("./factory/order");
|
|
10
19
|
const ReservedAgentIdentifireNamesFactory = require("./factory/reservedAgentIdentifireNames");
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
exports.
|
|
40
|
-
|
|
20
|
+
const TransactionFactory = require("./factory/transaction");
|
|
21
|
+
// import type * as UtilService from './service/util';
|
|
22
|
+
// import all lazily(2023-10-11~)
|
|
23
|
+
var account;
|
|
24
|
+
(function (account) {
|
|
25
|
+
let service;
|
|
26
|
+
function createService() {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
if (service === undefined) {
|
|
29
|
+
service = yield Promise.resolve().then(() => require('./service/account'));
|
|
30
|
+
}
|
|
31
|
+
return service;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
account.createService = createService;
|
|
35
|
+
})(account = exports.account || (exports.account = {}));
|
|
36
|
+
var accountTransaction;
|
|
37
|
+
(function (accountTransaction) {
|
|
38
|
+
let service;
|
|
39
|
+
function createService() {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
if (service === undefined) {
|
|
42
|
+
service = yield Promise.resolve().then(() => require('./service/accountTransaction'));
|
|
43
|
+
}
|
|
44
|
+
return service;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
accountTransaction.createService = createService;
|
|
48
|
+
})(accountTransaction = exports.accountTransaction || (exports.accountTransaction = {}));
|
|
49
|
+
var aggregation;
|
|
50
|
+
(function (aggregation) {
|
|
51
|
+
let service;
|
|
52
|
+
function createService() {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
if (service === undefined) {
|
|
55
|
+
service = yield Promise.resolve().then(() => require('./service/aggregation'));
|
|
56
|
+
}
|
|
57
|
+
return service;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
aggregation.createService = createService;
|
|
61
|
+
})(aggregation = exports.aggregation || (exports.aggregation = {}));
|
|
62
|
+
var assetTransaction;
|
|
63
|
+
(function (assetTransaction) {
|
|
64
|
+
let service;
|
|
65
|
+
function createService() {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
if (service === undefined) {
|
|
68
|
+
service = yield Promise.resolve().then(() => require('./service/assetTransaction'));
|
|
69
|
+
}
|
|
70
|
+
return service;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
assetTransaction.createService = createService;
|
|
74
|
+
})(assetTransaction = exports.assetTransaction || (exports.assetTransaction = {}));
|
|
75
|
+
var code;
|
|
76
|
+
(function (code) {
|
|
77
|
+
let service;
|
|
78
|
+
function createService() {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
if (service === undefined) {
|
|
81
|
+
service = yield Promise.resolve().then(() => require('./service/code'));
|
|
82
|
+
}
|
|
83
|
+
return service;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
code.createService = createService;
|
|
87
|
+
})(code = exports.code || (exports.code = {}));
|
|
88
|
+
var delivery;
|
|
89
|
+
(function (delivery) {
|
|
90
|
+
let service;
|
|
91
|
+
function createService() {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
if (service === undefined) {
|
|
94
|
+
service = yield Promise.resolve().then(() => require('./service/delivery'));
|
|
95
|
+
}
|
|
96
|
+
return service;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
delivery.createService = createService;
|
|
100
|
+
})(delivery = exports.delivery || (exports.delivery = {}));
|
|
101
|
+
var event;
|
|
102
|
+
(function (event) {
|
|
103
|
+
let service;
|
|
104
|
+
function createService() {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
if (service === undefined) {
|
|
107
|
+
service = yield Promise.resolve().then(() => require('./service/event'));
|
|
108
|
+
}
|
|
109
|
+
return service;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
event.createService = createService;
|
|
113
|
+
})(event = exports.event || (exports.event = {}));
|
|
114
|
+
var iam;
|
|
115
|
+
(function (iam) {
|
|
116
|
+
let service;
|
|
117
|
+
function createService() {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
if (service === undefined) {
|
|
120
|
+
service = yield Promise.resolve().then(() => require('./service/iam'));
|
|
121
|
+
}
|
|
122
|
+
return service;
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
iam.createService = createService;
|
|
126
|
+
})(iam = exports.iam || (exports.iam = {}));
|
|
127
|
+
var notification;
|
|
128
|
+
(function (notification) {
|
|
129
|
+
let service;
|
|
130
|
+
function createService() {
|
|
131
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
132
|
+
if (service === undefined) {
|
|
133
|
+
service = yield Promise.resolve().then(() => require('./service/notification'));
|
|
134
|
+
}
|
|
135
|
+
return service;
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
notification.createService = createService;
|
|
139
|
+
})(notification = exports.notification || (exports.notification = {}));
|
|
140
|
+
var offer;
|
|
141
|
+
(function (offer) {
|
|
142
|
+
let service;
|
|
143
|
+
function createService() {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
if (service === undefined) {
|
|
146
|
+
service = yield Promise.resolve().then(() => require('./service/offer'));
|
|
147
|
+
}
|
|
148
|
+
return service;
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
offer.createService = createService;
|
|
152
|
+
})(offer = exports.offer || (exports.offer = {}));
|
|
153
|
+
var order;
|
|
154
|
+
(function (order) {
|
|
155
|
+
let service;
|
|
156
|
+
function createService() {
|
|
157
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
158
|
+
if (service === undefined) {
|
|
159
|
+
service = yield Promise.resolve().then(() => require('./service/order'));
|
|
160
|
+
}
|
|
161
|
+
return service;
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
order.createService = createService;
|
|
165
|
+
})(order = exports.order || (exports.order = {}));
|
|
41
166
|
var payment;
|
|
42
167
|
(function (payment) {
|
|
43
|
-
|
|
168
|
+
let any;
|
|
169
|
+
(function (any) {
|
|
170
|
+
let service;
|
|
171
|
+
function createService() {
|
|
172
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
173
|
+
if (service === undefined) {
|
|
174
|
+
service = yield Promise.resolve().then(() => require('./service/payment/any'));
|
|
175
|
+
}
|
|
176
|
+
return service;
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
any.createService = createService;
|
|
180
|
+
})(any = payment.any || (payment.any = {}));
|
|
44
181
|
})(payment = exports.payment || (exports.payment = {}));
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
182
|
+
var permit;
|
|
183
|
+
(function (permit) {
|
|
184
|
+
let service;
|
|
185
|
+
function createService() {
|
|
186
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
187
|
+
if (service === undefined) {
|
|
188
|
+
service = yield Promise.resolve().then(() => require('./service/permit'));
|
|
189
|
+
}
|
|
190
|
+
return service;
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
permit.createService = createService;
|
|
194
|
+
})(permit = exports.permit || (exports.permit = {}));
|
|
195
|
+
var project;
|
|
196
|
+
(function (project) {
|
|
197
|
+
let service;
|
|
198
|
+
function createService() {
|
|
199
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
200
|
+
if (service === undefined) {
|
|
201
|
+
service = yield Promise.resolve().then(() => require('./service/project'));
|
|
202
|
+
}
|
|
203
|
+
return service;
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
project.createService = createService;
|
|
207
|
+
})(project = exports.project || (exports.project = {}));
|
|
208
|
+
var report;
|
|
209
|
+
(function (report) {
|
|
210
|
+
let service;
|
|
211
|
+
function createService() {
|
|
212
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
213
|
+
if (service === undefined) {
|
|
214
|
+
service = yield Promise.resolve().then(() => require('./service/report'));
|
|
215
|
+
}
|
|
216
|
+
return service;
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
report.createService = createService;
|
|
220
|
+
})(report = exports.report || (exports.report = {}));
|
|
221
|
+
var reserve;
|
|
222
|
+
(function (reserve) {
|
|
223
|
+
let service;
|
|
224
|
+
function createService() {
|
|
225
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
226
|
+
if (service === undefined) {
|
|
227
|
+
service = yield Promise.resolve().then(() => require('./service/reserve'));
|
|
228
|
+
}
|
|
229
|
+
return service;
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
reserve.createService = createService;
|
|
233
|
+
})(reserve = exports.reserve || (exports.reserve = {}));
|
|
234
|
+
var task;
|
|
235
|
+
(function (task) {
|
|
236
|
+
let service;
|
|
237
|
+
function createService() {
|
|
238
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
239
|
+
if (service === undefined) {
|
|
240
|
+
service = yield Promise.resolve().then(() => require('./service/task'));
|
|
241
|
+
}
|
|
242
|
+
return service;
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
task.createService = createService;
|
|
246
|
+
})(task = exports.task || (exports.task = {}));
|
|
247
|
+
var transaction;
|
|
248
|
+
(function (transaction) {
|
|
249
|
+
let service;
|
|
250
|
+
function createService() {
|
|
251
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
252
|
+
if (service === undefined) {
|
|
253
|
+
service = yield Promise.resolve().then(() => require('./service/transaction'));
|
|
254
|
+
}
|
|
255
|
+
return service;
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
transaction.createService = createService;
|
|
259
|
+
})(transaction = exports.transaction || (exports.transaction = {}));
|
|
260
|
+
// export namespace util {
|
|
261
|
+
// let service: typeof UtilService | undefined;
|
|
262
|
+
// export async function createService() {
|
|
263
|
+
// if (service === undefined) {
|
|
264
|
+
// service = await import('./service/util');
|
|
265
|
+
// }
|
|
266
|
+
// return service;
|
|
267
|
+
// }
|
|
268
|
+
// }
|
|
52
269
|
var factory;
|
|
53
270
|
(function (factory) {
|
|
54
271
|
factory.accountTransactionIdentifier = AccountTransactionIdentifierFactory;
|
|
@@ -57,4 +274,6 @@ var factory;
|
|
|
57
274
|
// tslint:disable-next-line:no-shadowed-variable
|
|
58
275
|
factory.order = OrderFactory;
|
|
59
276
|
factory.reservedAgentIdentifireNames = ReservedAgentIdentifireNamesFactory;
|
|
277
|
+
// tslint:disable-next-line:no-shadowed-variable
|
|
278
|
+
factory.transaction = TransactionFactory;
|
|
60
279
|
})(factory = exports.factory || (exports.factory = {}));
|
package/package.json
CHANGED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// tslint:disable:no-console
|
|
2
|
-
// import * as moment from 'moment';
|
|
3
|
-
import * as mongoose from 'mongoose';
|
|
4
|
-
|
|
5
|
-
import { chevre } from '../../../lib/index';
|
|
6
|
-
|
|
7
|
-
async function main() {
|
|
8
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
9
|
-
|
|
10
|
-
const actionRepo = new chevre.repository.Action(mongoose.connection);
|
|
11
|
-
|
|
12
|
-
const actions = <chevre.factory.action.transfer.send.message.email.IAction[]>await actionRepo.search(
|
|
13
|
-
{
|
|
14
|
-
limit: 1000,
|
|
15
|
-
page: 1,
|
|
16
|
-
typeOf: { $eq: chevre.factory.actionType.SendAction },
|
|
17
|
-
object: {
|
|
18
|
-
typeOf: { $eq: chevre.factory.creativeWorkType.EmailMessage }
|
|
19
|
-
}
|
|
20
|
-
// startFrom: moment()
|
|
21
|
-
// .add(-20, 'days')
|
|
22
|
-
// .toDate(),
|
|
23
|
-
// startThrough: moment()
|
|
24
|
-
// .add(-19, 'days')
|
|
25
|
-
// .toDate(),
|
|
26
|
-
},
|
|
27
|
-
['project', '_id', 'object', 'purpose'],
|
|
28
|
-
[]
|
|
29
|
-
);
|
|
30
|
-
const maxLenght = Math.max(...actions.map((action) => {
|
|
31
|
-
return (Array.isArray(action.object)) ? action.object[0].text?.length : action.object.text?.length;
|
|
32
|
-
}));
|
|
33
|
-
actions.forEach((action) => {
|
|
34
|
-
const length = (Array.isArray(action.object)) ? action.object[0].text?.length : action.object.text?.length;
|
|
35
|
-
if (typeof length !== 'number') {
|
|
36
|
-
throw new Error(`${action.project.id},${action.id},${action.purpose?.typeOf},${action.purpose?.orderNumber},${action.object.text?.length}`);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
console.log('maxLenght:', maxLenght);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
main()
|
|
43
|
-
.then(console.log)
|
|
44
|
-
.catch(console.error);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// tslint:disable:no-console
|
|
2
|
-
import * as mongoose from 'mongoose';
|
|
3
|
-
|
|
4
|
-
import { chevre } from '../../../lib/index';
|
|
5
|
-
|
|
6
|
-
const project = { id: String(process.env.PROJECT_ID) };
|
|
7
|
-
|
|
8
|
-
async function main() {
|
|
9
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: true });
|
|
10
|
-
|
|
11
|
-
const taskRepo = new chevre.repository.Task(mongoose.connection);
|
|
12
|
-
|
|
13
|
-
const tasks = await taskRepo.search(
|
|
14
|
-
{
|
|
15
|
-
limit: 1,
|
|
16
|
-
project: { id: { $eq: project.id } },
|
|
17
|
-
name: { $in: [chevre.factory.taskName.SendOrder] },
|
|
18
|
-
data: {
|
|
19
|
-
object: {
|
|
20
|
-
orderNumber: { $eq: 'xxx' }
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
);
|
|
25
|
-
console.log('tasks found', tasks);
|
|
26
|
-
console.log(tasks.length, 'tasks found');
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
main()
|
|
30
|
-
.then()
|
|
31
|
-
.catch(console.error);
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// tslint:disable:no-console
|
|
2
|
-
import * as mongoose from 'mongoose';
|
|
3
|
-
|
|
4
|
-
import { chevre } from '../../../lib/index';
|
|
5
|
-
|
|
6
|
-
async function main() {
|
|
7
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI);
|
|
8
|
-
|
|
9
|
-
const transactionRepo = new chevre.repository.Transaction(mongoose.connection);
|
|
10
|
-
|
|
11
|
-
const transactions = await transactionRepo.search({
|
|
12
|
-
limit: 100,
|
|
13
|
-
page: 1,
|
|
14
|
-
typeOf: chevre.factory.transactionType.PlaceOrder,
|
|
15
|
-
result: { order: { confirmationNumber: { $eq: '96275' } } },
|
|
16
|
-
inclusion: ['result'],
|
|
17
|
-
exclusion: []
|
|
18
|
-
});
|
|
19
|
-
console.log(transactions);
|
|
20
|
-
console.log(transactions.length);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
main()
|
|
24
|
-
.then(console.log)
|
|
25
|
-
.catch(console.error);
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// tslint:disable:no-console
|
|
2
|
-
import * as moment from 'moment';
|
|
3
|
-
import * as mongoose from 'mongoose';
|
|
4
|
-
|
|
5
|
-
import { chevre } from '../../../lib/index';
|
|
6
|
-
|
|
7
|
-
const project = { id: String(process.env.PROJECT_ID) };
|
|
8
|
-
const SENDER_EMAIL = String(process.env.SENDER_EMAIL);
|
|
9
|
-
const RECIPIENT_EMAIL = String(process.env.RECIPIENT_EMAIL);
|
|
10
|
-
|
|
11
|
-
async function main() {
|
|
12
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI);
|
|
13
|
-
|
|
14
|
-
const actionRepo = new chevre.repository.Action(mongoose.connection);
|
|
15
|
-
const projectRepo = new chevre.repository.Project(mongoose.connection);
|
|
16
|
-
|
|
17
|
-
await chevre.service.notification.sendEmailMessage({
|
|
18
|
-
project: {
|
|
19
|
-
typeOf: chevre.factory.organizationType.Project,
|
|
20
|
-
id: project.id
|
|
21
|
-
},
|
|
22
|
-
typeOf: chevre.factory.actionType.SendAction,
|
|
23
|
-
object: {
|
|
24
|
-
typeOf: chevre.factory.creativeWorkType.EmailMessage,
|
|
25
|
-
identifier: 'SendOrder-CIN1-3970498-5700993',
|
|
26
|
-
name: 'SendOrder-CIN1-3970498-5700993',
|
|
27
|
-
sender: {
|
|
28
|
-
typeOf: 'Corporation',
|
|
29
|
-
name: 'sample sender ',
|
|
30
|
-
email: SENDER_EMAIL
|
|
31
|
-
},
|
|
32
|
-
toRecipient: [
|
|
33
|
-
{
|
|
34
|
-
typeOf: 'WebApplication',
|
|
35
|
-
name: 'sample recipient 2',
|
|
36
|
-
email: RECIPIENT_EMAIL
|
|
37
|
-
}
|
|
38
|
-
],
|
|
39
|
-
about: {
|
|
40
|
-
typeOf: 'Thing',
|
|
41
|
-
identifier: chevre.factory.creativeWork.message.email.AboutIdentifier.OnOrderSent,
|
|
42
|
-
name: 'sample about'
|
|
43
|
-
},
|
|
44
|
-
text: 'sample text'
|
|
45
|
-
},
|
|
46
|
-
agent: {
|
|
47
|
-
typeOf: chevre.factory.organizationType.Project,
|
|
48
|
-
id: project.id
|
|
49
|
-
},
|
|
50
|
-
recipient: {
|
|
51
|
-
typeOf: chevre.factory.creativeWorkType.WebApplication,
|
|
52
|
-
id: 'xxxx',
|
|
53
|
-
name: 'sample recipient'
|
|
54
|
-
},
|
|
55
|
-
purpose: {
|
|
56
|
-
typeOf: chevre.factory.order.OrderType.Order,
|
|
57
|
-
seller: {
|
|
58
|
-
id: '59d20831e53ebc2b4e774466',
|
|
59
|
-
name: 'seller name',
|
|
60
|
-
typeOf: chevre.factory.organizationType.Corporation
|
|
61
|
-
},
|
|
62
|
-
customer: {
|
|
63
|
-
typeOf: chevre.factory.creativeWorkType.WebApplication,
|
|
64
|
-
id: 'xxxx'
|
|
65
|
-
},
|
|
66
|
-
orderNumber: 'CIN1-3970498-5700993',
|
|
67
|
-
price: 0,
|
|
68
|
-
priceCurrency: chevre.factory.priceCurrency.JPY,
|
|
69
|
-
orderDate: moment('2023-03-06T01:02:58.866Z')
|
|
70
|
-
.toDate()
|
|
71
|
-
}
|
|
72
|
-
})({
|
|
73
|
-
action: actionRepo,
|
|
74
|
-
project: projectRepo
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
main()
|
|
79
|
-
.then(console.log)
|
|
80
|
-
.catch(console.error);
|