@neuralinnovations/dataisland-sdk 0.6.9 → 0.6.10
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/package.json +1 -1
- package/dist/src/storages/queryFlows/queryFlow.d.ts +1 -0
- package/dist/src/storages/queryFlows/queryFlow.d.ts.map +1 -1
- package/dist/src/storages/queryFlows/queryFlow.impl.d.ts.map +1 -1
- package/dist/src/storages/queryFlows/queryFlow.impl.js +0 -4
- package/dist/src/storages/queryFlows/queryFlow.impl.js.map +1 -1
- package/dist/src/storages/queryFlows/queryFlow.js.map +1 -1
- package/dist/src/storages/queryFlows/queryFlows.impl.d.ts +3 -0
- package/dist/src/storages/queryFlows/queryFlows.impl.d.ts.map +1 -1
- package/dist/src/storages/queryFlows/queryFlows.impl.js +22 -0
- package/dist/src/storages/queryFlows/queryFlows.impl.js.map +1 -1
- package/package.json +1 -1
- package/src/storages/queryFlows/queryFlow.impl.ts +0 -4
- package/src/storages/queryFlows/queryFlow.ts +2 -0
- package/src/storages/queryFlows/queryFlows.impl.ts +39 -10
package/dist/package.json
CHANGED
|
@@ -10,5 +10,6 @@ export declare abstract class QueryFlow extends EventDispatcher<QueryFlowEvent,
|
|
|
10
10
|
abstract get state(): QueryFlowState;
|
|
11
11
|
abstract get status(): QueryFlowStatus;
|
|
12
12
|
abstract get urls(): QueryFileUrlDto[] | undefined;
|
|
13
|
+
abstract fetch(): any;
|
|
13
14
|
}
|
|
14
15
|
//# sourceMappingURL=queryFlow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryFlow.d.ts","sourceRoot":"","sources":["../../../../src/storages/queryFlows/queryFlow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EACL,eAAe,EACf,cAAc,EACd,eAAe,EAChB,MAAM,6BAA6B,CAAA;AAEpC,oBAAY,cAAc;IACxB,OAAO,YAAY;CACpB;AAED,8BAAsB,SAAU,SAAQ,eAAe,CACrD,cAAc,EACd,SAAS,CACV;IAEC,QAAQ,KAAK,EAAE,IAAI,MAAM,CAAA;IAEzB,QAAQ,KAAK,IAAI,IAAI,MAAM,CAAA;IAE3B,QAAQ,KAAK,KAAK,IAAI,cAAc,CAAA;IAEpC,QAAQ,KAAK,MAAM,IAAI,eAAe,CAAA;IAEtC,QAAQ,KAAK,IAAI,IAAI,eAAe,EAAE,GAAG,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"queryFlow.d.ts","sourceRoot":"","sources":["../../../../src/storages/queryFlows/queryFlow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EACL,eAAe,EACf,cAAc,EACd,eAAe,EAChB,MAAM,6BAA6B,CAAA;AAEpC,oBAAY,cAAc;IACxB,OAAO,YAAY;CACpB;AAED,8BAAsB,SAAU,SAAQ,eAAe,CACrD,cAAc,EACd,SAAS,CACV;IAEC,QAAQ,KAAK,EAAE,IAAI,MAAM,CAAA;IAEzB,QAAQ,KAAK,IAAI,IAAI,MAAM,CAAA;IAE3B,QAAQ,KAAK,KAAK,IAAI,cAAc,CAAA;IAEpC,QAAQ,KAAK,MAAM,IAAI,eAAe,CAAA;IAEtC,QAAQ,KAAK,IAAI,IAAI,eAAe,EAAE,GAAG,SAAS,CAAA;IAElD,QAAQ,CAAC,KAAK,IAAI,GAAG;CAEtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryFlow.impl.d.ts","sourceRoot":"","sources":["../../../../src/storages/queryFlows/queryFlow.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,aAAa,CAAA;AACvD,OAAO,EACL,eAAe,EAEf,cAAc,EACd,eAAe,EAChB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAIvC,qBAAa,aAAc,SAAQ,SAAS;IAI9B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAHpC,OAAO,CAAC,QAAQ,CAAC,CAAc;IAC/B,OAAO,CAAC,GAAG,CAAC,CAAQ;gBAES,OAAO,EAAE,OAAO;IAIvC,QAAQ,CAAC,EAAE,EAAE,MAAM;IAKnB,KAAK;
|
|
1
|
+
{"version":3,"file":"queryFlow.impl.d.ts","sourceRoot":"","sources":["../../../../src/storages/queryFlows/queryFlow.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,aAAa,CAAA;AACvD,OAAO,EACL,eAAe,EAEf,cAAc,EACd,eAAe,EAChB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAIvC,qBAAa,aAAc,SAAQ,SAAS;IAI9B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAHpC,OAAO,CAAC,QAAQ,CAAC,CAAc;IAC/B,OAAO,CAAC,GAAG,CAAC,CAAQ;gBAES,OAAO,EAAE,OAAO;IAIvC,QAAQ,CAAC,EAAE,EAAE,MAAM;IAKnB,KAAK;IA0BX,IAAI,EAAE,IAAI,MAAM,CAMf;IAED,IAAI,IAAI,IAAI,MAAM,CAMjB;IAED,IAAI,IAAI,IAAI,eAAe,EAAE,GAAG,SAAS,CAMxC;IAED,IAAI,KAAK,IAAI,cAAc,CAM1B;IAED,IAAI,MAAM,IAAI,eAAe,CAM5B;CAEF"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.QueryFlowImpl = void 0;
|
|
4
4
|
const queryFlow_1 = require("./queryFlow");
|
|
5
|
-
const queryFlowResponse_1 = require("../../dto/queryFlowResponse");
|
|
6
5
|
const rpcService_1 = require("../../services/rpcService");
|
|
7
6
|
const responseUtils_1 = require("../../services/responseUtils");
|
|
8
7
|
class QueryFlowImpl extends queryFlow_1.QueryFlow {
|
|
@@ -32,9 +31,6 @@ class QueryFlowImpl extends queryFlow_1.QueryFlow {
|
|
|
32
31
|
data: this
|
|
33
32
|
});
|
|
34
33
|
}
|
|
35
|
-
if (this._content.state === queryFlowResponse_1.QueryFlowState.IN_PROGRESS) {
|
|
36
|
-
setTimeout(async () => await this.fetch(), 2000);
|
|
37
|
-
}
|
|
38
34
|
}
|
|
39
35
|
get id() {
|
|
40
36
|
if (this._id) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryFlow.impl.js","sourceRoot":"","sources":["../../../../src/storages/queryFlows/queryFlow.impl.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;
|
|
1
|
+
{"version":3,"file":"queryFlow.impl.js","sourceRoot":"","sources":["../../../../src/storages/queryFlows/queryFlow.impl.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;AASvD,0DAAsD;AACtD,gEAA4D;AAE5D,MAAa,aAAc,SAAQ,qBAAS;IAI1C,YAA6B,OAAgB;QAC3C,KAAK,EAAE,CAAA;QADoB,YAAO,GAAP,OAAO,CAAS;IAE7C,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,EAAU;QACvB,IAAI,CAAC,GAAG,GAAG,EAAE,CAAA;QACb,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;IACpB,CAAC;IAED,KAAK,CAAC,KAAK;;QACT,MAAM,QAAQ,GAAG,MAAM,CAAA,MAAA,IAAI,CAAC,OAAO;aAChC,OAAO,CAAC,uBAAU,CAAC,0CAClB,cAAc,CAAC,mBAAmB,EACnC,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,EAC7B,OAAO,EAAE,CAAA,CAAA;QAEZ,wBAAwB;QACxB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A;QAC7C,CAAC;IACH,CAAC;IAED,IAAI,KAAK;QACP,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAA;QAC5B,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QAC7C,CAAC;IACH,CAAC;IAED,IAAI,MAAM;QACR,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAA;QAC7B,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QAC7C,CAAC;IACH,CAAC;CAEF;AA/ED,sCA+EC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryFlow.js","sourceRoot":"","sources":["../../../../src/storages/queryFlows/queryFlow.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAQ9C,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qCAAmB,CAAA;AACrB,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAED,MAAsB,SAAU,SAAQ,wBAGvC;
|
|
1
|
+
{"version":3,"file":"queryFlow.js","sourceRoot":"","sources":["../../../../src/storages/queryFlows/queryFlow.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAQ9C,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qCAAmB,CAAA;AACrB,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAED,MAAsB,SAAU,SAAQ,wBAGvC;CAcA;AAjBD,8BAiBC"}
|
|
@@ -8,8 +8,11 @@ export declare class QueryFlowsImpl extends QueryFlows {
|
|
|
8
8
|
readonly organization: OrganizationImpl;
|
|
9
9
|
readonly context: Context;
|
|
10
10
|
private _collection;
|
|
11
|
+
private _inProgress;
|
|
12
|
+
private _fetchTimeout?;
|
|
11
13
|
constructor(organization: OrganizationImpl, context: Context);
|
|
12
14
|
getQueryFlows(): Promise<QueryFlow[]>;
|
|
15
|
+
internalFetchQueries(): Promise<void>;
|
|
13
16
|
create(name: string, workspaceId: WorkspaceId, file: UploadFile, table: UploadFile): Promise<FlowId>;
|
|
14
17
|
delete(id: FlowId): Promise<void>;
|
|
15
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryFlows.impl.d.ts","sourceRoot":"","sources":["../../../../src/storages/queryFlows/queryFlows.impl.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"queryFlows.impl.d.ts","sourceRoot":"","sources":["../../../../src/storages/queryFlows/queryFlows.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAA;AACrC,OAAO,EAAC,MAAM,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAA;AAChE,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAA;AACrC,OAAO,EAAC,gBAAgB,EAAC,MAAM,oCAAoC,CAAA;AAGnE,OAAO,EAAC,WAAW,EAAC,MAAM,0BAA0B,CAAA;AAOpD,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAA;AAEzC,qBAAa,cAAe,SAAQ,UAAU;aAS1B,YAAY,EAAE,gBAAgB;aAC9B,OAAO,EAAE,OAAO;IARlC,OAAO,CAAC,WAAW,CAAkB;IAErC,OAAO,CAAC,WAAW,CAAkB;IAErC,OAAO,CAAC,aAAa,CAAC,CAAgB;gBAGpB,YAAY,EAAE,gBAAgB,EAC9B,OAAO,EAAE,OAAO;IAI5B,aAAa,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IA4CrC,oBAAoB;IAcpB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAmDpG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAoCxC"}
|
|
@@ -4,6 +4,7 @@ exports.QueryFlowsImpl = void 0;
|
|
|
4
4
|
const queryFlows_1 = require("./queryFlows");
|
|
5
5
|
const rpcService_1 = require("../../services/rpcService");
|
|
6
6
|
const responseUtils_1 = require("../../services/responseUtils");
|
|
7
|
+
const queryFlowResponse_1 = require("../../dto/queryFlowResponse");
|
|
7
8
|
const queryFlow_impl_1 = require("./queryFlow.impl");
|
|
8
9
|
class QueryFlowsImpl extends queryFlows_1.QueryFlows {
|
|
9
10
|
constructor(organization, context) {
|
|
@@ -11,6 +12,7 @@ class QueryFlowsImpl extends queryFlows_1.QueryFlows {
|
|
|
11
12
|
this.organization = organization;
|
|
12
13
|
this.context = context;
|
|
13
14
|
this._collection = [];
|
|
15
|
+
this._inProgress = [];
|
|
14
16
|
}
|
|
15
17
|
async getQueryFlows() {
|
|
16
18
|
var _a;
|
|
@@ -25,17 +27,37 @@ class QueryFlowsImpl extends queryFlows_1.QueryFlows {
|
|
|
25
27
|
.flowIds;
|
|
26
28
|
// Clear collection before add new elementss
|
|
27
29
|
this._collection = [];
|
|
30
|
+
this._inProgress = [];
|
|
31
|
+
clearTimeout(this._fetchTimeout);
|
|
28
32
|
// init flows from the server's response
|
|
29
33
|
for (const flow of flows) {
|
|
30
34
|
// create workspace implementation
|
|
31
35
|
const flowImpl = new queryFlow_impl_1.QueryFlowImpl(this.context);
|
|
32
36
|
// init workspace from the server's response
|
|
33
37
|
await flowImpl.initFrom(flow);
|
|
38
|
+
if (flowImpl.state == queryFlowResponse_1.QueryFlowState.IN_PROGRESS) {
|
|
39
|
+
this._inProgress.push(flowImpl);
|
|
40
|
+
}
|
|
34
41
|
// add workspace to the collection
|
|
35
42
|
this._collection.push(flowImpl);
|
|
36
43
|
}
|
|
44
|
+
if (this._inProgress.length > 0) {
|
|
45
|
+
this._fetchTimeout = setTimeout(async () => await this.internalFetchQueries(), 2000);
|
|
46
|
+
}
|
|
37
47
|
return this._collection;
|
|
38
48
|
}
|
|
49
|
+
async internalFetchQueries() {
|
|
50
|
+
for (const flow of this._inProgress) {
|
|
51
|
+
await flow.fetch();
|
|
52
|
+
}
|
|
53
|
+
this._inProgress = this._inProgress.filter(flow => flow.state == queryFlowResponse_1.QueryFlowState.IN_PROGRESS);
|
|
54
|
+
if (this._inProgress.length > 0) {
|
|
55
|
+
this._fetchTimeout = setTimeout(async () => await this.internalFetchQueries(), 2000);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
clearTimeout(this._fetchTimeout);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
39
61
|
async create(name, workspaceId, file, table) {
|
|
40
62
|
var _a;
|
|
41
63
|
if (name === undefined || name === null || name.trim() === "") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryFlows.impl.js","sourceRoot":"","sources":["../../../../src/storages/queryFlows/queryFlows.impl.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"queryFlows.impl.js","sourceRoot":"","sources":["../../../../src/storages/queryFlows/queryFlows.impl.ts"],"names":[],"mappings":";;;AACA,6CAAgE;AAGhE,0DAAoD;AACpD,gEAA0D;AAE1D,mEAIoC;AACpC,qDAA8C;AAG9C,MAAa,cAAe,SAAQ,uBAAU;IAQ5C,YACkB,YAA8B,EAC9B,OAAgB;QAChC,KAAK,EAAE,CAAA;QAFS,iBAAY,GAAZ,YAAY,CAAkB;QAC9B,YAAO,GAAP,OAAO,CAAS;QAR1B,gBAAW,GAAgB,EAAE,CAAA;QAE7B,gBAAW,GAAgB,EAAE,CAAA;IAQrC,CAAC;IAED,KAAK,CAAC,aAAa;;QACjB,MAAM,QAAQ,GAAG,MAAM,CAAA,MAAA,IAAI,CAAC,OAAO;aAChC,OAAO,CAAC,uBAAU,CAAC,0CAClB,cAAc,CAAC,wBAAwB,EACxC,WAAW,CAAC,gBAAgB,EAAE,IAAI,CAAC,YAAY,CAAC,EAAE,EAClD,OAAO,EAAE,CAAA,C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
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import {Context} from "../../context"
|
|
2
|
+
import {FlowId, QueryFlows, QueryFlowsEvent} from "./queryFlows"
|
|
3
|
+
import {QueryFlow} from "./queryFlow"
|
|
4
|
+
import {OrganizationImpl} from "../organizations/organization.impl"
|
|
5
|
+
import {RpcService} from "../../services/rpcService"
|
|
6
|
+
import {ResponseUtils} from "../../services/responseUtils"
|
|
7
|
+
import {WorkspaceId} from "../workspaces/workspaces"
|
|
8
8
|
import {
|
|
9
9
|
QueryFlowListResponse,
|
|
10
|
-
QueryFlowResponse
|
|
10
|
+
QueryFlowResponse,
|
|
11
|
+
QueryFlowState
|
|
11
12
|
} from "../../dto/queryFlowResponse"
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
13
|
+
import {QueryFlowImpl} from "./queryFlow.impl"
|
|
14
|
+
import {UploadFile} from "../files/files"
|
|
14
15
|
|
|
15
16
|
export class QueryFlowsImpl extends QueryFlows {
|
|
16
17
|
|
|
17
18
|
private _collection: QueryFlow[] = []
|
|
18
19
|
|
|
20
|
+
private _inProgress: QueryFlow[] = []
|
|
21
|
+
|
|
22
|
+
private _fetchTimeout?: NodeJS.Timeout
|
|
23
|
+
|
|
19
24
|
constructor(
|
|
20
25
|
public readonly organization: OrganizationImpl,
|
|
21
26
|
public readonly context: Context) {
|
|
@@ -40,6 +45,8 @@ export class QueryFlowsImpl extends QueryFlows {
|
|
|
40
45
|
|
|
41
46
|
// Clear collection before add new elementss
|
|
42
47
|
this._collection = []
|
|
48
|
+
this._inProgress = []
|
|
49
|
+
clearTimeout(this._fetchTimeout)
|
|
43
50
|
|
|
44
51
|
// init flows from the server's response
|
|
45
52
|
for (const flow of flows) {
|
|
@@ -49,13 +56,35 @@ export class QueryFlowsImpl extends QueryFlows {
|
|
|
49
56
|
// init workspace from the server's response
|
|
50
57
|
await flowImpl.initFrom(flow)
|
|
51
58
|
|
|
59
|
+
if (flowImpl.state == QueryFlowState.IN_PROGRESS){
|
|
60
|
+
this._inProgress.push(flowImpl)
|
|
61
|
+
}
|
|
62
|
+
|
|
52
63
|
// add workspace to the collection
|
|
53
64
|
this._collection.push(flowImpl)
|
|
54
65
|
}
|
|
55
66
|
|
|
67
|
+
if (this._inProgress.length > 0) {
|
|
68
|
+
this._fetchTimeout = setTimeout(async () => await this.internalFetchQueries(), 2000)
|
|
69
|
+
}
|
|
70
|
+
|
|
56
71
|
return this._collection
|
|
57
72
|
}
|
|
58
73
|
|
|
74
|
+
async internalFetchQueries() {
|
|
75
|
+
for (const flow of this._inProgress){
|
|
76
|
+
await flow.fetch()
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
this._inProgress = this._inProgress.filter(flow => flow.state == QueryFlowState.IN_PROGRESS)
|
|
80
|
+
|
|
81
|
+
if (this._inProgress.length > 0) {
|
|
82
|
+
this._fetchTimeout = setTimeout(async () => await this.internalFetchQueries(), 2000)
|
|
83
|
+
} else {
|
|
84
|
+
clearTimeout(this._fetchTimeout)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
59
88
|
async create(name: string, workspaceId: WorkspaceId, file: UploadFile, table: UploadFile): Promise<FlowId> {
|
|
60
89
|
if (name === undefined || name === null || name.trim() === "") {
|
|
61
90
|
throw new Error("Name is required, must be not empty")
|