@alwaysai/device-agent-schemas 1.0.0 → 1.1.1
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/lib/constants.d.ts +5 -3
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +4 -2
- package/lib/constants.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/schemas/agent/request-data-from-cloud.d.ts +32 -5
- package/lib/schemas/agent/request-data-from-cloud.d.ts.map +1 -1
- package/lib/schemas/agent/request-data-from-cloud.js +24 -5
- package/lib/schemas/agent/request-data-from-cloud.js.map +1 -1
- package/lib/schemas/client/application-action-schema.d.ts +48 -0
- package/lib/schemas/client/application-action-schema.d.ts.map +1 -1
- package/lib/schemas/client/application-action-schema.js +45 -20
- package/lib/schemas/client/application-action-schema.js.map +1 -1
- package/lib/schemas/common-schema.d.ts +5 -0
- package/lib/schemas/common-schema.d.ts.map +1 -1
- package/lib/schemas/common-schema.js +5 -0
- package/lib/schemas/common-schema.js.map +1 -1
- package/lib/types.d.ts +4 -4
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js +5 -4
- package/lib/types.js.map +1 -1
- package/lib/types.test.js +20 -20
- package/lib/types.test.js.map +1 -1
- package/package.json +1 -1
- package/src/constants.ts +3 -1
- package/src/index.ts +2 -2
- package/src/schemas/agent/request-data-from-cloud.ts +35 -8
- package/src/schemas/client/application-action-schema.ts +54 -20
- package/src/schemas/common-schema.ts +6 -1
- package/src/types.test.ts +20 -20
- package/src/types.ts +11 -7
package/lib/constants.d.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
export declare const PROJECT_ID_PATTERN = "([0-9a-z]+-+)+([0-9a-z])+";
|
|
2
2
|
export declare const DEVICE_ID_PATTERN = "([0-9a-z]+-+)+([0-9a-z])+";
|
|
3
3
|
export declare const APP_RELEASE_ID_PATTERN = "[0-9a-z]{64}";
|
|
4
|
+
export declare const MODEL_ID_PATTERN = "[A-Za-z0-9_]+/[A-Za-z0-9_]*";
|
|
4
5
|
export declare const keyMirrors: {
|
|
5
6
|
agentMessageType: {
|
|
6
7
|
app_logs: "app_logs";
|
|
7
8
|
app_state: "app_state";
|
|
8
9
|
device_stats: "device_stats";
|
|
9
10
|
app_install_status: "app_install_status";
|
|
10
|
-
|
|
11
|
+
signed_urls_request: "signed_urls_request";
|
|
11
12
|
};
|
|
12
13
|
clientMessageType: {
|
|
13
14
|
app_state_control: "app_state_control";
|
|
14
15
|
app_version_control: "app_version_control";
|
|
15
16
|
app_install_cloud_response: "app_install_cloud_response";
|
|
17
|
+
models_install_cloud_response: "models_install_cloud_response";
|
|
16
18
|
live_state_updates: "live_state_updates";
|
|
17
19
|
};
|
|
18
20
|
appState: {
|
|
@@ -38,9 +40,9 @@ export declare const keyMirrors: {
|
|
|
38
40
|
success: "success";
|
|
39
41
|
};
|
|
40
42
|
};
|
|
41
|
-
export declare const agentMessageTypeValues: ("app_logs" | "app_state" | "device_stats" | "app_install_status" | "
|
|
43
|
+
export declare const agentMessageTypeValues: ("app_logs" | "app_state" | "device_stats" | "app_install_status" | "signed_urls_request")[];
|
|
42
44
|
export declare type AgentMessageTypeValue = keyof typeof keyMirrors.agentMessageType;
|
|
43
|
-
export declare const clientMessageTypeValues: ("app_state_control" | "app_version_control" | "app_install_cloud_response" | "live_state_updates")[];
|
|
45
|
+
export declare const clientMessageTypeValues: ("app_state_control" | "app_version_control" | "app_install_cloud_response" | "models_install_cloud_response" | "live_state_updates")[];
|
|
44
46
|
export declare type ClientMessageTypeValue = keyof typeof keyMirrors.clientMessageType;
|
|
45
47
|
export declare const appStateValues: ("up" | "stopped" | "restarting")[];
|
|
46
48
|
export declare type AppStateValue = keyof typeof keyMirrors.appState;
|
package/lib/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,eAAO,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|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.appInstallStatusValues = exports.liveUpdatesValues = exports.appVersionControlValues = exports.appStateControlValues = exports.appStateValues = exports.clientMessageTypeValues = exports.agentMessageTypeValues = exports.keyMirrors = exports.APP_RELEASE_ID_PATTERN = exports.DEVICE_ID_PATTERN = exports.PROJECT_ID_PATTERN = void 0;
|
|
3
|
+
exports.appInstallStatusValues = exports.liveUpdatesValues = exports.appVersionControlValues = exports.appStateControlValues = exports.appStateValues = exports.clientMessageTypeValues = exports.agentMessageTypeValues = exports.keyMirrors = exports.MODEL_ID_PATTERN = exports.APP_RELEASE_ID_PATTERN = exports.DEVICE_ID_PATTERN = exports.PROJECT_ID_PATTERN = void 0;
|
|
4
4
|
const utils_1 = require("./utils");
|
|
5
5
|
exports.PROJECT_ID_PATTERN = '([0-9a-z]+-+)+([0-9a-z])+';
|
|
6
6
|
exports.DEVICE_ID_PATTERN = '([0-9a-z]+-+)+([0-9a-z])+';
|
|
7
7
|
exports.APP_RELEASE_ID_PATTERN = '[0-9a-z]{64}';
|
|
8
|
+
exports.MODEL_ID_PATTERN = '[A-Za-z0-9_]+/[A-Za-z0-9_]*';
|
|
8
9
|
const agentMessageTypeEnum = (0, utils_1.keyMirror)({
|
|
9
10
|
app_logs: null,
|
|
10
11
|
app_state: null,
|
|
11
12
|
device_stats: null,
|
|
12
13
|
app_install_status: null,
|
|
13
|
-
|
|
14
|
+
signed_urls_request: null,
|
|
14
15
|
});
|
|
15
16
|
const clientMessageTypeEnum = (0, utils_1.keyMirror)({
|
|
16
17
|
app_state_control: null,
|
|
17
18
|
app_version_control: null,
|
|
18
19
|
app_install_cloud_response: null,
|
|
20
|
+
models_install_cloud_response: null,
|
|
19
21
|
live_state_updates: null,
|
|
20
22
|
});
|
|
21
23
|
const appStateEnum = (0, utils_1.keyMirror)({
|
package/lib/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AAEvB,QAAA,kBAAkB,GAAG,2BAA2B,CAAC;AACjD,QAAA,iBAAiB,GAAG,2BAA2B,CAAC;AAChD,QAAA,sBAAsB,GAAG,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AAEvB,QAAA,kBAAkB,GAAG,2BAA2B,CAAC;AACjD,QAAA,iBAAiB,GAAG,2BAA2B,CAAC;AAChD,QAAA,sBAAsB,GAAG,cAAc,CAAC;AACxC,QAAA,gBAAgB,GAAG,6BAA6B,CAAC;AAE9D,MAAM,oBAAoB,GAAG,IAAA,iBAAS,EAAC;IACrC,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,IAAI;IACf,YAAY,EAAE,IAAI;IAClB,kBAAkB,EAAE,IAAI;IACxB,mBAAmB,EAAE,IAAI;CAC1B,CAAC,CAAC;AAEH,MAAM,qBAAqB,GAAG,IAAA,iBAAS,EAAC;IACtC,iBAAiB,EAAE,IAAI;IACvB,mBAAmB,EAAE,IAAI;IACzB,0BAA0B,EAAE,IAAI;IAChC,6BAA6B,EAAE,IAAI;IACnC,kBAAkB,EAAE,IAAI;CACzB,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,IAAA,iBAAS,EAAC;IAC7B,EAAE,EAAE,IAAI;IACR,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,IAAI;CACjB,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAG,IAAA,iBAAS,EAAC;IACpC,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,IAAI;CACd,CAAC,CAAC;AAEH,MAAM,qBAAqB,GAAG,IAAA,iBAAS,EAAC;IACtC,OAAO,EAAE,IAAI;CACd,CAAC,CAAC;AAEH,MAAM,eAAe,GAAG,IAAA,iBAAS,EAAC;IAChC,YAAY,EAAE,IAAI;CACnB,CAAC,CAAC;AAEH,MAAM,oBAAoB,GAAG,IAAA,iBAAS,EAAC;IACrC,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;CACd,CAAC,CAAC;AAEU,QAAA,UAAU,GAAG;IACxB,gBAAgB,EAAE,oBAAoB;IACtC,iBAAiB,EAAE,qBAAqB;IACxC,QAAQ,EAAE,YAAY;IACtB,eAAe,EAAE,mBAAmB;IACpC,iBAAiB,EAAE,qBAAqB;IACxC,WAAW,EAAE,eAAe;IAC5B,gBAAgB,EAAE,oBAAoB;CACvC,CAAC;AAEW,QAAA,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAU,CAAC,gBAAgB,CAAC,CAAC;AAGpE,QAAA,uBAAuB,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAU,CAAC,iBAAiB,CAAC,CAAC;AAGtE,QAAA,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAU,CAAC,QAAQ,CAAC,CAAC;AAGpD,QAAA,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAU,CAAC,eAAe,CAAC,CAAC;AAGlE,QAAA,uBAAuB,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAU,CAAC,iBAAiB,CAAC,CAAC;AAGtE,QAAA,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAU,CAAC,WAAW,CAAC,CAAC;AAG1D,QAAA,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAU,CAAC,gBAAgB,CAAC,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -6,6 +6,6 @@ import { LiveUpdatesToggleMessage, LiveUpdatesToggles } from './schemas/client/d
|
|
|
6
6
|
import { DeviceStatsMessage } from './schemas/agent/device-status-schema';
|
|
7
7
|
import { AppInstallStatusMessage, AppInstallStatusPacket } from './schemas/agent/app-install-status-schema';
|
|
8
8
|
import { AppStateControlValue, AppStateValue, keyMirrors } from './constants';
|
|
9
|
-
import {
|
|
10
|
-
export { AppLogsPacket, AppDetailsPacket, ServiceStatusPacket, AppStatePacket, ModelInstallPayload, AppInstallStatusPacket, AppStateControlPacket, AppVersionControlPacket, AppStateControlValue, AppStateValue, LiveUpdatesToggles, DeviceAgentMessagePayload, ClientMessagePayload, DeviceStatsMessage, AppStateMessage, AppLogsMessage, AppInstallStatusMessage, AppStateControlMessage, AppVersionControlMessage, AppInstallCloudResponseMessage, LiveUpdatesToggleMessage,
|
|
9
|
+
import { SignedUrlsRequestMessage } from './schemas/agent/request-data-from-cloud';
|
|
10
|
+
export { AppLogsPacket, AppDetailsPacket, ServiceStatusPacket, AppStatePacket, ModelInstallPayload, AppInstallStatusPacket, AppStateControlPacket, AppVersionControlPacket, AppStateControlValue, AppStateValue, LiveUpdatesToggles, DeviceAgentMessagePayload, ClientMessagePayload, DeviceStatsMessage, AppStateMessage, AppLogsMessage, AppInstallStatusMessage, AppStateControlMessage, AppVersionControlMessage, AppInstallCloudResponseMessage, LiveUpdatesToggleMessage, SignedUrlsRequestMessage, DeviceAgentMessage, ClientMessage, validateDeviceAgentMessage, validateClientMessage, keyMirrors, };
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,eAAe,EAChB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EACL,8BAA8B,EAC9B,qBAAqB,EACrB,sBAA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tB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,yBAAyB,EACzB,oBAAoB,EAEpB,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,8BAA8B,EAC9B,wBAAwB,EACxB,wBAAwB,EAExB,kBAAkB,EAClB,aAAa,EAEb,0BAA0B,EAC1B,qBAAqB,EAErB,UAAU,GACX,CAAC"}
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import { keyMirrors } from "../../constants";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
declare type ModelsObject = {
|
|
3
|
+
[modelId: string]: number;
|
|
4
|
+
};
|
|
5
|
+
export interface SignedUrlsRequestMessage {
|
|
6
|
+
messageType: typeof keyMirrors.agentMessageType.signed_urls_request;
|
|
7
|
+
signedUrlsRequest?: {
|
|
5
8
|
projectId: string;
|
|
6
9
|
appReleaseHash: string;
|
|
7
10
|
};
|
|
11
|
+
modelsOnlyUrlsRequest?: {
|
|
12
|
+
projectId: string;
|
|
13
|
+
models: ModelsObject;
|
|
14
|
+
};
|
|
8
15
|
}
|
|
9
|
-
export declare const
|
|
16
|
+
export declare const signedUrlsRequestSchema: {
|
|
10
17
|
$id: string;
|
|
11
18
|
type: string;
|
|
12
19
|
properties: {
|
|
13
20
|
messageType: {
|
|
14
|
-
const: "
|
|
21
|
+
const: "signed_urls_request";
|
|
15
22
|
};
|
|
16
23
|
signedUrlsRequest: {
|
|
17
24
|
type: string;
|
|
@@ -26,8 +33,28 @@ export declare const appInstallSignedUrlsRequestSchema: {
|
|
|
26
33
|
required: string[];
|
|
27
34
|
additionalProperties: boolean;
|
|
28
35
|
};
|
|
36
|
+
modelsOnlyUrlsRequest: {
|
|
37
|
+
type: string;
|
|
38
|
+
properties: {
|
|
39
|
+
projectId: {
|
|
40
|
+
$ref: string;
|
|
41
|
+
};
|
|
42
|
+
models: {
|
|
43
|
+
type: string;
|
|
44
|
+
patternProperties: {
|
|
45
|
+
"[A-Za-z0-9_]+/[A-Za-z0-9_]*": {
|
|
46
|
+
type: string[];
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
additionalProperties: boolean;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
required: string[];
|
|
53
|
+
additionalProperties: boolean;
|
|
54
|
+
};
|
|
29
55
|
};
|
|
30
56
|
required: string[];
|
|
31
57
|
additionalProperties: boolean;
|
|
32
58
|
};
|
|
59
|
+
export {};
|
|
33
60
|
//# sourceMappingURL=request-data-from-cloud.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-data-from-cloud.d.ts","sourceRoot":"","sources":["../../../src/schemas/agent/request-data-from-cloud.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"request-data-from-cloud.d.ts","sourceRoot":"","sources":["../../../src/schemas/agent/request-data-from-cloud.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAoB,MAAM,iBAAiB,CAAC;AAE/D,aAAK,YAAY,GAAG;IAClB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B,CAAA;AAED,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,OAAO,UAAU,CAAC,gBAAgB,CAAC,mBAAmB,CAAC;IACpE,iBAAiB,CAAC,EAAE;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,qBAAqB,CAAC,EAAE;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,YAAY,CAAC;KACtB,CAAC;CACH;AAED,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CnC,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.signedUrlsRequestSchema = void 0;
|
|
4
4
|
const constants_1 = require("../../constants");
|
|
5
|
-
exports.
|
|
6
|
-
$id: '
|
|
5
|
+
exports.signedUrlsRequestSchema = {
|
|
6
|
+
$id: 'signed_urls_request_schema.json',
|
|
7
7
|
type: 'object',
|
|
8
8
|
properties: {
|
|
9
9
|
messageType: {
|
|
10
|
-
const: constants_1.keyMirrors.agentMessageType.
|
|
10
|
+
const: constants_1.keyMirrors.agentMessageType.signed_urls_request,
|
|
11
11
|
},
|
|
12
12
|
signedUrlsRequest: {
|
|
13
13
|
type: 'object',
|
|
@@ -22,8 +22,27 @@ exports.appInstallSignedUrlsRequestSchema = {
|
|
|
22
22
|
required: ['projectId', 'appReleaseHash'],
|
|
23
23
|
additionalProperties: false,
|
|
24
24
|
},
|
|
25
|
+
modelsOnlyUrlsRequest: {
|
|
26
|
+
type: 'object',
|
|
27
|
+
properties: {
|
|
28
|
+
projectId: {
|
|
29
|
+
$ref: 'common_schema.json#/$defs/projectId',
|
|
30
|
+
},
|
|
31
|
+
models: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
patternProperties: {
|
|
34
|
+
[constants_1.MODEL_ID_PATTERN]: {
|
|
35
|
+
type: ['integer'],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
additionalProperties: false,
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
required: ['projectId', 'models'],
|
|
42
|
+
additionalProperties: false,
|
|
43
|
+
},
|
|
25
44
|
},
|
|
26
|
-
required: ['messageType'
|
|
45
|
+
required: ['messageType'],
|
|
27
46
|
additionalProperties: false,
|
|
28
47
|
};
|
|
29
48
|
//# sourceMappingURL=request-data-from-cloud.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-data-from-cloud.js","sourceRoot":"","sources":["../../../src/schemas/agent/request-data-from-cloud.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"request-data-from-cloud.js","sourceRoot":"","sources":["../../../src/schemas/agent/request-data-from-cloud.ts"],"names":[],"mappings":";;;AAAA,+CAA+D;AAkBlD,QAAA,uBAAuB,GAAG;IACrC,GAAG,EAAE,iCAAiC;IACtC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,WAAW,EAAE;YACX,KAAK,EAAE,sBAAU,CAAC,gBAAgB,CAAC,mBAAmB;SACvD;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,qCAAqC;iBAC5C;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,0CAA0C;iBACjD;aACF;YACD,QAAQ,EAAE,CAAC,WAAW,EAAE,gBAAgB,CAAC;YACzC,oBAAoB,EAAE,KAAK;SAC5B;QACD,qBAAqB,EAAE;YACrB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,qCAAqC;iBAC5C;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,iBAAiB,EAAE;wBACf,CAAC,4BAAgB,CAAC,EAAE;4BAChB,IAAI,EAAE,CAAC,SAAS,CAAC;yBACpB;qBACJ;oBACD,oBAAoB,EAAE,KAAK;iBAC5B;aACF;YACD,QAAQ,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC;YACjC,oBAAoB,EAAE,KAAK;SAC5B;KACF;IACD,QAAQ,EAAE,CAAC,aAAa,CAAC;IACzB,oBAAoB,EAAE,KAAK;CAC5B,CAAC"}
|
|
@@ -32,6 +32,13 @@ export interface AppInstallCloudResponseMessage {
|
|
|
32
32
|
modelsInstallPayload: ModelInstallPayload[];
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
+
export interface ModelsInstallCloudResponseMessage {
|
|
36
|
+
messageType: typeof keyMirrors.clientMessageType.models_install_cloud_response;
|
|
37
|
+
modelsInstallCloudResponse: {
|
|
38
|
+
projectId: string;
|
|
39
|
+
newModels: ModelInstallPayload[];
|
|
40
|
+
};
|
|
41
|
+
}
|
|
35
42
|
export declare const appStateControlSchema: {
|
|
36
43
|
$id: string;
|
|
37
44
|
type: string;
|
|
@@ -115,8 +122,49 @@ export declare const appInstallCloudResponseSchema: {
|
|
|
115
122
|
type: string;
|
|
116
123
|
properties: {
|
|
117
124
|
id: {
|
|
125
|
+
$ref: string;
|
|
126
|
+
};
|
|
127
|
+
version: {
|
|
118
128
|
type: string;
|
|
119
129
|
};
|
|
130
|
+
modelSignedUrl: {
|
|
131
|
+
type: string;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
required: string[];
|
|
135
|
+
additionalProperties: boolean;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
required: string[];
|
|
140
|
+
additionalProperties: boolean;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
required: string[];
|
|
144
|
+
additionalProperties: boolean;
|
|
145
|
+
};
|
|
146
|
+
export declare const modelsInstallCloudResponseSchema: {
|
|
147
|
+
$id: string;
|
|
148
|
+
type: string;
|
|
149
|
+
properties: {
|
|
150
|
+
messageType: {
|
|
151
|
+
type: string;
|
|
152
|
+
enum: "models_install_cloud_response"[];
|
|
153
|
+
};
|
|
154
|
+
modelsInstallCloudResponse: {
|
|
155
|
+
type: string;
|
|
156
|
+
properties: {
|
|
157
|
+
projectId: {
|
|
158
|
+
$ref: string;
|
|
159
|
+
};
|
|
160
|
+
newModels: {
|
|
161
|
+
type: string;
|
|
162
|
+
items: {
|
|
163
|
+
type: string;
|
|
164
|
+
properties: {
|
|
165
|
+
id: {
|
|
166
|
+
$ref: string;
|
|
167
|
+
};
|
|
120
168
|
version: {
|
|
121
169
|
type: string;
|
|
122
170
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-action-schema.d.ts","sourceRoot":"","sources":["../../../src/schemas/client/application-action-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EAEpB,UAAU,EACX,MAAM,iBAAiB,CAAC;AAEzB,oBAAY,qBAAqB,GAAG;IAClC,WAAW,EAAE,oBAAoB,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,OAAO,UAAU,CAAC,iBAAiB,CAAC,iBAAiB,CAAC;IACnE,eAAe,EAAE,qBAAqB,CAAC;CACxC;AAED,oBAAY,uBAAuB,GAAG;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAA;AAED,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,OAAO,UAAU,CAAC,iBAAiB,CAAC,mBAAmB,CAAC;IACrE,iBAAiB,EAAE,uBAAuB,CAAC;CAC5C;AAED,oBAAY,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,oBAAY,iBAAiB,GAAG;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,WAAW,8BAA8B;IAC7C,WAAW,EAAE,OAAO,UAAU,CAAC,iBAAiB,CAAC,0BAA0B,CAAC;IAC5E,uBAAuB,EAAE;QACvB,SAAS,EAAE,MAAM,CAAC;QAClB,cAAc,EAAE,MAAM,CAAC;QACvB,iBAAiB,EAAE,iBAAiB,CAAC;QACrC,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;KAC7C,
|
|
1
|
+
{"version":3,"file":"application-action-schema.d.ts","sourceRoot":"","sources":["../../../src/schemas/client/application-action-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EAEpB,UAAU,EACX,MAAM,iBAAiB,CAAC;AAEzB,oBAAY,qBAAqB,GAAG;IAClC,WAAW,EAAE,oBAAoB,CAAC;IAClC,SAAS,EAAE,MA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCzC,CAAC;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsB5C,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.appInstallCloudResponseSchema = exports.appVersionControlSchema = exports.appStateControlSchema = void 0;
|
|
3
|
+
exports.modelsInstallCloudResponseSchema = exports.appInstallCloudResponseSchema = exports.appVersionControlSchema = exports.appStateControlSchema = void 0;
|
|
4
4
|
const constants_1 = require("../../constants");
|
|
5
5
|
;
|
|
6
6
|
;
|
|
7
7
|
;
|
|
8
|
+
;
|
|
8
9
|
exports.appStateControlSchema = {
|
|
9
10
|
$id: 'app_state_control_schema.json',
|
|
10
11
|
type: 'object',
|
|
@@ -55,6 +56,25 @@ exports.appVersionControlSchema = {
|
|
|
55
56
|
required: ['messageType', 'appVersionControl'],
|
|
56
57
|
additionalProperties: false,
|
|
57
58
|
};
|
|
59
|
+
const modelsInstallPayload = {
|
|
60
|
+
type: 'array',
|
|
61
|
+
items: {
|
|
62
|
+
type: 'object',
|
|
63
|
+
properties: {
|
|
64
|
+
id: {
|
|
65
|
+
$ref: 'common_schema.json#/$defs/modelId',
|
|
66
|
+
},
|
|
67
|
+
version: {
|
|
68
|
+
type: 'number',
|
|
69
|
+
},
|
|
70
|
+
modelSignedUrl: {
|
|
71
|
+
type: 'string',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
required: ['id', 'version', 'modelSignedUrl'],
|
|
75
|
+
additionalProperties: false,
|
|
76
|
+
},
|
|
77
|
+
};
|
|
58
78
|
exports.appInstallCloudResponseSchema = {
|
|
59
79
|
$id: 'app_install_cloud_response_schema.json',
|
|
60
80
|
type: 'object',
|
|
@@ -82,25 +102,7 @@ exports.appInstallCloudResponseSchema = {
|
|
|
82
102
|
required: ['appSignedUrl'],
|
|
83
103
|
additionalProperties: false,
|
|
84
104
|
},
|
|
85
|
-
modelsInstallPayload
|
|
86
|
-
type: 'array',
|
|
87
|
-
items: {
|
|
88
|
-
type: 'object',
|
|
89
|
-
properties: {
|
|
90
|
-
id: {
|
|
91
|
-
type: 'string',
|
|
92
|
-
},
|
|
93
|
-
version: {
|
|
94
|
-
type: 'number',
|
|
95
|
-
},
|
|
96
|
-
modelSignedUrl: {
|
|
97
|
-
type: 'string',
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
required: ['id', 'version', 'modelSignedUrl'],
|
|
101
|
-
additionalProperties: false,
|
|
102
|
-
}
|
|
103
|
-
}
|
|
105
|
+
modelsInstallPayload,
|
|
104
106
|
},
|
|
105
107
|
required: ['projectId', 'appReleaseHash', 'appInstallPayload', 'modelsInstallPayload'],
|
|
106
108
|
additionalProperties: false,
|
|
@@ -109,4 +111,27 @@ exports.appInstallCloudResponseSchema = {
|
|
|
109
111
|
required: ['messageType', 'appInstallCloudResponse'],
|
|
110
112
|
additionalProperties: false,
|
|
111
113
|
};
|
|
114
|
+
exports.modelsInstallCloudResponseSchema = {
|
|
115
|
+
$id: 'models_install_cloud_response_schema.json',
|
|
116
|
+
type: 'object',
|
|
117
|
+
properties: {
|
|
118
|
+
messageType: {
|
|
119
|
+
type: 'string',
|
|
120
|
+
enum: [constants_1.keyMirrors.clientMessageType.models_install_cloud_response],
|
|
121
|
+
},
|
|
122
|
+
modelsInstallCloudResponse: {
|
|
123
|
+
type: 'object',
|
|
124
|
+
properties: {
|
|
125
|
+
projectId: {
|
|
126
|
+
$ref: 'common_schema.json#/$defs/projectId',
|
|
127
|
+
},
|
|
128
|
+
newModels: modelsInstallPayload,
|
|
129
|
+
},
|
|
130
|
+
required: ['projectId', 'newModels'],
|
|
131
|
+
additionalProperties: false,
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
required: ['messageType', 'modelsInstallCloudResponse'],
|
|
135
|
+
additionalProperties: false,
|
|
136
|
+
};
|
|
112
137
|
//# sourceMappingURL=application-action-schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-action-schema.js","sourceRoot":"","sources":["../../../src/schemas/client/application-action-schema.ts"],"names":[],"mappings":";;;AAAA,+CAIyB;AAUxB,CAAC;AAUD,CAAC;AAoBD,CAAC;AAEW,QAAA,qBAAqB,GAAG;IACnC,GAAG,EAAE,+BAA+B;IACpC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,WAAW,EAAE;YACX,KAAK,EAAE,sBAAU,CAAC,iBAAiB,CAAC,iBAAiB;SACtD;QACD,eAAe,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,iCAAqB;iBAC5B;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,qCAAqC;iBAC5C;aACF;YACD,QAAQ,EAAE,CAAC,aAAa,EAAE,WAAW,CAAC;YACtC,oBAAoB,EAAE,KAAK;SAC5B;KACF;IACD,QAAQ,EAAE,CAAC,aAAa,EAAE,iBAAiB,CAAC;IAC5C,oBAAoB,EAAE,KAAK;CAC5B,CAAC;AAEW,QAAA,uBAAuB,GAAG;IACrC,GAAG,EAAE,iCAAiC;IACtC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAE,sBAAU,CAAC,iBAAiB,CAAC,mBAAmB,CAAE;SAC3D;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,qCAAqC;iBAC5C;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,0CAA0C;iBACjD;aACF;YACD,QAAQ,EAAE,CAAC,WAAW,EAAE,gBAAgB,CAAC;YACzC,oBAAoB,EAAE,KAAK;SAC5B;KACF;IACD,QAAQ,EAAE,CAAC,aAAa,EAAE,mBAAmB,CAAC;IAC9C,oBAAoB,EAAE,KAAK;CAC5B,CAAC;
|
|
1
|
+
{"version":3,"file":"application-action-schema.js","sourceRoot":"","sources":["../../../src/schemas/client/application-action-schema.ts"],"names":[],"mappings":";;;AAAA,+CAIyB;AAUxB,CAAC;AAUD,CAAC;AAoBD,CAAC;AAQD,CAAC;AAEW,QAAA,qBAAqB,GAAG;IACnC,GAAG,EAAE,+BAA+B;IACpC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,WAAW,EAAE;YACX,KAAK,EAAE,sBAAU,CAAC,iBAAiB,CAAC,iBAAiB;SACtD;QACD,eAAe,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,iCAAqB;iBAC5B;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,qCAAqC;iBAC5C;aACF;YACD,QAAQ,EAAE,CAAC,aAAa,EAAE,WAAW,CAAC;YACtC,oBAAoB,EAAE,KAAK;SAC5B;KACF;IACD,QAAQ,EAAE,CAAC,aAAa,EAAE,iBAAiB,CAAC;IAC5C,oBAAoB,EAAE,KAAK;CAC5B,CAAC;AAEW,QAAA,uBAAuB,GAAG;IACrC,GAAG,EAAE,iCAAiC;IACtC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAE,sBAAU,CAAC,iBAAiB,CAAC,mBAAmB,CAAE;SAC3D;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,qCAAqC;iBAC5C;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,0CAA0C;iBACjD;aACF;YACD,QAAQ,EAAE,CAAC,WAAW,EAAE,gBAAgB,CAAC;YACzC,oBA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,yBAAyB,CAAC;IACpD,oBAAoB,EAAE,KAAK;CAC5B,CAAC;AAEW,QAAA,gCAAgC,GAAG;IAC9C,GAAG,EAAE,2CAA2C;IAChD,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAE,sBAAU,CAAC,iBAAiB,CAAC,6BAA6B,CAAE;SACrE;QACD,0BAA0B,EAAE;YAC1B,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,qCAAqC;iBAC5C;gBACD,SAAS,EAAE,oBAAoB;aAChC;YACD,QAAQ,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;YACpC,oBAAoB,EAAE,KAAK;SAC5B;KACF;IACD,QAAQ,EAAE,CAAC,aAAa,EAAE,4BAA4B,CAAC;IACvD,oBAAoB,EAAE,KAAK;CAC5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-schema.d.ts","sourceRoot":"","sources":["../../src/schemas/common-schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"common-schema.d.ts","sourceRoot":"","sources":["../../src/schemas/common-schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;CAoBxB,CAAC"}
|
|
@@ -16,6 +16,11 @@ exports.commonSchema = {
|
|
|
16
16
|
type: 'string',
|
|
17
17
|
pattern: constants_1.APP_RELEASE_ID_PATTERN,
|
|
18
18
|
},
|
|
19
|
+
modelId: {
|
|
20
|
+
description: 'The id of a model',
|
|
21
|
+
type: 'string',
|
|
22
|
+
pattern: constants_1.MODEL_ID_PATTERN,
|
|
23
|
+
},
|
|
19
24
|
},
|
|
20
25
|
};
|
|
21
26
|
//# sourceMappingURL=common-schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-schema.js","sourceRoot":"","sources":["../../src/schemas/common-schema.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"common-schema.js","sourceRoot":"","sources":["../../src/schemas/common-schema.ts"],"names":[],"mappings":";;;AAAA,4CAA4F;AAE/E,QAAA,YAAY,GAAG;IAC1B,GAAG,EAAE,oBAAoB;IACzB,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE;QACL,SAAS,EAAE;YACT,WAAW,EAAE,2DAA2D;YACxE,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,8BAAkB;SAC5B;QACD,cAAc,EAAE;YACd,WAAW,EAAE,iEAAiE;YAC9E,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,kCAAsB;SAChC;QACD,OAAO,EAAG;YACR,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,4BAAgB;SAC1B;KACF;CACF,CAAC"}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { DeviceStatsMessage } from './schemas/agent/device-status-schema';
|
|
2
2
|
import { AppStateMessage } from './schemas/agent/application-state-schema';
|
|
3
|
-
import { AppInstallCloudResponseMessage, AppStateControlMessage, AppVersionControlMessage } from './schemas/client/application-action-schema';
|
|
3
|
+
import { AppInstallCloudResponseMessage, AppStateControlMessage, AppVersionControlMessage, ModelsInstallCloudResponseMessage } from './schemas/client/application-action-schema';
|
|
4
4
|
import { LiveUpdatesToggleMessage } from './schemas/client/device-agent-action-schema';
|
|
5
5
|
import { AppLogsMessage } from './schemas/agent/application-logs-schema';
|
|
6
6
|
import { AppInstallStatusMessage } from './schemas/agent/app-install-status-schema';
|
|
7
|
-
import {
|
|
8
|
-
export declare type DeviceAgentMessagePayload = DeviceStatsMessage | AppLogsMessage | AppStateMessage | AppInstallStatusMessage |
|
|
7
|
+
import { SignedUrlsRequestMessage } from './schemas/agent/request-data-from-cloud';
|
|
8
|
+
export declare type DeviceAgentMessagePayload = DeviceStatsMessage | AppLogsMessage | AppStateMessage | AppInstallStatusMessage | SignedUrlsRequestMessage;
|
|
9
9
|
export interface DeviceAgentMessage {
|
|
10
10
|
deviceId: string;
|
|
11
11
|
timestamp: string;
|
|
12
12
|
topic: string;
|
|
13
13
|
payload: DeviceAgentMessagePayload;
|
|
14
14
|
}
|
|
15
|
-
export declare type ClientMessagePayload = AppStateControlMessage | AppVersionControlMessage | AppInstallCloudResponseMessage | LiveUpdatesToggleMessage;
|
|
15
|
+
export declare type ClientMessagePayload = AppStateControlMessage | AppVersionControlMessage | AppInstallCloudResponseMessage | ModelsInstallCloudResponseMessage | LiveUpdatesToggleMessage;
|
|
16
16
|
export interface ClientMessage {
|
|
17
17
|
timestamp: string;
|
|
18
18
|
topic: string;
|
package/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,kBAAkB,EACnB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,eAAe,EAEhB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,8BAA8B,EAC9B,sBAAsB,EAEtB,wBAAwB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,kBAAkB,EACnB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,eAAe,EAEhB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,8BAA8B,EAC9B,sBAAsB,EAEtB,wBAAwB,EAGxB,iCAAiC,EAElC,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACL,wBAAwB,EAEzB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,cAAc,EAAiB,MAAM,yCAAyC,CAAC;AAGxF,OAAO,EACL,uBAAuB,EAExB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,wBAAwB,EAEzB,MAAM,yCAAyC,CAAC;AAEjD,oBAAY,yBAAyB,GACjC,kBAAkB,GAClB,cAAc,GACd,eAAe,GACf,uBAAuB,GACvB,wBAAwB,CAAC;AAG7B,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,yBAAyB,CAAC;CACpC;AAED,oBAAY,oBAAoB,GAC5B,sBAAsB,GACtB,wBAAwB,GACxB,8BAA8B,GAC9B,iCAAiC,GACjC,wBAAwB,CAAC;AAE7B,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,oBAAoB,CAAC;CAC/B;AAsFD,eAAO,MAAM,0BAA0B,oDAAsC,CAAC;AAI9E,eAAO,MAAM,qBAAqB,+CAAuC,CAAC"}
|
package/lib/types.js
CHANGED
|
@@ -39,7 +39,7 @@ const agentMessageSchema = (0, utils_1.loadSchemaAsObject)({
|
|
|
39
39
|
application_state_schema_1.appStateSchema,
|
|
40
40
|
application_logs_schema_1.appLogsSchema,
|
|
41
41
|
app_install_status_schema_1.appInstallStatusSchema,
|
|
42
|
-
request_data_from_cloud_1.
|
|
42
|
+
request_data_from_cloud_1.signedUrlsRequestSchema,
|
|
43
43
|
],
|
|
44
44
|
},
|
|
45
45
|
},
|
|
@@ -49,12 +49,12 @@ const agentMessageSchema = (0, utils_1.loadSchemaAsObject)({
|
|
|
49
49
|
toCloud: {
|
|
50
50
|
description: 'Messages sent from the agent itself to cloud backend',
|
|
51
51
|
type: 'string',
|
|
52
|
-
pattern: `^
|
|
52
|
+
pattern: `^to-cloud/aai-device/${constants_1.DEVICE_ID_PATTERN}`,
|
|
53
53
|
},
|
|
54
54
|
toClient: {
|
|
55
55
|
description: 'Messages sent from the agent itself to console client',
|
|
56
56
|
type: 'string',
|
|
57
|
-
pattern: `^
|
|
57
|
+
pattern: `^to-client/aai-device/${constants_1.DEVICE_ID_PATTERN}`,
|
|
58
58
|
},
|
|
59
59
|
},
|
|
60
60
|
});
|
|
@@ -74,6 +74,7 @@ const clientMessageSchema = (0, utils_1.loadSchemaAsObject)({
|
|
|
74
74
|
application_action_schema_1.appStateControlSchema,
|
|
75
75
|
application_action_schema_1.appVersionControlSchema,
|
|
76
76
|
application_action_schema_1.appInstallCloudResponseSchema,
|
|
77
|
+
application_action_schema_1.modelsInstallCloudResponseSchema,
|
|
77
78
|
device_agent_action_schema_1.liveUpdatesToggleSchema,
|
|
78
79
|
],
|
|
79
80
|
},
|
|
@@ -84,7 +85,7 @@ const clientMessageSchema = (0, utils_1.loadSchemaAsObject)({
|
|
|
84
85
|
message: {
|
|
85
86
|
description: 'Topic on which messages are sent to device agent.',
|
|
86
87
|
type: 'string',
|
|
87
|
-
pattern: `^
|
|
88
|
+
pattern: `^to-device/aai-device/${constants_1.DEVICE_ID_PATTERN}`,
|
|
88
89
|
},
|
|
89
90
|
},
|
|
90
91
|
});
|
package/lib/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAAA,6BAA0C;AAC1C,2DAAuD;AACvD,+EAG8C;AAC9C,uFAGkD;AAClD,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAAA,6BAA0C;AAC1C,2DAAuD;AACvD,+EAG8C;AAC9C,uFAGkD;AAClD,0FASoD;AACpD,4FAGqD;AACrD,qFAAwF;AACxF,2CAAgD;AAChD,mCAA6C;AAC7C,yFAGmD;AACnD,qFAGiD;AA8BjD,qEAAqE;AACrE,gFAAgF;AAChF,MAAM,GAAG,GAAG,IAAI,aAAG,CAAC;IAClB,OAAO,EAAE,CAAC,4BAAY,CAAC;CACxB,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,IAAA,0BAAkB,EAAC;IAC5C,GAAG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;SACF;KACF;IACD,QAAQ,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,SAAS,CAAC;IAC3C,oBAAoB,EAAE,KAAK;IAC3B,KAAK,EAAE;QACL,OAAO,EAAE;YACP,WAAW,EAAE,mDAAmD;YAChE,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,yBAAyB,6BAAiB,EAAE;SACtD;KACF;CACF,CAAC,CAAC;AAEH,mDAAmD;AACnD,MAAM,sBAAsB,GAAuC,kBAAkB,CAAC;AACzE,QAAA,0BAA0B,GAAG,GAAG,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAE9E,6CAA6C;AAC7C,MAAM,uBAAuB,GAAkC,mBAAmB,CAAC;AACtE,QAAA,qBAAqB,GAAG,GAAG,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC"}
|
package/lib/types.test.js
CHANGED
|
@@ -5,9 +5,9 @@ const validAgentMessages = [
|
|
|
5
5
|
{
|
|
6
6
|
timestamp: 'Mon, 06 Jun 2022 20:21:46 GMT',
|
|
7
7
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
8
|
-
topic: '
|
|
8
|
+
topic: 'to-cloud/aai-device/68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
9
9
|
payload: {
|
|
10
|
-
messageType: '
|
|
10
|
+
messageType: 'signed_urls_request',
|
|
11
11
|
signedUrlsRequest: {
|
|
12
12
|
projectId: 'b8f8e280-0c59-46e7-911e-7b897263ebc3',
|
|
13
13
|
appReleaseHash: 'c36d58b6a5b5c09e5d46da8a5315f01c20f8c7ff0087b1e31e6e334a702ee8ba',
|
|
@@ -17,7 +17,7 @@ const validAgentMessages = [
|
|
|
17
17
|
{
|
|
18
18
|
timestamp: 'Mon, 06 Jun 2022 20:21:46 GMT',
|
|
19
19
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
20
|
-
topic: '
|
|
20
|
+
topic: 'to-client/aai-device/68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
21
21
|
payload: {
|
|
22
22
|
messageType: 'device_stats',
|
|
23
23
|
deviceStats: {
|
|
@@ -30,7 +30,7 @@ const validAgentMessages = [
|
|
|
30
30
|
{
|
|
31
31
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
32
32
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
33
|
-
topic: '
|
|
33
|
+
topic: 'to-client/aai-device/68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
34
34
|
payload: {
|
|
35
35
|
messageType: 'app_logs',
|
|
36
36
|
appLogs: {
|
|
@@ -42,7 +42,7 @@ const validAgentMessages = [
|
|
|
42
42
|
{
|
|
43
43
|
timestamp: 'Mon, 06 Jun 2022 20:21:46 GMT',
|
|
44
44
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
45
|
-
topic: '
|
|
45
|
+
topic: 'to-client/aai-device/68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
46
46
|
payload: {
|
|
47
47
|
messageType: 'app_state',
|
|
48
48
|
appState: [
|
|
@@ -64,7 +64,7 @@ const validAgentMessages = [
|
|
|
64
64
|
{
|
|
65
65
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
66
66
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
67
|
-
topic: '
|
|
67
|
+
topic: 'to-client/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
68
68
|
payload: {
|
|
69
69
|
messageType: 'app_install_status',
|
|
70
70
|
appInstallStatus: {
|
|
@@ -76,7 +76,7 @@ const validAgentMessages = [
|
|
|
76
76
|
{
|
|
77
77
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
78
78
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
79
|
-
topic: '
|
|
79
|
+
topic: 'to-client/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
80
80
|
payload: {
|
|
81
81
|
messageType: 'app_install_status',
|
|
82
82
|
appInstallStatus: {
|
|
@@ -92,7 +92,7 @@ const invalidAgentMessages = [
|
|
|
92
92
|
{
|
|
93
93
|
timestamp: 'Mon, 06 Jun 2022 20:21:46 GMT',
|
|
94
94
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
95
|
-
topic: '
|
|
95
|
+
topic: 'to-client/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
96
96
|
payload: {
|
|
97
97
|
messageType: 'device_stats',
|
|
98
98
|
deviceStats: {
|
|
@@ -107,7 +107,7 @@ const invalidAgentMessages = [
|
|
|
107
107
|
{
|
|
108
108
|
timestamp: 'Mon, 06 Jun 2022 20:21:46 GMT',
|
|
109
109
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
110
|
-
topic: '
|
|
110
|
+
topic: 'to-client/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
111
111
|
payload: {
|
|
112
112
|
messageType: 'device_stats',
|
|
113
113
|
deviceStats: {
|
|
@@ -121,7 +121,7 @@ const invalidAgentMessages = [
|
|
|
121
121
|
{
|
|
122
122
|
timestamp: 'Mon, 06 Jun 2022 20:21:46 GMT',
|
|
123
123
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
124
|
-
topic: '
|
|
124
|
+
topic: 'to-client/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
125
125
|
payload: {
|
|
126
126
|
messageType: 'app_state',
|
|
127
127
|
applicationState: {
|
|
@@ -134,7 +134,7 @@ const invalidAgentMessages = [
|
|
|
134
134
|
{
|
|
135
135
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
136
136
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
137
|
-
topic: '
|
|
137
|
+
topic: 'to-client/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
138
138
|
payload: {
|
|
139
139
|
messageType: 'app_logs',
|
|
140
140
|
applicationLogs: {
|
|
@@ -146,7 +146,7 @@ const invalidAgentMessages = [
|
|
|
146
146
|
{
|
|
147
147
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
148
148
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
149
|
-
topic: '
|
|
149
|
+
topic: 'to-client/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
150
150
|
payload: {
|
|
151
151
|
messageType: 'install_status',
|
|
152
152
|
installationStatus: {
|
|
@@ -159,7 +159,7 @@ const invalidAgentMessages = [
|
|
|
159
159
|
{
|
|
160
160
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
161
161
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
162
|
-
topic: '
|
|
162
|
+
topic: 'to-client/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
163
163
|
payload: {
|
|
164
164
|
messageType: 'install_status',
|
|
165
165
|
installationStatus: {
|
|
@@ -171,7 +171,7 @@ const invalidAgentMessages = [
|
|
|
171
171
|
{
|
|
172
172
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
173
173
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
174
|
-
topic: '
|
|
174
|
+
topic: 'to-client/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
175
175
|
payload: {
|
|
176
176
|
messageType: 'install_status',
|
|
177
177
|
installationStatus: {
|
|
@@ -184,7 +184,7 @@ const invalidAgentMessages = [
|
|
|
184
184
|
const validClientMessages = [
|
|
185
185
|
{
|
|
186
186
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
187
|
-
topic: '
|
|
187
|
+
topic: 'to-device/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
188
188
|
payload: {
|
|
189
189
|
messageType: 'live_state_updates',
|
|
190
190
|
liveUpdatesToggles: {
|
|
@@ -195,7 +195,7 @@ const validClientMessages = [
|
|
|
195
195
|
},
|
|
196
196
|
{
|
|
197
197
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
198
|
-
topic: '
|
|
198
|
+
topic: 'to-device/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
199
199
|
payload: {
|
|
200
200
|
messageType: 'app_state_control',
|
|
201
201
|
appStateControl: {
|
|
@@ -206,7 +206,7 @@ const validClientMessages = [
|
|
|
206
206
|
},
|
|
207
207
|
{
|
|
208
208
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
209
|
-
topic: '
|
|
209
|
+
topic: 'to-device/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
210
210
|
payload: {
|
|
211
211
|
messageType: 'app_version_control',
|
|
212
212
|
appVersionControl: {
|
|
@@ -219,7 +219,7 @@ const validClientMessages = [
|
|
|
219
219
|
const invalidClientMessages = [
|
|
220
220
|
{
|
|
221
221
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
222
|
-
topic: '
|
|
222
|
+
topic: 'to-device/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
223
223
|
payload: {
|
|
224
224
|
messageType: 'live_updates',
|
|
225
225
|
toggle: 56,
|
|
@@ -227,7 +227,7 @@ const invalidClientMessages = [
|
|
|
227
227
|
},
|
|
228
228
|
{
|
|
229
229
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
230
|
-
topic: '
|
|
230
|
+
topic: 'to-device/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
231
231
|
payload: {
|
|
232
232
|
messageType: 'app_state_control',
|
|
233
233
|
appStateControl: {
|
|
@@ -238,7 +238,7 @@ const invalidClientMessages = [
|
|
|
238
238
|
},
|
|
239
239
|
{
|
|
240
240
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
241
|
-
topic: '
|
|
241
|
+
topic: 'to-device/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
242
242
|
payload: {
|
|
243
243
|
messageType: 'app_version_control',
|
|
244
244
|
appVersionControl: {
|
package/lib/types.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.test.js","sourceRoot":"","sources":["../src/types.test.ts"],"names":[],"mappings":";;AAAA,mCAA4E;AAE5E,MAAM,kBAAkB,GAAG;IACzB;QACE,SAAS,EAAE,+BAA+B;QAC1C,QAAQ,EAAE,sCAAsC;QAChD,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.test.js","sourceRoot":"","sources":["../src/types.test.ts"],"names":[],"mappings":";;AAAA,mCAA4E;AAE5E,MAAM,kBAAkB,GAAG;IACzB;QACE,SAAS,EAAE,+BAA+B;QAC1C,QAAQ,EAAE,sCAAsC;QAChD,KAAK,EAAE,0DAA0D;QACjE,OAAO,EAAE;YACP,WAAW,EAAE,qBAAqB;YAClC,iBAAiB,EAAE;gBACjB,SAAS,EAAE,sCAAsC;gBACjD,cAAc,EACZ,kEAAkE;aACrE;SACF;KACF;IACD;QACE,SAAS,EAAE,+BAA+B;QAC1C,QAAQ,EAAE,sCAAsC;QAChD,KAAK,EAAE,2DAA2D;QAClE,OAAO,EAAE;YACP,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE;gBACX,QAAQ,EAAE,EAAE;gBACZ,QAAQ,EAAE,EAAE;gBACZ,oBAAoB,EAAE,EAAE;aACzB;SACF;KACF;IACD;QACE,SAAS,EAAE,+BAA+B;QAC1C,QAAQ,EAAE,sCAAsC;QAChD,KAAK,EAAE,2DAA2D;QAClE,OAAO,EAAE;YACP,WAAW,EAAE,UAAU;YACvB,OAAO,EAAE;gBACP,SAAS,EAAE,mBAAmB;gBAC9B,QAAQ,EAAE,cAAc;aACzB;SACF;KACF;IACD;QACE,SAAS,EAAE,+BAA+B;QAC1C,QAAQ,EA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IAAA,kCAA0B,EAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,4BAA4B,EAAE,GAAG,EAAE;IACtC,oBAAoB,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACpC,MAAM,CAAC,IAAA,kCAA0B,EAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACrC,mBAAmB,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACnC,MAAM,CAAC,IAAA,6BAAqB,EAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,6BAA6B,EAAE,GAAG,EAAE;IACvC,qBAAqB,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACrC,MAAM,CAAC,IAAA,6BAAqB,EAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
|
@@ -3,19 +3,21 @@ import { keyMirror } from './utils';
|
|
|
3
3
|
export const PROJECT_ID_PATTERN = '([0-9a-z]+-+)+([0-9a-z])+';
|
|
4
4
|
export const DEVICE_ID_PATTERN = '([0-9a-z]+-+)+([0-9a-z])+';
|
|
5
5
|
export const APP_RELEASE_ID_PATTERN = '[0-9a-z]{64}';
|
|
6
|
+
export const MODEL_ID_PATTERN = '[A-Za-z0-9_]+/[A-Za-z0-9_]*';
|
|
6
7
|
|
|
7
8
|
const agentMessageTypeEnum = keyMirror({
|
|
8
9
|
app_logs: null,
|
|
9
10
|
app_state: null,
|
|
10
11
|
device_stats: null,
|
|
11
12
|
app_install_status: null,
|
|
12
|
-
|
|
13
|
+
signed_urls_request: null,
|
|
13
14
|
});
|
|
14
15
|
|
|
15
16
|
const clientMessageTypeEnum = keyMirror({
|
|
16
17
|
app_state_control: null,
|
|
17
18
|
app_version_control: null,
|
|
18
19
|
app_install_cloud_response: null,
|
|
20
|
+
models_install_cloud_response: null,
|
|
19
21
|
live_state_updates: null,
|
|
20
22
|
});
|
|
21
23
|
|
package/src/index.ts
CHANGED
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
AppInstallStatusPacket,
|
|
33
33
|
} from './schemas/agent/app-install-status-schema';
|
|
34
34
|
import { AppStateControlValue, AppStateValue, keyMirrors } from './constants';
|
|
35
|
-
import {
|
|
35
|
+
import { SignedUrlsRequestMessage } from './schemas/agent/request-data-from-cloud';
|
|
36
36
|
|
|
37
37
|
export {
|
|
38
38
|
// types
|
|
@@ -58,7 +58,7 @@ export {
|
|
|
58
58
|
AppVersionControlMessage,
|
|
59
59
|
AppInstallCloudResponseMessage,
|
|
60
60
|
LiveUpdatesToggleMessage,
|
|
61
|
-
|
|
61
|
+
SignedUrlsRequestMessage,
|
|
62
62
|
// generic messages
|
|
63
63
|
DeviceAgentMessage,
|
|
64
64
|
ClientMessage,
|
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
import { keyMirrors } from "../../constants";
|
|
1
|
+
import { keyMirrors, MODEL_ID_PATTERN } from "../../constants";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
type ModelsObject = {
|
|
4
|
+
[modelId: string]: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface SignedUrlsRequestMessage {
|
|
8
|
+
messageType: typeof keyMirrors.agentMessageType.signed_urls_request;
|
|
9
|
+
signedUrlsRequest?: {
|
|
6
10
|
projectId: string;
|
|
7
11
|
appReleaseHash: string;
|
|
8
12
|
};
|
|
13
|
+
modelsOnlyUrlsRequest?: {
|
|
14
|
+
projectId: string;
|
|
15
|
+
models: ModelsObject;
|
|
16
|
+
};
|
|
9
17
|
}
|
|
10
18
|
|
|
11
|
-
export const
|
|
12
|
-
$id: '
|
|
19
|
+
export const signedUrlsRequestSchema = {
|
|
20
|
+
$id: 'signed_urls_request_schema.json',
|
|
13
21
|
type: 'object',
|
|
14
22
|
properties: {
|
|
15
23
|
messageType: {
|
|
16
|
-
const: keyMirrors.agentMessageType.
|
|
24
|
+
const: keyMirrors.agentMessageType.signed_urls_request,
|
|
17
25
|
},
|
|
18
26
|
signedUrlsRequest: {
|
|
19
27
|
type: 'object',
|
|
@@ -28,7 +36,26 @@ export const appInstallSignedUrlsRequestSchema = {
|
|
|
28
36
|
required: ['projectId', 'appReleaseHash'],
|
|
29
37
|
additionalProperties: false,
|
|
30
38
|
},
|
|
39
|
+
modelsOnlyUrlsRequest: {
|
|
40
|
+
type: 'object',
|
|
41
|
+
properties: {
|
|
42
|
+
projectId: {
|
|
43
|
+
$ref: 'common_schema.json#/$defs/projectId',
|
|
44
|
+
},
|
|
45
|
+
models: {
|
|
46
|
+
type: 'object',
|
|
47
|
+
patternProperties: {
|
|
48
|
+
[MODEL_ID_PATTERN]: {
|
|
49
|
+
type: ['integer'],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
additionalProperties: false,
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
required: ['projectId', 'models'],
|
|
56
|
+
additionalProperties: false,
|
|
57
|
+
},
|
|
31
58
|
},
|
|
32
|
-
required: ['messageType'
|
|
59
|
+
required: ['messageType'],
|
|
33
60
|
additionalProperties: false,
|
|
34
61
|
};
|
|
@@ -41,7 +41,15 @@ export interface AppInstallCloudResponseMessage {
|
|
|
41
41
|
appReleaseHash: string;
|
|
42
42
|
appInstallPayload: AppInstallPayload;
|
|
43
43
|
modelsInstallPayload: ModelInstallPayload[];
|
|
44
|
-
}
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export interface ModelsInstallCloudResponseMessage {
|
|
48
|
+
messageType: typeof keyMirrors.clientMessageType.models_install_cloud_response;
|
|
49
|
+
modelsInstallCloudResponse: {
|
|
50
|
+
projectId: string;
|
|
51
|
+
newModels: ModelInstallPayload[];
|
|
52
|
+
};
|
|
45
53
|
};
|
|
46
54
|
|
|
47
55
|
export const appStateControlSchema = {
|
|
@@ -96,6 +104,26 @@ export const appVersionControlSchema = {
|
|
|
96
104
|
additionalProperties: false,
|
|
97
105
|
};
|
|
98
106
|
|
|
107
|
+
const modelsInstallPayload = {
|
|
108
|
+
type: 'array',
|
|
109
|
+
items: {
|
|
110
|
+
type: 'object',
|
|
111
|
+
properties: {
|
|
112
|
+
id: {
|
|
113
|
+
$ref: 'common_schema.json#/$defs/modelId',
|
|
114
|
+
},
|
|
115
|
+
version: {
|
|
116
|
+
type: 'number',
|
|
117
|
+
},
|
|
118
|
+
modelSignedUrl: {
|
|
119
|
+
type: 'string',
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
required: ['id', 'version', 'modelSignedUrl'],
|
|
123
|
+
additionalProperties: false,
|
|
124
|
+
},
|
|
125
|
+
}
|
|
126
|
+
|
|
99
127
|
export const appInstallCloudResponseSchema = {
|
|
100
128
|
$id: 'app_install_cloud_response_schema.json',
|
|
101
129
|
type: 'object',
|
|
@@ -123,25 +151,7 @@ export const appInstallCloudResponseSchema = {
|
|
|
123
151
|
required: ['appSignedUrl'],
|
|
124
152
|
additionalProperties: false,
|
|
125
153
|
},
|
|
126
|
-
modelsInstallPayload
|
|
127
|
-
type: 'array',
|
|
128
|
-
items: {
|
|
129
|
-
type: 'object',
|
|
130
|
-
properties: {
|
|
131
|
-
id: {
|
|
132
|
-
type: 'string',
|
|
133
|
-
},
|
|
134
|
-
version: {
|
|
135
|
-
type: 'number',
|
|
136
|
-
},
|
|
137
|
-
modelSignedUrl: {
|
|
138
|
-
type: 'string',
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
required: ['id', 'version', 'modelSignedUrl'],
|
|
142
|
-
additionalProperties: false,
|
|
143
|
-
}
|
|
144
|
-
}
|
|
154
|
+
modelsInstallPayload,
|
|
145
155
|
},
|
|
146
156
|
required: ['projectId', 'appReleaseHash', 'appInstallPayload', 'modelsInstallPayload'],
|
|
147
157
|
additionalProperties: false,
|
|
@@ -150,3 +160,27 @@ export const appInstallCloudResponseSchema = {
|
|
|
150
160
|
required: ['messageType', 'appInstallCloudResponse'],
|
|
151
161
|
additionalProperties: false,
|
|
152
162
|
};
|
|
163
|
+
|
|
164
|
+
export const modelsInstallCloudResponseSchema = {
|
|
165
|
+
$id: 'models_install_cloud_response_schema.json',
|
|
166
|
+
type: 'object',
|
|
167
|
+
properties: {
|
|
168
|
+
messageType: {
|
|
169
|
+
type: 'string',
|
|
170
|
+
enum: [ keyMirrors.clientMessageType.models_install_cloud_response ],
|
|
171
|
+
},
|
|
172
|
+
modelsInstallCloudResponse: {
|
|
173
|
+
type: 'object',
|
|
174
|
+
properties: {
|
|
175
|
+
projectId: {
|
|
176
|
+
$ref: 'common_schema.json#/$defs/projectId',
|
|
177
|
+
},
|
|
178
|
+
newModels: modelsInstallPayload,
|
|
179
|
+
},
|
|
180
|
+
required: ['projectId', 'newModels'],
|
|
181
|
+
additionalProperties: false,
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
required: ['messageType', 'modelsInstallCloudResponse'],
|
|
185
|
+
additionalProperties: false,
|
|
186
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { APP_RELEASE_ID_PATTERN, PROJECT_ID_PATTERN } from '../constants';
|
|
1
|
+
import { APP_RELEASE_ID_PATTERN, MODEL_ID_PATTERN, PROJECT_ID_PATTERN } from '../constants';
|
|
2
2
|
|
|
3
3
|
export const commonSchema = {
|
|
4
4
|
$id: 'common_schema.json',
|
|
@@ -14,5 +14,10 @@ export const commonSchema = {
|
|
|
14
14
|
type: 'string',
|
|
15
15
|
pattern: APP_RELEASE_ID_PATTERN,
|
|
16
16
|
},
|
|
17
|
+
modelId: {
|
|
18
|
+
description: 'The id of a model',
|
|
19
|
+
type: 'string',
|
|
20
|
+
pattern: MODEL_ID_PATTERN,
|
|
21
|
+
},
|
|
17
22
|
},
|
|
18
23
|
};
|
package/src/types.test.ts
CHANGED
|
@@ -4,9 +4,9 @@ const validAgentMessages = [
|
|
|
4
4
|
{
|
|
5
5
|
timestamp: 'Mon, 06 Jun 2022 20:21:46 GMT',
|
|
6
6
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
7
|
-
topic: '
|
|
7
|
+
topic: 'to-cloud/aai-device/68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
8
8
|
payload: {
|
|
9
|
-
messageType: '
|
|
9
|
+
messageType: 'signed_urls_request',
|
|
10
10
|
signedUrlsRequest: {
|
|
11
11
|
projectId: 'b8f8e280-0c59-46e7-911e-7b897263ebc3',
|
|
12
12
|
appReleaseHash:
|
|
@@ -17,7 +17,7 @@ const validAgentMessages = [
|
|
|
17
17
|
{
|
|
18
18
|
timestamp: 'Mon, 06 Jun 2022 20:21:46 GMT',
|
|
19
19
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
20
|
-
topic: '
|
|
20
|
+
topic: 'to-client/aai-device/68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
21
21
|
payload: {
|
|
22
22
|
messageType: 'device_stats',
|
|
23
23
|
deviceStats: {
|
|
@@ -30,7 +30,7 @@ const validAgentMessages = [
|
|
|
30
30
|
{
|
|
31
31
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
32
32
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
33
|
-
topic: '
|
|
33
|
+
topic: 'to-client/aai-device/68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
34
34
|
payload: {
|
|
35
35
|
messageType: 'app_logs',
|
|
36
36
|
appLogs: {
|
|
@@ -42,7 +42,7 @@ const validAgentMessages = [
|
|
|
42
42
|
{
|
|
43
43
|
timestamp: 'Mon, 06 Jun 2022 20:21:46 GMT',
|
|
44
44
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
45
|
-
topic: '
|
|
45
|
+
topic: 'to-client/aai-device/68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
46
46
|
payload: {
|
|
47
47
|
messageType: 'app_state',
|
|
48
48
|
appState: [
|
|
@@ -64,7 +64,7 @@ const validAgentMessages = [
|
|
|
64
64
|
{
|
|
65
65
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
66
66
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
67
|
-
topic: '
|
|
67
|
+
topic: 'to-client/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
68
68
|
payload: {
|
|
69
69
|
messageType: 'app_install_status',
|
|
70
70
|
appInstallStatus: {
|
|
@@ -77,7 +77,7 @@ const validAgentMessages = [
|
|
|
77
77
|
{
|
|
78
78
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
79
79
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
80
|
-
topic: '
|
|
80
|
+
topic: 'to-client/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
81
81
|
payload: {
|
|
82
82
|
messageType: 'app_install_status',
|
|
83
83
|
appInstallStatus: {
|
|
@@ -95,7 +95,7 @@ const invalidAgentMessages = [
|
|
|
95
95
|
{
|
|
96
96
|
timestamp: 'Mon, 06 Jun 2022 20:21:46 GMT',
|
|
97
97
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
98
|
-
topic: '
|
|
98
|
+
topic: 'to-client/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
99
99
|
payload: {
|
|
100
100
|
messageType: 'device_stats',
|
|
101
101
|
deviceStats: {
|
|
@@ -110,7 +110,7 @@ const invalidAgentMessages = [
|
|
|
110
110
|
{
|
|
111
111
|
timestamp: 'Mon, 06 Jun 2022 20:21:46 GMT',
|
|
112
112
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
113
|
-
topic: '
|
|
113
|
+
topic: 'to-client/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
114
114
|
payload: {
|
|
115
115
|
messageType: 'device_stats',
|
|
116
116
|
deviceStats: {
|
|
@@ -124,7 +124,7 @@ const invalidAgentMessages = [
|
|
|
124
124
|
{
|
|
125
125
|
timestamp: 'Mon, 06 Jun 2022 20:21:46 GMT',
|
|
126
126
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
127
|
-
topic: '
|
|
127
|
+
topic: 'to-client/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
128
128
|
payload: {
|
|
129
129
|
messageType: 'app_state',
|
|
130
130
|
applicationState: {
|
|
@@ -137,7 +137,7 @@ const invalidAgentMessages = [
|
|
|
137
137
|
{
|
|
138
138
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
139
139
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
140
|
-
topic: '
|
|
140
|
+
topic: 'to-client/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
141
141
|
payload: {
|
|
142
142
|
messageType: 'app_logs',
|
|
143
143
|
applicationLogs: {
|
|
@@ -149,7 +149,7 @@ const invalidAgentMessages = [
|
|
|
149
149
|
{
|
|
150
150
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
151
151
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
152
|
-
topic: '
|
|
152
|
+
topic: 'to-client/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
153
153
|
payload: {
|
|
154
154
|
messageType: 'install_status',
|
|
155
155
|
installationStatus: {
|
|
@@ -163,7 +163,7 @@ const invalidAgentMessages = [
|
|
|
163
163
|
{
|
|
164
164
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
165
165
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
166
|
-
topic: '
|
|
166
|
+
topic: 'to-client/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
167
167
|
payload: {
|
|
168
168
|
messageType: 'install_status',
|
|
169
169
|
installationStatus: {
|
|
@@ -175,7 +175,7 @@ const invalidAgentMessages = [
|
|
|
175
175
|
{
|
|
176
176
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
177
177
|
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
178
|
-
topic: '
|
|
178
|
+
topic: 'to-client/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
179
179
|
payload: {
|
|
180
180
|
messageType: 'install_status',
|
|
181
181
|
installationStatus: {
|
|
@@ -189,7 +189,7 @@ const invalidAgentMessages = [
|
|
|
189
189
|
const validClientMessages = [
|
|
190
190
|
{
|
|
191
191
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
192
|
-
topic: '
|
|
192
|
+
topic: 'to-device/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
193
193
|
payload: {
|
|
194
194
|
messageType: 'live_state_updates',
|
|
195
195
|
liveUpdatesToggles: {
|
|
@@ -200,7 +200,7 @@ const validClientMessages = [
|
|
|
200
200
|
},
|
|
201
201
|
{
|
|
202
202
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
203
|
-
topic: '
|
|
203
|
+
topic: 'to-device/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
204
204
|
payload: {
|
|
205
205
|
messageType: 'app_state_control',
|
|
206
206
|
appStateControl: {
|
|
@@ -211,7 +211,7 @@ const validClientMessages = [
|
|
|
211
211
|
},
|
|
212
212
|
{
|
|
213
213
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
214
|
-
topic: '
|
|
214
|
+
topic: 'to-device/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
215
215
|
payload: {
|
|
216
216
|
messageType: 'app_version_control',
|
|
217
217
|
appVersionControl: {
|
|
@@ -226,7 +226,7 @@ const validClientMessages = [
|
|
|
226
226
|
const invalidClientMessages = [
|
|
227
227
|
{
|
|
228
228
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
229
|
-
topic: '
|
|
229
|
+
topic: 'to-device/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
230
230
|
payload: {
|
|
231
231
|
messageType: 'live_updates',
|
|
232
232
|
toggle: 56,
|
|
@@ -234,7 +234,7 @@ const invalidClientMessages = [
|
|
|
234
234
|
},
|
|
235
235
|
{
|
|
236
236
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
237
|
-
topic: '
|
|
237
|
+
topic: 'to-device/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
238
238
|
payload: {
|
|
239
239
|
messageType: 'app_state_control',
|
|
240
240
|
appStateControl: {
|
|
@@ -245,7 +245,7 @@ const invalidClientMessages = [
|
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
247
|
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
248
|
-
topic: '
|
|
248
|
+
topic: 'to-device/aai-device/8195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
249
249
|
payload: {
|
|
250
250
|
messageType: 'app_version_control',
|
|
251
251
|
appVersionControl: {
|
package/src/types.ts
CHANGED
|
@@ -15,6 +15,8 @@ import {
|
|
|
15
15
|
AppVersionControlMessage,
|
|
16
16
|
appVersionControlSchema,
|
|
17
17
|
appInstallCloudResponseSchema,
|
|
18
|
+
ModelsInstallCloudResponseMessage,
|
|
19
|
+
modelsInstallCloudResponseSchema,
|
|
18
20
|
} from './schemas/client/application-action-schema';
|
|
19
21
|
import {
|
|
20
22
|
LiveUpdatesToggleMessage,
|
|
@@ -28,8 +30,8 @@ import {
|
|
|
28
30
|
appInstallStatusSchema,
|
|
29
31
|
} from './schemas/agent/app-install-status-schema';
|
|
30
32
|
import {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
SignedUrlsRequestMessage,
|
|
34
|
+
signedUrlsRequestSchema,
|
|
33
35
|
} from './schemas/agent/request-data-from-cloud';
|
|
34
36
|
|
|
35
37
|
export type DeviceAgentMessagePayload =
|
|
@@ -37,7 +39,7 @@ export type DeviceAgentMessagePayload =
|
|
|
37
39
|
| AppLogsMessage
|
|
38
40
|
| AppStateMessage
|
|
39
41
|
| AppInstallStatusMessage
|
|
40
|
-
|
|
|
42
|
+
| SignedUrlsRequestMessage;
|
|
41
43
|
|
|
42
44
|
// Message Packet Structures
|
|
43
45
|
export interface DeviceAgentMessage {
|
|
@@ -51,6 +53,7 @@ export type ClientMessagePayload =
|
|
|
51
53
|
| AppStateControlMessage
|
|
52
54
|
| AppVersionControlMessage
|
|
53
55
|
| AppInstallCloudResponseMessage
|
|
56
|
+
| ModelsInstallCloudResponseMessage
|
|
54
57
|
| LiveUpdatesToggleMessage;
|
|
55
58
|
|
|
56
59
|
export interface ClientMessage {
|
|
@@ -88,7 +91,7 @@ const agentMessageSchema = loadSchemaAsObject({
|
|
|
88
91
|
appStateSchema,
|
|
89
92
|
appLogsSchema,
|
|
90
93
|
appInstallStatusSchema,
|
|
91
|
-
|
|
94
|
+
signedUrlsRequestSchema,
|
|
92
95
|
],
|
|
93
96
|
},
|
|
94
97
|
},
|
|
@@ -98,12 +101,12 @@ const agentMessageSchema = loadSchemaAsObject({
|
|
|
98
101
|
toCloud: {
|
|
99
102
|
description: 'Messages sent from the agent itself to cloud backend',
|
|
100
103
|
type: 'string',
|
|
101
|
-
pattern: `^
|
|
104
|
+
pattern: `^to-cloud/aai-device/${DEVICE_ID_PATTERN}`,
|
|
102
105
|
},
|
|
103
106
|
toClient: {
|
|
104
107
|
description: 'Messages sent from the agent itself to console client',
|
|
105
108
|
type: 'string',
|
|
106
|
-
pattern: `^
|
|
109
|
+
pattern: `^to-client/aai-device/${DEVICE_ID_PATTERN}`,
|
|
107
110
|
},
|
|
108
111
|
},
|
|
109
112
|
});
|
|
@@ -125,6 +128,7 @@ const clientMessageSchema = loadSchemaAsObject({
|
|
|
125
128
|
appStateControlSchema,
|
|
126
129
|
appVersionControlSchema,
|
|
127
130
|
appInstallCloudResponseSchema,
|
|
131
|
+
modelsInstallCloudResponseSchema,
|
|
128
132
|
liveUpdatesToggleSchema,
|
|
129
133
|
],
|
|
130
134
|
},
|
|
@@ -135,7 +139,7 @@ const clientMessageSchema = loadSchemaAsObject({
|
|
|
135
139
|
message: {
|
|
136
140
|
description: 'Topic on which messages are sent to device agent.',
|
|
137
141
|
type: 'string',
|
|
138
|
-
pattern: `^
|
|
142
|
+
pattern: `^to-device/aai-device/${DEVICE_ID_PATTERN}`,
|
|
139
143
|
},
|
|
140
144
|
},
|
|
141
145
|
});
|