@spytecgps/nova-orm 1.4.242 → 1.4.244
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/cache/buildCache.d.ts +48 -0
- package/dist/cache/buildCache.js +1 -0
- package/dist/cache/index.d.ts +1 -1
- package/dist/cache/index.js +1 -1
- package/dist/entities/job.d.ts +42 -1
- package/dist/entities/job.js +1 -1
- package/dist/migration/_virtual/_virtual_multi-entry.js +2 -2
- package/package.json +1 -1
- package/schema.sql +21 -2
- package/dist/cache/buildCacheFromEnv.d.ts +0 -32
- package/dist/cache/buildCacheFromEnv.js +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build the TypeORM `cache:` config object from an explicit Redis config.
|
|
3
|
+
*
|
|
4
|
+
* Consumers own the env-var reading (so the wiring is visible in their config
|
|
5
|
+
* tree) and pass us a plain object. We translate it into the TypeORM-native
|
|
6
|
+
* shape, handling the standalone-vs-cluster fork plus the ElastiCache
|
|
7
|
+
* cluster-mode safety defaults (enableOfflineQueue:false, checkServerIdentity
|
|
8
|
+
* bypass for TLS — see project_elasticache_cluster_ioredis_tls).
|
|
9
|
+
*/
|
|
10
|
+
export type CacheMode = 'standalone' | 'cluster';
|
|
11
|
+
/**
|
|
12
|
+
* `host` is `string | undefined` so consumers can populate this directly from
|
|
13
|
+
* env vars without a guarding ternary — when REDIS_HOST is unset in dev/test,
|
|
14
|
+
* `buildCache()` returns undefined and no cache is installed.
|
|
15
|
+
*/
|
|
16
|
+
export interface RedisConfig {
|
|
17
|
+
host: string | undefined;
|
|
18
|
+
port: number;
|
|
19
|
+
tls: boolean;
|
|
20
|
+
mode: CacheMode;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Matches the shape of TypeORM's `DataSourceOptions.cache`. Fields are typed
|
|
24
|
+
* loose (`any` / `unknown`) deliberately — TypeORM's own type is loose, and
|
|
25
|
+
* tightening here would force `as any` casts at every consumer's callsite when
|
|
26
|
+
* the result is spread into a `DeepPartial<DataSourceOptions>` config tree.
|
|
27
|
+
*/
|
|
28
|
+
export interface BuiltCacheConfig {
|
|
29
|
+
type?: 'ioredis';
|
|
30
|
+
options?: any;
|
|
31
|
+
client?: unknown;
|
|
32
|
+
ignoreErrors?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Returns undefined when `config` is missing or has no host. Consumers can write:
|
|
36
|
+
*
|
|
37
|
+
* redis: {
|
|
38
|
+
* host: process.env.REDIS_HOST, // string | undefined
|
|
39
|
+
* port: Number(process.env.REDIS_PORT ?? '6379'),
|
|
40
|
+
* tls: process.env.REDIS_TLS === 'true',
|
|
41
|
+
* mode: (process.env.REDIS_MODE ?? 'standalone') as Cache.CacheMode,
|
|
42
|
+
* }
|
|
43
|
+
* cache: Cache.buildCache(config.redis)
|
|
44
|
+
*
|
|
45
|
+
* No ternary, no cast. In dev/test where REDIS_HOST is unset the cache is
|
|
46
|
+
* simply not installed.
|
|
47
|
+
*/
|
|
48
|
+
export declare function buildCache(config: RedisConfig | undefined): BuiltCacheConfig | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";let r;exports.buildCache=function(e){if(!e?.host)return;const{host:t,port:o,tls:i,mode:s}=e;if("cluster"===s){const e=function(){if(void 0!==r)return r;try{r=require("ioredis")}catch{r=null}return r}();if(!e)throw new Error("buildCache: mode=cluster requires `ioredis` to be installed");return{client:new e.Cluster([{host:t,port:o}],{redisOptions:i?{tls:{checkServerIdentity:()=>{}}}:{},enableOfflineQueue:!1}),ignoreErrors:!0}}return{type:"ioredis",options:{host:t,port:o,tls:i?{}:void 0},ignoreErrors:!0}};
|
package/dist/cache/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { attachIoredisErrorHandler, RedisQueryResultCacheLike } from './attachIoredisErrorHandler';
|
|
2
|
-
export {
|
|
2
|
+
export { buildCache, BuiltCacheConfig, CacheMode, RedisConfig } from './buildCache';
|
|
3
3
|
export { CacheKind, InstrumentedQueryResultCache, InstrumentedQueryResultCacheOptions, } from './InstrumentedQueryResultCache';
|
|
4
4
|
export { LruQueryResultCache, LruQueryResultCacheConfig } from './LruQueryResultCache';
|
package/dist/cache/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./attachIoredisErrorHandler.js"),r=require("./
|
|
1
|
+
"use strict";var e=require("./attachIoredisErrorHandler.js"),r=require("./buildCache.js"),u=require("./InstrumentedQueryResultCache.js"),t=require("./LruQueryResultCache.js");exports.attachIoredisErrorHandler=e.attachIoredisErrorHandler,exports.buildCache=r.buildCache,exports.InstrumentedQueryResultCache=u.InstrumentedQueryResultCache,exports.LruQueryResultCache=t.LruQueryResultCache;
|
package/dist/entities/job.d.ts
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Legacy three-state status. The processor keeps this in sync with `lifecycle`
|
|
3
|
+
* via {@link deriveLegacyStatus} so existing FE callers continue to work while
|
|
4
|
+
* the three-axis model rolls out.
|
|
5
|
+
*/
|
|
6
|
+
export type JobStatus = 'Upcoming' | 'In Progress' | 'Completed' | 'Cancelled';
|
|
7
|
+
/**
|
|
8
|
+
* Mutually exclusive lifecycle phase. Exactly one at any time.
|
|
9
|
+
* Drives the primary status chip on the job card.
|
|
10
|
+
*/
|
|
11
|
+
export type JobLifecycle = 'Upcoming' | 'AwaitingUpdate' | 'AtOrigin' | 'InProgress' | 'Arriving' | 'Arrived' | 'Complete' | 'Cancelled';
|
|
12
|
+
/**
|
|
13
|
+
* Non-exclusive health signals. Zero or more apply at once.
|
|
14
|
+
*/
|
|
15
|
+
export type JobHealthChip = 'OnTrack' | 'Delayed' | 'DelayedStart' | 'NotReporting' | 'RuleViolation' | 'LowBattery';
|
|
16
|
+
/**
|
|
17
|
+
* Arrival evidence state. Mutually exclusive.
|
|
18
|
+
*/
|
|
19
|
+
export type JobProofState = 'NotArrived' | 'FirstObserved' | 'ArrivalConfirmed' | 'Unknown';
|
|
20
|
+
/** Derived when lifecycle reaches Complete. */
|
|
21
|
+
export type JobOutcome = 'on_time' | 'late' | 'early';
|
|
2
22
|
export interface JobRule {
|
|
3
23
|
id: string;
|
|
4
24
|
kind: string;
|
|
@@ -6,6 +26,7 @@ export interface JobRule {
|
|
|
6
26
|
config?: Record<string, unknown>;
|
|
7
27
|
violated?: boolean;
|
|
8
28
|
violationDetail?: string;
|
|
29
|
+
violatedAt?: string;
|
|
9
30
|
}
|
|
10
31
|
export interface JobTimelineEvent {
|
|
11
32
|
id: string;
|
|
@@ -13,23 +34,43 @@ export interface JobTimelineEvent {
|
|
|
13
34
|
time: string;
|
|
14
35
|
kind?: 'now' | 'alert' | 'info';
|
|
15
36
|
}
|
|
37
|
+
export declare const ACTIVE_JOB_LIFECYCLES: ReadonlySet<JobLifecycle>;
|
|
38
|
+
export declare const deriveLegacyStatus: (lifecycle: JobLifecycle) => JobStatus;
|
|
16
39
|
export declare class Job {
|
|
17
40
|
id: number;
|
|
18
41
|
clientId: number;
|
|
19
42
|
imei: string;
|
|
20
43
|
name: string;
|
|
44
|
+
/** Legacy three-state — kept in sync with {@link lifecycle} by the processor. */
|
|
21
45
|
status: JobStatus;
|
|
46
|
+
lifecycle: JobLifecycle;
|
|
47
|
+
healthChips: JobHealthChip[] | null;
|
|
48
|
+
proofState: JobProofState;
|
|
49
|
+
outcome: JobOutcome | null;
|
|
22
50
|
startLat: number | null;
|
|
23
51
|
startLng: number | null;
|
|
24
52
|
startLabel: string | null;
|
|
25
53
|
startDetail: string | null;
|
|
54
|
+
startRadiusM: number;
|
|
26
55
|
endLat: number | null;
|
|
27
56
|
endLng: number | null;
|
|
28
57
|
endLabel: string | null;
|
|
29
58
|
endDetail: string | null;
|
|
59
|
+
endRadiusM: number;
|
|
30
60
|
scheduledStart: Date | null;
|
|
31
61
|
targetArrival: Date | null;
|
|
62
|
+
startedAt: Date | null;
|
|
63
|
+
firstObservedAt: Date | null;
|
|
32
64
|
arrivedAt: Date | null;
|
|
65
|
+
completedAt: Date | null;
|
|
66
|
+
cancelledAt: Date | null;
|
|
67
|
+
pingsInEndZone: number;
|
|
68
|
+
lastPositionAt: Date | null;
|
|
69
|
+
lastEvaluatedAt: Date | null;
|
|
70
|
+
etaArrivalAt: Date | null;
|
|
71
|
+
etaUpdatedAt: Date | null;
|
|
72
|
+
etaDriveSeconds: number | null;
|
|
73
|
+
etaDistanceMeters: number | null;
|
|
33
74
|
rules: JobRule[] | null;
|
|
34
75
|
timeline: JobTimelineEvent[] | null;
|
|
35
76
|
liveLinkToken: string | null;
|
package/dist/entities/job.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../node_modules/tslib/tslib.es6.js"),t=require("typeorm"),a=require("../utils/uuidTransformer.js");exports.Job=class Job{id;clientId;imei;name;status;startLat;startLng;startLabel;startDetail;endLat;endLng;endLabel;endDetail;scheduledStart;targetArrival;arrivedAt;rules;timeline;liveLinkToken;createdBy;createdAt;modifiedBy;modifiedAt;deletedAt;deletedBy},e.__decorate([t.PrimaryGeneratedColumn({type:"int",name:"id"}),e.__metadata("design:type",Number)],exports.Job.prototype,"id",void 0),e.__decorate([t.Column("int",{name:"clientId"}),e.__metadata("design:type",Number)],exports.Job.prototype,"clientId",void 0),e.__decorate([t.Column("varchar",{name:"imei",length:15}),e.__metadata("design:type",String)],exports.Job.prototype,"imei",void 0),e.__decorate([t.Column("varchar",{name:"name",length:255}),e.__metadata("design:type",String)],exports.Job.prototype,"name",void 0),e.__decorate([t.Column("varchar",{name:"status",length:20}),e.__metadata("design:type",String)],exports.Job.prototype,"status",void 0),e.__decorate([t.Column("double",{name:"startLat",nullable:!0}),e.__metadata("design:type",Number)],exports.Job.prototype,"startLat",void 0),e.__decorate([t.Column("double",{name:"startLng",nullable:!0}),e.__metadata("design:type",Number)],exports.Job.prototype,"startLng",void 0),e.__decorate([t.Column("varchar",{name:"startLabel",length:500,nullable:!0}),e.__metadata("design:type",String)],exports.Job.prototype,"startLabel",void 0),e.__decorate([t.Column("varchar",{name:"startDetail",length:500,nullable:!0}),e.__metadata("design:type",String)],exports.Job.prototype,"startDetail",void 0),e.__decorate([t.Column("double",{name:"endLat",nullable:!0}),e.__metadata("design:type",Number)],exports.Job.prototype,"endLat",void 0),e.__decorate([t.Column("double",{name:"endLng",nullable:!0}),e.__metadata("design:type",Number)],exports.Job.prototype,"endLng",void 0),e.__decorate([t.Column("varchar",{name:"endLabel",length:500,nullable:!0}),e.__metadata("design:type",String)],exports.Job.prototype,"endLabel",void 0),e.__decorate([t.Column("varchar",{name:"endDetail",length:500,nullable:!0}),e.__metadata("design:type",String)],exports.Job.prototype,"endDetail",void 0),e.__decorate([t.Column("datetime",{name:"scheduledStart",nullable:!0}),e.__metadata("design:type",Date)],exports.Job.prototype,"scheduledStart",void 0),e.__decorate([t.Column("datetime",{name:"targetArrival",nullable:!0}),e.__metadata("design:type",Date)],exports.Job.prototype,"targetArrival",void 0),e.__decorate([t.Column("datetime",{name:"arrivedAt",nullable:!0}),e.__metadata("design:type",Date)],exports.Job.prototype,"arrivedAt",void 0),e.__decorate([t.Column("json",{name:"rules",nullable:!0}),e.__metadata("design:type",Array)],exports.Job.prototype,"rules",void 0),e.__decorate([t.Column("json",{name:"timeline",nullable:!0}),e.__metadata("design:type",Array)],exports.Job.prototype,"timeline",void 0),e.__decorate([t.Column("binary",{name:"liveLinkToken",length:16,nullable:!0,transformer:a.UUIDTransformer}),e.__metadata("design:type",String)],exports.Job.prototype,"liveLinkToken",void 0),e.__decorate([t.Column("binary",{name:"createdBy",length:16,transformer:a.UUIDTransformer}),e.__metadata("design:type",String)],exports.Job.prototype,"createdBy",void 0),e.__decorate([t.CreateDateColumn({name:"createdAt"}),e.__metadata("design:type",Date)],exports.Job.prototype,"createdAt",void 0),e.__decorate([t.Column("binary",{name:"modifiedBy",length:16,nullable:!0,transformer:a.UUIDTransformer}),e.__metadata("design:type",String)],exports.Job.prototype,"modifiedBy",void 0),e.__decorate([t.UpdateDateColumn({name:"modifiedAt",nullable:!0}),e.__metadata("design:type",Date)],exports.Job.prototype,"modifiedAt",void 0),e.__decorate([t.DeleteDateColumn({name:"deletedAt",nullable:!0}),e.__metadata("design:type",Date)],exports.Job.prototype,"deletedAt",void 0),e.__decorate([t.Column("binary",{name:"deletedBy",length:16,nullable:!0,transformer:a.UUIDTransformer}),e.__metadata("design:type",String)],exports.Job.prototype,"deletedBy",void 0),exports.Job=e.__decorate([t.Index("ixJobClientIdStatus",["clientId","status"],{}),t.Index("ixJobClientIdCreatedBy",["clientId","createdBy"],{}),t.Index("uxJobLiveLinkToken",["liveLinkToken"],{unique:!0}),t.Entity("job",{schema:"nova"})],exports.Job);
|
|
1
|
+
"use strict";var e=require("../node_modules/tslib/tslib.es6.js"),t=require("typeorm"),a=require("../utils/uuidTransformer.js");exports.Job=class Job{id;clientId;imei;name;status;lifecycle;healthChips;proofState;outcome;startLat;startLng;startLabel;startDetail;startRadiusM;endLat;endLng;endLabel;endDetail;endRadiusM;scheduledStart;targetArrival;startedAt;firstObservedAt;arrivedAt;completedAt;cancelledAt;pingsInEndZone;lastPositionAt;lastEvaluatedAt;etaArrivalAt;etaUpdatedAt;etaDriveSeconds;etaDistanceMeters;rules;timeline;liveLinkToken;createdBy;createdAt;modifiedBy;modifiedAt;deletedAt;deletedBy},e.__decorate([t.PrimaryGeneratedColumn({type:"int",name:"id"}),e.__metadata("design:type",Number)],exports.Job.prototype,"id",void 0),e.__decorate([t.Column("int",{name:"clientId"}),e.__metadata("design:type",Number)],exports.Job.prototype,"clientId",void 0),e.__decorate([t.Column("varchar",{name:"imei",length:15}),e.__metadata("design:type",String)],exports.Job.prototype,"imei",void 0),e.__decorate([t.Column("varchar",{name:"name",length:255}),e.__metadata("design:type",String)],exports.Job.prototype,"name",void 0),e.__decorate([t.Column("varchar",{name:"status",length:20}),e.__metadata("design:type",String)],exports.Job.prototype,"status",void 0),e.__decorate([t.Column("varchar",{name:"lifecycle",length:20,default:"Upcoming"}),e.__metadata("design:type",String)],exports.Job.prototype,"lifecycle",void 0),e.__decorate([t.Column("json",{name:"healthChips",nullable:!0}),e.__metadata("design:type",Array)],exports.Job.prototype,"healthChips",void 0),e.__decorate([t.Column("varchar",{name:"proofState",length:20,default:"NotArrived"}),e.__metadata("design:type",String)],exports.Job.prototype,"proofState",void 0),e.__decorate([t.Column("varchar",{name:"outcome",length:10,nullable:!0}),e.__metadata("design:type",String)],exports.Job.prototype,"outcome",void 0),e.__decorate([t.Column("double",{name:"startLat",nullable:!0}),e.__metadata("design:type",Number)],exports.Job.prototype,"startLat",void 0),e.__decorate([t.Column("double",{name:"startLng",nullable:!0}),e.__metadata("design:type",Number)],exports.Job.prototype,"startLng",void 0),e.__decorate([t.Column("varchar",{name:"startLabel",length:500,nullable:!0}),e.__metadata("design:type",String)],exports.Job.prototype,"startLabel",void 0),e.__decorate([t.Column("varchar",{name:"startDetail",length:500,nullable:!0}),e.__metadata("design:type",String)],exports.Job.prototype,"startDetail",void 0),e.__decorate([t.Column("int",{name:"startRadiusM",default:150}),e.__metadata("design:type",Number)],exports.Job.prototype,"startRadiusM",void 0),e.__decorate([t.Column("double",{name:"endLat",nullable:!0}),e.__metadata("design:type",Number)],exports.Job.prototype,"endLat",void 0),e.__decorate([t.Column("double",{name:"endLng",nullable:!0}),e.__metadata("design:type",Number)],exports.Job.prototype,"endLng",void 0),e.__decorate([t.Column("varchar",{name:"endLabel",length:500,nullable:!0}),e.__metadata("design:type",String)],exports.Job.prototype,"endLabel",void 0),e.__decorate([t.Column("varchar",{name:"endDetail",length:500,nullable:!0}),e.__metadata("design:type",String)],exports.Job.prototype,"endDetail",void 0),e.__decorate([t.Column("int",{name:"endRadiusM",default:150}),e.__metadata("design:type",Number)],exports.Job.prototype,"endRadiusM",void 0),e.__decorate([t.Column("datetime",{name:"scheduledStart",nullable:!0}),e.__metadata("design:type",Date)],exports.Job.prototype,"scheduledStart",void 0),e.__decorate([t.Column("datetime",{name:"targetArrival",nullable:!0}),e.__metadata("design:type",Date)],exports.Job.prototype,"targetArrival",void 0),e.__decorate([t.Column("datetime",{name:"startedAt",nullable:!0}),e.__metadata("design:type",Date)],exports.Job.prototype,"startedAt",void 0),e.__decorate([t.Column("datetime",{name:"firstObservedAt",nullable:!0}),e.__metadata("design:type",Date)],exports.Job.prototype,"firstObservedAt",void 0),e.__decorate([t.Column("datetime",{name:"arrivedAt",nullable:!0}),e.__metadata("design:type",Date)],exports.Job.prototype,"arrivedAt",void 0),e.__decorate([t.Column("datetime",{name:"completedAt",nullable:!0}),e.__metadata("design:type",Date)],exports.Job.prototype,"completedAt",void 0),e.__decorate([t.Column("datetime",{name:"cancelledAt",nullable:!0}),e.__metadata("design:type",Date)],exports.Job.prototype,"cancelledAt",void 0),e.__decorate([t.Column("int",{name:"pingsInEndZone",default:0}),e.__metadata("design:type",Number)],exports.Job.prototype,"pingsInEndZone",void 0),e.__decorate([t.Column("datetime",{name:"lastPositionAt",nullable:!0}),e.__metadata("design:type",Date)],exports.Job.prototype,"lastPositionAt",void 0),e.__decorate([t.Column("datetime",{name:"lastEvaluatedAt",nullable:!0}),e.__metadata("design:type",Date)],exports.Job.prototype,"lastEvaluatedAt",void 0),e.__decorate([t.Column("datetime",{name:"etaArrivalAt",nullable:!0}),e.__metadata("design:type",Date)],exports.Job.prototype,"etaArrivalAt",void 0),e.__decorate([t.Column("datetime",{name:"etaUpdatedAt",nullable:!0}),e.__metadata("design:type",Date)],exports.Job.prototype,"etaUpdatedAt",void 0),e.__decorate([t.Column("int",{name:"etaDriveSeconds",nullable:!0}),e.__metadata("design:type",Number)],exports.Job.prototype,"etaDriveSeconds",void 0),e.__decorate([t.Column("int",{name:"etaDistanceMeters",nullable:!0}),e.__metadata("design:type",Number)],exports.Job.prototype,"etaDistanceMeters",void 0),e.__decorate([t.Column("json",{name:"rules",nullable:!0}),e.__metadata("design:type",Array)],exports.Job.prototype,"rules",void 0),e.__decorate([t.Column("json",{name:"timeline",nullable:!0}),e.__metadata("design:type",Array)],exports.Job.prototype,"timeline",void 0),e.__decorate([t.Column("binary",{name:"liveLinkToken",length:16,nullable:!0,transformer:a.UUIDTransformer}),e.__metadata("design:type",String)],exports.Job.prototype,"liveLinkToken",void 0),e.__decorate([t.Column("binary",{name:"createdBy",length:16,transformer:a.UUIDTransformer}),e.__metadata("design:type",String)],exports.Job.prototype,"createdBy",void 0),e.__decorate([t.CreateDateColumn({name:"createdAt"}),e.__metadata("design:type",Date)],exports.Job.prototype,"createdAt",void 0),e.__decorate([t.Column("binary",{name:"modifiedBy",length:16,nullable:!0,transformer:a.UUIDTransformer}),e.__metadata("design:type",String)],exports.Job.prototype,"modifiedBy",void 0),e.__decorate([t.UpdateDateColumn({name:"modifiedAt",nullable:!0}),e.__metadata("design:type",Date)],exports.Job.prototype,"modifiedAt",void 0),e.__decorate([t.DeleteDateColumn({name:"deletedAt",nullable:!0}),e.__metadata("design:type",Date)],exports.Job.prototype,"deletedAt",void 0),e.__decorate([t.Column("binary",{name:"deletedBy",length:16,nullable:!0,transformer:a.UUIDTransformer}),e.__metadata("design:type",String)],exports.Job.prototype,"deletedBy",void 0),exports.Job=e.__decorate([t.Index("ixJobClientIdStatus",["clientId","status"],{}),t.Index("ixJobClientIdLifecycle",["clientId","lifecycle"],{}),t.Index("ixJobImeiLifecycle",["imei","lifecycle"],{}),t.Index("ixJobClientIdCreatedBy",["clientId","createdBy"],{}),t.Index("uxJobLiveLinkToken",["liveLinkToken"],{unique:!0}),t.Entity("job",{schema:"nova"})],exports.Job);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var _1684483704434AddLowerCaseIndex = require('../1684483704434-addLowerCaseIndex.js');
|
|
4
|
+
var _1746434400000AddQuickSearchFulltextIndexes = require('../1746434400000-addQuickSearchFulltextIndexes.js');
|
|
4
5
|
var _1684483705001UpdateSecurityUserViewsV1 = require('../1684483705001-updateSecurityUserViewsV1.js');
|
|
5
6
|
var _1684483705002UpdateSecurityUserViewsV2 = require('../1684483705002-updateSecurityUserViewsV2.js');
|
|
6
|
-
var _1746434400000AddQuickSearchFulltextIndexes = require('../1746434400000-addQuickSearchFulltextIndexes.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
exports.addLowerCaseIndex1684483704434 = _1684483704434AddLowerCaseIndex.addLowerCaseIndex1684483704434;
|
|
11
|
+
exports.addQuickSearchFulltextIndexes1746434400000 = _1746434400000AddQuickSearchFulltextIndexes.addQuickSearchFulltextIndexes1746434400000;
|
|
11
12
|
exports.updateSecurityUserViewsV11684483705001 = _1684483705001UpdateSecurityUserViewsV1.updateSecurityUserViewsV11684483705001;
|
|
12
13
|
exports.updateSecurityUserViewsV21684483705002 = _1684483705002UpdateSecurityUserViewsV2.updateSecurityUserViewsV21684483705002;
|
|
13
|
-
exports.addQuickSearchFulltextIndexes1746434400000 = _1746434400000AddQuickSearchFulltextIndexes.addQuickSearchFulltextIndexes1746434400000;
|
package/package.json
CHANGED
package/schema.sql
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
-- nova-orm-schema-checksum:
|
|
1
|
+
-- nova-orm-schema-checksum: e9c87b87d49ceaf19de90f926e849568
|
|
2
2
|
-- Nova ORM Schema Dump
|
|
3
|
-
-- Generated at: 2026-05-
|
|
3
|
+
-- Generated at: 2026-05-25T14:56:50.616Z
|
|
4
4
|
|
|
5
5
|
SET FOREIGN_KEY_CHECKS = 0;
|
|
6
6
|
|
|
@@ -2229,17 +2229,34 @@ CREATE TABLE `job` (
|
|
|
2229
2229
|
`imei` varchar(15) NOT NULL,
|
|
2230
2230
|
`name` varchar(255) NOT NULL,
|
|
2231
2231
|
`status` varchar(20) NOT NULL,
|
|
2232
|
+
`lifecycle` varchar(20) NOT NULL DEFAULT 'Upcoming',
|
|
2233
|
+
`healthChips` json DEFAULT NULL,
|
|
2234
|
+
`proofState` varchar(20) NOT NULL DEFAULT 'NotArrived',
|
|
2235
|
+
`outcome` varchar(10) DEFAULT NULL,
|
|
2232
2236
|
`startLat` double DEFAULT NULL,
|
|
2233
2237
|
`startLng` double DEFAULT NULL,
|
|
2234
2238
|
`startLabel` varchar(500) DEFAULT NULL,
|
|
2235
2239
|
`startDetail` varchar(500) DEFAULT NULL,
|
|
2240
|
+
`startRadiusM` int NOT NULL DEFAULT '150',
|
|
2236
2241
|
`endLat` double DEFAULT NULL,
|
|
2237
2242
|
`endLng` double DEFAULT NULL,
|
|
2238
2243
|
`endLabel` varchar(500) DEFAULT NULL,
|
|
2239
2244
|
`endDetail` varchar(500) DEFAULT NULL,
|
|
2245
|
+
`endRadiusM` int NOT NULL DEFAULT '150',
|
|
2240
2246
|
`scheduledStart` datetime DEFAULT NULL,
|
|
2241
2247
|
`targetArrival` datetime DEFAULT NULL,
|
|
2248
|
+
`startedAt` datetime DEFAULT NULL,
|
|
2249
|
+
`firstObservedAt` datetime DEFAULT NULL,
|
|
2242
2250
|
`arrivedAt` datetime DEFAULT NULL,
|
|
2251
|
+
`completedAt` datetime DEFAULT NULL,
|
|
2252
|
+
`cancelledAt` datetime DEFAULT NULL,
|
|
2253
|
+
`pingsInEndZone` int NOT NULL DEFAULT '0',
|
|
2254
|
+
`lastPositionAt` datetime DEFAULT NULL,
|
|
2255
|
+
`lastEvaluatedAt` datetime DEFAULT NULL,
|
|
2256
|
+
`etaArrivalAt` datetime DEFAULT NULL,
|
|
2257
|
+
`etaUpdatedAt` datetime DEFAULT NULL,
|
|
2258
|
+
`etaDriveSeconds` int DEFAULT NULL,
|
|
2259
|
+
`etaDistanceMeters` int DEFAULT NULL,
|
|
2243
2260
|
`rules` json DEFAULT NULL,
|
|
2244
2261
|
`timeline` json DEFAULT NULL,
|
|
2245
2262
|
`liveLinkToken` binary(16) DEFAULT NULL,
|
|
@@ -2252,6 +2269,8 @@ CREATE TABLE `job` (
|
|
|
2252
2269
|
PRIMARY KEY (`id`),
|
|
2253
2270
|
UNIQUE KEY `uxJobLiveLinkToken` (`liveLinkToken`),
|
|
2254
2271
|
KEY `ixJobClientIdCreatedBy` (`clientId`,`createdBy`),
|
|
2272
|
+
KEY `ixJobImeiLifecycle` (`imei`,`lifecycle`),
|
|
2273
|
+
KEY `ixJobClientIdLifecycle` (`clientId`,`lifecycle`),
|
|
2255
2274
|
KEY `ixJobClientIdStatus` (`clientId`,`status`)
|
|
2256
2275
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
|
2257
2276
|
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Build the TypeORM `cache:` config object from REDIS_* env vars so consumers
|
|
3
|
-
* don't have to embed mode-switching logic in every service. SSM-driven
|
|
4
|
-
* `/${stage}/cache/<name>/redis/{host,port,tls,mode}` keys map 1:1 to the env
|
|
5
|
-
* vars and this helper returns the right TypeORM shape.
|
|
6
|
-
*
|
|
7
|
-
* Returns undefined if REDIS_HOST is absent, so it's safe to spread into a
|
|
8
|
-
* DataSource config that may or may not have a cache configured.
|
|
9
|
-
*
|
|
10
|
-
* Supported modes:
|
|
11
|
-
* - "standalone" (default): uses TypeORM's built-in RedisQueryResultCache
|
|
12
|
-
* with the `ioredis` client type. One node, no cluster topology.
|
|
13
|
-
* - "cluster": custom client passed through TypeORM's `client` field; uses
|
|
14
|
-
* `ioredis` Cluster mode with the ElastiCache-cluster-mode safety
|
|
15
|
-
* defaults baked in (enableOfflineQueue:false, checkServerIdentity bypass
|
|
16
|
-
* for TLS — see project_elasticache_cluster_ioredis_tls).
|
|
17
|
-
*/
|
|
18
|
-
export type CacheMode = 'standalone' | 'cluster';
|
|
19
|
-
export interface CacheFromEnvOptions {
|
|
20
|
-
/** Env var name for host. Default: REDIS_HOST. Override to support multiple caches in one process. */
|
|
21
|
-
hostEnv?: string;
|
|
22
|
-
portEnv?: string;
|
|
23
|
-
tlsEnv?: string;
|
|
24
|
-
modeEnv?: string;
|
|
25
|
-
}
|
|
26
|
-
export interface BuiltCacheConfig {
|
|
27
|
-
type?: 'ioredis';
|
|
28
|
-
options?: Record<string, unknown>;
|
|
29
|
-
client?: unknown;
|
|
30
|
-
ignoreErrors?: boolean;
|
|
31
|
-
}
|
|
32
|
-
export declare function buildCacheFromEnv(options?: CacheFromEnvOptions): BuiltCacheConfig | undefined;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";let e;exports.buildCacheFromEnv=function(r={}){const t=r.hostEnv??"REDIS_HOST",n=r.portEnv??"REDIS_PORT",o=r.tlsEnv??"REDIS_TLS",s=r.modeEnv??"REDIS_MODE",i=process.env[t];if(!i)return;const u=Number(process.env[n]??"6379"),c="true"===process.env[o];if("cluster"===(process.env[s]??"standalone")){const r=function(){if(void 0!==e)return e;try{e=require("ioredis")}catch{e=null}return e}();if(!r)throw new Error("buildCacheFromEnv: REDIS_MODE=cluster requires `ioredis` to be installed");return{client:new r.Cluster([{host:i,port:u}],{redisOptions:c?{tls:{checkServerIdentity:()=>{}}}:{},enableOfflineQueue:!1}),ignoreErrors:!0}}return{type:"ioredis",options:{host:i,port:u,tls:c?{}:void 0},ignoreErrors:!0}};
|