@be-link/pos-cli-nodejs 0.0.117 → 0.0.119
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/package.json +1 -1
- package/{dist/pos → pos}/http.js +27 -0
- package/.husky/commit-msg +0 -4
- package/.versionrc +0 -22
- package/CHANGELOG.md +0 -138
- package/Makefile +0 -4
- package/ci/index.ts +0 -73
- package/commitlint.config.js +0 -3
- package/dist/README.md +0 -40
- package/dist/package.json +0 -52
- package/docs/.nojekyll +0 -1
- package/docs/assets/highlight.css +0 -71
- package/docs/assets/main.js +0 -59
- package/docs/assets/navigation.js +0 -1
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1383
- package/docs/classes/_internal_.OrderCoreService.html +0 -351
- package/docs/classes/_internal_.OrderFulfillService.html +0 -489
- package/docs/classes/_internal_.OrderJobService.html +0 -229
- package/docs/classes/_internal_.OrderNoteService.html +0 -177
- package/docs/classes/_internal_.QueryByCommodityService.html +0 -311
- package/docs/classes/_internal_.QueryByStoreService.html +0 -133
- package/docs/classes/_internal_.QueryByUserService.html +0 -283
- package/docs/classes/_internal_.QueryByWebService.html +0 -133
- package/docs/classes/_internal_.default.html +0 -82
- package/docs/enums/_internal_.Constants.ApplicablePeopleEnum.html +0 -90
- package/docs/enums/_internal_.Constants.ItineraryTypeEnum.html +0 -82
- package/docs/enums/_internal_.Constants.ModifyOperatorRoleEnum.html +0 -114
- package/docs/enums/_internal_.Constants.NoteStatusEnum.html +0 -82
- package/docs/enums/_internal_.Constants.NoteTypeEnum.html +0 -106
- package/docs/enums/_internal_.Constants.OperatorRoleEnum.html +0 -114
- package/docs/enums/_internal_.Constants.PayToolEnum.html +0 -82
- package/docs/enums/_internal_.Constants.PaymentTypeEnum.html +0 -98
- package/docs/enums/_internal_.Constants.PromotionTypeEnum.html +0 -82
- package/docs/enums/_internal_.Constants.PurchaseSkuStatusEnum.html +0 -82
- package/docs/enums/_internal_.Constants.ShuttleTypeEnum.html +0 -82
- package/docs/enums/_internal_.Constants.TradeOperatorRoleEnum.html +0 -98
- package/docs/enums/_internal_.Constants.TradeOrderStatusEnum.html +0 -146
- package/docs/enums/_internal_.Constants.TransportationTypeEnum.html +0 -114
- package/docs/enums/_internal_.QueryDataBlock.html +0 -121
- package/docs/index.html +0 -68
- package/docs/interfaces/_internal_.Content.html +0 -81
- package/docs/interfaces/_internal_.CostInclusionJson.html +0 -81
- package/docs/interfaces/_internal_.CouponSnapShotInfo.html +0 -133
- package/docs/interfaces/_internal_.CreditInfo.html +0 -73
- package/docs/interfaces/_internal_.IPositiveAttributes.html +0 -161
- package/docs/interfaces/_internal_.IPositiveChangeSkuRecord.html +0 -145
- package/docs/interfaces/_internal_.IPositiveItemInfo.html +0 -413
- package/docs/interfaces/_internal_.IPositiveOrder.html +0 -263
- package/docs/interfaces/_internal_.IPositivePaymentInfo.html +0 -153
- package/docs/interfaces/_internal_.IPositivePromotionInfo.html +0 -129
- package/docs/interfaces/_internal_.IPositiveSkuInfo.html +0 -332
- package/docs/interfaces/_internal_.IWxPaymentInfo.html +0 -95
- package/docs/interfaces/_internal_.ItinerarySchedule.html +0 -89
- package/docs/interfaces/_internal_.OrderCoreController.html +0 -321
- package/docs/interfaces/_internal_.OrderJobController.html +0 -201
- package/docs/interfaces/_internal_.OrderNoteController.html +0 -156
- package/docs/interfaces/_internal_.ProductDetail.html +0 -81
- package/docs/interfaces/_internal_.PurchasingInstruction.html +0 -81
- package/docs/interfaces/_internal_.QueryByCommodityController.html +0 -284
- package/docs/interfaces/_internal_.QueryByStoreController.html +0 -115
- package/docs/interfaces/_internal_.QueryByUserController.html +0 -258
- package/docs/interfaces/_internal_.QueryByWebController.html +0 -115
- package/docs/interfaces/_internal_.QueryDataBlockTypeMap.html +0 -125
- package/docs/interfaces/_internal_.SubContent.html +0 -81
- package/docs/interfaces/_internal_.addShuttleInfo.html +0 -129
- package/docs/interfaces/_internal_.aiBuildNoteInfo.html +0 -73
- package/docs/interfaces/_internal_.batchUpsertItineraryInfo.html +0 -202
- package/docs/interfaces/_internal_.bindTouristToOrder.html +0 -97
- package/docs/interfaces/_internal_.calculateUserConsumeInfo.html +0 -89
- package/docs/interfaces/_internal_.changeNoteStatus.html +0 -97
- package/docs/interfaces/_internal_.changeOrderContactInfo.html +0 -97
- package/docs/interfaces/_internal_.changeOrderSku.html +0 -105
- package/docs/interfaces/_internal_.confirmMealInfo.html +0 -81
- package/docs/interfaces/_internal_.createNote.html +0 -105
- package/docs/interfaces/_internal_.createScheduleNotice.html +0 -89
- package/docs/interfaces/_internal_.getItineraryCount.html +0 -73
- package/docs/interfaces/_internal_.getOrderById.html +0 -86
- package/docs/interfaces/_internal_.getOrderCount.html +0 -193
- package/docs/interfaces/_internal_.getPartyOrderCount.html +0 -97
- package/docs/interfaces/_internal_.getStoreOrderCount.html +0 -121
- package/docs/interfaces/_internal_.getTourismInfoByOrderId-1.html +0 -229
- package/docs/interfaces/_internal_.getTourismInfoByOrderId.html +0 -73
- package/docs/interfaces/_internal_.getUserOrderCount.html +0 -97
- package/docs/interfaces/_internal_.importPreCheck.html +0 -112
- package/docs/interfaces/_internal_.isOrderCanAddTourists.html +0 -73
- package/docs/interfaces/_internal_.markItineraryRead.html +0 -81
- package/docs/interfaces/_internal_.markOrderPurchaseInsurance.html +0 -73
- package/docs/interfaces/_internal_.markServiceNoticeAuth.html +0 -73
- package/docs/interfaces/_internal_.markServiceNoticeRead.html +0 -81
- package/docs/interfaces/_internal_.mgetUserOrderCountList-1.html +0 -54
- package/docs/interfaces/_internal_.mgetUserOrderCountList.html +0 -81
- package/docs/interfaces/_internal_.modifyOrderMealInfo.html +0 -81
- package/docs/interfaces/_internal_.multiSendSmsToTourist.html +0 -81
- package/docs/interfaces/_internal_.multiSendVoiceToTourist.html +0 -81
- package/docs/interfaces/_internal_.orderCreate-1.html +0 -122
- package/docs/interfaces/_internal_.orderCreate.html +0 -208
- package/docs/interfaces/_internal_.orderFulfillController.html +0 -452
- package/docs/interfaces/_internal_.orderPaid.html +0 -97
- package/docs/interfaces/_internal_.orderSettled.html +0 -89
- package/docs/interfaces/_internal_.platformReject.html +0 -97
- package/docs/interfaces/_internal_.preCheckTourists.html +0 -89
- package/docs/interfaces/_internal_.queryItineraryInfoByOrderIdList-1.html +0 -54
- package/docs/interfaces/_internal_.queryItineraryInfoByOrderIdList.html +0 -65
- package/docs/interfaces/_internal_.queryItineraryList-1.html +0 -81
- package/docs/interfaces/_internal_.queryItineraryList.html +0 -89
- package/docs/interfaces/_internal_.queryNoteByOrderIdList.html +0 -73
- package/docs/interfaces/_internal_.queryOrder.html +0 -102
- package/docs/interfaces/_internal_.queryOrderByIdList.html +0 -86
- package/docs/interfaces/_internal_.queryOrderBySkuIdList.html +0 -94
- package/docs/interfaces/_internal_.queryOrderChangeSkuRecords.html +0 -73
- package/docs/interfaces/_internal_.queryOrderList.html +0 -210
- package/docs/interfaces/_internal_.queryOrderMergeRecordByOrderId-1.html +0 -123
- package/docs/interfaces/_internal_.queryOrderMergeRecordByOrderId.html +0 -73
- package/docs/interfaces/_internal_.queryPartyOrderInfo-1.html +0 -81
- package/docs/interfaces/_internal_.queryPartyOrderInfo.html +0 -113
- package/docs/interfaces/_internal_.queryPeriodTradeOrderList-1.html +0 -89
- package/docs/interfaces/_internal_.queryPeriodTradeOrderList.html +0 -51
- package/docs/interfaces/_internal_.queryPeriodTradeOrderOperatorList-1.html +0 -137
- package/docs/interfaces/_internal_.queryPeriodTradeOrderOperatorList.html +0 -89
- package/docs/interfaces/_internal_.queryRollingSalesStatistics-1.html +0 -113
- package/docs/interfaces/_internal_.queryRollingSalesStatistics.html +0 -129
- package/docs/interfaces/_internal_.querySaleItem-1.html +0 -81
- package/docs/interfaces/_internal_.querySaleItem.html +0 -105
- package/docs/interfaces/_internal_.queryShuttleInfoByOrderId-1.html +0 -169
- package/docs/interfaces/_internal_.queryShuttleInfoByOrderId.html +0 -73
- package/docs/interfaces/_internal_.queryStoreOrderList.html +0 -165
- package/docs/interfaces/_internal_.querySubOrderListByRootOrderId.html +0 -94
- package/docs/interfaces/_internal_.queryTopSaleItem-1.html +0 -81
- package/docs/interfaces/_internal_.queryTopSaleItem.html +0 -97
- package/docs/interfaces/_internal_.queryTourismInfoInOrderIdList.html +0 -73
- package/docs/interfaces/_internal_.queryUnionIdListByTimeRange.html +0 -89
- package/docs/interfaces/_internal_.queryUserOrder.html +0 -153
- package/docs/interfaces/_internal_.sendOrderPaidNotification.html +0 -73
- package/docs/interfaces/_internal_.submittedToSupplier.html +0 -89
- package/docs/interfaces/_internal_.supplierConfirmed.html +0 -89
- package/docs/interfaces/_internal_.supplierRejected.html +0 -97
- package/docs/interfaces/_internal_.thirdOrderInfoConfirmed.html +0 -105
- package/docs/interfaces/_internal_.updateShuttleInfo.html +0 -129
- package/docs/interfaces/_internal_.updateTradeOrderRoomCount.html +0 -94
- package/docs/interfaces/_internal_.updateTradeOrderTouristsInfo.html +0 -139
- package/docs/modules/_internal_.Constants.html +0 -71
- package/docs/modules/_internal_.html +0 -180
- package/docs/modules.html +0 -62
- package/docs/types/_internal_.QueryDataRes.html +0 -56
- package/docs/types/_internal_.Record.html +0 -58
- package/docs/types/_internal_.importPreCheck-1.html +0 -66
- package/docs/types/_internal_.queryNoteByOrderIdList-1.html +0 -106
- package/docs/types/_internal_.queryTourismInfoInOrderIdList-1.html +0 -48
- package/docs/variables/PosConstants.html +0 -50
- package/docs/variables/orderCoreService.html +0 -47
- package/docs/variables/orderFulfillService.html +0 -47
- package/docs/variables/orderJobService.html +0 -47
- package/docs/variables/orderNoteService.html +0 -47
- package/docs/variables/queryByCommodityService.html +0 -47
- package/docs/variables/queryByStoreService.html +0 -47
- package/docs/variables/queryByUserService.html +0 -47
- package/docs/variables/queryByWebService.html +0 -47
- package/jest.config.js +0 -194
- package/src/errors/BizError.ts +0 -10
- package/src/errors/SystemError.ts +0 -10
- package/src/index.ts +0 -31
- package/src/pos/http.ts +0 -42
- package/src/pos/modules/dataMigrate/service.ts +0 -18
- package/src/pos/modules/dataMigrate/types.ts +0 -11
- package/src/pos/modules/orderCore/service.ts +0 -42
- package/src/pos/modules/orderCore/types.ts +0 -252
- package/src/pos/modules/orderFulfill/service.ts +0 -112
- package/src/pos/modules/orderFulfill/types.ts +0 -495
- package/src/pos/modules/orderJob/service.ts +0 -61
- package/src/pos/modules/orderJob/types.ts +0 -34
- package/src/pos/modules/orderNote/service.ts +0 -29
- package/src/pos/modules/orderNote/types.ts +0 -76
- package/src/pos/modules/orderQuery/commodity.ts +0 -56
- package/src/pos/modules/orderQuery/store.ts +0 -24
- package/src/pos/modules/orderQuery/types.ts +0 -841
- package/src/pos/modules/orderQuery/user.ts +0 -69
- package/src/pos/modules/orderQuery/web.ts +0 -26
- package/src/pos/modules/service.ts +0 -31
- package/src/types.ts +0 -871
- package/src/utils/env.ts +0 -14
- package/src/utils/string.ts +0 -6
- package/tsconfig.json +0 -114
- package/typedoc.json +0 -15
- /package/{dist/errors → errors}/BizError.d.ts +0 -0
- /package/{dist/errors → errors}/BizError.js +0 -0
- /package/{dist/errors → errors}/SystemError.d.ts +0 -0
- /package/{dist/errors → errors}/SystemError.js +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/index.js → index.js} +0 -0
- /package/{dist/pos → pos}/http.d.ts +0 -0
- /package/{dist/pos → pos}/modules/dataMigrate/service.d.ts +0 -0
- /package/{dist/pos → pos}/modules/dataMigrate/service.js +0 -0
- /package/{dist/pos → pos}/modules/dataMigrate/types.d.ts +0 -0
- /package/{dist/pos → pos}/modules/dataMigrate/types.js +0 -0
- /package/{dist/pos → pos}/modules/orderCore/service.d.ts +0 -0
- /package/{dist/pos → pos}/modules/orderCore/service.js +0 -0
- /package/{dist/pos → pos}/modules/orderCore/types.d.ts +0 -0
- /package/{dist/pos → pos}/modules/orderCore/types.js +0 -0
- /package/{dist/pos → pos}/modules/orderFulfill/service.d.ts +0 -0
- /package/{dist/pos → pos}/modules/orderFulfill/service.js +0 -0
- /package/{dist/pos → pos}/modules/orderFulfill/types.d.ts +0 -0
- /package/{dist/pos → pos}/modules/orderFulfill/types.js +0 -0
- /package/{dist/pos → pos}/modules/orderJob/service.d.ts +0 -0
- /package/{dist/pos → pos}/modules/orderJob/service.js +0 -0
- /package/{dist/pos → pos}/modules/orderJob/types.d.ts +0 -0
- /package/{dist/pos → pos}/modules/orderJob/types.js +0 -0
- /package/{dist/pos → pos}/modules/orderNote/service.d.ts +0 -0
- /package/{dist/pos → pos}/modules/orderNote/service.js +0 -0
- /package/{dist/pos → pos}/modules/orderNote/types.d.ts +0 -0
- /package/{dist/pos → pos}/modules/orderNote/types.js +0 -0
- /package/{dist/pos → pos}/modules/orderQuery/commodity.d.ts +0 -0
- /package/{dist/pos → pos}/modules/orderQuery/commodity.js +0 -0
- /package/{dist/pos → pos}/modules/orderQuery/store.d.ts +0 -0
- /package/{dist/pos → pos}/modules/orderQuery/store.js +0 -0
- /package/{dist/pos → pos}/modules/orderQuery/types.d.ts +0 -0
- /package/{dist/pos → pos}/modules/orderQuery/types.js +0 -0
- /package/{dist/pos → pos}/modules/orderQuery/user.d.ts +0 -0
- /package/{dist/pos → pos}/modules/orderQuery/user.js +0 -0
- /package/{dist/pos → pos}/modules/orderQuery/web.d.ts +0 -0
- /package/{dist/pos → pos}/modules/orderQuery/web.js +0 -0
- /package/{dist/pos → pos}/modules/service.d.ts +0 -0
- /package/{dist/pos → pos}/modules/service.js +0 -0
- /package/{dist/types.d.ts → types.d.ts} +0 -0
- /package/{dist/types.js → types.js} +0 -0
- /package/{dist/utils → utils}/env.d.ts +0 -0
- /package/{dist/utils → utils}/env.js +0 -0
- /package/{dist/utils → utils}/string.d.ts +0 -0
- /package/{dist/utils → utils}/string.js +0 -0
package/jest.config.js
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* For a detailed explanation regarding each configuration property, visit:
|
|
3
|
-
* https://jestjs.io/docs/configuration
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
module.exports = {
|
|
7
|
-
// All imported modules in your tests should be mocked automatically
|
|
8
|
-
// automock: false,
|
|
9
|
-
|
|
10
|
-
// Stop running tests after `n` failures
|
|
11
|
-
// bail: 0,
|
|
12
|
-
|
|
13
|
-
// The directory where Jest should store its cached dependency information
|
|
14
|
-
// cacheDirectory: "/private/var/folders/dt/kcn7j7yj36n1881sqpgzqv3c0000gn/T/jest_dx",
|
|
15
|
-
|
|
16
|
-
// Automatically clear mock calls and instances between every test
|
|
17
|
-
clearMocks: true,
|
|
18
|
-
|
|
19
|
-
// Indicates whether the coverage information should be collected while executing the test
|
|
20
|
-
// collectCoverage: false,
|
|
21
|
-
|
|
22
|
-
// An array of glob patterns indicating a set of files for which coverage information should be collected
|
|
23
|
-
// collectCoverageFrom: undefined,
|
|
24
|
-
|
|
25
|
-
// The directory where Jest should output its coverage files
|
|
26
|
-
// coverageDirectory: undefined,
|
|
27
|
-
|
|
28
|
-
// An array of regexp pattern strings used to skip coverage collection
|
|
29
|
-
// coveragePathIgnorePatterns: [
|
|
30
|
-
// "/node_modules/"
|
|
31
|
-
// ],
|
|
32
|
-
|
|
33
|
-
// Indicates which provider should be used to instrument code for coverage
|
|
34
|
-
coverageProvider: 'v8',
|
|
35
|
-
|
|
36
|
-
// A list of reporter names that Jest uses when writing coverage reports
|
|
37
|
-
// coverageReporters: [
|
|
38
|
-
// "json",
|
|
39
|
-
// "text",
|
|
40
|
-
// "lcov",
|
|
41
|
-
// "clover"
|
|
42
|
-
// ],
|
|
43
|
-
|
|
44
|
-
// An object that configures minimum threshold enforcement for coverage results
|
|
45
|
-
// coverageThreshold: undefined,
|
|
46
|
-
|
|
47
|
-
// A path to a custom dependency extractor
|
|
48
|
-
// dependencyExtractor: undefined,
|
|
49
|
-
|
|
50
|
-
// Make calling deprecated APIs throw helpful error messages
|
|
51
|
-
// errorOnDeprecated: false,
|
|
52
|
-
|
|
53
|
-
// Force coverage collection from ignored files using an array of glob patterns
|
|
54
|
-
// forceCoverageMatch: [],
|
|
55
|
-
|
|
56
|
-
// A path to a module which exports an async function that is triggered once before all test suites
|
|
57
|
-
// globalSetup: undefined,
|
|
58
|
-
|
|
59
|
-
// A path to a module which exports an async function that is triggered once after all test suites
|
|
60
|
-
// globalTeardown: undefined,
|
|
61
|
-
|
|
62
|
-
// A set of global variables that need to be available in all test environments
|
|
63
|
-
// globals: {},
|
|
64
|
-
|
|
65
|
-
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
|
|
66
|
-
// maxWorkers: "50%",
|
|
67
|
-
|
|
68
|
-
// An array of directory names to be searched recursively up from the requiring module's location
|
|
69
|
-
// moduleDirectories: [
|
|
70
|
-
// "node_modules"
|
|
71
|
-
// ],
|
|
72
|
-
|
|
73
|
-
// An array of file extensions your modules use
|
|
74
|
-
moduleFileExtensions: [
|
|
75
|
-
"js",
|
|
76
|
-
"jsx",
|
|
77
|
-
"ts",
|
|
78
|
-
"tsx",
|
|
79
|
-
"json",
|
|
80
|
-
"node"
|
|
81
|
-
],
|
|
82
|
-
|
|
83
|
-
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
|
|
84
|
-
// moduleNameMapper: {},
|
|
85
|
-
|
|
86
|
-
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
|
|
87
|
-
// modulePathIgnorePatterns: [],
|
|
88
|
-
|
|
89
|
-
// Activates notifications for test results
|
|
90
|
-
// notify: false,
|
|
91
|
-
|
|
92
|
-
// An enum that specifies notification mode. Requires { notify: true }
|
|
93
|
-
// notifyMode: "failure-change",
|
|
94
|
-
|
|
95
|
-
// A preset that is used as a base for Jest's configuration
|
|
96
|
-
preset: 'ts-jest',
|
|
97
|
-
|
|
98
|
-
// Run tests from one or more projects
|
|
99
|
-
// projects: undefined,
|
|
100
|
-
|
|
101
|
-
// Use this configuration option to add custom reporters to Jest
|
|
102
|
-
// reporters: undefined,
|
|
103
|
-
|
|
104
|
-
// Automatically reset mock state between every test
|
|
105
|
-
// resetMocks: false,
|
|
106
|
-
|
|
107
|
-
// Reset the module registry before running each individual test
|
|
108
|
-
// resetModules: false,
|
|
109
|
-
|
|
110
|
-
// A path to a custom resolver
|
|
111
|
-
// resolver: undefined,
|
|
112
|
-
|
|
113
|
-
// Automatically restore mock state between every test
|
|
114
|
-
// restoreMocks: false,
|
|
115
|
-
|
|
116
|
-
// The root directory that Jest should scan for tests and modules within
|
|
117
|
-
// rootDir: undefined,
|
|
118
|
-
|
|
119
|
-
// A list of paths to directories that Jest should use to search for files in
|
|
120
|
-
// roots: [
|
|
121
|
-
// "<rootDir>"
|
|
122
|
-
// ],
|
|
123
|
-
|
|
124
|
-
// Allows you to use a custom runner instead of Jest's default test runner
|
|
125
|
-
// runner: "jest-runner",
|
|
126
|
-
|
|
127
|
-
// The paths to modules that run some code to configure or set up the testing environment before each test
|
|
128
|
-
// setupFiles: [],
|
|
129
|
-
|
|
130
|
-
// A list of paths to modules that run some code to configure or set up the testing framework before each test
|
|
131
|
-
// setupFilesAfterEnv: [],
|
|
132
|
-
|
|
133
|
-
// The number of seconds after which a test is considered as slow and reported as such in the results.
|
|
134
|
-
// slowTestThreshold: 5,
|
|
135
|
-
|
|
136
|
-
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
|
|
137
|
-
// snapshotSerializers: [],
|
|
138
|
-
|
|
139
|
-
// The test environment that will be used for testing
|
|
140
|
-
// testEnvironment: "jest-environment-node",
|
|
141
|
-
|
|
142
|
-
// Options that will be passed to the testEnvironment
|
|
143
|
-
// testEnvironmentOptions: {},
|
|
144
|
-
|
|
145
|
-
// Adds a location field to test results
|
|
146
|
-
// testLocationInResults: false,
|
|
147
|
-
|
|
148
|
-
// The glob patterns Jest uses to detect test files
|
|
149
|
-
// testMatch: [
|
|
150
|
-
// "**/__tests__/**/*.[jt]s?(x)",
|
|
151
|
-
// "**/?(*.)+(spec|test).[tj]s?(x)"
|
|
152
|
-
// ],
|
|
153
|
-
|
|
154
|
-
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
|
155
|
-
// testPathIgnorePatterns: [
|
|
156
|
-
// "/node_modules/"
|
|
157
|
-
// ],
|
|
158
|
-
|
|
159
|
-
// The regexp pattern or array of patterns that Jest uses to detect test files
|
|
160
|
-
// testRegex: [],
|
|
161
|
-
|
|
162
|
-
// This option allows the use of a custom results processor
|
|
163
|
-
// testResultsProcessor: undefined,
|
|
164
|
-
|
|
165
|
-
// This option allows use of a custom test runner
|
|
166
|
-
// testRunner: "jest-circus/runner",
|
|
167
|
-
|
|
168
|
-
// This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
|
|
169
|
-
// testURL: "http://localhost",
|
|
170
|
-
|
|
171
|
-
// Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
|
|
172
|
-
// timers: "real",
|
|
173
|
-
|
|
174
|
-
// A map from regular expressions to paths to transformers
|
|
175
|
-
transform: { "^.+\\.ts?$": "ts-jest" },
|
|
176
|
-
|
|
177
|
-
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
|
|
178
|
-
// transformIgnorePatterns: [
|
|
179
|
-
// "/node_modules/",
|
|
180
|
-
// "\\.pnp\\.[^\\/]+$"
|
|
181
|
-
// ],
|
|
182
|
-
|
|
183
|
-
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
|
|
184
|
-
// unmockedModulePathPatterns: undefined,
|
|
185
|
-
|
|
186
|
-
// Indicates whether each individual test should be reported during the run
|
|
187
|
-
// verbose: undefined,
|
|
188
|
-
|
|
189
|
-
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
|
|
190
|
-
// watchPathIgnorePatterns: [],
|
|
191
|
-
|
|
192
|
-
// Whether to use watchman for file crawling
|
|
193
|
-
// watchman: true,
|
|
194
|
-
}
|
package/src/errors/BizError.ts
DELETED
package/src/index.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as PosConstants from 'vitality-meta/enums/pos'
|
|
2
|
-
import * as PosDto from './types'
|
|
3
|
-
import BizError from './errors/BizError'
|
|
4
|
-
|
|
5
|
-
import orderCoreService from './pos/modules/orderCore/service'
|
|
6
|
-
import orderFulfillService from './pos/modules/orderFulfill/service'
|
|
7
|
-
import queryByCommodityService from './pos/modules/orderQuery/commodity'
|
|
8
|
-
import queryByStoreService from './pos/modules/orderQuery/store'
|
|
9
|
-
import queryByUserService from './pos/modules/orderQuery/user'
|
|
10
|
-
import queryByWebService from './pos/modules/orderQuery/web'
|
|
11
|
-
import orderNoteService from './pos/modules/orderNote/service'
|
|
12
|
-
import orderJobService from './pos/modules/orderJob/service'
|
|
13
|
-
import dataMigrateService from './pos/modules/dataMigrate/service'
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
/** 业务模块 */
|
|
17
|
-
orderCoreService,
|
|
18
|
-
orderFulfillService,
|
|
19
|
-
queryByCommodityService,
|
|
20
|
-
queryByStoreService,
|
|
21
|
-
queryByUserService,
|
|
22
|
-
queryByWebService,
|
|
23
|
-
orderNoteService,
|
|
24
|
-
orderJobService,
|
|
25
|
-
dataMigrateService,
|
|
26
|
-
/** 枚举类 */
|
|
27
|
-
PosConstants,
|
|
28
|
-
PosDto,
|
|
29
|
-
/** 错误类 */
|
|
30
|
-
BizError
|
|
31
|
-
}
|
package/src/pos/http.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import axios, {AxiosError} from 'axios'
|
|
2
|
-
import { v4 as uuidV4 } from 'uuid'
|
|
3
|
-
import BizError from '../errors/BizError'
|
|
4
|
-
import SystemError from '../errors/SystemError'
|
|
5
|
-
|
|
6
|
-
type ResponseData = {
|
|
7
|
-
data: any
|
|
8
|
-
message: string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export async function callApi<T extends (args: any) => Promise<any>>(url: string, ...request: Parameters<T>)
|
|
12
|
-
: Promise<Awaited<ReturnType<T>>>
|
|
13
|
-
{
|
|
14
|
-
const requestId = uuidV4()
|
|
15
|
-
try {
|
|
16
|
-
console.info(`准备发起POS请求[${requestId}]: ${url}, 参数: ${JSON.stringify(request)}`)
|
|
17
|
-
const response = await axios.post(url, request[0], {
|
|
18
|
-
headers: {
|
|
19
|
-
'X-Request-Id': requestId
|
|
20
|
-
}
|
|
21
|
-
})
|
|
22
|
-
const responseData = response.data as ResponseData
|
|
23
|
-
return responseData.data
|
|
24
|
-
} catch (error: any) {
|
|
25
|
-
const axiosError = error as AxiosError
|
|
26
|
-
const ErrorClass = axiosError.response
|
|
27
|
-
? axiosError.response.status === 400
|
|
28
|
-
? BizError
|
|
29
|
-
: SystemError
|
|
30
|
-
: SystemError
|
|
31
|
-
if (axiosError.response) {
|
|
32
|
-
const response = axiosError.response
|
|
33
|
-
const data = response.data as ResponseData
|
|
34
|
-
console.error(`POS 异常: ${axiosError.message},requestId: ${requestId}`)
|
|
35
|
-
console.info('响应信息', data.message)
|
|
36
|
-
console.error('异常堆栈', JSON.stringify(error.stack))
|
|
37
|
-
throw new ErrorClass(data.message || 'Pos Error', response.status)
|
|
38
|
-
}
|
|
39
|
-
console.error(`POS 未知异常: ${axiosError.message}`, error.stack)
|
|
40
|
-
throw error
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Service } from './types'
|
|
2
|
-
import { callApi } from '../../http'
|
|
3
|
-
import BaseService from '../service'
|
|
4
|
-
|
|
5
|
-
class DataMigrateService extends BaseService implements Service.DataMigrateController {
|
|
6
|
-
protected prefixUrl: string = '/dataMigrate'
|
|
7
|
-
|
|
8
|
-
pos(): Promise<void> {
|
|
9
|
-
return callApi<Service.DataMigrateController['pos']>(this.getApiUrl(this.pos))
|
|
10
|
-
}
|
|
11
|
-
rev(): Promise<void> {
|
|
12
|
-
return callApi<Service.DataMigrateController['rev']>(this.getApiUrl(this.rev))
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const dataMigrateService = new DataMigrateService()
|
|
17
|
-
|
|
18
|
-
export default dataMigrateService
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Service } from './types'
|
|
2
|
-
import { callApi } from '../../http'
|
|
3
|
-
import BaseService from '../service'
|
|
4
|
-
|
|
5
|
-
class OrderCoreService extends BaseService implements Service.OrderCoreController {
|
|
6
|
-
protected prefixUrl: string = '/core'
|
|
7
|
-
|
|
8
|
-
onRefundTrigger(request: Service.Request.onRefundTrigger): Promise<void> {
|
|
9
|
-
return callApi<Service.OrderCoreController['onRefundTrigger']>(this.getApiUrl(this.onRefundTrigger), request)
|
|
10
|
-
}
|
|
11
|
-
orderCreate(request: Service.Request.orderCreate): Promise<Service.Response.orderCreate> {
|
|
12
|
-
return callApi<Service.OrderCoreController['orderCreate']>(this.getApiUrl(this.orderCreate), request)
|
|
13
|
-
}
|
|
14
|
-
thirdOrderInfoConfirmed(request: Service.Request.thirdOrderInfoConfirmed) {
|
|
15
|
-
return callApi<Service.OrderCoreController['thirdOrderInfoConfirmed']>(this.getApiUrl(this.thirdOrderInfoConfirmed), request)
|
|
16
|
-
}
|
|
17
|
-
platformReject(request: Service.Request.platformReject) {
|
|
18
|
-
return callApi<Service.OrderCoreController['platformReject']>(this.getApiUrl(this.platformReject), request)
|
|
19
|
-
}
|
|
20
|
-
supplierRejected(request: Service.Request.supplierRejected) {
|
|
21
|
-
return callApi<Service.OrderCoreController['supplierRejected']>(this.getApiUrl(this.supplierRejected), request)
|
|
22
|
-
}
|
|
23
|
-
supplierConfirmed(request: Service.Request.supplierConfirmed) {
|
|
24
|
-
return callApi<Service.OrderCoreController['supplierConfirmed']>(this.getApiUrl(this.supplierConfirmed), request)
|
|
25
|
-
}
|
|
26
|
-
submittedToSupplier(request: Service.Request.submittedToSupplier) {
|
|
27
|
-
return callApi<Service.OrderCoreController['submittedToSupplier']>(this.getApiUrl(this.submittedToSupplier), request)
|
|
28
|
-
}
|
|
29
|
-
sendOrderPaidNotification(request: Service.Request.sendOrderPaidNotification) {
|
|
30
|
-
return callApi<Service.OrderCoreController['sendOrderPaidNotification']>(this.getApiUrl(this.sendOrderPaidNotification), request)
|
|
31
|
-
}
|
|
32
|
-
orderSettled(request: Service.Request.orderSettled): Promise<void> {
|
|
33
|
-
return callApi<Service.OrderCoreController['orderSettled']>(this.getApiUrl(this.orderSettled), request)
|
|
34
|
-
}
|
|
35
|
-
changeOrderContactInfo(request: Service.Request.changeOrderContactInfo): Promise<void> {
|
|
36
|
-
return callApi<Service.OrderCoreController['changeOrderContactInfo']>(this.getApiUrl(this.changeOrderContactInfo), request)
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const orderCoreService = new OrderCoreService()
|
|
41
|
-
|
|
42
|
-
export default orderCoreService
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
import * as PosConstants from 'vitality-meta/enums/pos'
|
|
2
|
-
import * as DTO from '../../../types'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export namespace Service {
|
|
6
|
-
export namespace Request {
|
|
7
|
-
export interface orderCreate {
|
|
8
|
-
/** 基础信息 */
|
|
9
|
-
basicInfo: {
|
|
10
|
-
/** 用户id */
|
|
11
|
-
unionId: string
|
|
12
|
-
/** openId */
|
|
13
|
-
openId: string
|
|
14
|
-
/** 实际支付 */
|
|
15
|
-
actuallyPaidFee: number
|
|
16
|
-
/** 交易场景 */
|
|
17
|
-
sceneInfo: {
|
|
18
|
-
/** 场景1 */
|
|
19
|
-
scene1: string
|
|
20
|
-
/** 场景2 */
|
|
21
|
-
scene2: string
|
|
22
|
-
/** app场景 */
|
|
23
|
-
appScene: number
|
|
24
|
-
}
|
|
25
|
-
/** 用户订单备注 */
|
|
26
|
-
orderNote?: string
|
|
27
|
-
/** 来源人Id */
|
|
28
|
-
fromUnionId: string
|
|
29
|
-
/** 来源人身份 */
|
|
30
|
-
fromUserRole: string
|
|
31
|
-
/** 主单Id */
|
|
32
|
-
rootOrderId?: string
|
|
33
|
-
/** 联系人信息 */
|
|
34
|
-
contactInfo: {
|
|
35
|
-
/** 联系人姓名 */
|
|
36
|
-
name: string
|
|
37
|
-
/** 联系人手机号 */
|
|
38
|
-
mobile: string
|
|
39
|
-
/** 身份证 */
|
|
40
|
-
idCard?: string
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
/** 出行人信息 */
|
|
44
|
-
tourismInfo?: {
|
|
45
|
-
/** 出行人id列表 */
|
|
46
|
-
touristIdList?: string[]
|
|
47
|
-
}
|
|
48
|
-
/** 商品信息 */
|
|
49
|
-
commodityInfo: {
|
|
50
|
-
/** 商品id */
|
|
51
|
-
itemId: string
|
|
52
|
-
/** sku列表 */
|
|
53
|
-
skuList: {
|
|
54
|
-
skuId: string
|
|
55
|
-
quantity: number
|
|
56
|
-
}[]
|
|
57
|
-
}
|
|
58
|
-
/** 优惠信息 */
|
|
59
|
-
promotionInfo: {
|
|
60
|
-
/** 是否使用单品优惠券 */
|
|
61
|
-
useItemCoupon: boolean
|
|
62
|
-
/** 是否使用订单优惠券 */
|
|
63
|
-
useOrderCoupon: boolean
|
|
64
|
-
/** 是否使用会员价 */
|
|
65
|
-
useMemberPrice: boolean
|
|
66
|
-
/** 是否使用积分 */
|
|
67
|
-
useCreditCoin: boolean
|
|
68
|
-
}
|
|
69
|
-
/** 履约信息 */
|
|
70
|
-
fulfillInfo?: {
|
|
71
|
-
/** 房间信息 */
|
|
72
|
-
roomInfo?: {
|
|
73
|
-
/** 单床房 */
|
|
74
|
-
SINGLE_BED: {
|
|
75
|
-
/** 数量 */
|
|
76
|
-
count: number
|
|
77
|
-
},
|
|
78
|
-
/** 双床房 */
|
|
79
|
-
DOUBLE_BED: {
|
|
80
|
-
/** 数量 */
|
|
81
|
-
count: number
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
/** 自定义餐食 */
|
|
85
|
-
customMealInfo: string
|
|
86
|
-
/** 权益id */
|
|
87
|
-
rightsIds?: string[]
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export interface thirdOrderInfoConfirmed {
|
|
92
|
-
/** 订单id */
|
|
93
|
-
tradeOrderId: string
|
|
94
|
-
/** 三方订单id */
|
|
95
|
-
thirdOrderId: string
|
|
96
|
-
/** 三方skuId */
|
|
97
|
-
thirdOrderSkuId: string
|
|
98
|
-
/** 操作人 */
|
|
99
|
-
operator: string
|
|
100
|
-
/** 操作人角色 */
|
|
101
|
-
operatorRole: PosConstants.TradeOperatorRoleEnum
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export interface platformReject {
|
|
105
|
-
/** 订单id */
|
|
106
|
-
tradeOrderId: string
|
|
107
|
-
/** 操作人 */
|
|
108
|
-
operator: string
|
|
109
|
-
/** 操作人角色 */
|
|
110
|
-
operatorRole: PosConstants.TradeOperatorRoleEnum
|
|
111
|
-
/** 拒单原因 */
|
|
112
|
-
reason: string
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export interface supplierRejected {
|
|
116
|
-
/** 订单id */
|
|
117
|
-
tradeOrderId: string
|
|
118
|
-
/** 操作人 */
|
|
119
|
-
operator: string
|
|
120
|
-
/** 操作人角色 */
|
|
121
|
-
operatorRole: PosConstants.TradeOperatorRoleEnum
|
|
122
|
-
/** 拒单原因 */
|
|
123
|
-
reason: string
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export interface supplierConfirmed {
|
|
127
|
-
/** 订单id */
|
|
128
|
-
tradeOrderId: string
|
|
129
|
-
/** 操作人 */
|
|
130
|
-
operator: string
|
|
131
|
-
/** 操作人角色 */
|
|
132
|
-
operatorRole: PosConstants.TradeOperatorRoleEnum
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export interface sendOrderPaidNotification {
|
|
136
|
-
/** 订单Id */
|
|
137
|
-
tradeOrderId: string
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export interface submittedToSupplier {
|
|
141
|
-
/** 订单Id */
|
|
142
|
-
tradeOrderId: string
|
|
143
|
-
/** 操作人 */
|
|
144
|
-
operator: string
|
|
145
|
-
/** 操作人角色 */
|
|
146
|
-
operatorRole: PosConstants.TradeOperatorRoleEnum
|
|
147
|
-
}
|
|
148
|
-
export interface orderSettled {
|
|
149
|
-
/** 订单Id */
|
|
150
|
-
tradeOrderId: string
|
|
151
|
-
/** 操作人 */
|
|
152
|
-
operator: 'SYSTEM'
|
|
153
|
-
/** 操作人角色 */
|
|
154
|
-
operatorRole: PosConstants.TradeOperatorRoleEnum
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
export interface changeOrderContactInfo {
|
|
158
|
-
/** 联系人姓名 */
|
|
159
|
-
name: string
|
|
160
|
-
/** 联系人身份证号 */
|
|
161
|
-
idCard: string
|
|
162
|
-
/** 联系人手机号 */
|
|
163
|
-
mobile: string
|
|
164
|
-
/** 订单号 */
|
|
165
|
-
tradeOrderId: string
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
export interface onRefundTrigger {
|
|
169
|
-
refundOrderId: string
|
|
170
|
-
positiveOrderId: string
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export namespace Response {
|
|
175
|
-
export interface orderCreate {
|
|
176
|
-
/** 订单Id */
|
|
177
|
-
tradeOrderId: string,
|
|
178
|
-
/** 是否是微信渠道交易 */
|
|
179
|
-
isWxChannelTrade: boolean,
|
|
180
|
-
/** 微信支付参数 */
|
|
181
|
-
wxPaymentParam: {
|
|
182
|
-
/** appId */
|
|
183
|
-
appId: string,
|
|
184
|
-
/** 支付时间戳 */
|
|
185
|
-
timeStamp: string,
|
|
186
|
-
/** 随机字符串 */
|
|
187
|
-
nonceStr: string,
|
|
188
|
-
/** 订单详情扩展字符串 */
|
|
189
|
-
package: string,
|
|
190
|
-
/** 签名类型 */
|
|
191
|
-
signType: string,
|
|
192
|
-
/** 支付签名 */
|
|
193
|
-
paySign: string
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
export interface OrderCoreController {
|
|
199
|
-
/**
|
|
200
|
-
* 订单创建
|
|
201
|
-
* @path /core/order-create
|
|
202
|
-
*/
|
|
203
|
-
orderCreate(request: Request.orderCreate): Promise<Response.orderCreate>
|
|
204
|
-
/**
|
|
205
|
-
* 旅游非自主团接单
|
|
206
|
-
* @path /core/third-order-info-confirmed
|
|
207
|
-
*/
|
|
208
|
-
thirdOrderInfoConfirmed(request: Request.thirdOrderInfoConfirmed): Promise<void>
|
|
209
|
-
/**
|
|
210
|
-
* 旅游非自主团拒单
|
|
211
|
-
* @path /core/platform-reject
|
|
212
|
-
*/
|
|
213
|
-
platformReject(request: Request.platformReject): Promise<void>
|
|
214
|
-
/**
|
|
215
|
-
* 酒店拒单
|
|
216
|
-
* @path /core/supplier-rejected
|
|
217
|
-
*/
|
|
218
|
-
supplierRejected(request: Request.supplierRejected): Promise<void>
|
|
219
|
-
/**
|
|
220
|
-
* 供应商已接单
|
|
221
|
-
* @path /core/supplier-confirmed
|
|
222
|
-
*/
|
|
223
|
-
supplierConfirmed(request: Request.supplierConfirmed): Promise<void>
|
|
224
|
-
/**
|
|
225
|
-
* 提交给供应商
|
|
226
|
-
* @path /core/submitted-to-supplier
|
|
227
|
-
*/
|
|
228
|
-
submittedToSupplier(request: Request.submittedToSupplier): Promise<void>
|
|
229
|
-
/**
|
|
230
|
-
* 发送订单支付通知
|
|
231
|
-
* @path /core/send-order-paid-notification
|
|
232
|
-
*/
|
|
233
|
-
sendOrderPaidNotification(request: Request.sendOrderPaidNotification): Promise<void>
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* 订单完结
|
|
237
|
-
* @path /core/order-settled
|
|
238
|
-
*/
|
|
239
|
-
orderSettled(request: Request.orderSettled): Promise<void>
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* 修改联系人信息
|
|
243
|
-
* @path /core/change-order-contact-info
|
|
244
|
-
*/
|
|
245
|
-
changeOrderContactInfo(request: Request.changeOrderContactInfo): Promise<void>
|
|
246
|
-
/**
|
|
247
|
-
* 逆向触发,更新订单信息
|
|
248
|
-
* @path /core/on-refund-trigger
|
|
249
|
-
*/
|
|
250
|
-
onRefundTrigger(request: Request.onRefundTrigger): Promise<void>
|
|
251
|
-
}
|
|
252
|
-
}
|