@rowengine/common 1.0.86 → 1.0.87

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.
@@ -0,0 +1 @@
1
+ export * from "./interfaces";
package/build/index.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./interfaces"), exports);
@@ -0,0 +1,27 @@
1
+ import { Center } from "./center";
2
+ import { Company } from "./company";
3
+ import { User } from "./user";
4
+ export interface Activity {
5
+ id: string;
6
+ user: User;
7
+ company: Company;
8
+ project: {
9
+ id: string;
10
+ name: string;
11
+ area: number;
12
+ center: Center;
13
+ /**
14
+ * The percentage of good points on the points cloud.
15
+ */
16
+ goodPointsPercentage?: number;
17
+ /**
18
+ * Processing time in seconds.
19
+ */
20
+ timeElapsed?: number;
21
+ /**
22
+ * Time spent on the queue in seconds.
23
+ */
24
+ timeOnQueue?: number;
25
+ };
26
+ createdAt: Date;
27
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export interface BBox {
2
+ maxx: number;
3
+ maxy: number;
4
+ minx: number;
5
+ miny: number;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export interface Center {
2
+ lat: number;
3
+ lng: number;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ export interface Company {
2
+ id: string;
3
+ name: string;
4
+ blocked: boolean;
5
+ createdAt: Date;
6
+ createdBy: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ export declare enum ExportableType {
2
+ GAPS_REPORT = "GAPS_REPORT",
3
+ BETWEEN_ROWS = "BETWEEN_ROWS",
4
+ TRAMPLING_REPORT = "TRAMPLING_REPORT",
5
+ ROWS_REPORT = "ROWS_REPORT",
6
+ PARALLELISM_POINTS = "PARALLELISM_POINTS",
7
+ PERFORMANCE_REPORT = "PERFORMANCE_REPORT"
8
+ }
9
+ export interface Exportable {
10
+ type: ExportableType;
11
+ options: any;
12
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExportableType = void 0;
4
+ var ExportableType;
5
+ (function (ExportableType) {
6
+ ExportableType["GAPS_REPORT"] = "GAPS_REPORT";
7
+ ExportableType["BETWEEN_ROWS"] = "BETWEEN_ROWS";
8
+ ExportableType["TRAMPLING_REPORT"] = "TRAMPLING_REPORT";
9
+ ExportableType["ROWS_REPORT"] = "ROWS_REPORT";
10
+ ExportableType["PARALLELISM_POINTS"] = "PARALLELISM_POINTS";
11
+ ExportableType["PERFORMANCE_REPORT"] = "PERFORMANCE_REPORT";
12
+ })(ExportableType || (exports.ExportableType = ExportableType = {}));
@@ -0,0 +1,15 @@
1
+ import { Center } from "./center";
2
+ export interface FieldResult {
3
+ success: boolean;
4
+ quantity: number;
5
+ length: number;
6
+ }
7
+ export interface Field {
8
+ id: number;
9
+ name: string;
10
+ area: number;
11
+ center: Center;
12
+ gapsClass: number;
13
+ rows?: FieldResult;
14
+ gaps?: FieldResult;
15
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ export interface Feature {
2
+ type: string;
3
+ properties: any;
4
+ geometry: {
5
+ type: string;
6
+ coordinates: number[] | number[][];
7
+ };
8
+ }
9
+ export interface Geojson {
10
+ type: string;
11
+ features: Feature[];
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ export * from "./company";
2
+ export * from "./user";
3
+ export * from "./center";
4
+ export * from "./project";
5
+ export * from "./geojson";
6
+ export * from "./field";
7
+ export * from "./stagetimes";
8
+ export * from "./bbox";
9
+ export * from "./reload";
10
+ export * from "./activity";
11
+ export * from "./pixviewer-link";
12
+ export * from "./exportable";
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./company"), exports);
18
+ __exportStar(require("./user"), exports);
19
+ __exportStar(require("./center"), exports);
20
+ __exportStar(require("./project"), exports);
21
+ __exportStar(require("./geojson"), exports);
22
+ __exportStar(require("./field"), exports);
23
+ __exportStar(require("./stagetimes"), exports);
24
+ __exportStar(require("./bbox"), exports);
25
+ __exportStar(require("./reload"), exports);
26
+ __exportStar(require("./activity"), exports);
27
+ __exportStar(require("./pixviewer-link"), exports);
28
+ __exportStar(require("./exportable"), exports);
@@ -0,0 +1,6 @@
1
+ import { User } from "./user";
2
+ export interface PixViewerLink {
3
+ user: User;
4
+ token: string;
5
+ createdAt: Date;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,87 @@
1
+ import { BBox } from "./bbox";
2
+ import { Center } from "./center";
3
+ import { Company } from "./company";
4
+ import { Exportable } from "./exportable";
5
+ import { Field } from "./field";
6
+ import { User } from "./user";
7
+ export declare enum ProjectStatus {
8
+ DELETING = "DELETING",
9
+ PENDING_BOUNDARY = "PENDING_BOUNDARY",
10
+ PREPARING = "PREPARING",
11
+ PROCESSING = "PROCESSING",
12
+ FAILED = "FAILED",
13
+ NOT_ENOUGH_CREDITS = "NOT_ENOUGH_CREDITS",
14
+ READY = "READY"
15
+ }
16
+ export declare enum ProviderStatus {
17
+ /** Project got out of exportables queue and now is waiting for analysis. */
18
+ AWAITING_ANALYSIS = "AWAITING_ANALYSIS",
19
+ /** The provider rejected the entire project */
20
+ REJECTED = "REJECTED",
21
+ /** The provider is editing the project. */
22
+ EDITING = "EDITING",
23
+ /** Edited or not, but the provider finished the job. */
24
+ DONE = "DONE",
25
+ /** Awaiting user to accept or reject a full edit by provider. */
26
+ AWAITING_CONFIRMATION = "AWAITING_CONFIRMATION",
27
+ /** User sent local files and we're updating the project files */
28
+ UPDATING = "UPDATING",
29
+ /** Owner of the project refused the full edit and partial result, project wont be charged */
30
+ EDIT_REFUSED = "EDIT_REFUSED",
31
+ /** Owner refused the full edit, but accepted the bot result. */
32
+ PARTIAL_RESULT_ACCEPTED = "PARTIAL_RESULT_ACCEPTED"
33
+ }
34
+ export declare enum ProviderEditMode {
35
+ FAST_EDIT = "FAST_EDIT",
36
+ FULL_EDIT = "FULL_EDIT",
37
+ NO_EDIT = "NO_EDIT"
38
+ }
39
+ export declare enum PixViewerStatus {
40
+ SENDING = "SENDING",
41
+ READY = "READY",
42
+ FAILED = "FAILED",
43
+ NOT_ENOUGH_SPACE = "NOT_ENOUGH_SPACE",
44
+ WAITING_REPORTS = "WAITING_REPORTS"
45
+ }
46
+ export declare enum BonusExportableStatus {
47
+ PENDING_ROWS = "PENDING_ROWS",
48
+ AWAITING_CONFIRMATION = "AWAITING_CONFIRMATION",
49
+ PROCESSING = "PROCESSING",
50
+ READY = "READY",
51
+ FAILED = "FAILED"
52
+ }
53
+ export interface ProjectBonusExportables {
54
+ status: BonusExportableStatus;
55
+ exportables: Exportable[];
56
+ }
57
+ export interface ServiceProvided {
58
+ status: ProviderStatus;
59
+ userEmail?: string;
60
+ editMode?: ProviderEditMode;
61
+ comment?: string;
62
+ }
63
+ export interface GapsOptions {
64
+ minSize: number;
65
+ minActSize: number;
66
+ }
67
+ export interface Project {
68
+ id: string;
69
+ user: User;
70
+ company: Company;
71
+ name: string;
72
+ status: ProjectStatus;
73
+ sizeInMbs: number;
74
+ createdAt: Date;
75
+ locale: "pt-BR" | "en" | "es";
76
+ spacement: number;
77
+ gapsOptions: GapsOptions;
78
+ timeElapsedInSeconds?: number;
79
+ center?: Center;
80
+ area?: number;
81
+ fields?: Field[];
82
+ tilesBBox?: BBox;
83
+ goodPointsPercentage?: number;
84
+ bonusExportables?: ProjectBonusExportables;
85
+ pixViewerStatus?: PixViewerStatus;
86
+ serviceProvided?: ServiceProvided;
87
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BonusExportableStatus = exports.PixViewerStatus = exports.ProviderEditMode = exports.ProviderStatus = exports.ProjectStatus = void 0;
4
+ /* STATUS TO SHOW TO THE USER */
5
+ var ProjectStatus;
6
+ (function (ProjectStatus) {
7
+ ProjectStatus["DELETING"] = "DELETING";
8
+ ProjectStatus["PENDING_BOUNDARY"] = "PENDING_BOUNDARY";
9
+ ProjectStatus["PREPARING"] = "PREPARING";
10
+ ProjectStatus["PROCESSING"] = "PROCESSING";
11
+ ProjectStatus["FAILED"] = "FAILED";
12
+ ProjectStatus["NOT_ENOUGH_CREDITS"] = "NOT_ENOUGH_CREDITS";
13
+ ProjectStatus["READY"] = "READY";
14
+ })(ProjectStatus || (exports.ProjectStatus = ProjectStatus = {}));
15
+ var ProviderStatus;
16
+ (function (ProviderStatus) {
17
+ /** Project got out of exportables queue and now is waiting for analysis. */
18
+ ProviderStatus["AWAITING_ANALYSIS"] = "AWAITING_ANALYSIS";
19
+ /** The provider rejected the entire project */
20
+ ProviderStatus["REJECTED"] = "REJECTED";
21
+ /** The provider is editing the project. */
22
+ ProviderStatus["EDITING"] = "EDITING";
23
+ /** Edited or not, but the provider finished the job. */
24
+ ProviderStatus["DONE"] = "DONE";
25
+ /** Awaiting user to accept or reject a full edit by provider. */
26
+ ProviderStatus["AWAITING_CONFIRMATION"] = "AWAITING_CONFIRMATION";
27
+ /** User sent local files and we're updating the project files */
28
+ ProviderStatus["UPDATING"] = "UPDATING";
29
+ /** Owner of the project refused the full edit and partial result, project wont be charged */
30
+ ProviderStatus["EDIT_REFUSED"] = "EDIT_REFUSED";
31
+ /** Owner refused the full edit, but accepted the bot result. */
32
+ ProviderStatus["PARTIAL_RESULT_ACCEPTED"] = "PARTIAL_RESULT_ACCEPTED";
33
+ })(ProviderStatus || (exports.ProviderStatus = ProviderStatus = {}));
34
+ var ProviderEditMode;
35
+ (function (ProviderEditMode) {
36
+ ProviderEditMode["FAST_EDIT"] = "FAST_EDIT";
37
+ ProviderEditMode["FULL_EDIT"] = "FULL_EDIT";
38
+ ProviderEditMode["NO_EDIT"] = "NO_EDIT";
39
+ })(ProviderEditMode || (exports.ProviderEditMode = ProviderEditMode = {}));
40
+ var PixViewerStatus;
41
+ (function (PixViewerStatus) {
42
+ PixViewerStatus["SENDING"] = "SENDING";
43
+ PixViewerStatus["READY"] = "READY";
44
+ PixViewerStatus["FAILED"] = "FAILED";
45
+ PixViewerStatus["NOT_ENOUGH_SPACE"] = "NOT_ENOUGH_SPACE";
46
+ // Wil not be used anymore.
47
+ PixViewerStatus["WAITING_REPORTS"] = "WAITING_REPORTS";
48
+ })(PixViewerStatus || (exports.PixViewerStatus = PixViewerStatus = {}));
49
+ var BonusExportableStatus;
50
+ (function (BonusExportableStatus) {
51
+ BonusExportableStatus["PENDING_ROWS"] = "PENDING_ROWS";
52
+ BonusExportableStatus["AWAITING_CONFIRMATION"] = "AWAITING_CONFIRMATION";
53
+ BonusExportableStatus["PROCESSING"] = "PROCESSING";
54
+ BonusExportableStatus["READY"] = "READY";
55
+ BonusExportableStatus["FAILED"] = "FAILED";
56
+ })(BonusExportableStatus || (exports.BonusExportableStatus = BonusExportableStatus = {}));
@@ -0,0 +1,9 @@
1
+ import { Company } from "./company";
2
+ export interface Reload {
3
+ id: string;
4
+ company: Company;
5
+ value: number;
6
+ availableValue: number;
7
+ createdAt: Date;
8
+ validUntil: Date;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,31 @@
1
+ import { Company } from "./company";
2
+ import { Project } from "./project";
3
+ /**
4
+ * Store the processing time for each executable/stage in seconds.
5
+ */
6
+ export interface PrepareTimes {
7
+ fastClip: number;
8
+ vegid: number;
9
+ mask: number;
10
+ }
11
+ /**
12
+ * Store the processing time for each executable/stage in seconds.
13
+ */
14
+ export interface ExportablesTimes {
15
+ irserver: number;
16
+ multrline: number;
17
+ gaps: number;
18
+ }
19
+ /**
20
+ * Store the processing time for each executable/stage
21
+ * on the queues (in seconds).
22
+ */
23
+ export interface StageTimes {
24
+ project: Project;
25
+ company: Company;
26
+ date: Date;
27
+ area?: number;
28
+ tiles: number;
29
+ prepare?: PrepareTimes;
30
+ exportables?: ExportablesTimes;
31
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ import { Company } from "./company";
2
+ export declare enum UserLevel {
3
+ Master = "master",
4
+ ServiceProvider = "service_provider",
5
+ Manager = "manager",
6
+ Operator = "operator"
7
+ }
8
+ export interface User {
9
+ id: string;
10
+ email: string;
11
+ company: Company;
12
+ name: string;
13
+ level: UserLevel;
14
+ blocked: boolean;
15
+ password: string;
16
+ createdAt: Date;
17
+ createdBy: string;
18
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserLevel = void 0;
4
+ var UserLevel;
5
+ (function (UserLevel) {
6
+ UserLevel["Master"] = "master";
7
+ UserLevel["ServiceProvider"] = "service_provider";
8
+ UserLevel["Manager"] = "manager";
9
+ UserLevel["Operator"] = "operator";
10
+ })(UserLevel || (exports.UserLevel = UserLevel = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rowengine/common",
3
- "version": "1.0.86",
3
+ "version": "1.0.87",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "exports": {
@@ -39,7 +39,6 @@
39
39
  "node-nats-streaming": "^0.3.2"
40
40
  },
41
41
  "devDependencies": {
42
- "@types/node": "^18.15.11",
43
- "typescript": "^5.5.4"
42
+ "@types/node": "^18.15.11"
44
43
  }
45
44
  }