spotcharge-types 1.0.361 → 1.0.362
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/consts/catalog/catalog-error.const.d.ts +6 -0
- package/dist/consts/catalog/catalog-error.const.d.ts.map +1 -0
- package/dist/consts/catalog/catalog-error.const.js +8 -0
- package/dist/consts/catalog/catalog-error.const.js.map +1 -0
- package/dist/consts/catalog/vehicle-type.const.d.ts +8 -0
- package/dist/consts/catalog/vehicle-type.const.d.ts.map +1 -0
- package/dist/consts/catalog/vehicle-type.const.js +10 -0
- package/dist/consts/catalog/vehicle-type.const.js.map +1 -0
- package/dist/consts/index.d.ts +2 -0
- package/dist/consts/index.d.ts.map +1 -1
- package/dist/consts/index.js +5 -1
- package/dist/consts/index.js.map +1 -1
- package/dist/models/api/catalog/index.d.ts +3 -0
- package/dist/models/api/catalog/index.d.ts.map +1 -0
- package/dist/models/api/catalog/index.js +3 -0
- package/dist/models/api/catalog/index.js.map +1 -0
- package/dist/models/api/catalog/vehicle-brand.api.model.d.ts +43 -0
- package/dist/models/api/catalog/vehicle-brand.api.model.d.ts.map +1 -0
- package/dist/models/api/catalog/vehicle-brand.api.model.js +3 -0
- package/dist/models/api/catalog/vehicle-brand.api.model.js.map +1 -0
- package/dist/models/api/catalog/vehicle.api.model.d.ts +70 -0
- package/dist/models/api/catalog/vehicle.api.model.d.ts.map +1 -0
- package/dist/models/api/catalog/vehicle.api.model.js +3 -0
- package/dist/models/api/catalog/vehicle.api.model.js.map +1 -0
- package/dist/models/api/index.d.ts +1 -1
- package/dist/models/api/index.d.ts.map +1 -1
- package/dist/models/api/index.js +1 -0
- package/dist/models/api/index.js.map +1 -1
- package/package.json +1 -1
- package/src/consts/catalog/catalog-error.const.ts +7 -0
- package/src/consts/catalog/vehicle-type.const.ts +9 -0
- package/src/consts/index.ts +3 -1
- package/src/models/api/catalog/index.ts +22 -0
- package/src/models/api/catalog/vehicle-brand.api.model.ts +52 -0
- package/src/models/api/catalog/vehicle.api.model.ts +83 -0
- package/src/models/api/index.ts +1 -9
- package/sync-types-to-repos.sh +216 -59
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const CatalogErrorCode: {
|
|
2
|
+
readonly VehicleBrandNameTaken: "VEHICLE_BRAND_NAME_TAKEN";
|
|
3
|
+
readonly VehicleModelTaken: "VEHICLE_MODEL_TAKEN";
|
|
4
|
+
};
|
|
5
|
+
export type CatalogErrorCode = (typeof CatalogErrorCode)[keyof typeof CatalogErrorCode];
|
|
6
|
+
//# sourceMappingURL=catalog-error.const.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-error.const.d.ts","sourceRoot":"","sources":["../../../src/consts/catalog/catalog-error.const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;CAGnB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CatalogErrorCode = void 0;
|
|
4
|
+
exports.CatalogErrorCode = {
|
|
5
|
+
VehicleBrandNameTaken: 'VEHICLE_BRAND_NAME_TAKEN',
|
|
6
|
+
VehicleModelTaken: 'VEHICLE_MODEL_TAKEN',
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=catalog-error.const.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-error.const.js","sourceRoot":"","sources":["../../../src/consts/catalog/catalog-error.const.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG;IAC9B,qBAAqB,EAAE,0BAA0B;IACjD,iBAAiB,EAAE,qBAAqB;CAChC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const VehicleTypeCatalog: {
|
|
2
|
+
readonly Car: "car";
|
|
3
|
+
readonly Bike: "bike";
|
|
4
|
+
readonly Rikshaw: "rikshaw";
|
|
5
|
+
readonly Pickup: "pickup";
|
|
6
|
+
};
|
|
7
|
+
export type VehicleTypeCatalog = (typeof VehicleTypeCatalog)[keyof typeof VehicleTypeCatalog];
|
|
8
|
+
//# sourceMappingURL=vehicle-type.const.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vehicle-type.const.d.ts","sourceRoot":"","sources":["../../../src/consts/catalog/vehicle-type.const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;;CAKrB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAC5B,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VehicleTypeCatalog = void 0;
|
|
4
|
+
exports.VehicleTypeCatalog = {
|
|
5
|
+
Car: 'car',
|
|
6
|
+
Bike: 'bike',
|
|
7
|
+
Rikshaw: 'rikshaw',
|
|
8
|
+
Pickup: 'pickup',
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=vehicle-type.const.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vehicle-type.const.js","sourceRoot":"","sources":["../../../src/consts/catalog/vehicle-type.const.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG;IAChC,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACR,CAAC"}
|
package/dist/consts/index.d.ts
CHANGED
|
@@ -6,4 +6,6 @@ export { Notifications, NotificationType } from './notifications.const';
|
|
|
6
6
|
export { permissionConfig, Permission, PermissionKeys } from './permission-config';
|
|
7
7
|
export { PromotionAdjustmentType, PromotionAppliesTo, PromotionScopeType, } from './pricing';
|
|
8
8
|
export { CampaignScopeType } from './marketing';
|
|
9
|
+
export { VehicleTypeCatalog } from './catalog/vehicle-type.const';
|
|
10
|
+
export { CatalogErrorCode } from './catalog/catalog-error.const';
|
|
9
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/consts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,kBAAkB,EAAE,wBAAwB,EAAC,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAC,eAAe,EAAE,WAAW,EAAC,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAC,0BAA0B,EAAE,8BAA8B,EAAC,MAAM,uCAAuC,CAAC;AACjH,OAAO,EAAC,aAAa,EAAE,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAC,gBAAgB,EAAE,UAAU,EAAE,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACjF,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/consts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,kBAAkB,EAAE,wBAAwB,EAAC,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAC,eAAe,EAAE,WAAW,EAAC,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAC,0BAA0B,EAAE,8BAA8B,EAAC,MAAM,uCAAuC,CAAC;AACjH,OAAO,EAAC,aAAa,EAAE,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAC,gBAAgB,EAAE,UAAU,EAAE,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACjF,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC"}
|
package/dist/consts/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CampaignScopeType = exports.PromotionScopeType = exports.PromotionAppliesTo = exports.PromotionAdjustmentType = exports.permissionConfig = exports.Notifications = exports.VehicleInspectionChecklist = exports.InOutType = exports.InOutStatus = exports.VehiclePurpose = void 0;
|
|
3
|
+
exports.CatalogErrorCode = exports.VehicleTypeCatalog = exports.CampaignScopeType = exports.PromotionScopeType = exports.PromotionAppliesTo = exports.PromotionAdjustmentType = exports.permissionConfig = exports.Notifications = exports.VehicleInspectionChecklist = exports.InOutType = exports.InOutStatus = exports.VehiclePurpose = void 0;
|
|
4
4
|
var vehicle_purpose_const_1 = require("./vehicle-purpose.const");
|
|
5
5
|
Object.defineProperty(exports, "VehiclePurpose", { enumerable: true, get: function () { return vehicle_purpose_const_1.VehiclePurpose; } });
|
|
6
6
|
var in_out_status_const_1 = require("./in-out-status.const");
|
|
@@ -19,4 +19,8 @@ Object.defineProperty(exports, "PromotionAppliesTo", { enumerable: true, get: fu
|
|
|
19
19
|
Object.defineProperty(exports, "PromotionScopeType", { enumerable: true, get: function () { return pricing_1.PromotionScopeType; } });
|
|
20
20
|
var marketing_1 = require("./marketing");
|
|
21
21
|
Object.defineProperty(exports, "CampaignScopeType", { enumerable: true, get: function () { return marketing_1.CampaignScopeType; } });
|
|
22
|
+
var vehicle_type_const_1 = require("./catalog/vehicle-type.const");
|
|
23
|
+
Object.defineProperty(exports, "VehicleTypeCatalog", { enumerable: true, get: function () { return vehicle_type_const_1.VehicleTypeCatalog; } });
|
|
24
|
+
var catalog_error_const_1 = require("./catalog/catalog-error.const");
|
|
25
|
+
Object.defineProperty(exports, "CatalogErrorCode", { enumerable: true, get: function () { return catalog_error_const_1.CatalogErrorCode; } });
|
|
22
26
|
//# sourceMappingURL=index.js.map
|
package/dist/consts/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/consts/index.ts"],"names":[],"mappings":";;;AAAA,iEAAqG;AAA7F,uHAAA,cAAc,OAAA;AACtB,6DAAmE;AAA1C,kHAAA,WAAW,OAAA;AACpC,yDAAyD;AAAjD,8GAAA,SAAS,OAAA;AACjB,6FAAiH;AAAzG,iJAAA,0BAA0B,OAAA;AAClC,6DAAsE;AAA9D,oHAAA,aAAa,OAAA;AACrB,yDAAiF;AAAzE,qHAAA,gBAAgB,OAAA;AACxB,qCAImB;AAHjB,kHAAA,uBAAuB,OAAA;AACvB,6GAAA,kBAAkB,OAAA;AAClB,6GAAA,kBAAkB,OAAA;AAEpB,yCAAgD;AAAvC,8GAAA,iBAAiB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/consts/index.ts"],"names":[],"mappings":";;;AAAA,iEAAqG;AAA7F,uHAAA,cAAc,OAAA;AACtB,6DAAmE;AAA1C,kHAAA,WAAW,OAAA;AACpC,yDAAyD;AAAjD,8GAAA,SAAS,OAAA;AACjB,6FAAiH;AAAzG,iJAAA,0BAA0B,OAAA;AAClC,6DAAsE;AAA9D,oHAAA,aAAa,OAAA;AACrB,yDAAiF;AAAzE,qHAAA,gBAAgB,OAAA;AACxB,qCAImB;AAHjB,kHAAA,uBAAuB,OAAA;AACvB,6GAAA,kBAAkB,OAAA;AAClB,6GAAA,kBAAkB,OAAA;AAEpB,yCAAgD;AAAvC,8GAAA,iBAAiB,OAAA;AAC1B,mEAAkE;AAAzD,wHAAA,kBAAkB,OAAA;AAC3B,qEAAiE;AAAxD,uHAAA,gBAAgB,OAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { VehicleBrandListOrderBy, PublicVehicleBrandListItemApiModel, AdminVehicleBrandListItemApiModel, PublicVehicleBrandListApiModel, AdminVehicleBrandListApiModel, AdminVehicleBrandDetailApiModel, CreateVehicleBrandRequest, UpdateVehicleBrandRequest, } from './vehicle-brand.api.model';
|
|
2
|
+
export { VehicleListOrderBy, PublicVehicleBrandEmbedApiModel, PublicVehicleListItemApiModel, AdminVehicleListItemApiModel, PublicVehicleListApiModel, AdminVehicleListApiModel, AdminVehicleDetailApiModel, CreateVehicleRequest, UpdateVehicleRequest, } from './vehicle.api.model';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/api/catalog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,kCAAkC,EAClC,iCAAiC,EACjC,8BAA8B,EAC9B,6BAA6B,EAC7B,+BAA+B,EAC/B,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,kBAAkB,EAClB,+BAA+B,EAC/B,6BAA6B,EAC7B,4BAA4B,EAC5B,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/api/catalog/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ApiSortDirection, AuditTimestampsApiModel } from '../users';
|
|
2
|
+
/** GET /api/vehicle-brands | GET /api/admin/vehicle-brands list */
|
|
3
|
+
export type VehicleBrandListOrderBy = 'name' | 'createdAt';
|
|
4
|
+
export interface PublicVehicleBrandListItemApiModel {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
logo: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface AdminVehicleBrandListItemApiModel extends PublicVehicleBrandListItemApiModel {
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
}
|
|
13
|
+
export interface PublicVehicleBrandListApiModel {
|
|
14
|
+
rows: PublicVehicleBrandListItemApiModel[];
|
|
15
|
+
totalCount: number;
|
|
16
|
+
pageIndex: number;
|
|
17
|
+
pageSize: number;
|
|
18
|
+
orderBy: VehicleBrandListOrderBy;
|
|
19
|
+
sortDirection: ApiSortDirection;
|
|
20
|
+
}
|
|
21
|
+
export interface AdminVehicleBrandListApiModel {
|
|
22
|
+
rows: AdminVehicleBrandListItemApiModel[];
|
|
23
|
+
totalCount: number;
|
|
24
|
+
pageIndex: number;
|
|
25
|
+
pageSize: number;
|
|
26
|
+
orderBy: VehicleBrandListOrderBy;
|
|
27
|
+
sortDirection: ApiSortDirection;
|
|
28
|
+
}
|
|
29
|
+
export interface AdminVehicleBrandDetailApiModel extends Omit<AdminVehicleBrandListItemApiModel, 'createdAt'>, AuditTimestampsApiModel {
|
|
30
|
+
legacyFirestoreId?: string | null;
|
|
31
|
+
isDeleted: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface CreateVehicleBrandRequest {
|
|
34
|
+
name: string;
|
|
35
|
+
logo?: string | null;
|
|
36
|
+
isActive?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface UpdateVehicleBrandRequest {
|
|
39
|
+
name?: string;
|
|
40
|
+
logo?: string | null;
|
|
41
|
+
isActive?: boolean;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=vehicle-brand.api.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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AC;CACpB;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vehicle-brand.api.model.js","sourceRoot":"","sources":["../../../../src/models/api/catalog/vehicle-brand.api.model.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { VehicleTypeCatalog } from '../../../consts/catalog/vehicle-type.const';
|
|
2
|
+
import { ApiSortDirection, AuditTimestampsApiModel } from '../users';
|
|
3
|
+
import { AdminVehicleBrandListItemApiModel } from './vehicle-brand.api.model';
|
|
4
|
+
/** GET /api/vehicles | GET /api/admin/vehicles list */
|
|
5
|
+
export type VehicleListOrderBy = 'model' | 'createdAt';
|
|
6
|
+
export interface PublicVehicleBrandEmbedApiModel {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
logo: string | null;
|
|
10
|
+
}
|
|
11
|
+
export interface PublicVehicleListItemApiModel {
|
|
12
|
+
id: string;
|
|
13
|
+
model: string;
|
|
14
|
+
image: string | null;
|
|
15
|
+
batteryCapacity: number | null;
|
|
16
|
+
type: VehicleTypeCatalog;
|
|
17
|
+
brand: PublicVehicleBrandEmbedApiModel;
|
|
18
|
+
}
|
|
19
|
+
export interface AdminVehicleListItemApiModel {
|
|
20
|
+
id: string;
|
|
21
|
+
model: string;
|
|
22
|
+
image: string | null;
|
|
23
|
+
batteryCapacity: number | null;
|
|
24
|
+
type: VehicleTypeCatalog;
|
|
25
|
+
vehicleBrandId: string;
|
|
26
|
+
isActive: boolean;
|
|
27
|
+
brand: AdminVehicleBrandListItemApiModel;
|
|
28
|
+
createdAt: string;
|
|
29
|
+
}
|
|
30
|
+
export interface PublicVehicleListApiModel {
|
|
31
|
+
rows: PublicVehicleListItemApiModel[];
|
|
32
|
+
totalCount: number;
|
|
33
|
+
pageIndex: number;
|
|
34
|
+
pageSize: number;
|
|
35
|
+
orderBy: VehicleListOrderBy;
|
|
36
|
+
sortDirection: ApiSortDirection;
|
|
37
|
+
}
|
|
38
|
+
export interface AdminVehicleListApiModel {
|
|
39
|
+
rows: AdminVehicleListItemApiModel[];
|
|
40
|
+
totalCount: number;
|
|
41
|
+
pageIndex: number;
|
|
42
|
+
pageSize: number;
|
|
43
|
+
orderBy: VehicleListOrderBy;
|
|
44
|
+
sortDirection: ApiSortDirection;
|
|
45
|
+
}
|
|
46
|
+
export interface AdminVehicleDetailApiModel extends Omit<AdminVehicleListItemApiModel, 'brand' | 'createdAt'>, AuditTimestampsApiModel {
|
|
47
|
+
year: number | null;
|
|
48
|
+
legacyFirestoreId?: string | null;
|
|
49
|
+
brand: PublicVehicleBrandEmbedApiModel;
|
|
50
|
+
isDeleted: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface CreateVehicleRequest {
|
|
53
|
+
vehicleBrandId: string;
|
|
54
|
+
model: string;
|
|
55
|
+
image?: string | null;
|
|
56
|
+
batteryCapacity?: number | null;
|
|
57
|
+
type: VehicleTypeCatalog;
|
|
58
|
+
year?: number | null;
|
|
59
|
+
isActive?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface UpdateVehicleRequest {
|
|
62
|
+
vehicleBrandId?: string;
|
|
63
|
+
model?: string;
|
|
64
|
+
image?: string | null;
|
|
65
|
+
batteryCapacity?: number | null;
|
|
66
|
+
type?: VehicleTypeCatalog;
|
|
67
|
+
year?: number | null;
|
|
68
|
+
isActive?: boolean;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=vehicle.api.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vehicle.api.model.d.ts","sourceRoot":"","sources":["../../../../src/models/api/catalog/vehicle.api.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC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AAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,aAAa,EAAE,gBAAgB,CAAC;CACjC;AAED,MAAM,WAAW,0BACf,SAAQ,IAAI,CAAC,4BAA4B,EAAE,OAAO,GAAG,WAAW,CAAC,EAC/D,uBAAuB;IACzB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,KAAK,EAAE,+BAA+B,CAAC;IACvC,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,IAAI,EAAE,kBAAkB,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vehicle.api.model.js","sourceRoot":"","sources":["../../../../src/models/api/catalog/vehicle.api.model.ts"],"names":[],"mappings":""}
|
|
@@ -16,7 +16,7 @@ export { RfidApiModel } from './rfid.api.model';
|
|
|
16
16
|
export { OrderApiModel } from './order.api.model';
|
|
17
17
|
export { VehicleApiModel } from './vehicle.api.model';
|
|
18
18
|
export { BrandApiModel } from './brand.api.model';
|
|
19
|
-
export
|
|
19
|
+
export * from './catalog';
|
|
20
20
|
export { BookingApiModel, Refund } from './booking.api.model';
|
|
21
21
|
export { WalletTransactionApiModel } from './wallet-transaction.api.model';
|
|
22
22
|
export { FleetVehicleApiModel } from './fleet-vehicle.api.model';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,eAAe,EAAE,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,iBAAiB,EAAE,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAC,eAAe,EAAE,uBAAuB,EAAC,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,EACzB,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,IAAI,wBAAwB,EAC7C,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AACrE,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,mBAAm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AO,EACL,uCAAuC,EACvC,qCAAqC,EACrC,yCAAyC,EACzC,oCAAoC,EACpC,+BAA+B,EAC/B,wBAAwB,EACxB,gCAAgC,EAChC,oBAAoB,EACpB,sBAAsB,EACtB,6BAA6B,EAC7B,sCAAsC,EACtC,uCAAuC,EACvC,sCAAsC,GACvC,MAAM,sEAAsE,CAAC;AAC9E,OAAO,EAAC,kBAAkB,EAAC,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAC,2BAA2B,EAAC,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,0BAA0B,EAC1B,6BAA6B,EAC7B,mCAAmC,EACnC,8BAA8B,EAC9B,4BAA4B,GAC7B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,eAAe,EACf,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,SAAS,CAAC;AACjB,cAAc,SAAS,CAAC"}
|
package/dist/models/api/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.FLEET_ID_HEADER = exports.PARTNER_BUSINESS_UNIT_ACCESS_HEADER = exports.ChannelPartnerYearsInBusiness = exports.ChannelPartnerTimeline = exports.ChannelPartnerSource = exports.ChannelPartnerInvestmentCapacity = exports.ChannelPartnerEntityType = exports.ChannelPartnerApplicationStatus = exports.PartnerInquiryStatus = exports.PartnerInquiryTimeline = exports.PartnerInquiryLocationReadiness = exports.PartnerInquiryInvestmentRange = exports.ContactSubmissionStatus = exports.StationSearchSource = void 0;
|
|
18
|
+
__exportStar(require("./catalog"), exports);
|
|
18
19
|
var enum_1 = require("../../enum");
|
|
19
20
|
Object.defineProperty(exports, "StationSearchSource", { enumerable: true, get: function () { return enum_1.StationSearchSource; } });
|
|
20
21
|
var contact_submission_api_model_1 = require("./contact-submissions/contact-submission.api.model");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAgEA,4CAA0B;AAwC1B,mCAA+C;AAAvC,2GAAA,mBAAmB,OAAA;AAkF3B,mGAQ4D;AAH1D,uIAAA,uBAAuB,OAAA;AAKzB,yEAA2J;AAA3H,0IAAA,6BAA6B,OAAA;AAAE,4IAAA,+BAA+B,OAAA;AAAE,mIAAA,sBAAsB,OAAA;AACtH,2FASuD;AADrD,iIAAA,oBAAoB,OAAA;AAEtB,8HAc8E;AAT5E,wJAAA,+BAA+B,OAAA;AAC/B,iJAAA,wBAAwB,OAAA;AACxB,yJAAA,gCAAgC,OAAA;AAChC,6IAAA,oBAAoB,OAAA;AACpB,+IAAA,sBAAsB,OAAA;AACtB,sJAAA,6BAA6B,OAAA;AAO/B,qCAQmB;AAHjB,8HAAA,mCAAmC,OAAA;AAIrC,iCAIiB;AAHf,wGAAA,eAAe,OAAA;AAIjB,0CAAwB"}
|
package/package.json
CHANGED
package/src/consts/index.ts
CHANGED
|
@@ -9,4 +9,6 @@ export {
|
|
|
9
9
|
PromotionAppliesTo,
|
|
10
10
|
PromotionScopeType,
|
|
11
11
|
} from './pricing';
|
|
12
|
-
export { CampaignScopeType } from './marketing';
|
|
12
|
+
export { CampaignScopeType } from './marketing';
|
|
13
|
+
export { VehicleTypeCatalog } from './catalog/vehicle-type.const';
|
|
14
|
+
export { CatalogErrorCode } from './catalog/catalog-error.const';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export {
|
|
2
|
+
VehicleBrandListOrderBy,
|
|
3
|
+
PublicVehicleBrandListItemApiModel,
|
|
4
|
+
AdminVehicleBrandListItemApiModel,
|
|
5
|
+
PublicVehicleBrandListApiModel,
|
|
6
|
+
AdminVehicleBrandListApiModel,
|
|
7
|
+
AdminVehicleBrandDetailApiModel,
|
|
8
|
+
CreateVehicleBrandRequest,
|
|
9
|
+
UpdateVehicleBrandRequest,
|
|
10
|
+
} from './vehicle-brand.api.model';
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
VehicleListOrderBy,
|
|
14
|
+
PublicVehicleBrandEmbedApiModel,
|
|
15
|
+
PublicVehicleListItemApiModel,
|
|
16
|
+
AdminVehicleListItemApiModel,
|
|
17
|
+
PublicVehicleListApiModel,
|
|
18
|
+
AdminVehicleListApiModel,
|
|
19
|
+
AdminVehicleDetailApiModel,
|
|
20
|
+
CreateVehicleRequest,
|
|
21
|
+
UpdateVehicleRequest,
|
|
22
|
+
} from './vehicle.api.model';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ApiSortDirection, AuditTimestampsApiModel } from '../users';
|
|
2
|
+
|
|
3
|
+
/** GET /api/vehicle-brands | GET /api/admin/vehicle-brands list */
|
|
4
|
+
export type VehicleBrandListOrderBy = 'name' | 'createdAt';
|
|
5
|
+
|
|
6
|
+
export interface PublicVehicleBrandListItemApiModel {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
logo: string | null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface AdminVehicleBrandListItemApiModel extends PublicVehicleBrandListItemApiModel {
|
|
13
|
+
isActive: boolean;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface PublicVehicleBrandListApiModel {
|
|
18
|
+
rows: PublicVehicleBrandListItemApiModel[];
|
|
19
|
+
totalCount: number;
|
|
20
|
+
pageIndex: number;
|
|
21
|
+
pageSize: number;
|
|
22
|
+
orderBy: VehicleBrandListOrderBy;
|
|
23
|
+
sortDirection: ApiSortDirection;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface AdminVehicleBrandListApiModel {
|
|
27
|
+
rows: AdminVehicleBrandListItemApiModel[];
|
|
28
|
+
totalCount: number;
|
|
29
|
+
pageIndex: number;
|
|
30
|
+
pageSize: number;
|
|
31
|
+
orderBy: VehicleBrandListOrderBy;
|
|
32
|
+
sortDirection: ApiSortDirection;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface AdminVehicleBrandDetailApiModel
|
|
36
|
+
extends Omit<AdminVehicleBrandListItemApiModel, 'createdAt'>,
|
|
37
|
+
AuditTimestampsApiModel {
|
|
38
|
+
legacyFirestoreId?: string | null;
|
|
39
|
+
isDeleted: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface CreateVehicleBrandRequest {
|
|
43
|
+
name: string;
|
|
44
|
+
logo?: string | null;
|
|
45
|
+
isActive?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface UpdateVehicleBrandRequest {
|
|
49
|
+
name?: string;
|
|
50
|
+
logo?: string | null;
|
|
51
|
+
isActive?: boolean;
|
|
52
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { VehicleTypeCatalog } from '../../../consts/catalog/vehicle-type.const';
|
|
2
|
+
import { ApiSortDirection, AuditTimestampsApiModel } from '../users';
|
|
3
|
+
import {
|
|
4
|
+
AdminVehicleBrandListItemApiModel,
|
|
5
|
+
PublicVehicleBrandListItemApiModel,
|
|
6
|
+
} from './vehicle-brand.api.model';
|
|
7
|
+
|
|
8
|
+
/** GET /api/vehicles | GET /api/admin/vehicles list */
|
|
9
|
+
export type VehicleListOrderBy = 'model' | 'createdAt';
|
|
10
|
+
|
|
11
|
+
export interface PublicVehicleBrandEmbedApiModel {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
logo: string | null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface PublicVehicleListItemApiModel {
|
|
18
|
+
id: string;
|
|
19
|
+
model: string;
|
|
20
|
+
image: string | null;
|
|
21
|
+
batteryCapacity: number | null;
|
|
22
|
+
type: VehicleTypeCatalog;
|
|
23
|
+
brand: PublicVehicleBrandEmbedApiModel;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface AdminVehicleListItemApiModel {
|
|
27
|
+
id: string;
|
|
28
|
+
model: string;
|
|
29
|
+
image: string | null;
|
|
30
|
+
batteryCapacity: number | null;
|
|
31
|
+
type: VehicleTypeCatalog;
|
|
32
|
+
vehicleBrandId: string;
|
|
33
|
+
isActive: boolean;
|
|
34
|
+
brand: AdminVehicleBrandListItemApiModel;
|
|
35
|
+
createdAt: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface PublicVehicleListApiModel {
|
|
39
|
+
rows: PublicVehicleListItemApiModel[];
|
|
40
|
+
totalCount: number;
|
|
41
|
+
pageIndex: number;
|
|
42
|
+
pageSize: number;
|
|
43
|
+
orderBy: VehicleListOrderBy;
|
|
44
|
+
sortDirection: ApiSortDirection;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface AdminVehicleListApiModel {
|
|
48
|
+
rows: AdminVehicleListItemApiModel[];
|
|
49
|
+
totalCount: number;
|
|
50
|
+
pageIndex: number;
|
|
51
|
+
pageSize: number;
|
|
52
|
+
orderBy: VehicleListOrderBy;
|
|
53
|
+
sortDirection: ApiSortDirection;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface AdminVehicleDetailApiModel
|
|
57
|
+
extends Omit<AdminVehicleListItemApiModel, 'brand' | 'createdAt'>,
|
|
58
|
+
AuditTimestampsApiModel {
|
|
59
|
+
year: number | null;
|
|
60
|
+
legacyFirestoreId?: string | null;
|
|
61
|
+
brand: PublicVehicleBrandEmbedApiModel;
|
|
62
|
+
isDeleted: boolean;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface CreateVehicleRequest {
|
|
66
|
+
vehicleBrandId: string;
|
|
67
|
+
model: string;
|
|
68
|
+
image?: string | null;
|
|
69
|
+
batteryCapacity?: number | null;
|
|
70
|
+
type: VehicleTypeCatalog;
|
|
71
|
+
year?: number | null;
|
|
72
|
+
isActive?: boolean;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface UpdateVehicleRequest {
|
|
76
|
+
vehicleBrandId?: string;
|
|
77
|
+
model?: string;
|
|
78
|
+
image?: string | null;
|
|
79
|
+
batteryCapacity?: number | null;
|
|
80
|
+
type?: VehicleTypeCatalog;
|
|
81
|
+
year?: number | null;
|
|
82
|
+
isActive?: boolean;
|
|
83
|
+
}
|
package/src/models/api/index.ts
CHANGED
|
@@ -62,15 +62,7 @@ export {RfidApiModel} from './rfid.api.model';
|
|
|
62
62
|
export {OrderApiModel} from './order.api.model';
|
|
63
63
|
export {VehicleApiModel} from './vehicle.api.model';
|
|
64
64
|
export {BrandApiModel} from './brand.api.model';
|
|
65
|
-
export
|
|
66
|
-
BrandListItemApiModel,
|
|
67
|
-
BrandListApiModel,
|
|
68
|
-
BrandDetailApiModel,
|
|
69
|
-
CreateBrandRequest,
|
|
70
|
-
UpdateBrandRequest,
|
|
71
|
-
CreateBrandResponse,
|
|
72
|
-
BrandListOrderBy
|
|
73
|
-
} from './brand/brand.api.model';
|
|
65
|
+
export * from './catalog';
|
|
74
66
|
export {BookingApiModel, Refund} from './booking.api.model';
|
|
75
67
|
export {WalletTransactionApiModel} from './wallet-transaction.api.model';
|
|
76
68
|
export {FleetVehicleApiModel} from './fleet-vehicle.api.model';
|
package/sync-types-to-repos.sh
CHANGED
|
@@ -4,30 +4,22 @@
|
|
|
4
4
|
# Never runs `npm install file:...` — that writes file:../spotcharge-types into
|
|
5
5
|
# package.json and lockfiles, and some npm versions ignore --no-save.
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# Bumps the local patch version first so unpublished work is not stuck on an
|
|
8
|
+
# already-published number (npm install / IDEs treat that as "already have it").
|
|
9
|
+
# Skip the bump with SYNC_NO_BUMP=1.
|
|
10
|
+
#
|
|
11
|
+
# Discovers sibling packages that depend on spotcharge-types (skips git/gitlab
|
|
12
|
+
# specs). Pins each package.json to ^<version> and copies dist + src.
|
|
8
13
|
#
|
|
9
14
|
# Usage (from spotcharge-types):
|
|
10
15
|
# ./sync-types-to-repos.sh
|
|
11
16
|
# npm run sync-repos
|
|
12
17
|
|
|
13
|
-
set -
|
|
18
|
+
set -euo pipefail
|
|
14
19
|
|
|
15
20
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
16
21
|
TYPES_DIR="$SCRIPT_DIR"
|
|
17
22
|
PROJECTS_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
18
|
-
TYPES_VERSION="$(node -p "require('$TYPES_DIR/package.json').version")"
|
|
19
|
-
PUBLISHED_SPEC="^${TYPES_VERSION}"
|
|
20
|
-
|
|
21
|
-
TARGETS=(
|
|
22
|
-
"spotcharge-node-ocpp"
|
|
23
|
-
"spotcharge.co.in_mobile-app"
|
|
24
|
-
"spotcharge-superadmin"
|
|
25
|
-
"spotcharge-superadmin/functions"
|
|
26
|
-
"spotcharge-fleet-mobile-app"
|
|
27
|
-
"spotcharge-client-portal"
|
|
28
|
-
"spotcharge-script"
|
|
29
|
-
"spotcharge-script/scripts"
|
|
30
|
-
)
|
|
31
23
|
|
|
32
24
|
RED='\033[0;31m'
|
|
33
25
|
GREEN='\033[0;32m'
|
|
@@ -43,11 +35,89 @@ fail() {
|
|
|
43
35
|
exit 1
|
|
44
36
|
}
|
|
45
37
|
|
|
38
|
+
read_types_version() {
|
|
39
|
+
node -p "require('$TYPES_DIR/package.json').version"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
bump_local_patch() {
|
|
43
|
+
if [[ "${SYNC_NO_BUMP:-}" == "1" ]]; then
|
|
44
|
+
log "SYNC_NO_BUMP=1 — keeping spotcharge-types@$(read_types_version)"
|
|
45
|
+
return 0
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
local before after
|
|
49
|
+
before="$(read_types_version)"
|
|
50
|
+
log "Bumping patch ${before} → next (unpublished local sync)..."
|
|
51
|
+
cd "$TYPES_DIR" || fail "cannot cd to $TYPES_DIR"
|
|
52
|
+
npm version patch --no-git-tag-version >/dev/null
|
|
53
|
+
after="$(read_types_version)"
|
|
54
|
+
log " ${GREEN}${before} → ${after}${NC}"
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
# Sibling packages with a semver/file: spotcharge-types dep. Skips git hosts.
|
|
58
|
+
discover_targets() {
|
|
59
|
+
node - "$PROJECTS_ROOT" "$TYPES_DIR" <<'EOF'
|
|
60
|
+
const fs = require('fs');
|
|
61
|
+
const path = require('path');
|
|
62
|
+
|
|
63
|
+
const root = process.argv[2];
|
|
64
|
+
const typesDir = process.argv[3];
|
|
65
|
+
const skipNames = new Set(['node_modules', 'dist', '.git', 'coverage']);
|
|
66
|
+
const gitSpec = /^(gitlab:|github:|git\+|https?:|ssh:)/;
|
|
67
|
+
const out = [];
|
|
68
|
+
|
|
69
|
+
function specOf(pkg) {
|
|
70
|
+
return (
|
|
71
|
+
(pkg.dependencies && pkg.dependencies['spotcharge-types']) ||
|
|
72
|
+
(pkg.devDependencies && pkg.devDependencies['spotcharge-types']) ||
|
|
73
|
+
null
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function walk(dir, depth) {
|
|
78
|
+
if (depth > 3) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
let entries;
|
|
82
|
+
try {
|
|
83
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
84
|
+
} catch {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const pkgPath = path.join(dir, 'package.json');
|
|
89
|
+
if (fs.existsSync(pkgPath) && path.resolve(dir) !== path.resolve(typesDir)) {
|
|
90
|
+
try {
|
|
91
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
92
|
+
const spec = specOf(pkg);
|
|
93
|
+
if (spec && !gitSpec.test(spec)) {
|
|
94
|
+
out.push(path.relative(root, dir));
|
|
95
|
+
}
|
|
96
|
+
} catch {
|
|
97
|
+
// ignore unreadable package.json
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
for (const entry of entries) {
|
|
102
|
+
if (!entry.isDirectory() || skipNames.has(entry.name) || entry.name.startsWith('.')) {
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
walk(path.join(dir, entry.name), depth + 1);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
walk(root, 0);
|
|
110
|
+
out.sort();
|
|
111
|
+
process.stdout.write(out.join('\n') + (out.length ? '\n' : ''));
|
|
112
|
+
EOF
|
|
113
|
+
}
|
|
114
|
+
|
|
46
115
|
# Surgical string replace — do not JSON.parse/stringify lockfiles (preserves formatting).
|
|
47
|
-
|
|
48
|
-
strip_file_specs() {
|
|
116
|
+
pin_types_spec() {
|
|
49
117
|
local project_dir="$1"
|
|
50
|
-
|
|
118
|
+
local published_spec="$2"
|
|
119
|
+
local types_version="$3"
|
|
120
|
+
node - "$project_dir" "$published_spec" "$types_version" <<'EOF'
|
|
51
121
|
const fs = require('fs');
|
|
52
122
|
const path = require('path');
|
|
53
123
|
|
|
@@ -55,22 +125,19 @@ const projectDir = process.argv[2];
|
|
|
55
125
|
const publishedSpec = process.argv[3];
|
|
56
126
|
const typesVersion = process.argv[4];
|
|
57
127
|
const files = ['package.json', 'package-lock.json', 'npm-shrinkwrap.json'];
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
` "version": "${typesVersion}",`,
|
|
61
|
-
` "resolved": "https://registry.npmjs.org/spotcharge-types/-/spotcharge-types-${typesVersion}.tgz",`,
|
|
62
|
-
' "license": "ISC"',
|
|
63
|
-
' }',
|
|
64
|
-
].join('\n');
|
|
65
|
-
|
|
66
|
-
const replaceFileSpecs = (raw) =>
|
|
128
|
+
|
|
129
|
+
const pinSpecs = (raw) =>
|
|
67
130
|
raw
|
|
68
|
-
.replace(/("spotcharge-types"\s*:\s*)"file:[^"]+"/g, `$1"${publishedSpec}"`)
|
|
69
|
-
.replace(/("version"\s*:\s*)"file:[^"]*spotcharge-types[^"]*"/g, `$1"${publishedSpec}"`)
|
|
131
|
+
.replace(/("spotcharge-types"\s*:\s*)"(file:[^"]+|\^?\d+\.\d+\.\d+)"/g, `$1"${publishedSpec}"`)
|
|
70
132
|
.replace(/\n "\.\.(?:\/\.\.)*\/spotcharge-types": \{[\s\S]*?\n \},/g, '')
|
|
71
133
|
.replace(
|
|
72
134
|
/ "node_modules\/spotcharge-types": \{\s*"resolved": "(?:\.\.\/)+spotcharge-types",\s*"link": true\s*\}/g,
|
|
73
|
-
|
|
135
|
+
[
|
|
136
|
+
' "node_modules/spotcharge-types": {',
|
|
137
|
+
` "version": "${typesVersion}",`,
|
|
138
|
+
' "license": "ISC"',
|
|
139
|
+
' }',
|
|
140
|
+
].join('\n')
|
|
74
141
|
);
|
|
75
142
|
|
|
76
143
|
const changed = [];
|
|
@@ -80,7 +147,7 @@ for (const name of files) {
|
|
|
80
147
|
continue;
|
|
81
148
|
}
|
|
82
149
|
const raw = fs.readFileSync(filePath, 'utf8');
|
|
83
|
-
const next =
|
|
150
|
+
const next = pinSpecs(raw);
|
|
84
151
|
if (next !== raw) {
|
|
85
152
|
fs.writeFileSync(filePath, next);
|
|
86
153
|
changed.push(name);
|
|
@@ -88,7 +155,7 @@ for (const name of files) {
|
|
|
88
155
|
}
|
|
89
156
|
|
|
90
157
|
if (changed.length) {
|
|
91
|
-
process.stdout.write(`
|
|
158
|
+
process.stdout.write(`pinned spotcharge-types@${publishedSpec} in ${changed.join(', ')}\n`);
|
|
92
159
|
}
|
|
93
160
|
EOF
|
|
94
161
|
}
|
|
@@ -101,21 +168,99 @@ has_file_spec() {
|
|
|
101
168
|
copy_types_into_node_modules() {
|
|
102
169
|
local project_dir="$1"
|
|
103
170
|
local dest="$project_dir/node_modules/spotcharge-types"
|
|
171
|
+
local tmp="${dest}.syncing.$$"
|
|
172
|
+
|
|
173
|
+
mkdir -p "$project_dir/node_modules"
|
|
174
|
+
rm -rf "$tmp"
|
|
175
|
+
mkdir -p "$tmp/dist"
|
|
176
|
+
cp "$TYPES_DIR/package.json" "$tmp/package.json"
|
|
177
|
+
cp -R "$TYPES_DIR/dist/." "$tmp/dist/"
|
|
178
|
+
if [[ -d "$TYPES_DIR/src" ]]; then
|
|
179
|
+
mkdir -p "$tmp/src"
|
|
180
|
+
cp -R "$TYPES_DIR/src/." "$tmp/src/"
|
|
181
|
+
fi
|
|
182
|
+
|
|
183
|
+
mkdir -p "$dest"
|
|
184
|
+
# Replace package files in place. Ignore leftover .cursor/.idea — those get
|
|
185
|
+
# copied into node_modules when dest was once a full-repo copy, and the
|
|
186
|
+
# sandbox/IDE often locks them so `rm -rf dest` cannot finish.
|
|
187
|
+
if command -v rsync >/dev/null 2>&1; then
|
|
188
|
+
rsync -a --delete --exclude '.cursor/' --exclude '.idea/' "$tmp/" "$dest/"
|
|
189
|
+
else
|
|
190
|
+
rm -rf "$dest/dist" "$dest/src" "$dest/package.json"
|
|
191
|
+
cp "$tmp/package.json" "$dest/package.json"
|
|
192
|
+
cp -R "$tmp/dist" "$dest/dist"
|
|
193
|
+
if [[ -d "$tmp/src" ]]; then
|
|
194
|
+
cp -R "$tmp/src" "$dest/src"
|
|
195
|
+
fi
|
|
196
|
+
fi
|
|
197
|
+
rm -rf "$tmp"
|
|
198
|
+
rm -rf "$dest/.cursor" "$dest/.idea" 2>/dev/null || true
|
|
199
|
+
}
|
|
104
200
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
201
|
+
verify_copy() {
|
|
202
|
+
local project_dir="$1"
|
|
203
|
+
local label="$2"
|
|
204
|
+
local types_version="$3"
|
|
205
|
+
local published_spec="$4"
|
|
206
|
+
node - "$project_dir" "$label" "$types_version" "$published_spec" "$TYPES_DIR" <<'EOF'
|
|
207
|
+
const fs = require('fs');
|
|
208
|
+
const path = require('path');
|
|
209
|
+
|
|
210
|
+
const projectDir = process.argv[2];
|
|
211
|
+
const label = process.argv[3];
|
|
212
|
+
const typesVersion = process.argv[4];
|
|
213
|
+
const publishedSpec = process.argv[5];
|
|
214
|
+
const typesDir = process.argv[6];
|
|
215
|
+
const dest = path.join(projectDir, 'node_modules', 'spotcharge-types');
|
|
216
|
+
const issues = [];
|
|
217
|
+
|
|
218
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(projectDir, 'package.json'), 'utf8'));
|
|
219
|
+
const spec =
|
|
220
|
+
(pkg.dependencies && pkg.dependencies['spotcharge-types']) ||
|
|
221
|
+
(pkg.devDependencies && pkg.devDependencies['spotcharge-types']);
|
|
222
|
+
if (spec !== publishedSpec) {
|
|
223
|
+
issues.push(`package.json spec is ${spec}, expected ${publishedSpec}`);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (!fs.existsSync(path.join(dest, 'package.json'))) {
|
|
227
|
+
issues.push('node_modules/spotcharge-types missing');
|
|
228
|
+
} else {
|
|
229
|
+
const copied = JSON.parse(fs.readFileSync(path.join(dest, 'package.json'), 'utf8'));
|
|
230
|
+
if (copied.version !== typesVersion) {
|
|
231
|
+
issues.push(`copied version ${copied.version} != ${typesVersion}`);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
for (const rel of ['dist/index.js', 'dist/index.d.ts']) {
|
|
236
|
+
if (!fs.existsSync(path.join(dest, rel))) {
|
|
237
|
+
issues.push(`missing ${rel}`);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (fs.existsSync(path.join(typesDir, 'src')) && !fs.existsSync(path.join(dest, 'src'))) {
|
|
242
|
+
issues.push('missing src (needed for declaration maps)');
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const catalogSrc = path.join(typesDir, 'dist', 'models', 'api', 'catalog', 'index.d.ts');
|
|
246
|
+
const catalogDest = path.join(dest, 'dist', 'models', 'api', 'catalog', 'index.d.ts');
|
|
247
|
+
if (fs.existsSync(catalogSrc) && !fs.existsSync(catalogDest)) {
|
|
248
|
+
issues.push('missing catalog d.ts');
|
|
249
|
+
}
|
|
109
250
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
251
|
+
if (issues.length) {
|
|
252
|
+
process.stderr.write(`${label}: ${issues.join('; ')}\n`);
|
|
253
|
+
process.exit(1);
|
|
254
|
+
}
|
|
255
|
+
EOF
|
|
113
256
|
}
|
|
114
257
|
|
|
115
258
|
install_types_in() {
|
|
116
259
|
local project_dir="$1"
|
|
117
260
|
local label="$2"
|
|
118
|
-
local
|
|
261
|
+
local types_version="$3"
|
|
262
|
+
local published_spec="$4"
|
|
263
|
+
local pin_out
|
|
119
264
|
|
|
120
265
|
if [[ ! -d "$project_dir" ]]; then
|
|
121
266
|
log "${YELLOW}SKIP${NC} $label — directory not found: $project_dir"
|
|
@@ -129,9 +274,9 @@ install_types_in() {
|
|
|
129
274
|
|
|
130
275
|
log "\n${GREEN}==>${NC} $label"
|
|
131
276
|
|
|
132
|
-
|
|
133
|
-
if [[ -n "$
|
|
134
|
-
log " ${YELLOW}${
|
|
277
|
+
pin_out="$(pin_types_spec "$project_dir" "$published_spec" "$types_version")"
|
|
278
|
+
if [[ -n "$pin_out" ]]; then
|
|
279
|
+
log " ${YELLOW}${pin_out}${NC}"
|
|
135
280
|
fi
|
|
136
281
|
|
|
137
282
|
if has_file_spec "$project_dir/package.json"; then
|
|
@@ -139,32 +284,43 @@ install_types_in() {
|
|
|
139
284
|
return 1
|
|
140
285
|
fi
|
|
141
286
|
|
|
142
|
-
log " copying spotcharge-types@${
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return 0
|
|
147
|
-
fi
|
|
148
|
-
|
|
149
|
-
log " ${RED}failed${NC} in $project_dir"
|
|
150
|
-
return 1
|
|
287
|
+
log " copying spotcharge-types@${types_version} into node_modules"
|
|
288
|
+
copy_types_into_node_modules "$project_dir"
|
|
289
|
+
verify_copy "$project_dir" "$label" "$types_version" "$published_spec"
|
|
290
|
+
log " ${GREEN}ok${NC}"
|
|
151
291
|
}
|
|
152
292
|
|
|
153
293
|
main() {
|
|
154
|
-
log "Building spotcharge-types@${TYPES_VERSION}..."
|
|
155
294
|
cd "$TYPES_DIR" || fail "cannot cd to $TYPES_DIR"
|
|
295
|
+
bump_local_patch
|
|
296
|
+
|
|
297
|
+
local types_version published_spec
|
|
298
|
+
types_version="$(read_types_version)"
|
|
299
|
+
published_spec="^${types_version}"
|
|
300
|
+
|
|
301
|
+
log "Building spotcharge-types@${types_version}..."
|
|
156
302
|
npm start || fail "types build failed (npm start)"
|
|
157
303
|
|
|
158
304
|
if [[ ! -f "$TYPES_DIR/dist/index.js" ]]; then
|
|
159
305
|
fail "build output missing: dist/index.js — run npm start in spotcharge-types first"
|
|
160
306
|
fi
|
|
161
307
|
|
|
162
|
-
local
|
|
163
|
-
local
|
|
308
|
+
local targets=()
|
|
309
|
+
local line
|
|
310
|
+
while IFS= read -r line; do
|
|
311
|
+
[[ -n "$line" ]] && targets+=("$line")
|
|
312
|
+
done < <(discover_targets)
|
|
164
313
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
314
|
+
if [[ "${#targets[@]}" -eq 0 ]]; then
|
|
315
|
+
fail "no sibling packages depend on spotcharge-types"
|
|
316
|
+
fi
|
|
317
|
+
|
|
318
|
+
log "Targets: ${targets[*]}"
|
|
319
|
+
|
|
320
|
+
local failed=0
|
|
321
|
+
local target
|
|
322
|
+
for target in "${targets[@]}"; do
|
|
323
|
+
install_types_in "$PROJECTS_ROOT/$target" "$target" "$types_version" "$published_spec" || failed=$((failed + 1))
|
|
168
324
|
done
|
|
169
325
|
|
|
170
326
|
log ""
|
|
@@ -172,7 +328,8 @@ main() {
|
|
|
172
328
|
fail "$failed project(s) failed to install spotcharge-types"
|
|
173
329
|
fi
|
|
174
330
|
|
|
175
|
-
log "${GREEN}Done.${NC} spotcharge-types@${
|
|
331
|
+
log "${GREEN}Done.${NC} spotcharge-types@${types_version} synced."
|
|
332
|
+
log "package.json uses ${published_spec}. Do not npm install in consumers until this version is published, or re-run sync-repos after."
|
|
176
333
|
}
|
|
177
334
|
|
|
178
335
|
main "$@"
|