storemw-core-api 1.0.147 → 1.0.148
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/dist/app.js +1 -0
- package/dist/app.js.map +1 -1
- package/dist/controllers/index.d.ts +1 -0
- package/dist/controllers/index.js +6 -1
- package/dist/controllers/index.js.map +1 -1
- package/dist/controllers/scheduler/schedulerLogController.d.ts +9 -0
- package/dist/controllers/scheduler/schedulerLogController.js +133 -0
- package/dist/controllers/scheduler/schedulerLogController.js.map +1 -0
- package/dist/middlewares/route/index.d.ts +1 -0
- package/dist/middlewares/route/index.js +7 -2
- package/dist/middlewares/route/index.js.map +1 -1
- package/dist/middlewares/route/validateSchedulerLog.d.ts +5 -0
- package/dist/middlewares/route/validateSchedulerLog.js +20 -0
- package/dist/middlewares/route/validateSchedulerLog.js.map +1 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +4 -1
- package/dist/models/index.js.map +1 -1
- package/dist/models/scheduler/SchedulerLogModel.d.ts +371 -0
- package/dist/models/scheduler/SchedulerLogModel.js +13 -0
- package/dist/models/scheduler/SchedulerLogModel.js.map +1 -0
- package/dist/routes/index.d.ts +1 -0
- package/dist/routes/index.js +3 -1
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/scheduler/schedulerLogRoutes.d.ts +2 -0
- package/dist/routes/scheduler/schedulerLogRoutes.js +13 -0
- package/dist/routes/scheduler/schedulerLogRoutes.js.map +1 -0
- package/dist/routes/scheduler/schedulerLogsRoutes.d.ts +2 -0
- package/dist/routes/scheduler/schedulerLogsRoutes.js +13 -0
- package/dist/routes/scheduler/schedulerLogsRoutes.js.map +1 -0
- package/dist/routes/scheduler/schedulersRoutes.d.ts +2 -0
- package/dist/routes/scheduler/schedulersRoutes.js +12 -0
- package/dist/routes/scheduler/schedulersRoutes.js.map +1 -0
- package/dist/schema/middleware/route/index.d.ts +2 -0
- package/dist/schema/middleware/route/index.js +3 -1
- package/dist/schema/middleware/route/index.js.map +1 -1
- package/dist/schema/middleware/route/schemaSchedulerLog.d.ts +4 -0
- package/dist/schema/middleware/route/schemaSchedulerLog.js +10 -0
- package/dist/schema/middleware/route/schemaSchedulerLog.js.map +1 -0
- package/dist/schema/payload/index.d.ts +2 -0
- package/dist/schema/payload/index.js +4 -1
- package/dist/schema/payload/index.js.map +1 -1
- package/dist/schema/payload/scheduler/schemaSchedulerLog.d.ts +267 -0
- package/dist/schema/payload/scheduler/schemaSchedulerLog.js +48 -0
- package/dist/schema/payload/scheduler/schemaSchedulerLog.js.map +1 -0
- package/dist/services/file/FileService.js.map +1 -1
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.js +4 -1
- package/dist/services/index.js.map +1 -1
- package/dist/services/scheduler/SchedulerLogService.d.ts +101 -0
- package/dist/services/scheduler/SchedulerLogService.js +146 -0
- package/dist/services/scheduler/SchedulerLogService.js.map +1 -0
- package/package.json +1 -1
- package/prisma/schema.prisma +30 -0
package/dist/services/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AccessKeyUtilService = exports.SmtpEmailService = exports.oneTimeCodeStatus = exports.oneTimeCodePurposeTypes = exports.oneTimeCodeTypes = exports.OneTimeCodeService = exports.NumberDateSequenceService = exports.injectionFieldDataTypes = exports.injectionFieldTypes = exports.InjectionFieldService = exports.LocationService = exports.FileService = exports.itemTypes = exports.ItemService = exports.DocumentService = exports.RegionService = exports.userBranchTypes = exports.UserBranchService = exports.UserMeService = exports.userParentSqlSelect = exports.userTypes = exports.UserService = exports.AccountSubscribeService = exports.subscribePlanBillingCycles = exports.subscribeCurrencies = exports.SubscribePlanService = exports.BusinessService = exports.AccountService = exports.resetPasswordMethods = exports.ResetPasswordService = exports.AccessControlService = exports.accessKeyStatus = exports.accessKeyUserTypes = exports.AccessKeyService = exports.authTypes = exports.AuthService = void 0;
|
|
3
|
+
exports.AccessKeyUtilService = exports.schedulerLogTypes = exports.SchedulerLogService = exports.SmtpEmailService = exports.oneTimeCodeStatus = exports.oneTimeCodePurposeTypes = exports.oneTimeCodeTypes = exports.OneTimeCodeService = exports.NumberDateSequenceService = exports.injectionFieldDataTypes = exports.injectionFieldTypes = exports.InjectionFieldService = exports.LocationService = exports.FileService = exports.itemTypes = exports.ItemService = exports.DocumentService = exports.RegionService = exports.userBranchTypes = exports.UserBranchService = exports.UserMeService = exports.userParentSqlSelect = exports.userTypes = exports.UserService = exports.AccountSubscribeService = exports.subscribePlanBillingCycles = exports.subscribeCurrencies = exports.SubscribePlanService = exports.BusinessService = exports.AccountService = exports.resetPasswordMethods = exports.ResetPasswordService = exports.AccessControlService = exports.accessKeyStatus = exports.accessKeyUserTypes = exports.AccessKeyService = exports.authTypes = exports.AuthService = void 0;
|
|
4
4
|
var AuthService_1 = require("../services/auth/AuthService");
|
|
5
5
|
Object.defineProperty(exports, "AuthService", { enumerable: true, get: function () { return AuthService_1.AuthService; } });
|
|
6
6
|
Object.defineProperty(exports, "authTypes", { enumerable: true, get: function () { return AuthService_1.authTypes; } });
|
|
@@ -60,6 +60,9 @@ Object.defineProperty(exports, "oneTimeCodePurposeTypes", { enumerable: true, ge
|
|
|
60
60
|
Object.defineProperty(exports, "oneTimeCodeStatus", { enumerable: true, get: function () { return OneTimeCodeService_1.oneTimeCodeStatus; } });
|
|
61
61
|
var SmtpEmailService_1 = require("../services/gateway/SmtpEmailService");
|
|
62
62
|
Object.defineProperty(exports, "SmtpEmailService", { enumerable: true, get: function () { return SmtpEmailService_1.SmtpEmailService; } });
|
|
63
|
+
var SchedulerLogService_1 = require("../services/scheduler/SchedulerLogService");
|
|
64
|
+
Object.defineProperty(exports, "SchedulerLogService", { enumerable: true, get: function () { return SchedulerLogService_1.SchedulerLogService; } });
|
|
65
|
+
Object.defineProperty(exports, "schedulerLogTypes", { enumerable: true, get: function () { return SchedulerLogService_1.schedulerLogTypes; } });
|
|
63
66
|
// export { ChangePasswordUtilService } from "../services/utils/unuse/ChangePasswordUtilService"
|
|
64
67
|
// export type { ChangePasswordUtilServiceProps, ChangePasswordUtilChangeProps } from "../services/utils/unuse/ChangePasswordUtilService"
|
|
65
68
|
var AccessKeyUtilService_1 = require("../services/utils/AccessKeyUtilService");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;AAAA,2DAAoE;AAA3D,0GAAA,WAAW,OAAA;AAAE,wGAAA,SAAS,OAAA;AAE/B,2EAA8G;AAArG,oHAAA,gBAAgB,OAAA;AAAE,sHAAA,kBAAkB,OAAA;AAAE,mHAAA,eAAe,OAAA;AAE9D,uFAAqF;AAA5E,4HAAA,oBAAoB,OAAA;AAE7B,uFAA2G;AAAlG,4HAAA,oBAAoB,OAAA;AAAE,4HAAA,oBAAoB,OAAA;AAEnD,oEAAkE;AAAzD,gHAAA,cAAc,OAAA;AAEvB,uEAAqE;AAA5D,kHAAA,eAAe,OAAA;AAGxB,0FAAyI;AAAhI,4HAAA,oBAAoB,OAAA;AAAE,2HAAA,mBAAmB,OAAA;AAAE,kIAAA,0BAA0B,OAAA;AAE9E,mGAAiG;AAAxF,kIAAA,uBAAuB,OAAA;AAGhC,2DAAyF;AAAhF,0GAAA,WAAW,OAAA;AAAE,wGAAA,SAAS,OAAA;AAAE,kHAAA,mBAAmB,OAAA;AAGpD,+DAA6D;AAApD,8GAAA,aAAa,OAAA;AAGtB,sGAAsG;AACtG,qNAAqN;AACrN,uFAAuF;AACvF,kLAAkL;AAElL,yEAAwF;AAA/E,sHAAA,iBAAiB,OAAA;AAAE,oHAAA,eAAe,OAAA;AAE3C,iEAA+D;AAAtD,8GAAA,aAAa,OAAA;AAEtB,uEAAqE;AAA5D,kHAAA,eAAe,OAAA;AAExB,2DAAoE;AAA3D,0GAAA,WAAW,OAAA;AAAE,wGAAA,SAAS,OAAA;AAE/B,2DAAyD;AAAhD,0GAAA,WAAW,OAAA;AAEpB,uEAAqE;AAA5D,kHAAA,eAAe,OAAA;AAExB,0FAAsI;AAA7H,8HAAA,qBAAqB,OAAA;AAAE,4HAAA,mBAAmB,OAAA;AAAE,gIAAA,uBAAuB,OAAA;AAE5E,yFAAuF;AAA9E,sIAAA,yBAAyB,OAAA;AAElC,kFAA8I;AAArI,wHAAA,kBAAkB,OAAA;AAAE,sHAAA,gBAAgB,OAAA;AAAE,6HAAA,uBAAuB,OAAA;AAAE,uHAAA,iBAAiB,OAAA;AAEzF,wEAAsE;AAA7D,oHAAA,gBAAgB,OAAA;AAGzB,+FAA+F;AAC/F,wIAAwI;AACxI,8EAA4E;AAAnE,4HAAA,oBAAoB,OAAA","sourcesContent":["export { AuthService, authTypes } from \"@/services/auth/AuthService\"\nexport type { AuthServiceProps, AuthType, AuthTokenResult, AuthJwtToken, AuthGetTokenProps } from \"@/services/auth/AuthService\"\nexport { AccessKeyService, accessKeyUserTypes, accessKeyStatus } from \"@/services/access_key/AccessKeyService\"\nexport type { AccessKeyServiceProps, AccessKeyStatus, AccessKeyUserType, AccessKeyCreateProps, AccessKeyRevokeProps } from \"@/services/access_key/AccessKeyService\"\nexport { AccessControlService } from \"@/services/access_control/AccessControlService\"\nexport type { AccessControlServiceProps, AccessControlScopeOrExtra, AccessControlListOptionsProps } from \"@/services/access_control/AccessControlService\"\nexport { ResetPasswordService, resetPasswordMethods } from \"@/services/reset_password/ResetPasswordService\"\nexport type { ResetPasswordServiceProps, ResetPasswordMethod, ResetPasswordRequestProps, ResetPasswordValidateCodeProps, ResetPasswordPerformProps } from \"@/services/reset_password/ResetPasswordService\"\nexport { AccountService } from \"@/services/account/AccountService\"\nexport type { AccountServiceProps, Account, AccountGetProps, AccountListProps, AccountCreateProps, AccountUpdateProps, AccountRemoveProps } from \"@/services/account/AccountService\"\nexport { BusinessService } from \"@/services/business/BusinessService\"\nexport type { BusinessServiceProps, Business, BusinessGetProps, BusinessListProps, BusinessCreateProps, BusinessUpdateProps } from \"@/services/business/BusinessService\"\n\nexport { SubscribePlanService, subscribeCurrencies, subscribePlanBillingCycles } from \"@/services/subscription/plan/SubscribePlanService\"\nexport type { SubscribePlanServiceProps, SubscribePlan, SubscribePlanBillingCycle, SubscribePlanCurrency, SubscribePlanGetProps, SubscribePlanListProps, SubscribePlanCreateProps, SubscribePlanUpdateProps } from \"@/services/subscription/plan/SubscribePlanService\"\nexport { AccountSubscribeService } from \"@/services/subscription/account/AccountSubscribeService\"\nexport type { AccountSubscribeServiceProps, AccountSubscribe, AccountSubscribeGetProps, AccountSubscribeListProps, AccountSubscribeCreateProps, AccountSubscribeCancelProps } from \"@/services/subscription/account/AccountSubscribeService\"\n\nexport { UserService, userTypes, userParentSqlSelect } from \"@/services/user/UserService\"\nexport type { UserServiceProps, UserType, UserGetProps, UserListProps, UserCreateProps, UserUpdateProps, UserRemoveProps, UserReplacePasswordProps } from \"@/services/user/UserService\"\n\nexport { UserMeService } from \"@/services/user/UserMeService\"\nexport type { UserMeServiceProps, UserMeUpdateProps, UserMeChangePasswordProps } from \"@/services/user/UserMeService\"\n\n// export { AdministratorService, administratorDataTypes } from \"@/services/user/AdministratorService\"\n// export type { AdministratorServiceProps, AdministratorGetProps, AdministratorListProps, AdministratorCreateProps, AdministratorUpdateProps, AdministratorRemoveProps } from \"@/services/user/AdministratorService\"\n// export { OperatorService, operatorDataTypes } from \"@/services/user/OperatorService\"\n// export type { OperatorServiceProps, OperatorGetProps, OperatorListProps, OperatorCreateProps, OperatorUpdateProps, OperatorRemoveProps } from \"@/services/user/OperatorService\"\n\nexport { UserBranchService, userBranchTypes } from \"@/services/branch/UserBranchService\"\nexport type { UserBranchServiceProps, UserBranchType, UserBranchGetProps, UserBranchListProps, UserBranchCreateProps, UserBranchUpdateProps, UserBranchRemoveProps } from \"@/services/branch/UserBranchService\"\nexport { RegionService } from \"@/services/region/RegionService\"\nexport type { RegionServiceProps, RegionType, RegionGetProps, RegionCreateProps, RegionListProps, RegionUpdateProps, RegionRemoveProps } from \"@/services/region/RegionService\"\nexport { DocumentService } from \"@/services/document/DocumentService\"\nexport type { DocumentServiceProps, DocumentType, DocumentGetProps, DocumentUpdateProps, DocumentCreateProps, DocumentListProps, DocumentRemoveProps } from \"@/services/document/DocumentService\"\nexport { ItemService, itemTypes } from \"@/services/item/ItemService\"\nexport type { ItemServiceProps, ItemType, ItemGetProps, ItemUpdateProps, ItemCreateProps, ItemListProps, ItemRemoveProps } from \"@/services/item/ItemService\"\nexport { FileService } from \"@/services/file/FileService\"\nexport type { FileImageCompressionOptions, FileVideoCompressionOptions, FileStorageProviderType, FileLocalProviderOptions, FileGoogleCloudProviderOptions, FileAwsS3ProviderOptions, FileCategoryName, FileUploadItem, FileServiceProps, FileGetProps, FileUploadProps, FileCreateProps, FileListProps, FileRemoveProps } from \"@/services/file/FileService\"\nexport { LocationService } from \"@/services/location/LocationService\"\nexport type { LocationServiceProps, LocationType, LocationGetProps, LocationUpdateProps, LocationCreateProps, LocationListProps, LocationRemoveProps } from \"@/services/location/LocationService\"\nexport { InjectionFieldService, injectionFieldTypes, injectionFieldDataTypes } from \"@/services/injection_field/InjectionFieldService\"\nexport type { InjectionFieldModuleRef, InjectionFieldServiceProps, InjectionFieldType, InjectionFieldDataType, InjectionFieldCreateProps, InjectionFieldListProps, InjectionFieldGetProps, InjectionFieldReplaceProps } from \"@/services/injection_field/InjectionFieldService\"\nexport { NumberDateSequenceService } from \"@/services/others/NumberDateSequenceService\"\nexport type { NumberDateSequenceModuleRef, NumberDateSequenceServiceProps, NumberDateSequenceInitProps, NumberDateSequenceCreateProps } from \"@/services/others/NumberDateSequenceService\"\nexport { OneTimeCodeService, oneTimeCodeTypes, oneTimeCodePurposeTypes, oneTimeCodeStatus } from \"@/services/one_time_code/OneTimeCodeService\"\nexport type { OneTimeCodeModuleRef, OneTimeCodeType, OneTimeCodePurposeType, OneTimeCodeStatus, OneTimeCodeServiceProps, OneTimeCodeCreateProps } from \"@/services/one_time_code/OneTimeCodeService\"\nexport { SmtpEmailService } from \"@/services/gateway/SmtpEmailService\"\nexport type { SmtpEmailServiceProps, SmtpEmailSendProps, SmtpEmailTransporterOptions } from \"@/services/gateway/SmtpEmailService\"\n\n// export { ChangePasswordUtilService } from \"@/services/utils/unuse/ChangePasswordUtilService\"\n// export type { ChangePasswordUtilServiceProps, ChangePasswordUtilChangeProps } from \"@/services/utils/unuse/ChangePasswordUtilService\"\nexport { AccessKeyUtilService } from \"@/services/utils/AccessKeyUtilService\"\nexport type { AccessKeyUtilServiceProps, AccessKeyUtilValidateProps, AccessKeyUtilAccountOwnerProps } from \"@/services/utils/AccessKeyUtilService\""]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;AAAA,2DAAoE;AAA3D,0GAAA,WAAW,OAAA;AAAE,wGAAA,SAAS,OAAA;AAE/B,2EAA8G;AAArG,oHAAA,gBAAgB,OAAA;AAAE,sHAAA,kBAAkB,OAAA;AAAE,mHAAA,eAAe,OAAA;AAE9D,uFAAqF;AAA5E,4HAAA,oBAAoB,OAAA;AAE7B,uFAA2G;AAAlG,4HAAA,oBAAoB,OAAA;AAAE,4HAAA,oBAAoB,OAAA;AAEnD,oEAAkE;AAAzD,gHAAA,cAAc,OAAA;AAEvB,uEAAqE;AAA5D,kHAAA,eAAe,OAAA;AAGxB,0FAAyI;AAAhI,4HAAA,oBAAoB,OAAA;AAAE,2HAAA,mBAAmB,OAAA;AAAE,kIAAA,0BAA0B,OAAA;AAE9E,mGAAiG;AAAxF,kIAAA,uBAAuB,OAAA;AAGhC,2DAAyF;AAAhF,0GAAA,WAAW,OAAA;AAAE,wGAAA,SAAS,OAAA;AAAE,kHAAA,mBAAmB,OAAA;AAGpD,+DAA6D;AAApD,8GAAA,aAAa,OAAA;AAGtB,sGAAsG;AACtG,qNAAqN;AACrN,uFAAuF;AACvF,kLAAkL;AAElL,yEAAwF;AAA/E,sHAAA,iBAAiB,OAAA;AAAE,oHAAA,eAAe,OAAA;AAE3C,iEAA+D;AAAtD,8GAAA,aAAa,OAAA;AAEtB,uEAAqE;AAA5D,kHAAA,eAAe,OAAA;AAExB,2DAAoE;AAA3D,0GAAA,WAAW,OAAA;AAAE,wGAAA,SAAS,OAAA;AAE/B,2DAAyD;AAAhD,0GAAA,WAAW,OAAA;AAEpB,uEAAqE;AAA5D,kHAAA,eAAe,OAAA;AAExB,0FAAsI;AAA7H,8HAAA,qBAAqB,OAAA;AAAE,4HAAA,mBAAmB,OAAA;AAAE,gIAAA,uBAAuB,OAAA;AAE5E,yFAAuF;AAA9E,sIAAA,yBAAyB,OAAA;AAElC,kFAA8I;AAArI,wHAAA,kBAAkB,OAAA;AAAE,sHAAA,gBAAgB,OAAA;AAAE,6HAAA,uBAAuB,OAAA;AAAE,uHAAA,iBAAiB,OAAA;AAEzF,wEAAsE;AAA7D,oHAAA,gBAAgB,OAAA;AAGzB,gFAAiG;AAAxF,0HAAA,mBAAmB,OAAA;AAAE,wHAAA,iBAAiB,OAAA;AAG/C,+FAA+F;AAC/F,wIAAwI;AACxI,8EAA4E;AAAnE,4HAAA,oBAAoB,OAAA","sourcesContent":["export { AuthService, authTypes } from \"@/services/auth/AuthService\"\nexport type { AuthServiceProps, AuthType, AuthTokenResult, AuthJwtToken, AuthGetTokenProps } from \"@/services/auth/AuthService\"\nexport { AccessKeyService, accessKeyUserTypes, accessKeyStatus } from \"@/services/access_key/AccessKeyService\"\nexport type { AccessKeyServiceProps, AccessKeyStatus, AccessKeyUserType, AccessKeyCreateProps, AccessKeyRevokeProps } from \"@/services/access_key/AccessKeyService\"\nexport { AccessControlService } from \"@/services/access_control/AccessControlService\"\nexport type { AccessControlServiceProps, AccessControlScopeOrExtra, AccessControlListOptionsProps } from \"@/services/access_control/AccessControlService\"\nexport { ResetPasswordService, resetPasswordMethods } from \"@/services/reset_password/ResetPasswordService\"\nexport type { ResetPasswordServiceProps, ResetPasswordMethod, ResetPasswordRequestProps, ResetPasswordValidateCodeProps, ResetPasswordPerformProps } from \"@/services/reset_password/ResetPasswordService\"\nexport { AccountService } from \"@/services/account/AccountService\"\nexport type { AccountServiceProps, Account, AccountGetProps, AccountListProps, AccountCreateProps, AccountUpdateProps, AccountRemoveProps } from \"@/services/account/AccountService\"\nexport { BusinessService } from \"@/services/business/BusinessService\"\nexport type { BusinessServiceProps, Business, BusinessGetProps, BusinessListProps, BusinessCreateProps, BusinessUpdateProps } from \"@/services/business/BusinessService\"\n\nexport { SubscribePlanService, subscribeCurrencies, subscribePlanBillingCycles } from \"@/services/subscription/plan/SubscribePlanService\"\nexport type { SubscribePlanServiceProps, SubscribePlan, SubscribePlanBillingCycle, SubscribePlanCurrency, SubscribePlanGetProps, SubscribePlanListProps, SubscribePlanCreateProps, SubscribePlanUpdateProps } from \"@/services/subscription/plan/SubscribePlanService\"\nexport { AccountSubscribeService } from \"@/services/subscription/account/AccountSubscribeService\"\nexport type { AccountSubscribeServiceProps, AccountSubscribe, AccountSubscribeGetProps, AccountSubscribeListProps, AccountSubscribeCreateProps, AccountSubscribeCancelProps } from \"@/services/subscription/account/AccountSubscribeService\"\n\nexport { UserService, userTypes, userParentSqlSelect } from \"@/services/user/UserService\"\nexport type { UserServiceProps, UserType, UserGetProps, UserListProps, UserCreateProps, UserUpdateProps, UserRemoveProps, UserReplacePasswordProps } from \"@/services/user/UserService\"\n\nexport { UserMeService } from \"@/services/user/UserMeService\"\nexport type { UserMeServiceProps, UserMeUpdateProps, UserMeChangePasswordProps } from \"@/services/user/UserMeService\"\n\n// export { AdministratorService, administratorDataTypes } from \"@/services/user/AdministratorService\"\n// export type { AdministratorServiceProps, AdministratorGetProps, AdministratorListProps, AdministratorCreateProps, AdministratorUpdateProps, AdministratorRemoveProps } from \"@/services/user/AdministratorService\"\n// export { OperatorService, operatorDataTypes } from \"@/services/user/OperatorService\"\n// export type { OperatorServiceProps, OperatorGetProps, OperatorListProps, OperatorCreateProps, OperatorUpdateProps, OperatorRemoveProps } from \"@/services/user/OperatorService\"\n\nexport { UserBranchService, userBranchTypes } from \"@/services/branch/UserBranchService\"\nexport type { UserBranchServiceProps, UserBranchType, UserBranchGetProps, UserBranchListProps, UserBranchCreateProps, UserBranchUpdateProps, UserBranchRemoveProps } from \"@/services/branch/UserBranchService\"\nexport { RegionService } from \"@/services/region/RegionService\"\nexport type { RegionServiceProps, RegionType, RegionGetProps, RegionCreateProps, RegionListProps, RegionUpdateProps, RegionRemoveProps } from \"@/services/region/RegionService\"\nexport { DocumentService } from \"@/services/document/DocumentService\"\nexport type { DocumentServiceProps, DocumentType, DocumentGetProps, DocumentUpdateProps, DocumentCreateProps, DocumentListProps, DocumentRemoveProps } from \"@/services/document/DocumentService\"\nexport { ItemService, itemTypes } from \"@/services/item/ItemService\"\nexport type { ItemServiceProps, ItemType, ItemGetProps, ItemUpdateProps, ItemCreateProps, ItemListProps, ItemRemoveProps } from \"@/services/item/ItemService\"\nexport { FileService } from \"@/services/file/FileService\"\nexport type { FileImageCompressionOptions, FileVideoCompressionOptions, FileStorageProviderType, FileLocalProviderOptions, FileGoogleCloudProviderOptions, FileAwsS3ProviderOptions, FileCategoryName, FileUploadItem, FileServiceProps, FileGetProps, FileUploadProps, FileCreateProps, FileListProps, FileRemoveProps } from \"@/services/file/FileService\"\nexport { LocationService } from \"@/services/location/LocationService\"\nexport type { LocationServiceProps, LocationType, LocationGetProps, LocationUpdateProps, LocationCreateProps, LocationListProps, LocationRemoveProps } from \"@/services/location/LocationService\"\nexport { InjectionFieldService, injectionFieldTypes, injectionFieldDataTypes } from \"@/services/injection_field/InjectionFieldService\"\nexport type { InjectionFieldModuleRef, InjectionFieldServiceProps, InjectionFieldType, InjectionFieldDataType, InjectionFieldCreateProps, InjectionFieldListProps, InjectionFieldGetProps, InjectionFieldReplaceProps } from \"@/services/injection_field/InjectionFieldService\"\nexport { NumberDateSequenceService } from \"@/services/others/NumberDateSequenceService\"\nexport type { NumberDateSequenceModuleRef, NumberDateSequenceServiceProps, NumberDateSequenceInitProps, NumberDateSequenceCreateProps } from \"@/services/others/NumberDateSequenceService\"\nexport { OneTimeCodeService, oneTimeCodeTypes, oneTimeCodePurposeTypes, oneTimeCodeStatus } from \"@/services/one_time_code/OneTimeCodeService\"\nexport type { OneTimeCodeModuleRef, OneTimeCodeType, OneTimeCodePurposeType, OneTimeCodeStatus, OneTimeCodeServiceProps, OneTimeCodeCreateProps } from \"@/services/one_time_code/OneTimeCodeService\"\nexport { SmtpEmailService } from \"@/services/gateway/SmtpEmailService\"\nexport type { SmtpEmailServiceProps, SmtpEmailSendProps, SmtpEmailTransporterOptions } from \"@/services/gateway/SmtpEmailService\"\n\nexport { SchedulerLogService, schedulerLogTypes } from \"@/services/scheduler/SchedulerLogService\"\nexport type { SchedulerLogServiceProps, SchedulerLogFlowType, SchedulerLogModuleRef, SchedulerLogRemoveProps, SchedulerLogCreateProps, SchedulerLogListProps, SchedulerLogGetProps } from \"@/services/scheduler/SchedulerLogService\"\n\n// export { ChangePasswordUtilService } from \"@/services/utils/unuse/ChangePasswordUtilService\"\n// export type { ChangePasswordUtilServiceProps, ChangePasswordUtilChangeProps } from \"@/services/utils/unuse/ChangePasswordUtilService\"\nexport { AccessKeyUtilService } from \"@/services/utils/AccessKeyUtilService\"\nexport type { AccessKeyUtilServiceProps, AccessKeyUtilValidateProps, AccessKeyUtilAccountOwnerProps } from \"@/services/utils/AccessKeyUtilService\""]}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { QueryList, QueryGet } from "../../schema/common";
|
|
2
|
+
import { DefaultServiceProps } from "../../utils";
|
|
3
|
+
import { InjectionFieldModuleRef } from "../../services";
|
|
4
|
+
export type SchedulerLogModuleRef = InjectionFieldModuleRef;
|
|
5
|
+
export type SchedulerLogServiceProps = DefaultServiceProps & {};
|
|
6
|
+
export type SchedulerLogGetProps = Omit<QueryGet, "datatypes"> & {
|
|
7
|
+
id: number;
|
|
8
|
+
};
|
|
9
|
+
export type SchedulerLogListProps = Omit<QueryList, "datatypes"> & {};
|
|
10
|
+
export type SchedulerLogRemoveProps = {
|
|
11
|
+
schedulerLogIds: BigInt[];
|
|
12
|
+
};
|
|
13
|
+
export declare const schedulerLogTypes: {
|
|
14
|
+
in: string;
|
|
15
|
+
out: string;
|
|
16
|
+
};
|
|
17
|
+
export type SchedulerLogFlowType = keyof typeof schedulerLogTypes;
|
|
18
|
+
export type SchedulerLog = {
|
|
19
|
+
schedulerTaskId: number;
|
|
20
|
+
flowType: SchedulerLogFlowType;
|
|
21
|
+
sourceType: string;
|
|
22
|
+
sourceEntityId: string;
|
|
23
|
+
sourceEntityLabel: string;
|
|
24
|
+
sourceEntityData: string;
|
|
25
|
+
destinationType: string;
|
|
26
|
+
destinationEntityId: string;
|
|
27
|
+
destinationEntityLabel: string;
|
|
28
|
+
destinationSubmitPayload: string;
|
|
29
|
+
destinationSubmitResponse: string;
|
|
30
|
+
logAction: string;
|
|
31
|
+
logLabel: string;
|
|
32
|
+
logStatus: boolean;
|
|
33
|
+
logMesssage: string;
|
|
34
|
+
};
|
|
35
|
+
export type SchedulerLogCreateProps = {
|
|
36
|
+
data: SchedulerLog & {
|
|
37
|
+
fieldRef: SchedulerLogModuleRef["field_ref"];
|
|
38
|
+
fieldModule: SchedulerLogModuleRef["field_module"];
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export declare const SchedulerLogService: (props: SchedulerLogServiceProps) => {
|
|
42
|
+
getSchedulerLog: ({ id }: SchedulerLogGetProps) => Promise<any>;
|
|
43
|
+
createSchedulerLog: ({ data }: SchedulerLogCreateProps) => Promise<{
|
|
44
|
+
createdatetime: Date | null;
|
|
45
|
+
createuserid: bigint;
|
|
46
|
+
updatedatetime: Date | null;
|
|
47
|
+
updateuserid: bigint;
|
|
48
|
+
isdelete: boolean | null;
|
|
49
|
+
istrash: boolean | null;
|
|
50
|
+
accountid: bigint;
|
|
51
|
+
field_ref: string;
|
|
52
|
+
field_module: string;
|
|
53
|
+
scheduler_log_id: bigint;
|
|
54
|
+
scheduler_task_id: bigint;
|
|
55
|
+
flow_type: string;
|
|
56
|
+
log_action: string;
|
|
57
|
+
log_label: string;
|
|
58
|
+
log_status: boolean | null;
|
|
59
|
+
log_message: string | null;
|
|
60
|
+
source_type: string | null;
|
|
61
|
+
source_entity_id: string | null;
|
|
62
|
+
source_entity_label: string | null;
|
|
63
|
+
source_entity_data: string | null;
|
|
64
|
+
destination_type: string | null;
|
|
65
|
+
destination_entity_id: string | null;
|
|
66
|
+
destination_entity_label: string | null;
|
|
67
|
+
destination_submit_payload: string | null;
|
|
68
|
+
destination_submit_response: string | null;
|
|
69
|
+
}>;
|
|
70
|
+
removeSchedulerLoges: ({ schedulerLogIds }: SchedulerLogRemoveProps) => Promise<{
|
|
71
|
+
createdatetime: Date | null;
|
|
72
|
+
createuserid: bigint;
|
|
73
|
+
updatedatetime: Date | null;
|
|
74
|
+
updateuserid: bigint;
|
|
75
|
+
isdelete: boolean | null;
|
|
76
|
+
istrash: boolean | null;
|
|
77
|
+
accountid: bigint;
|
|
78
|
+
field_ref: string;
|
|
79
|
+
field_module: string;
|
|
80
|
+
scheduler_log_id: bigint;
|
|
81
|
+
scheduler_task_id: bigint;
|
|
82
|
+
flow_type: string;
|
|
83
|
+
log_action: string;
|
|
84
|
+
log_label: string;
|
|
85
|
+
log_status: boolean | null;
|
|
86
|
+
log_message: string | null;
|
|
87
|
+
source_type: string | null;
|
|
88
|
+
source_entity_id: string | null;
|
|
89
|
+
source_entity_label: string | null;
|
|
90
|
+
source_entity_data: string | null;
|
|
91
|
+
destination_type: string | null;
|
|
92
|
+
destination_entity_id: string | null;
|
|
93
|
+
destination_entity_label: string | null;
|
|
94
|
+
destination_submit_payload: string | null;
|
|
95
|
+
destination_submit_response: string | null;
|
|
96
|
+
}[]>;
|
|
97
|
+
listSchedulerLoges: ({ limit, offset, filters, sortfield, sortorder }: SchedulerLogListProps) => Promise<{
|
|
98
|
+
data: any[];
|
|
99
|
+
total: number;
|
|
100
|
+
}>;
|
|
101
|
+
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SchedulerLogService = exports.schedulerLogTypes = void 0;
|
|
4
|
+
const utils_1 = require("../../utils");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
const lib_1 = require("../../lib");
|
|
7
|
+
exports.schedulerLogTypes = {
|
|
8
|
+
in: "in",
|
|
9
|
+
out: "out"
|
|
10
|
+
};
|
|
11
|
+
const getCreatePayload = (data) => {
|
|
12
|
+
return {
|
|
13
|
+
[`${models_1.ModelSchedulerLogFields.scheduler_task_id}`]: Number(data.schedulerTaskId),
|
|
14
|
+
[`${models_1.ModelSchedulerLogFields.flow_type}`]: data.flowType,
|
|
15
|
+
[`${models_1.ModelSchedulerLogFields.log_action}`]: data.logAction,
|
|
16
|
+
[`${models_1.ModelSchedulerLogFields.field_module}`]: data.fieldRef,
|
|
17
|
+
[`${models_1.ModelSchedulerLogFields.field_ref}`]: data.fieldModule,
|
|
18
|
+
[`${models_1.ModelSchedulerLogFields.source_type}`]: data.sourceType,
|
|
19
|
+
[`${models_1.ModelSchedulerLogFields.source_entity_id}`]: data.sourceEntityId,
|
|
20
|
+
[`${models_1.ModelSchedulerLogFields.source_entity_label}`]: data.sourceEntityLabel,
|
|
21
|
+
[`${models_1.ModelSchedulerLogFields.source_entity_data}`]: data.sourceEntityData,
|
|
22
|
+
[`${models_1.ModelSchedulerLogFields.destination_type}`]: data.destinationType,
|
|
23
|
+
[`${models_1.ModelSchedulerLogFields.destination_entity_id}`]: data.destinationEntityId,
|
|
24
|
+
[`${models_1.ModelSchedulerLogFields.destination_entity_label}`]: data.destinationEntityLabel,
|
|
25
|
+
[`${models_1.ModelSchedulerLogFields.destination_submit_payload}`]: data.destinationSubmitPayload,
|
|
26
|
+
[`${models_1.ModelSchedulerLogFields.destination_submit_response}`]: data.destinationSubmitResponse,
|
|
27
|
+
[`${models_1.ModelSchedulerLogFields.log_label}`]: data.logLabel,
|
|
28
|
+
[`${models_1.ModelSchedulerLogFields.log_message}`]: data.logMesssage,
|
|
29
|
+
[`${models_1.ModelSchedulerLogFields.log_status}`]: Boolean(data.logStatus),
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
let mainSqlSelect = {
|
|
33
|
+
[`slog.${models_1.ModelSchedulerLogFields.scheduler_log_id}`]: "scheduler_log_id",
|
|
34
|
+
[`slog.${models_1.ModelSchedulerLogFields.scheduler_task_id}`]: "scheduler_task_id",
|
|
35
|
+
[`slog.${models_1.ModelSchedulerLogFields.field_module}`]: "field_module",
|
|
36
|
+
[`slog.${models_1.ModelSchedulerLogFields.field_ref}`]: "field_ref",
|
|
37
|
+
[`slog.${models_1.ModelSchedulerLogFields.flow_type}`]: "flow_type",
|
|
38
|
+
[`slog.${models_1.ModelSchedulerLogFields.destination_type}`]: "destination_type",
|
|
39
|
+
[`slog.${models_1.ModelSchedulerLogFields.destination_entity_id}`]: "destination_entity_id",
|
|
40
|
+
[`slog.${models_1.ModelSchedulerLogFields.destination_entity_label}`]: "destination_entity_label",
|
|
41
|
+
[`slog.${models_1.ModelSchedulerLogFields.destination_submit_payload}`]: "destination_submit_payload",
|
|
42
|
+
[`slog.${models_1.ModelSchedulerLogFields.destination_submit_response}`]: "destination_submit_response",
|
|
43
|
+
[`slog.${models_1.ModelSchedulerLogFields.source_type}`]: "source_type",
|
|
44
|
+
[`slog.${models_1.ModelSchedulerLogFields.source_entity_id}`]: "source_entity_id",
|
|
45
|
+
[`slog.${models_1.ModelSchedulerLogFields.source_entity_label}`]: "source_entity_label",
|
|
46
|
+
[`slog.${models_1.ModelSchedulerLogFields.source_entity_data}`]: "source_entity_data",
|
|
47
|
+
[`slog.${models_1.ModelSchedulerLogFields.log_action}`]: "log_action",
|
|
48
|
+
[`slog.${models_1.ModelSchedulerLogFields.log_label}`]: "log_label",
|
|
49
|
+
[`slog.${models_1.ModelSchedulerLogFields.log_message}`]: "log_message",
|
|
50
|
+
[`slog.${models_1.ModelSchedulerLogFields.log_status}`]: "log_status",
|
|
51
|
+
};
|
|
52
|
+
let defaultSqlSelect = {
|
|
53
|
+
[`slog.${models_1.ModelSchedulerLogFields.createdatetime}`]: "createdatetime",
|
|
54
|
+
[`creator.${models_1.ModelUserFields.login_username}`]: "createusername",
|
|
55
|
+
[`slog.${models_1.ModelSchedulerLogFields.updatedatetime}`]: "updatedatetime",
|
|
56
|
+
[`updater.${models_1.ModelUserFields.login_username}`]: "updateusername",
|
|
57
|
+
[`slog.${models_1.ModelSchedulerLogFields.isdelete}`]: "isdelete",
|
|
58
|
+
[`slog.${models_1.ModelSchedulerLogFields.istrash}`]: "istrash",
|
|
59
|
+
[`slog.${models_1.ModelSchedulerLogFields.accountid}`]: "accountid",
|
|
60
|
+
};
|
|
61
|
+
const SchedulerLogService = (props) => {
|
|
62
|
+
const { ...rest } = props;
|
|
63
|
+
const schedulerLogModel = (0, models_1.SchedulerLogModel)({ ...rest });
|
|
64
|
+
const createSchedulerLog = async ({ data }) => {
|
|
65
|
+
const _data = getCreatePayload(data);
|
|
66
|
+
if (!_data) {
|
|
67
|
+
throw new Error(`Invalid create scheduler log payload: ${JSON.stringify(_data)}`);
|
|
68
|
+
}
|
|
69
|
+
let response = await schedulerLogModel.create({ data: _data });
|
|
70
|
+
return response;
|
|
71
|
+
};
|
|
72
|
+
const getSchedulerLog = async ({ id }) => {
|
|
73
|
+
let { data } = await listSchedulerLoges({
|
|
74
|
+
limit: 1,
|
|
75
|
+
offset: 0,
|
|
76
|
+
filters: [{ field: `${models_1.ModelSchedulerLogFields.scheduler_log_id}`, operator: "=", value: id }],
|
|
77
|
+
sortfield: `${models_1.ModelSchedulerLogFields.scheduler_log_id}`,
|
|
78
|
+
sortorder: "ASC",
|
|
79
|
+
});
|
|
80
|
+
return data[0] ?? null;
|
|
81
|
+
};
|
|
82
|
+
const listSchedulerLoges = async ({ limit, offset, filters = [], sortfield, sortorder }) => {
|
|
83
|
+
let data = [];
|
|
84
|
+
let sqlSelect = [
|
|
85
|
+
`COUNT(slog.*) OVER() as filtered_count`,
|
|
86
|
+
(0, lib_1.buildSqlSelect)(``, mainSqlSelect),
|
|
87
|
+
// buildSqlSelect(``, regionSqlSelect),
|
|
88
|
+
(0, lib_1.buildSqlSelect)(``, defaultSqlSelect)
|
|
89
|
+
];
|
|
90
|
+
let sqlRelation = [
|
|
91
|
+
// buildSqlRelation("left", "slog", "states", "slogstate", ["slog.state_id = slogstate.state_id", "slogstate.isdelete = false", "slogstate.istrash = false"]),
|
|
92
|
+
// buildSqlRelation("left", "slog", "countries", "slogcoun", ["slog.country_id = slogcoun.country_id", "slogcoun.isdelete = false", "slogcoun.istrash = false"]),
|
|
93
|
+
// buildSqlRelation("left", "slog", "areas", "slogarea", ["slog.area_id = slogarea.area_id", "slogarea.isdelete = false", "slogarea.istrash = false"]),
|
|
94
|
+
(0, lib_1.buildSqlRelation)("left", "slog", "users", "creator", ["slog.createuserid = creator.user_id", "creator.isdelete = false", "creator.istrash = false"]),
|
|
95
|
+
(0, lib_1.buildSqlRelation)("left", "slog", "users", "updater", ["slog.updateuserid = updater.user_id", "updater.isdelete = false", "updater.istrash = false"])
|
|
96
|
+
];
|
|
97
|
+
let sqlGroupBy = [
|
|
98
|
+
...Object.keys(mainSqlSelect),
|
|
99
|
+
// ...Object.keys(regionSqlSelect),
|
|
100
|
+
...Object.keys(defaultSqlSelect)
|
|
101
|
+
];
|
|
102
|
+
let filterColumns = {
|
|
103
|
+
...mainSqlSelect,
|
|
104
|
+
// ...regionSqlSelect,
|
|
105
|
+
...defaultSqlSelect
|
|
106
|
+
};
|
|
107
|
+
let sqlWhere = [
|
|
108
|
+
`slog.isdelete = false`,
|
|
109
|
+
`slog.istrash = false`,
|
|
110
|
+
...(filters.length ? [(0, lib_1.buildSqlWhere)(filters, filterColumns)?.where] : []),
|
|
111
|
+
];
|
|
112
|
+
let sqlOrderby = (0, lib_1.buildSqlOrderBy)(sortfield, sortorder);
|
|
113
|
+
let sqlLimitOffset = (0, lib_1.buildSqlLimitOffset)(limit, offset);
|
|
114
|
+
const sqlRaw = (0, lib_1.buildSqlRawSelect)({
|
|
115
|
+
tableName: "scheduler_logs",
|
|
116
|
+
mainAlias: "slog",
|
|
117
|
+
accountId: rest.accountId,
|
|
118
|
+
sqlSelect,
|
|
119
|
+
sqlRelation,
|
|
120
|
+
sqlWhere,
|
|
121
|
+
sqlGroupBy,
|
|
122
|
+
sqlOrderby,
|
|
123
|
+
sqlLimitOffset
|
|
124
|
+
});
|
|
125
|
+
data = await schedulerLogModel.raw(sqlRaw);
|
|
126
|
+
const response = {
|
|
127
|
+
data: data.map(({ filtered_count, ...rest }) => rest),
|
|
128
|
+
total: data.length ? Number(data[0].filtered_count) : 0
|
|
129
|
+
};
|
|
130
|
+
return response;
|
|
131
|
+
};
|
|
132
|
+
const removeSchedulerLoges = async ({ schedulerLogIds }) => {
|
|
133
|
+
if (!schedulerLogIds.length)
|
|
134
|
+
(0, utils_1.throwError)('schedulerLogIds is required');
|
|
135
|
+
const response = await schedulerLogModel.remove({ where: { [`${models_1.ModelSchedulerLogFields.scheduler_log_id}`]: { in: schedulerLogIds } } });
|
|
136
|
+
return response;
|
|
137
|
+
};
|
|
138
|
+
return {
|
|
139
|
+
getSchedulerLog,
|
|
140
|
+
createSchedulerLog,
|
|
141
|
+
removeSchedulerLoges,
|
|
142
|
+
listSchedulerLoges
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
exports.SchedulerLogService = SchedulerLogService;
|
|
146
|
+
//# sourceMappingURL=SchedulerLogService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchedulerLogService.js","sourceRoot":"","sources":["../../../src/services/scheduler/SchedulerLogService.ts"],"names":[],"mappings":";;;AAAA,mCAA+C;AAE/C,qCAIkB;AAQlB,+BAAiI;AAiBpH,QAAA,iBAAiB,GAAG;IAC7B,EAAE,EAAE,IAAI;IACR,GAAG,EAAE,KAAK;CACb,CAAA;AAgCD,MAAM,g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oB,GAAG,KAAK,EAAE,EAAE,eAAe,EAA2B,EAAE,EAAE;QAEhF,IAAI,CAAC,eAAe,CAAC,MAAM;YAAE,IAAA,kBAAU,EAAC,6BAA6B,CAAC,CAAC;QAEvE,MAAM,QAAQ,GAAG,MAAM,iBAAiB,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,gCAAuB,CAAC,gBAAgB,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,CAAC;QAEzI,OAAO,QAAQ,CAAA;IACnB,CAAC,CAAC;IAEF,OAAO;QACH,eAAe;QACf,kBAAkB;QAClB,oBAAoB;QACpB,kBAAkB;KACrB,CAAA;AAEL,CAAC,CAAA;AAlHY,QAAA,mBAAmB,uBAkH/B","sourcesContent":["import { logError, throwError } from \"@/utils\";\n\nimport {\n ModelUserFields,\n SchedulerLogModel,\n ModelSchedulerLogFields\n} from \"@/models\";\n\nimport { QueryList, QueryGet } from \"@/schema/common\";\n\nimport { DefaultServiceProps } from \"@/utils\";\n\nimport { InjectionFieldModuleRef } from \"@/services\"\n\nimport { buildSqlRelation, buildSqlRawSelect, buildSqlWhere, buildSqlSelect, buildSqlLimitOffset, buildSqlOrderBy } from \"@/lib\";\n\nexport type SchedulerLogModuleRef = InjectionFieldModuleRef\n\nexport type SchedulerLogServiceProps = DefaultServiceProps & {};\n\nexport type SchedulerLogGetProps = Omit<QueryGet, \"datatypes\"> & {\n id: number,\n};\n\nexport type SchedulerLogListProps = Omit<QueryList, \"datatypes\"> & {\n};\n\nexport type SchedulerLogRemoveProps = {\n schedulerLogIds: BigInt[]\n};\n\nexport const schedulerLogTypes = {\n in: \"in\",\n out: \"out\"\n}\n\nexport type SchedulerLogFlowType = keyof typeof schedulerLogTypes\n\nexport type SchedulerLog = {\n schedulerTaskId: number;\n flowType: SchedulerLogFlowType;\n\n sourceType: string;\n sourceEntityId: string;\n sourceEntityLabel: string;\n sourceEntityData: string;\n\n destinationType: string;\n destinationEntityId: string;\n destinationEntityLabel: string;\n destinationSubmitPayload: string;\n destinationSubmitResponse: string;\n\n logAction: string;\n logLabel: string;\n logStatus: boolean;\n logMesssage: string;\n}\n\nexport type SchedulerLogCreateProps = {\n data: SchedulerLog & {\n fieldRef: SchedulerLogModuleRef[\"field_ref\"],\n fieldModule: SchedulerLogModuleRef[\"field_module\"]\n }\n}\n\nconst getCreatePayload = (data: SchedulerLogCreateProps[\"data\"]) => {\n\n return {\n [`${ModelSchedulerLogFields.scheduler_task_id}`]: Number(data.schedulerTaskId),\n [`${ModelSchedulerLogFields.flow_type}`]: data.flowType,\n [`${ModelSchedulerLogFields.log_action}`]: data.logAction,\n\n [`${ModelSchedulerLogFields.field_module}`]: data.fieldRef,\n [`${ModelSchedulerLogFields.field_ref}`]: data.fieldModule,\n\n [`${ModelSchedulerLogFields.source_type}`]: data.sourceType,\n [`${ModelSchedulerLogFields.source_entity_id}`]: data.sourceEntityId,\n [`${ModelSchedulerLogFields.source_entity_label}`]: data.sourceEntityLabel,\n [`${ModelSchedulerLogFields.source_entity_data}`]: data.sourceEntityData,\n\n [`${ModelSchedulerLogFields.destination_type}`]: data.destinationType,\n [`${ModelSchedulerLogFields.destination_entity_id}`]: data.destinationEntityId,\n [`${ModelSchedulerLogFields.destination_entity_label}`]: data.destinationEntityLabel,\n [`${ModelSchedulerLogFields.destination_submit_payload}`]: data.destinationSubmitPayload,\n [`${ModelSchedulerLogFields.destination_submit_response}`]: data.destinationSubmitResponse,\n\n [`${ModelSchedulerLogFields.log_label}`]: data.logLabel,\n [`${ModelSchedulerLogFields.log_message}`]: data.logMesssage,\n [`${ModelSchedulerLogFields.log_status}`]: Boolean(data.logStatus),\n }\n\n}\n\nlet mainSqlSelect = {\n [`slog.${ModelSchedulerLogFields.scheduler_log_id}`]: \"scheduler_log_id\",\n [`slog.${ModelSchedulerLogFields.scheduler_task_id}`]: \"scheduler_task_id\",\n [`slog.${ModelSchedulerLogFields.field_module}`]: \"field_module\",\n [`slog.${ModelSchedulerLogFields.field_ref}`]: \"field_ref\",\n [`slog.${ModelSchedulerLogFields.flow_type}`]: \"flow_type\",\n [`slog.${ModelSchedulerLogFields.destination_type}`]: \"destination_type\",\n [`slog.${ModelSchedulerLogFields.destination_entity_id}`]: \"destination_entity_id\",\n [`slog.${ModelSchedulerLogFields.destination_entity_label}`]: \"destination_entity_label\",\n [`slog.${ModelSchedulerLogFields.destination_submit_payload}`]: \"destination_submit_payload\",\n [`slog.${ModelSchedulerLogFields.destination_submit_response}`]: \"destination_submit_response\",\n [`slog.${ModelSchedulerLogFields.source_type}`]: \"source_type\",\n [`slog.${ModelSchedulerLogFields.source_entity_id}`]: \"source_entity_id\",\n [`slog.${ModelSchedulerLogFields.source_entity_label}`]: \"source_entity_label\",\n [`slog.${ModelSchedulerLogFields.source_entity_data}`]: \"source_entity_data\",\n [`slog.${ModelSchedulerLogFields.log_action}`]: \"log_action\",\n [`slog.${ModelSchedulerLogFields.log_label}`]: \"log_label\",\n [`slog.${ModelSchedulerLogFields.log_message}`]: \"log_message\",\n [`slog.${ModelSchedulerLogFields.log_status}`]: \"log_status\",\n}\n\nlet defaultSqlSelect = {\n [`slog.${ModelSchedulerLogFields.createdatetime}`]: \"createdatetime\",\n [`creator.${ModelUserFields.login_username}`]: \"createusername\",\n [`slog.${ModelSchedulerLogFields.updatedatetime}`]: \"updatedatetime\",\n [`updater.${ModelUserFields.login_username}`]: \"updateusername\",\n [`slog.${ModelSchedulerLogFields.isdelete}`]: \"isdelete\",\n [`slog.${ModelSchedulerLogFields.istrash}`]: \"istrash\",\n [`slog.${ModelSchedulerLogFields.accountid}`]: \"accountid\",\n}\n\nexport const SchedulerLogService = (props: SchedulerLogServiceProps) => {\n\n const {\n ...rest\n } = props\n\n const schedulerLogModel = SchedulerLogModel({ ...rest })\n\n const createSchedulerLog = async ({ data }: SchedulerLogCreateProps) => {\n\n const _data = getCreatePayload(data)\n\n if (!_data) {\n throw new Error(`Invalid create scheduler log payload: ${JSON.stringify(_data)}`);\n }\n\n let response = await schedulerLogModel.create({ data: _data })\n\n return response\n }\n\n const getSchedulerLog = async ({ id }: SchedulerLogGetProps) => {\n\n let { data } = await listSchedulerLoges({\n limit: 1,\n offset: 0,\n filters: [{ field: `${ModelSchedulerLogFields.scheduler_log_id}`, operator: \"=\", value: id }],\n sortfield: `${ModelSchedulerLogFields.scheduler_log_id}`,\n sortorder: \"ASC\",\n })\n\n return data[0] ?? null;\n\n };\n\n const listSchedulerLoges = async ({ limit, offset, filters = [], sortfield, sortorder }: SchedulerLogListProps) => {\n\n let data = []\n\n let sqlSelect = [\n `COUNT(slog.*) OVER() as filtered_count`,\n buildSqlSelect(``, mainSqlSelect),\n // buildSqlSelect(``, regionSqlSelect),\n buildSqlSelect(``, defaultSqlSelect)\n ]\n\n let sqlRelation = [\n // buildSqlRelation(\"left\", \"slog\", \"states\", \"slogstate\", [\"slog.state_id = slogstate.state_id\", \"slogstate.isdelete = false\", \"slogstate.istrash = false\"]),\n // buildSqlRelation(\"left\", \"slog\", \"countries\", \"slogcoun\", [\"slog.country_id = slogcoun.country_id\", \"slogcoun.isdelete = false\", \"slogcoun.istrash = false\"]),\n // buildSqlRelation(\"left\", \"slog\", \"areas\", \"slogarea\", [\"slog.area_id = slogarea.area_id\", \"slogarea.isdelete = false\", \"slogarea.istrash = false\"]),\n buildSqlRelation(\"left\", \"slog\", \"users\", \"creator\", [\"slog.createuserid = creator.user_id\", \"creator.isdelete = false\", \"creator.istrash = false\"]),\n buildSqlRelation(\"left\", \"slog\", \"users\", \"updater\", [\"slog.updateuserid = updater.user_id\", \"updater.isdelete = false\", \"updater.istrash = false\"])\n ]\n\n let sqlGroupBy: string[] = [\n ...Object.keys(mainSqlSelect),\n // ...Object.keys(regionSqlSelect), \n ...Object.keys(defaultSqlSelect)\n ]\n\n let filterColumns = {\n ...mainSqlSelect,\n // ...regionSqlSelect, \n ...defaultSqlSelect\n }\n\n let sqlWhere = [\n `slog.isdelete = false`,\n `slog.istrash = false`,\n ...(filters.length ? [buildSqlWhere(filters, filterColumns)?.where] : []),\n ]\n\n let sqlOrderby = buildSqlOrderBy(sortfield, sortorder)\n let sqlLimitOffset = buildSqlLimitOffset(limit, offset)\n\n const sqlRaw = buildSqlRawSelect({\n tableName: \"scheduler_logs\",\n mainAlias: \"slog\",\n accountId: rest.accountId,\n sqlSelect,\n sqlRelation,\n sqlWhere,\n sqlGroupBy,\n sqlOrderby,\n sqlLimitOffset\n })\n\n data = await schedulerLogModel.raw(sqlRaw)\n\n const response = {\n data: data.map(({ filtered_count, ...rest }) => rest),\n total: data.length ? Number(data[0].filtered_count) : 0\n }\n\n return response\n\n };\n\n const removeSchedulerLoges = async ({ schedulerLogIds }: SchedulerLogRemoveProps) => {\n\n if (!schedulerLogIds.length) throwError('schedulerLogIds is required');\n\n const response = await schedulerLogModel.remove({ where: { [`${ModelSchedulerLogFields.scheduler_log_id}`]: { in: schedulerLogIds } } });\n\n return response\n };\n\n return {\n getSchedulerLog,\n createSchedulerLog,\n removeSchedulerLoges,\n listSchedulerLoges\n }\n\n}\n\n"]}
|
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -2886,3 +2886,33 @@ model account_subscriptions {
|
|
|
2886
2886
|
|
|
2887
2887
|
@@schema("public")
|
|
2888
2888
|
}
|
|
2889
|
+
|
|
2890
|
+
model scheduler_logs {
|
|
2891
|
+
scheduler_log_id BigInt @id @default(autoincrement())
|
|
2892
|
+
createdatetime DateTime? @db.Timestamptz(6)
|
|
2893
|
+
createuserid BigInt @default(0)
|
|
2894
|
+
updatedatetime DateTime? @db.Timestamptz(6)
|
|
2895
|
+
updateuserid BigInt @default(0)
|
|
2896
|
+
isdelete Boolean? @default(false)
|
|
2897
|
+
istrash Boolean? @default(false)
|
|
2898
|
+
accountid BigInt @default(0)
|
|
2899
|
+
scheduler_task_id BigInt @default(autoincrement())
|
|
2900
|
+
flow_type String @db.VarChar(256)
|
|
2901
|
+
field_ref String @db.VarChar(256)
|
|
2902
|
+
field_module String @db.VarChar(256)
|
|
2903
|
+
log_action String @db.VarChar(256)
|
|
2904
|
+
log_label String @db.VarChar(256)
|
|
2905
|
+
log_status Boolean? @default(false)
|
|
2906
|
+
log_message String?
|
|
2907
|
+
source_type String? @db.VarChar(256)
|
|
2908
|
+
source_entity_id String? @db.VarChar(256)
|
|
2909
|
+
source_entity_label String? @db.VarChar(256)
|
|
2910
|
+
source_entity_data String?
|
|
2911
|
+
destination_type String? @db.VarChar(256)
|
|
2912
|
+
destination_entity_id String? @db.VarChar(256)
|
|
2913
|
+
destination_entity_label String? @db.VarChar(256)
|
|
2914
|
+
destination_submit_payload String?
|
|
2915
|
+
destination_submit_response String?
|
|
2916
|
+
|
|
2917
|
+
@@schema("public")
|
|
2918
|
+
}
|