mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
feat: add permanent option context var (unit tests fail)
This commit is contained in:
@@ -28,6 +28,12 @@ export class ContextVar extends BaseSchema {
|
||||
match: /^[a-z_0-9]+$/,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Prop({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
})
|
||||
permanent?: boolean;
|
||||
}
|
||||
|
||||
export const ContextVarModel: ModelDefinition = {
|
||||
|
||||
@@ -19,6 +19,7 @@ import { TFilterPopulateFields } from '@/utils/types/filter.types';
|
||||
|
||||
import { Label } from './label.schema';
|
||||
import { ChannelData } from './types/channel';
|
||||
import { SubscriberContext } from './types/subscriberContext';
|
||||
|
||||
@Schema({ timestamps: true })
|
||||
export class SubscriberStub extends BaseSchema {
|
||||
@@ -107,6 +108,12 @@ export class SubscriberStub extends BaseSchema {
|
||||
default: null,
|
||||
})
|
||||
avatar?: unknown;
|
||||
|
||||
@Prop({
|
||||
type: Object,
|
||||
default: { vars: {} }, //TODO: add this to the migration
|
||||
})
|
||||
context?: SubscriberContext;
|
||||
}
|
||||
|
||||
@Schema({ timestamps: true })
|
||||
|
||||
3
api/src/chat/schemas/types/subscriberContext.ts
Normal file
3
api/src/chat/schemas/types/subscriberContext.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export interface SubscriberContext {
|
||||
[key: string]: any;
|
||||
}
|
||||
Reference in New Issue
Block a user