@servicelabsco/slabs-access-manager 0.1.100 → 0.1.102
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/access/es6.classes.d.ts +1 -1
- package/dist/access/libraries/process.listing.csv.file.js +5 -0
- package/dist/access/libraries/process.listing.csv.file.js.map +1 -1
- package/dist/access/libraries/send.email.notification.js +5 -2
- package/dist/access/libraries/send.email.notification.js.map +1 -1
- package/dist/access/libraries/send.whatsapp.message.notification.d.ts +1 -1
- package/dist/access/libraries/send.whatsapp.message.notification.js +3 -2
- package/dist/access/libraries/send.whatsapp.message.notification.js.map +1 -1
- package/dist/access/services/send.email.service.d.ts +1 -2
- package/dist/access/services/send.email.service.js +0 -8
- package/dist/access/services/send.email.service.js.map +1 -1
- package/dist/migrations/1718112777127-ChangeContentDataTypeSysWhatsappTemplatesTable.d.ts +8 -0
- package/dist/migrations/1718112777127-ChangeContentDataTypeSysWhatsappTemplatesTable.js +19 -0
- package/dist/migrations/1718112777127-ChangeContentDataTypeSysWhatsappTemplatesTable.js.map +1 -0
- package/package.json +1 -1
|
@@ -279,7 +279,7 @@ declare const es6Classes: {
|
|
|
279
279
|
commands: (typeof WebhookPollCommand)[];
|
|
280
280
|
controllers: (typeof AccessMenuController | typeof ApiAccountController | typeof BulkUploadController | typeof BulkUploadItemController | typeof BusinessPreferenceController | typeof BusinessUserGroupController | typeof ChoiceListController | typeof ChoiceTypeController | typeof CustomFieldController | typeof DashboardController | typeof DownloadLogController | typeof GroupMemberController | typeof GroupRoleController | typeof ListingController | typeof ListingPreferenceController | typeof ScheduledReportController | typeof ScheduledReportItemController | typeof TagController | typeof UserNotificationController | typeof UserPreferenceController)[];
|
|
281
281
|
dtos: (typeof SlackTemplateAttributesDto | typeof NotificationPayloadDto | typeof SendEmailNotificationDataDto | typeof GchatPostingPayloadDto | typeof SlackPostingPayloadDto | typeof AddShortUrlDto | typeof BankAccountPayloadDto | typeof RecurringDefinitionDto | typeof AddListingPreferenceDto | typeof ListResponseDto | typeof DateRangeFilterDto | typeof DateFilterDto | typeof ListResponseFormatDto | typeof NumberRangeFilterDto | typeof CommonListFilterDto | typeof ProcessCommonListConfigDto | typeof AccessBusinessParamDto | typeof DbFindDto | typeof AddBusinessPreferenceDto | typeof ModifyCustomFieldStatusDto | typeof StringSearchDto | typeof AddGroupMemberDto | typeof AddRoleDto | typeof AddScheduledReportDto | typeof AddConversationDto | typeof AddTagDto | typeof ProcessListingPayloadDto)[];
|
|
282
|
-
entities: (typeof AccessBusinessEntity | typeof BusinessUserEntity | typeof ProductEntity | typeof GchatUserEntity | typeof GchatMessageEntity | typeof GchatWebhookMessageEntity | typeof SlackIntegrationEntity | typeof SlackMessageEntity | typeof SlackUserEntity | typeof
|
|
282
|
+
entities: (typeof AccessBusinessEntity | typeof BusinessUserEntity | typeof ProductEntity | typeof GchatUserEntity | typeof GchatMessageEntity | typeof GchatWebhookMessageEntity | typeof SlackIntegrationEntity | typeof SlackMessageEntity | typeof SlackUserEntity | typeof WhatsappMessageEntity | typeof WhatsappPreferenceEntity | typeof BusinessEmailEntity | typeof BusinessGroupRoleEntity | typeof GroupRoleEntity | typeof BusinessUserRoleEntity | typeof MenuRoleEntity | typeof MenuEntity | typeof UiActionRoleEntity | typeof MenuActionEntity | typeof ChildMenuEntity | typeof ConversationEntity | typeof DashboardComponentEntity | typeof DownloadLogEntity | typeof EmailRecipientEntity | typeof EmailMessageEntity | typeof GroupMemberEntity | typeof PreferenceUserEntity | typeof PreferenceUserGroupEntity | typeof ModuleMenuEntity | typeof ScheduledReportEntity | typeof ScheduledReportEmailEntity | typeof ScheduledReportItemEntity | typeof SlackWebhookMessageEntity | typeof UserNotificationEntity | typeof UserRoleEntity | typeof WatchlistAssignmentEntity | typeof WebhookSlugEntity)[];
|
|
283
283
|
enums: (typeof NotificationTypeEnum | typeof RecurringPeriodEnum | typeof CustomColumnTypeEnum)[];
|
|
284
284
|
jobs: (typeof AccessTestJob | typeof ApiAccountJob | typeof BusinessEmailJob | typeof BusinessGroupRoleJob | typeof BusinessPreferenceJob | typeof BusinessUserGroupJob | typeof BusinessUserJob | typeof BusinessUserRoleJob | typeof ChildMenuJob | typeof ChoiceListJob | typeof ChoiceTypeJob | typeof ConversationJob | typeof CustomFieldJob | typeof CustomReportJob | typeof DashboardComponentJob | typeof DashboardJob | typeof DownloadLogJob | typeof EmailAttachmentJob | typeof EmailMessageJob | typeof EmailRecipientJob | typeof GchatIncomingWebhookJob | typeof GchatMessageJob | typeof GchatTemplateJob | typeof GchatUserJob | typeof GchatWebhookJob | typeof GchatWebhookMessageJob | typeof GroupMemberJob | typeof GroupRoleJob | typeof ListPreferenceJob | typeof ListingColumnJob | typeof ListingPageJob | typeof ListingPreferenceJob | typeof MenuActionJob | typeof MenuJob | typeof MenuRoleJob | typeof ModuleJob | typeof ModuleMenuJob | typeof PreferenceUserGroupJob | typeof PreferenceUsersJob | typeof ProductJob | typeof RoleGroupJob | typeof ScheduledReportEmailJob | typeof ScheduledReportItemJob | typeof ScheduledReportJob | typeof SlackIncomingWebhookJob | typeof SlackIntegrationJob | typeof SlackMessageJob | typeof SlackTemplateJob | typeof SlackUserJob | typeof SlackWebhookJob | typeof SlackWebhookMessageJob | typeof SyncBURoleJob | typeof UiActionJob | typeof UiActionRoleJob | typeof UserNotificationJob | typeof UserPreferenceJob | typeof UserRoleJob | typeof WatchlistAssignmentJob | typeof WebhookSlugJob | typeof WebhookTypeJob | typeof WhatsappIncomingWebhookJob | typeof WhatsappMessageJob | typeof WhatsappTemplateJob)[];
|
|
285
285
|
libraries: (typeof ProcessEmailNotification | typeof SendEmailNotification | typeof SendGchatMessageNotification | typeof SendGchatWebhookNotification | typeof SendSlackMessageNotification | typeof SendSlackWebhookNotification | typeof SendWhatsappMessageNotification | typeof ProcessListingCsvFile | typeof ProcessDateFilter | typeof ProcessCommonList | typeof ProcessReportData | typeof ProcessApplicationMenu | typeof ProcessMenuDetails | typeof ProcessApiAccountData | typeof ProcessApiAccountList | typeof ProcessDbFind | typeof ProcessBulkUploadList | typeof ProcessBulkUploadItemList | typeof ProcessBusinessUserGroupList | typeof ProcessUserGroupCreation | typeof ProcessChoiceListData | typeof ProcessChoiceTypeList | typeof ProcessChoiceTypeData | typeof ProcessCustomFieldList | typeof ProcessCustomFieldCreation | typeof ProcessDashboardReport | typeof ProcessDownloadLogList | typeof ProcessGroupMemberList | typeof ProcessGroupRoleList | typeof ProcessPreferenceData | typeof ProcessScheduledReportData | typeof ProcessScheduledReportList | typeof ProcessScheduledReportItemList | typeof ProcessUserNotificationList | typeof ProcessBusinessGroupRoleUpdation | typeof ProcessBusinessUserRoleUpdate | typeof ProcessGroupMemberUpdation | typeof SyncBusinessUserRole | typeof CommonTagController | typeof ProcessConversationData | typeof ConversationController | typeof ValidateCustomFieldData | typeof ProcessCommonCustomField | typeof ProcessNotification | typeof ProcessTestList)[];
|
|
@@ -11,6 +11,9 @@ class ProcessListingCsvFile {
|
|
|
11
11
|
this.list = [];
|
|
12
12
|
}
|
|
13
13
|
async process(identifier, data, additionalData) {
|
|
14
|
+
global.console.log('identifier', identifier);
|
|
15
|
+
global.console.log('data', data);
|
|
16
|
+
global.console.log('additionalData', additionalData);
|
|
14
17
|
this.records = data;
|
|
15
18
|
this.additionalData = additionalData;
|
|
16
19
|
this.columns = await this.setColumns(identifier);
|
|
@@ -28,6 +31,8 @@ class ProcessListingCsvFile {
|
|
|
28
31
|
async generateFile(identifier) {
|
|
29
32
|
this.setHeader();
|
|
30
33
|
this.setData();
|
|
34
|
+
global.console.log('this.list', this.list.length);
|
|
35
|
+
global.console.log('this.list', this.list);
|
|
31
36
|
const buffer = Buffer.from(this.list.join('\n'), 'utf-8');
|
|
32
37
|
const originalname = `export-${identifier}-${nestjs_utility_services_1.PlatformUtility.generateRandomAlpha(16).toLowerCase()}.csv`;
|
|
33
38
|
const url = await this.uploadService.upload({ buffer, originalname }, { folder: `csv-exports/${this.today}` });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.listing.csv.file.js","sourceRoot":"","sources":["../../../src/access/libraries/process.listing.csv.file.ts"],"names":[],"mappings":";;;AAAA,oFAAwI;AACxI,uCAAkC;AAElC,yEAAoE;AAEpE,MAAa,qBAAqB;IAwC9B,YACqB,aAA4B,EAC5B,UAAsB;QADtB,kBAAa,GAAb,aAAa,CAAe;QAC5B,eAAU,GAAV,UAAU,CAAY;QAlBjC,SAAI,GAAa,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"process.listing.csv.file.js","sourceRoot":"","sources":["../../../src/access/libraries/process.listing.csv.file.ts"],"names":[],"mappings":";;;AAAA,oFAAwI;AACxI,uCAAkC;AAElC,yEAAoE;AAEpE,MAAa,qBAAqB;IAwC9B,YACqB,aAA4B,EAC5B,UAAsB;QADtB,kBAAa,GAAb,aAAa,CAAe;QAC5B,eAAU,GAAV,UAAU,CAAY;QAlBjC,SAAI,GAAa,EAAE,CAAC;IAmB1B,CAAC;IASL,KAAK,CAAC,OAAO,CAAC,UAAkB,EAAE,IAAW,EAAE,cAAsB;QACjE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QAC7C,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACjC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;QAErD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAEjD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM;YAAE,MAAM,IAAI,4CAAkB,CAAC,gCAAgC,CAAC,CAAC;QAEzF,IAAI,CAAC,KAAK,GAAG,IAAA,iBAAM,EAAC,IAAI,IAAI,EAAE,EAAE,UAAU,CAAC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C,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC;QACtB,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC;QAEnD,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;CACJ;AA1ND,sDA0NC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SendEmailNotification = void 0;
|
|
4
|
+
const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
|
|
4
5
|
class SendEmailNotification {
|
|
5
6
|
constructor(notification, sendEmailService) {
|
|
6
7
|
this.notification = notification;
|
|
@@ -13,12 +14,14 @@ class SendEmailNotification {
|
|
|
13
14
|
await this.sendMessage(this.notification, user);
|
|
14
15
|
}
|
|
15
16
|
async sendMessage(notification, userId) {
|
|
16
|
-
const
|
|
17
|
+
const user = await nestjs_utility_services_1.UserEntity.findOne({ where: { id: userId } });
|
|
18
|
+
if (!user)
|
|
19
|
+
return;
|
|
17
20
|
const { name, identifier, subject } = notification.template;
|
|
18
21
|
const { payload: emailData, ...rest } = this.data;
|
|
19
22
|
const payload = {
|
|
20
23
|
data: emailData,
|
|
21
|
-
to:
|
|
24
|
+
to: user.email,
|
|
22
25
|
template: identifier,
|
|
23
26
|
subject,
|
|
24
27
|
name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.email.notification.js","sourceRoot":"","sources":["../../../src/access/libraries/send.email.notification.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"send.email.notification.js","sourceRoot":"","sources":["../../../src/access/libraries/send.email.notification.ts"],"names":[],"mappings":";;;AAAA,oFAAoE;AAOpE,MAAa,qBAAqB;IAK9B,YACuB,YAAqC,EACrC,gBAAkC;QADlC,iBAAY,GAAZ,YAAY,CAAyB;QACrC,qBAAgB,GAAhB,gBAAgB,CAAkB;IACrD,CAAC;IAEL,KAAK,CAAC,OAAO,CAAC,OAA+B;QACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ;YAAE,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAC9F,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,YAAqC,EAAE,MAAc;QACnE,MAAM,IAAI,GAAG,MAAM,oCAAU,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;QACjE,IAAI,CAAC,IAAI;YAAE,OAAO;QAElB,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,YAAY,CAAC,QAAQ,CAAC;QAC5D,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QAElD,MAAM,OAAO,GAAgC;YACzC,IAAI,EAAE,SAAS;YACf,EAAE,EAAE,IAAI,CAAC,KAAK;YACd,QAAQ,EAAE,UAAU;YACpB,OAAO;YACP,IAAI;YACJ,GAAG,IAAI;SACV,CAAC;QAEF,MAAM,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC;CACJ;AAnCD,sDAmCC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PropertyService } from '@servicelabsco/nestjs-utility-services';
|
|
2
|
+
import { WhatsappNotificationEntity } from '../../accessUtility/entities/whatsapp.notification.entity';
|
|
2
3
|
import { NotificationPayloadDto } from '../dtos/notification.payload.dto';
|
|
3
4
|
import { WhatsappService } from '../services/whatsapp.service';
|
|
4
|
-
import { WhatsappNotificationEntity } from '../../accessUtility/entities/whatsapp.notification.entity';
|
|
5
5
|
export declare class SendWhatsappMessageNotification {
|
|
6
6
|
private readonly notification;
|
|
7
7
|
private readonly propertyService;
|
|
@@ -25,7 +25,8 @@ class SendWhatsappMessageNotification {
|
|
|
25
25
|
const user = await nestjs_utility_services_1.UserEntity.first(userId);
|
|
26
26
|
if (!user)
|
|
27
27
|
return;
|
|
28
|
-
const
|
|
28
|
+
const dialCode = user.dialing_code ? `${user.dialing_code}` : '+91';
|
|
29
|
+
const number = `${dialCode}${user.mobile}`;
|
|
29
30
|
const endPoint = await this.getEndpoint(number);
|
|
30
31
|
const token = await this.whatsappService.getAuthorizationToken();
|
|
31
32
|
const data = await this.getRequestData(this.payload.data, notification.template);
|
|
@@ -61,7 +62,7 @@ class SendWhatsappMessageNotification {
|
|
|
61
62
|
async getEndpoint(mobile) {
|
|
62
63
|
const baseUrl = await this.getbaseUrl();
|
|
63
64
|
const subAddress = 'api/v2/sendTemplateMessage';
|
|
64
|
-
const queryParams = `?whatsappNumber
|
|
65
|
+
const queryParams = `?whatsappNumber=${mobile}`;
|
|
65
66
|
const url = `${baseUrl}/${subAddress}${queryParams}`;
|
|
66
67
|
return url;
|
|
67
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.whatsapp.message.notification.js","sourceRoot":"","sources":["../../../src/access/libraries/send.whatsapp.message.notification.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"send.whatsapp.message.notification.js","sourceRoot":"","sources":["../../../src/access/libraries/send.whatsapp.message.notification.ts"],"names":[],"mappings":";;;AAAA,oFAAqF;AAKrF,iFAA4E;AAC5E,4EAAuE;AAOvE,MAAa,+BAA+B;IAIxC,YACqB,YAAwC,EACxC,eAAgC,EAChC,eAAgC;QAFhC,iBAAY,GAAZ,YAAY,CAA4B;QACxC,oBAAe,GAAf,eAAe,CAAiB;QAChC,oBAAe,GAAf,eAAe,CAAiB;IAClD,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,OAA+B;QACzC,IAAI,CAAC,KAAK,GAAG,MA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,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;IAClF,CAAC;IAEO,KAAK,CAAC,gBAAgB;QAC1B,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,iCAAiC,EAAE,SAAS,CAAC,CAAC;IACxF,CAAC;IAEO,KAAK,CAAC,UAAU,CAAC,OAAe,EAAE,YAAwC,EAAE,OAAY,EAAE,QAAa;QAC3G,MAAM,EAAE,GAAG,+CAAqB,CAAC,MAAM,CAAC;YACpC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACrC,OAAO;YACP,wBAAwB,EAAE,YAAY,CAAC,EAAE;YACzC,OAAO,EAAE,6CAAoB,CAAC,OAAO;YACrC,OAAO;YACP,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS;YACxC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW;YAC5C,kBAAkB,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,cAAc;SAC7D,CAAC,CAAC;QAEH,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;CACJ;AA5GD,0EA4GC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { MailService, PropertyService, RemoteRequestService
|
|
1
|
+
import { MailService, PropertyService, RemoteRequestService } from '@servicelabsco/nestjs-utility-services';
|
|
2
2
|
import { EmailNotificationPayloadDto } from '../dtos/email.notification.payload.dto';
|
|
3
3
|
export declare class SendEmailService {
|
|
4
4
|
private readonly mailService;
|
|
5
5
|
protected readonly propertyService: PropertyService;
|
|
6
6
|
protected readonly remoteRequestService: RemoteRequestService;
|
|
7
7
|
constructor(mailService: MailService, propertyService: PropertyService, remoteRequestService: RemoteRequestService);
|
|
8
|
-
getUserData(userId: number): Promise<UserEntity>;
|
|
9
8
|
sendEmail(payload: EmailNotificationPayloadDto): Promise<import("@servicelabsco/nestjs-utility-services").MailLogEntity>;
|
|
10
9
|
}
|
|
@@ -19,14 +19,6 @@ let SendEmailService = class SendEmailService {
|
|
|
19
19
|
this.propertyService = propertyService;
|
|
20
20
|
this.remoteRequestService = remoteRequestService;
|
|
21
21
|
}
|
|
22
|
-
async getUserData(userId) {
|
|
23
|
-
if (!userId)
|
|
24
|
-
return;
|
|
25
|
-
const user = await nestjs_utility_services_1.UserEntity.findOne({ where: { id: userId } });
|
|
26
|
-
if (!user)
|
|
27
|
-
return;
|
|
28
|
-
return user;
|
|
29
|
-
}
|
|
30
22
|
sendEmail(payload) {
|
|
31
23
|
return new process_email_notification_1.ProcessEmailNotification(this.mailService, this.propertyService, this.remoteRequestService).process(payload);
|
|
32
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.email.service.js","sourceRoot":"","sources":["../../../src/access/services/send.email.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,oFAAwH;AAExH,wFAAmF;AAG5E,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IACzB,YACqB,WAAwB,EACtB,eAAgC,EAChC,oBAA0C;QAF5C,gBAAW,GAAX,WAAW,CAAa;QACtB,oBAAe,GAAf,eAAe,CAAiB;QAChC,yBAAoB,GAApB,oBAAoB,CAAsB;IAC9D,CAAC;IAEG,
|
|
1
|
+
{"version":3,"file":"send.email.service.js","sourceRoot":"","sources":["../../../src/access/services/send.email.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,oFAAwH;AAExH,wFAAmF;AAG5E,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IACzB,YACqB,WAAwB,EACtB,eAAgC,EAChC,oBAA0C;QAF5C,gBAAW,GAAX,WAAW,CAAa;QACtB,oBAAe,GAAf,eAAe,CAAiB;QAChC,yBAAoB,GAApB,oBAAoB,CAAsB;IAC9D,CAAC;IAEG,SAAS,CAAC,OAAoC;QACjD,OAAO,IAAI,qDAAwB,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5H,CAAC;CACJ,CAAA;AAVY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;qCAGyB,qCAAW;QACL,yCAAe;QACV,8CAAoB;GAJxD,gBAAgB,CAU5B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MigrationUtility } from '@servicelabsco/nestjs-utility-services';
|
|
2
|
+
import { QueryRunner } from 'typeorm';
|
|
3
|
+
export declare class ChangeContentDataTypeSysWhatsappTemplatesTable1718112777127 extends MigrationUtility {
|
|
4
|
+
constructor();
|
|
5
|
+
process(): void;
|
|
6
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
7
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChangeContentDataTypeSysWhatsappTemplatesTable1718112777127 = void 0;
|
|
4
|
+
const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
|
|
5
|
+
class ChangeContentDataTypeSysWhatsappTemplatesTable1718112777127 extends nestjs_utility_services_1.MigrationUtility {
|
|
6
|
+
constructor() {
|
|
7
|
+
super('sys_whatsapp_templates');
|
|
8
|
+
this.process();
|
|
9
|
+
}
|
|
10
|
+
process() { }
|
|
11
|
+
async up(queryRunner) {
|
|
12
|
+
await queryRunner.query(`ALTER TABLE sys_whatsapp_templates ALTER COLUMN content TYPE TEXT`);
|
|
13
|
+
}
|
|
14
|
+
async down(queryRunner) {
|
|
15
|
+
await queryRunner.query(`ALTER TABLE sys_whatsapp_templates ALTER COLUMN content TYPE VARCHAR`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.ChangeContentDataTypeSysWhatsappTemplatesTable1718112777127 = ChangeContentDataTypeSysWhatsappTemplatesTable1718112777127;
|
|
19
|
+
//# sourceMappingURL=1718112777127-ChangeContentDataTypeSysWhatsappTemplatesTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1718112777127-ChangeContentDataTypeSysWhatsappTemplatesTable.js","sourceRoot":"","sources":["../../src/migrations/1718112777127-ChangeContentDataTypeSysWhatsappTemplatesTable.ts"],"names":[],"mappings":";;;AAAA,oFAA0E;AAG1E,MAAa,2DAA4D,SAAQ,0CAAgB;IAC7F;QACI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAChC,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAED,OAAO,KAAI,CAAC;IAEL,KAAK,CAAC,EAAE,CAAC,WAAwB;QACpC,MAAM,WAAW,CAAC,KAAK,CAAC,mEAAmE,CAAC,CAAC;IACjG,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACtC,MAAM,WAAW,CAAC,KAAK,CAAC,sEAAsE,CAAC,CAAC;IACpG,CAAC;CACJ;AAfD,kIAeC"}
|
package/package.json
CHANGED