Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 | 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 97x 403x 403x 403x 97x 3x 3x 3x 97x 28x 28x 28x 28x 97x 55x 55x 55x 55x 55x 97x 2x 2x 2x 2x 2x 97x 155x 155x 155x 155x 155x 97x 12x 12x 12x 12x 97x 2x 2x 2x 2x 97x 3x 3x 3x 3x 3x 97x 15x 15x 15x 15x 15x 15x 97x 98x 98x 98x 98x 98x 98x 97x 7x 7x 7x 7x 7x 7x 7x 97x 4x 4x 4x 4x 4x 4x 97x 15x 15x 15x 15x 15x 97x 2x 2x 2x 2x 2x 97x 2x 2x 2x 2x 2x | import { FeatureToggle, IStrategyConfig, ITag, IVariant } from './model'; export const APPLICATION_CREATED = 'application-created'; // feature event types export const FEATURE_CREATED = 'feature-created'; export const FEATURE_DELETED = 'feature-deleted'; export const FEATURE_UPDATED = 'feature-updated'; export const FEATURE_METADATA_UPDATED = 'feature-metadata-updated'; export const FEATURE_VARIANTS_UPDATED = 'feature-variants-updated'; export const FEATURE_PROJECT_CHANGE = 'feature-project-change'; export const FEATURE_ARCHIVED = 'feature-archived'; export const FEATURE_REVIVED = 'feature-revived'; export const FEATURE_IMPORT = 'feature-import'; export const FEATURE_TAGGED = 'feature-tagged'; export const FEATURE_TAG_IMPORT = 'feature-tag-import'; export const FEATURE_STRATEGY_UPDATE = 'feature-strategy-update'; export const FEATURE_STRATEGY_ADD = 'feature-strategy-add'; export const FEATURE_STRATEGY_REMOVE = 'feature-strategy-remove'; export const DROP_FEATURE_TAGS = 'drop-feature-tags'; export const FEATURE_UNTAGGED = 'feature-untagged'; export const FEATURE_STALE_ON = 'feature-stale-on'; export const FEATURE_STALE_OFF = 'feature-stale-off'; export const DROP_FEATURES = 'drop-features'; export const FEATURE_ENVIRONMENT_ENABLED = 'feature-environment-enabled'; export const FEATURE_ENVIRONMENT_DISABLED = 'feature-environment-disabled'; export const STRATEGY_CREATED = 'strategy-created'; export const STRATEGY_DELETED = 'strategy-deleted'; export const STRATEGY_DEPRECATED = 'strategy-deprecated'; export const STRATEGY_REACTIVATED = 'strategy-reactivated'; export const STRATEGY_UPDATED = 'strategy-updated'; export const STRATEGY_IMPORT = 'strategy-import'; export const DROP_STRATEGIES = 'drop-strategies'; export const CONTEXT_FIELD_CREATED = 'context-field-created'; export const CONTEXT_FIELD_UPDATED = 'context-field-updated'; export const CONTEXT_FIELD_DELETED = 'context-field-deleted'; export const PROJECT_CREATED = 'project-created'; export const PROJECT_UPDATED = 'project-updated'; export const PROJECT_DELETED = 'project-deleted'; export const PROJECT_IMPORT = 'project-import'; export const PROJECT_USER_ADDED = 'project-user-added'; export const PROJECT_USER_REMOVED = 'project-user-removed'; export const PROJECT_USER_ROLE_CHANGED = 'project-user-role-changed'; export const DROP_PROJECTS = 'drop-projects'; export const TAG_CREATED = 'tag-created'; export const TAG_DELETED = 'tag-deleted'; export const TAG_IMPORT = 'tag-import'; export const DROP_TAGS = 'drop-tags'; export const TAG_TYPE_CREATED = 'tag-type-created'; export const TAG_TYPE_DELETED = 'tag-type-deleted'; export const TAG_TYPE_UPDATED = 'tag-type-updated'; export const TAG_TYPE_IMPORT = 'tag-type-import'; export const DROP_TAG_TYPES = 'drop-tag-types'; export const ADDON_CONFIG_CREATED = 'addon-config-created'; export const ADDON_CONFIG_UPDATED = 'addon-config-updated'; export const ADDON_CONFIG_DELETED = 'addon-config-deleted'; export const DB_POOL_UPDATE = 'db-pool-update'; export const USER_CREATED = 'user-created'; export const USER_UPDATED = 'user-updated'; export const USER_DELETED = 'user-deleted'; export const DROP_ENVIRONMENTS = 'drop-environments'; export const ENVIRONMENT_IMPORT = 'environment-import'; export const SEGMENT_CREATED = 'segment-created'; export const SEGMENT_UPDATED = 'segment-updated'; export const SEGMENT_DELETED = 'segment-deleted'; export const CLIENT_METRICS = 'client-metrics'; export interface IBaseEvent { type: string; createdBy: string; project?: string; environment?: string; featureName?: string; data?: any; preData?: any; tags?: ITag[]; } export interface IEvent extends IBaseEvent { id: number; createdAt: Date; } class BaseEvent implements IBaseEvent { readonly type: string; readonly createdBy: string; readonly tags: ITag[]; constructor(type: string, createdBy: string, tags: ITag[] = []) { this.type = type; this.createdBy = createdBy; this.tags = tags; } } export class FeatureStaleEvent extends BaseEvent { readonly project: string; readonly featureName: string; constructor(p: { stale: boolean; project: string; featureName: string; createdBy: string; tags: ITag[]; }) { super( p.stale ? FEATURE_STALE_ON : FEATURE_STALE_OFF, p.createdBy, p.tags, ); this.project = p.project; this.featureName = p.featureName; } } export class FeatureEnvironmentEvent extends BaseEvent { readonly project: string; readonly featureName: string; readonly environment: string; constructor(p: { enabled: boolean; project: string; featureName: string; environment: string; createdBy: string; tags: ITag[]; }) { super( p.enabled ? FEATURE_ENVIRONMENT_ENABLED : FEATURE_ENVIRONMENT_DISABLED, p.createdBy, p.tags, ); this.project = p.project; this.featureName = p.featureName; this.environment = p.environment; } } export class FeatureVariantEvent extends BaseEvent { readonly project: string; readonly featureName: string; readonly data: { variants: IVariant[] }; readonly preData: { variants: IVariant[] }; constructor(p: { project: string; featureName: string; createdBy: string; tags: ITag[]; newVariants: IVariant[]; oldVariants: IVariant[]; }) { super(FEATURE_VARIANTS_UPDATED, p.createdBy, p.tags); this.project = p.project; this.featureName = p.featureName; this.data = { variants: p.newVariants }; this.preData = { variants: p.oldVariants }; } } export class FeatureChangeProjectEvent extends BaseEvent { readonly project: string; readonly featureName: string; readonly data: { oldProject: string; newProject: string; }; constructor(p: { oldProject: string; newProject: string; featureName: string; createdBy: string; tags: ITag[]; }) { super(FEATURE_PROJECT_CHANGE, p.createdBy, p.tags); const { newProject, oldProject, featureName } = p; this.project = newProject; this.featureName = featureName; this.data = { newProject, oldProject }; } } export class FeatureCreatedEvent extends BaseEvent { readonly project: string; readonly featureName: string; readonly data: FeatureToggle; constructor(p: { project: string; featureName: string; createdBy: string; data: FeatureToggle; tags: ITag[]; }) { super(FEATURE_CREATED, p.createdBy, p.tags); const { project, featureName, data } = p; this.project = project; this.featureName = featureName; this.data = data; } } export class FeatureArchivedEvent extends BaseEvent { readonly project: string; readonly featureName: string; constructor(p: { project: string; featureName: string; createdBy: string; tags: ITag[]; }) { super(FEATURE_ARCHIVED, p.createdBy, p.tags); const { project, featureName } = p; this.project = project; this.featureName = featureName; } } export class FeatureRevivedEvent extends BaseEvent { readonly project: string; readonly featureName: string; constructor(p: { project: string; featureName: string; createdBy: string; tags: ITag[]; }) { super(FEATURE_REVIVED, p.createdBy, p.tags); const { project, featureName } = p; this.project = project; this.featureName = featureName; } } export class FeatureDeletedEvent extends BaseEvent { readonly project: string; readonly featureName: string; readonly preData: FeatureToggle; constructor(p: { project: string; featureName: string; preData: FeatureToggle; createdBy: string; tags: ITag[]; }) { super(FEATURE_DELETED, p.createdBy, p.tags); const { project, featureName, preData } = p; this.project = project; this.featureName = featureName; this.preData = preData; } } export class FeatureMetadataUpdateEvent extends BaseEvent { readonly project: string; readonly featureName: string; readonly data: FeatureToggle; readonly preData: FeatureToggle; constructor(p: { featureName: string; createdBy: string; project: string; data: FeatureToggle; preData: FeatureToggle; tags: ITag[]; }) { super(FEATURE_METADATA_UPDATED, p.createdBy, p.tags); const { project, featureName, data, preData } = p; this.project = project; this.featureName = featureName; this.data = data; this.preData = preData; } } export class FeatureStrategyAddEvent extends BaseEvent { readonly project: string; readonly featureName: string; readonly environment: string; readonly data: IStrategyConfig; constructor(p: { project: string; featureName: string; environment: string; createdBy: string; data: IStrategyConfig; tags: ITag[]; }) { super(FEATURE_STRATEGY_ADD, p.createdBy, p.tags); const { project, featureName, environment, data } = p; this.project = project; this.featureName = featureName; this.environment = environment; this.data = data; } } export class FeatureStrategyUpdateEvent extends BaseEvent { readonly project: string; readonly featureName: string; readonly environment: string; readonly data: IStrategyConfig; readonly preData: IStrategyConfig; constructor(p: { project: string; featureName: string; environment: string; createdBy: string; data: IStrategyConfig; preData: IStrategyConfig; tags: ITag[]; }) { super(FEATURE_STRATEGY_UPDATE, p.createdBy, p.tags); const { project, featureName, environment, data, preData } = p; this.project = project; this.featureName = featureName; this.environment = environment; this.data = data; this.preData = preData; } } export class FeatureStrategyRemoveEvent extends BaseEvent { readonly project: string; readonly featureName: string; readonly environment: string; readonly preData: IStrategyConfig; constructor(p: { project: string; featureName: string; environment: string; createdBy: string; preData: IStrategyConfig; tags: ITag[]; }) { super(FEATURE_STRATEGY_REMOVE, p.createdBy, p.tags); const { project, featureName, environment, preData } = p; this.project = project; this.featureName = featureName; this.environment = environment; this.preData = preData; } } export class ProjectUserAddedEvent extends BaseEvent { readonly project: string; readonly data: any; readonly preData: any; constructor(p: { project: string; createdBy: string; data: any }) { super(PROJECT_USER_ADDED, p.createdBy); const { project, data } = p; this.project = project; this.data = data; this.preData = null; } } export class ProjectUserRemovedEvent extends BaseEvent { readonly project: string; readonly data: any; readonly preData: any; constructor(p: { project: string; createdBy: string; preData: any }) { super(PROJECT_USER_REMOVED, p.createdBy); const { project, preData } = p; this.project = project; this.data = null; this.preData = preData; } } export class ProjectUserUpdateRoleEvent extends BaseEvent { readonly project: string; readonly data: any; readonly preData: any; constructor(eventData: { project: string; createdBy: string; data: any; preData: any; }) { super(PROJECT_USER_REMOVED, eventData.createdBy); const { project, data, preData } = eventData; this.project = project; this.data = data; this.preData = preData; } } |