@alwaysai/device-agent-schemas 0.0.2 → 0.0.3
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/schemas/installation-status-schema.d.ts +4 -0
- package/lib/schemas/installation-status-schema.d.ts.map +1 -1
- package/lib/schemas/installation-status-schema.js +4 -1
- package/lib/schemas/installation-status-schema.js.map +1 -1
- package/lib/types.test.js +14 -0
- package/lib/types.test.js.map +1 -1
- package/package.json +1 -1
- package/src/schemas/installation-status-schema.ts +5 -1
- package/src/types.test.ts +17 -1
|
@@ -2,6 +2,7 @@ import { InstallationStatusValue } from "../constants";
|
|
|
2
2
|
export interface InstallationStatus {
|
|
3
3
|
status: InstallationStatusValue;
|
|
4
4
|
reason?: string;
|
|
5
|
+
applicationReleaseHash: string;
|
|
5
6
|
}
|
|
6
7
|
export interface InstallationStatusMessage {
|
|
7
8
|
installationStatus: InstallationStatus;
|
|
@@ -21,6 +22,9 @@ export declare const installationStatusSchema: {
|
|
|
21
22
|
reason: {
|
|
22
23
|
type: string;
|
|
23
24
|
};
|
|
25
|
+
applicationReleaseHash: {
|
|
26
|
+
$ref: string;
|
|
27
|
+
};
|
|
24
28
|
};
|
|
25
29
|
required: string[];
|
|
26
30
|
additionalProperties: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installation-status-schema.d.ts","sourceRoot":"","sources":["../../src/schemas/installation-status-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAA4B,MAAM,cAAc,CAAC;AAEjF,MAAM,WAAW,kBAAkB;IAC/B,MAAM,EAAE,uBAAuB,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"installation-status-schema.d.ts","sourceRoot":"","sources":["../../src/schemas/installation-status-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAA4B,MAAM,cAAc,CAAC;AAEjF,MAAM,WAAW,kBAAkB;IAC/B,MAAM,EAAE,uBAAuB,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sBAAsB,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,yBAAyB;IACtC,kBAAkB,EAAE,kBAAkB,CAAC;CAC1C;AAED,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BpC,CAAA"}
|
|
@@ -17,8 +17,11 @@ exports.installationStatusSchema = {
|
|
|
17
17
|
reason: {
|
|
18
18
|
type: 'string',
|
|
19
19
|
},
|
|
20
|
+
applicationReleaseHash: {
|
|
21
|
+
$ref: 'common_schema.json#/$defs/releaseHash',
|
|
22
|
+
},
|
|
20
23
|
},
|
|
21
|
-
required: ['status'],
|
|
24
|
+
required: ['status', 'applicationReleaseHash'],
|
|
22
25
|
additionalProperties: false,
|
|
23
26
|
},
|
|
24
27
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installation-status-schema.js","sourceRoot":"","sources":["../../src/schemas/installation-status-schema.ts"],"names":[],"mappings":";;;AAAA,4CAAiF;
|
|
1
|
+
{"version":3,"file":"installation-status-schema.js","sourceRoot":"","sources":["../../src/schemas/installation-status-schema.ts"],"names":[],"mappings":";;;AAAA,4CAAiF;AAYpE,QAAA,wBAAwB,GAAG;IACtC,GAAG,EAAE,iCAAiC;IACtC,KAAK,EAAE;QACL,kBAAkB,EAAE;YAClB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,kBAAkB,EAAE;oBAClB,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,MAAM,EAAE;4BACN,IAAI,EAAE,oCAAwB;yBAC/B;wBACD,MAAM,EAAE;4BACN,IAAI,EAAE,QAAQ;yBACf;wBACD,sBAAsB,EAAE;4BACtB,IAAI,EAAE,uCAAuC;yBAC9C;qBACF;oBACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,wBAAwB,CAAC;oBAC9C,oBAAoB,EAAE,KAAK;iBAC5B;aACF;YACD,QAAQ,EAAE,CAAC,oBAAoB,CAAC;YAChC,oBAAoB,EAAE,KAAK;SAC5B;KACF;CACF,CAAA"}
|
package/lib/types.test.js
CHANGED
|
@@ -64,6 +64,7 @@ const validData = [
|
|
|
64
64
|
payload: {
|
|
65
65
|
installationStatus: {
|
|
66
66
|
status: 'in_progress',
|
|
67
|
+
applicationReleaseHash: 'c36d58b6a5b5c09e5d46da8a5315f01c20f8c7ff0087b1e31e6e334a702ee8ba',
|
|
67
68
|
},
|
|
68
69
|
},
|
|
69
70
|
},
|
|
@@ -75,6 +76,7 @@ const validData = [
|
|
|
75
76
|
installationStatus: {
|
|
76
77
|
status: 'failure',
|
|
77
78
|
reason: 'Lost connection to device',
|
|
79
|
+
applicationReleaseHash: 'c36d58b6a5b5c09e5d46da8a5315f01c20f8c7ff0087b1e31e6e334a702ee8ba',
|
|
78
80
|
},
|
|
79
81
|
},
|
|
80
82
|
},
|
|
@@ -133,6 +135,18 @@ const invalidData = [
|
|
|
133
135
|
payload: {
|
|
134
136
|
installationStatus: {
|
|
135
137
|
status: 'woopdeedoop',
|
|
138
|
+
applicationReleaseHash: 'c36d58b6a5b5c09e5d46da8a5315f01c20f8c7ff0087b1e31e6e334a702ee8ba',
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
// missing release hash
|
|
143
|
+
{
|
|
144
|
+
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
145
|
+
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
146
|
+
topic: 'device/68195e4f-045c-4a9e-ae50-b87ed4d611f7/topic/installation-status',
|
|
147
|
+
payload: {
|
|
148
|
+
installationStatus: {
|
|
149
|
+
status: 'success',
|
|
136
150
|
},
|
|
137
151
|
},
|
|
138
152
|
},
|
package/lib/types.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.test.js","sourceRoot":"","sources":["../src/types.test.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"types.test.js","sourceRoot":"","sources":["../src/types.test.ts"],"names":[],"mappings":";;AAAA,mCAAqD;AAErD,MAAM,SAAS,GAAG;IAChB;QACE,SAAS,EAAE,+BAA+B;QAC1C,QAAQ,EAAE,sCAAsC;QAChD,KAAK,EAAE,qEAAqE;QAC5E,OAAO,EAAE;YACP,WAAW,EAAE;gBACX,QAAQ,EAAE,KAAK;gBACf,QAAQ,EAAE,IAAI;gBACd,oBAAoB,EAAE,IAAI;aAC3B;SACF;KACF;IACD;QACE,SAAS,EAAE,+BAA+B;QAC1C,QAAQ,EAAE,sCAAsC;QAChD,KAAK,EAAE,0EAA0E;QACjF,OAAO,EAAE;YACP,WAAW,EAAE,OAAO;YACpB,UAAU,EAAE;gBACV,SAAS,EAAE,mBAAmB;aAC/B;SACF;KACF;IACD;QACE,SAAS,EAAE,+BAA+B;QAC1C,QAAQ,EAAE,sCAAsC;QAChD,KAAK,EAAE,0EAA0E;QACjF,OAAO,EAAE;YACP,eAAe,EAAE;gBACf,IAAI,EAAE,CAAC,EAAE,CAAC;gBACV,SAAS,EAAE,mBAAmB;aAC/B;SACF;KACF;IACD;QACE,SAAS,EAAE,+BAA+B;QAC1C,QAAQ,EAAE,sCAAsC;QAChD,KAAK,EAAE,qEAAqE;QAC5E,OAAO,EAAE;YACP,gBAAgB,EAAE;gBAChB;oBACE,UAAU,EAAE;wBACV,SAAS,EAAE,sCAAsC;wBACjD,OAAO,EAAE,kEAAkE;qBAC5E;oBACD,QAAQ,EAAE;wBACR;4BACE,IAAI,EAAE,EAAE;4BACR,KAAK,EAAE,SAAS;yBACjB;qBACF;iBACF;aACF;SACF;KACF;IACD;QACE,SAAS,EAAE,+BAA+B;QAC1C,QAAQ,EAAE,sCAAsC;QAChD,KAAK,EAAE,uEAAuE;QAC9E,OAAO,EAAE;YACP,kBAAkB,EAAE;gBAClB,MAAM,EAAE,aAAa;gBACrB,sBAAsB,EACpB,kEAA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AAkE;aACrE;SACF;KACF;IACD,uBAAuB;IACvB;QACE,SAAS,EAAE,+BAA+B;QAC1C,QAAQ,EAAE,sCAAsC;QAChD,KAAK,EAAE,uEAAuE;QAC9E,OAAO,EAAE;YACP,kBAAkB,EAAE;gBAClB,MAAM,EAAE,SAAS;aAClB;SACF;KACF;IACD,wBAAwB;IACxB;QACE,SAAS,EAAE,+BAA+B;QAC1C,QAAQ,EAAE,sCAAsC;QAChD,KAAK,EAAE,uEAAuE;QAC9E,OAAO,EAAE;YACP,kBAAkB,EAAE;gBAClB,MAAM,EAAE,aAAa;gBACrB,MAAM,EAAE,EAAE;aACX;SACF;KACF;CACF,CAAC;AAEF,IAAI,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC3B,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACzB,MAAM,CAAC,IAAA,kCAA0B,EAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAC7B,WAAW,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC3B,MAAM,CAAC,IAAA,kCAA0B,EAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@ import { InstallationStatusValue, InstallationStatusValues } from "../constants"
|
|
|
3
3
|
export interface InstallationStatus {
|
|
4
4
|
status: InstallationStatusValue;
|
|
5
5
|
reason?: string;
|
|
6
|
+
applicationReleaseHash: string;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
export interface InstallationStatusMessage {
|
|
@@ -24,8 +25,11 @@ export const installationStatusSchema = {
|
|
|
24
25
|
reason: {
|
|
25
26
|
type: 'string',
|
|
26
27
|
},
|
|
28
|
+
applicationReleaseHash: {
|
|
29
|
+
$ref: 'common_schema.json#/$defs/releaseHash',
|
|
30
|
+
},
|
|
27
31
|
},
|
|
28
|
-
required: ['status'],
|
|
32
|
+
required: ['status', 'applicationReleaseHash'],
|
|
29
33
|
additionalProperties: false,
|
|
30
34
|
},
|
|
31
35
|
},
|
package/src/types.test.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { InstallationStatusValues } from './constants';
|
|
2
1
|
import { validateDeviceAgentMessage } from './types';
|
|
3
2
|
|
|
4
3
|
const validData = [
|
|
@@ -64,6 +63,8 @@ const validData = [
|
|
|
64
63
|
payload: {
|
|
65
64
|
installationStatus: {
|
|
66
65
|
status: 'in_progress',
|
|
66
|
+
applicationReleaseHash:
|
|
67
|
+
'c36d58b6a5b5c09e5d46da8a5315f01c20f8c7ff0087b1e31e6e334a702ee8ba',
|
|
67
68
|
},
|
|
68
69
|
},
|
|
69
70
|
},
|
|
@@ -75,6 +76,8 @@ const validData = [
|
|
|
75
76
|
installationStatus: {
|
|
76
77
|
status: 'failure',
|
|
77
78
|
reason: 'Lost connection to device',
|
|
79
|
+
applicationReleaseHash:
|
|
80
|
+
'c36d58b6a5b5c09e5d46da8a5315f01c20f8c7ff0087b1e31e6e334a702ee8ba',
|
|
78
81
|
},
|
|
79
82
|
},
|
|
80
83
|
},
|
|
@@ -134,6 +137,19 @@ const invalidData = [
|
|
|
134
137
|
payload: {
|
|
135
138
|
installationStatus: {
|
|
136
139
|
status: 'woopdeedoop',
|
|
140
|
+
applicationReleaseHash:
|
|
141
|
+
'c36d58b6a5b5c09e5d46da8a5315f01c20f8c7ff0087b1e31e6e334a702ee8ba',
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
// missing release hash
|
|
146
|
+
{
|
|
147
|
+
timestamp: 'Fri, 27 May 2022 03:47:15 GMT',
|
|
148
|
+
deviceId: '68195e4f-045c-4a9e-ae50-b87ed4d611f7',
|
|
149
|
+
topic: 'device/68195e4f-045c-4a9e-ae50-b87ed4d611f7/topic/installation-status',
|
|
150
|
+
payload: {
|
|
151
|
+
installationStatus: {
|
|
152
|
+
status: 'success',
|
|
137
153
|
},
|
|
138
154
|
},
|
|
139
155
|
},
|