@spotto/contract 0.2.0-alpha.1 → 0.2.0-alpha.4
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/types/readers/post/request.d.ts +6 -1
- package/dist/types/readers/post/request.js +5 -1
- package/dist/types/readers/post/request.js.map +1 -1
- package/dist/types/users/current.d.ts +5 -1
- package/dist/types/users/current.js +6 -0
- package/dist/types/users/current.js.map +1 -1
- package/package.json +3 -3
|
@@ -13,7 +13,7 @@ export interface IAntennaRequest {
|
|
|
13
13
|
level?: string;
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
export interface
|
|
16
|
+
export interface DefaultReaderRequest {
|
|
17
17
|
name: string;
|
|
18
18
|
type: ReaderType;
|
|
19
19
|
deviceType: DeviceType;
|
|
@@ -24,6 +24,11 @@ export interface PostReaderRequest {
|
|
|
24
24
|
saveNetwork?: boolean;
|
|
25
25
|
antennas?: IAntennaRequest[];
|
|
26
26
|
}
|
|
27
|
+
export declare type IFixedReaderRequest = Omit<DefaultReaderRequest, 'name' | 'type'> & {
|
|
28
|
+
type: 'FIXED';
|
|
29
|
+
name?: string;
|
|
30
|
+
};
|
|
31
|
+
export declare type PostReaderRequest = DefaultReaderRequest | IFixedReaderRequest;
|
|
27
32
|
export declare type PostReadersRequest = PostReaderRequest[];
|
|
28
33
|
export declare const upsertedLocationSchema: import("joi").ObjectSchema<IUpsertedLocation>;
|
|
29
34
|
export declare const antennaSchema: import("joi").ObjectSchema<IAntennaRequest>;
|
|
@@ -20,7 +20,11 @@ exports.portalAntennaSchema = shared_1.xArray(exports.antennaSchema.xor('locatio
|
|
|
20
20
|
.min(1);
|
|
21
21
|
exports.virtualAntennaSchema = shared_1.xArray(exports.antennaSchema.oxor('location', 'locationId'), 'port').min(1);
|
|
22
22
|
exports.postReadersRequestSchema = shared_1.xArray(joi_1.object({
|
|
23
|
-
name:
|
|
23
|
+
name: joi_1.when('type', {
|
|
24
|
+
is: 'FIXED',
|
|
25
|
+
then: shared_1.xString,
|
|
26
|
+
otherwise: shared_1.xString.required(),
|
|
27
|
+
}),
|
|
24
28
|
type: shared_1.xStringIsOneOf(...constants_1.READER_TYPES).required(),
|
|
25
29
|
deviceType: shared_1.xStringIsOneOf(...constants_1.DEVICE_TYPES).required(),
|
|
26
30
|
deviceId: joi_1.when('deviceType', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/types/readers/post/request.ts"],"names":[],"mappings":";;;AAAA,6BAAqD;AACrD,6CAAgE;AAChE,yCASsB;AACtB,4CAMsB;
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/types/readers/post/request.ts"],"names":[],"mappings":";;;AAAA,6BAAqD;AACrD,6CAAgE;AAChE,yCASsB;AACtB,4CAMsB;AAmET,QAAA,sBAAsB,GAAG,YAAM,CAAoB;IAC9D,IAAI,EAAE,gBAAO;IACb,KAAK,EAAE,gBAAO;CACf,CAAC,CAAC;AAEU,QAAA,aAAa,GAAG,YAAM,CAAkB;IACnD,IAAI,EAAE,aAAI,CAAC,QAAQ,EAAE;IACrB,IAAI,EAAE,gBAAO;IACb,UAAU,EAAE,kBAAS;IACrB,QAAQ,EAAE,8BAAsB;CACjC,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAAG,eAAM,CACvC,qBAAa,CAAC,GAAG,CAAC,UAAU,EAAE,YAAY,CAAC,EAE3C,MAAM,CACP;KACE,QAAQ,EAAE;KACV,GAAG,CAAC,CAAC,CAAC,CAAC;AAEG,QAAA,oBAAoB,GAAG,eAAM,CACxC,qBAAa,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,EAC5C,MAAM,CACP,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAEI,QAAA,wBAAwB,GAAG,eAAM,CAC5C,YAAM,CAAoB;IAExB,IAAI,EAAE,UAAI,CAAC,MAAM,EAAE;QACjB,EAAE,EAAE,OAAO;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B;YAGD;gBACE,EAAE,EAAE,SAAS;gBACb,IAAI,EAAE,4BAAoB;aAC3B;SACF;QACD,SAAS,EAAE,eAAS,EAAE;KACvB,CAAC;CACH,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,CAClC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAEF,MAAM,0BAA0B,GAAG,CAAC,OAAY,EAAE,EAAE,CACzD,0BAAiB,CAAqB,gCAAwB,EAAE,OAAO,CAAC,CAAC;AAD9D,QAAA,0BAA0B,8BACoC"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { IEntityMeta, IEmbeddedEntity } from '../shared';
|
|
2
|
+
import { Preferences } from '../organisations/constants';
|
|
2
3
|
export interface EmbeddedRole extends IEmbeddedEntity {
|
|
3
4
|
permissions: string[];
|
|
4
5
|
}
|
|
6
|
+
export interface EmbeddedOrganisation extends IEmbeddedEntity {
|
|
7
|
+
preferences: Preferences;
|
|
8
|
+
}
|
|
5
9
|
export interface CurrentUserResponse {
|
|
6
10
|
id: string;
|
|
7
11
|
email: string;
|
|
8
12
|
name: string;
|
|
9
13
|
role: EmbeddedRole;
|
|
10
|
-
organisation:
|
|
14
|
+
organisation: EmbeddedOrganisation;
|
|
11
15
|
meta?: IEntityMeta;
|
|
12
16
|
}
|
|
13
17
|
export declare const currentUserResponseSchema: import("joi").ObjectSchema<import("./[id]").UpdateUserResponse>;
|
|
@@ -4,12 +4,18 @@ exports.validateCurrentUserResponse = exports.currentUserResponseSchema = void 0
|
|
|
4
4
|
const shared_1 = require("../shared");
|
|
5
5
|
const _id_1 = require("./[id]");
|
|
6
6
|
const get_1 = require("../roles/[id]/get");
|
|
7
|
+
const constants_1 = require("../organisations/constants");
|
|
7
8
|
exports.currentUserResponseSchema = _id_1.getUserResponseSchema.append({
|
|
8
9
|
role: shared_1.embeddedEntitySchema()
|
|
9
10
|
.append({
|
|
10
11
|
permissions: get_1.permissionsSchema,
|
|
11
12
|
})
|
|
12
13
|
.required(),
|
|
14
|
+
organisation: shared_1.embeddedEntitySchema()
|
|
15
|
+
.append({
|
|
16
|
+
preferences: constants_1.preferencesSchema,
|
|
17
|
+
})
|
|
18
|
+
.required(),
|
|
13
19
|
});
|
|
14
20
|
const validateCurrentUserResponse = (payload) => shared_1.validateJoiSchema(exports.currentUserResponseSchema, payload);
|
|
15
21
|
exports.validateCurrentUserResponse = validateCurrentUserResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"current.js","sourceRoot":"","sources":["../../../src/types/users/current.ts"],"names":[],"mappings":";;;AAAA,sCAKmB;AACnB,gCAA+C;AAC/C,2CAAsD;
|
|
1
|
+
{"version":3,"file":"current.js","sourceRoot":"","sources":["../../../src/types/users/current.ts"],"names":[],"mappings":";;;AAAA,sCAKmB;AACnB,gCAA+C;AAC/C,2CAAsD;AACtD,0DAA4E;AA+B/D,QAAA,yBAAyB,GAAG,2BAAqB,CAAC,MAAM,CAAC;IACpE,IAAI,EAAE,6BAAoB,EAAgB;SACvC,MAAM,CAAC;QACN,WAAW,EAAE,uBAAiB;KAC/B,CAAC;SACD,QAAQ,EAAE;IACb,YAAY,EAAE,6BAAoB,EAAwB;SACvD,MAAM,CAAC;QACN,WAAW,EAAE,6BAAiB;KAC/B,CAAC;SACD,QAAQ,EAAE;CACd,CAAC,CAAC;AAEI,MAAM,2BAA2B,GAAG,CAAC,OAAY,EAAE,EAAE,CAC1D,0BAAiB,CAAsB,iCAAyB,EAAE,OAAO,CAAC,CAAC;AADhE,QAAA,2BAA2B,+BACqC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spotto/contract",
|
|
3
3
|
"license": "ISC",
|
|
4
|
-
"version": "0.2.0-alpha.
|
|
4
|
+
"version": "0.2.0-alpha.4",
|
|
5
5
|
"description": "Spotto's API Contract",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"files": [
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@airtasker/spot": "^1.4.0",
|
|
20
|
-
"@spotto/core-lib": "^0.1.
|
|
20
|
+
"@spotto/core-lib": "^0.1.6-alpha.0",
|
|
21
21
|
"geojson-validation": "^1.0.2",
|
|
22
22
|
"joi": "^17.2.1",
|
|
23
23
|
"qs": "^6.9.4"
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"jest": "^26.6.3",
|
|
27
27
|
"ts-jest": "^26.5.3"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "650f6c6c61aa37d20b4c72d9922c05d9a6b9e951"
|
|
30
30
|
}
|