@mydoormot/app-types 1.8.1 → 1.9.0

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @mydoormot/app-types@1.8.0 build /Users/chuksben/Desktop/projects/microservices/mydoormot/packages/app-types
2
+ > @mydoormot/app-types@1.8.2 build /Users/chuksben/Desktop/projects/microservices/mydoormot/packages/app-types
3
3
  > tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,11 +8,11 @@ CLI tsup v7.3.0
8
8
  CLI Target: es2021
9
9
  ESM Build start
10
10
  CJS Build start
11
+ CJS dist/index.cjs 14.07 KB
12
+ CJS ⚡️ Build success in 57ms
13
+ ESM dist/index.js 11.62 KB
14
+ ESM ⚡️ Build success in 57ms
11
15
  DTS Build start
12
- ESM dist/index.js 11.40 KB
13
- ESM ⚡️ Build success in 313ms
14
- CJS dist/index.cjs 13.82 KB
15
- CJS ⚡️ Build success in 313ms
16
- DTS ⚡️ Build success in 791ms
17
- DTS dist/index.d.ts 35.07 KB
18
- DTS dist/index.d.cts 35.07 KB
16
+ DTS ⚡️ Build success in 752ms
17
+ DTS dist/index.d.ts 36.60 KB
18
+ DTS dist/index.d.cts 36.60 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @mydoormot/app-types
2
2
 
3
+ ## 1.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Added portals api
8
+
9
+ ## 1.8.2
10
+
11
+ ### Patch Changes
12
+
13
+ - Added can delete on vehicle logs
14
+
3
15
  ## 1.8.1
4
16
 
5
17
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -43,6 +43,7 @@ __export(src_exports, {
43
43
  NotificationType: () => NotificationType,
44
44
  ParcelSize: () => ParcelSize,
45
45
  PaymentOptions: () => PaymentOptions,
46
+ PortalStatus: () => PortalStatus,
46
47
  RemittanceStatus: () => RemittanceStatus,
47
48
  RoleType: () => RoleType,
48
49
  VehicleLogType: () => VehicleLogType,
@@ -336,6 +337,13 @@ var WhatsappTemplateParamSource = /* @__PURE__ */ ((WhatsappTemplateParamSource2
336
337
  return WhatsappTemplateParamSource2;
337
338
  })(WhatsappTemplateParamSource || {});
338
339
 
340
+ // src/portal.ts
341
+ var PortalStatus = /* @__PURE__ */ ((PortalStatus2) => {
342
+ PortalStatus2["Draft"] = "draft";
343
+ PortalStatus2["Published"] = "published";
344
+ return PortalStatus2;
345
+ })(PortalStatus || {});
346
+
339
347
  // src/index.ts
340
348
  var LinkDestination = /* @__PURE__ */ ((LinkDestination2) => {
341
349
  LinkDestination2["Website"] = "web";
@@ -368,6 +376,7 @@ var LinkDestination = /* @__PURE__ */ ((LinkDestination2) => {
368
376
  NotificationType,
369
377
  ParcelSize,
370
378
  PaymentOptions,
379
+ PortalStatus,
371
380
  RemittanceStatus,
372
381
  RoleType,
373
382
  VehicleLogType,
package/dist/index.d.cts CHANGED
@@ -404,6 +404,12 @@ type VehicleLog = {
404
404
  type VehicleLogWithErrands = VehicleLog & {
405
405
  errandsCount?: number;
406
406
  totalErrandsRevenue?: number;
407
+ /**
408
+ * Only the most recent fuel log for a vehicle is deletable — false when a
409
+ * newer log exists. Use it to enable/disable the delete affordance, but still
410
+ * handle a 400 from the delete endpoint: a newer log may land in between.
411
+ */
412
+ canDelete?: boolean;
407
413
  };
408
414
  interface VehicleErrandStats {
409
415
  count: number;
@@ -1278,6 +1284,49 @@ interface WhatsappSendLog {
1278
1284
  sentAt: string | Date;
1279
1285
  }
1280
1286
 
1287
+ declare enum PortalStatus {
1288
+ Draft = "draft",
1289
+ Published = "published"
1290
+ }
1291
+ interface BusinessPortal {
1292
+ id: string;
1293
+ businessId: string;
1294
+ /** Compose the URL yourself, e.g. `https://mydoormot.io/b/${handle}`. */
1295
+ handle: string;
1296
+ previousHandles: string[];
1297
+ status: PortalStatus;
1298
+ publishedAt?: string;
1299
+ createdAt: string;
1300
+ updatedAt: string;
1301
+ }
1302
+ interface PublicPortalBusiness {
1303
+ name?: string;
1304
+ description?: string;
1305
+ officeNumber?: string;
1306
+ address?: string;
1307
+ logoUrl?: string;
1308
+ logoBlurHash?: string;
1309
+ coverImageUrl?: string;
1310
+ coverImageBlurHash?: string;
1311
+ isOnline?: boolean;
1312
+ openingHours?: Record<string, unknown>;
1313
+ socialLinks?: Record<string, unknown>;
1314
+ }
1315
+ /** `GET /api/v2/public/b/:handle` */
1316
+ interface PublicPortal {
1317
+ handle: string;
1318
+ /** Set when the requested handle was retired — redirect to `handle`. */
1319
+ redirectedFrom?: string;
1320
+ business: PublicPortalBusiness;
1321
+ }
1322
+ /** `GET /api/v2/public/portal-handle-availability` */
1323
+ interface PortalHandleAvailability {
1324
+ /** Normalised — what you would actually be assigned. */
1325
+ handle: string;
1326
+ available: boolean;
1327
+ reason?: string;
1328
+ }
1329
+
1281
1330
  interface PaginateResult<T> {
1282
1331
  docs: T[];
1283
1332
  totalDocs: number;
@@ -1300,4 +1349,4 @@ declare enum LinkDestination {
1300
1349
  }
1301
1350
  type NullOrUndefined = null | undefined;
1302
1351
 
1303
- export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, type BusinessCourierLink, BusinessCourierLinkStatus, type BusinessMember, type BusinessModules, type BusinessPg, BusinessRole, type BusinessSettings, BusinessStatus, type BusinessWhatsappConfig, type City, type Collection, type Customer, type CustomerAddress, type CustomerTransactionStats, DEFAULT_BUSINESS_MODULES, DEFAULT_BUSINESS_SETTINGS, DeliveryStatus, type DraftErrand, DraftErrandStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, type ExpensePaidBy, FeePaymentStatus, FeeSettlement, type GeoPoint, GlobalRoles, type Invoice, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, InvoiceStatus, type LatLng, LinkDestination, type MaintenanceItem, type MaintenancePartUsage, type MaintenanceRecord, type MaintenanceStats, type MaintenanceStatsSummary, type MaintenanceTopItem, MembershipStatus, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type OpeningHours, type PaginateResult, ParcelSize, PaymentOptions, type PendingErrand, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductOptionValue, type ProductStatus, type ProductTag, type ProductVariant, type ProductVariantPrice, RemittanceStatus, type Rider, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, type RiderWithUserDetails, RoleType, type State, type TrackerPosition, type Transaction, type TransactionCategory, type TransactionItem, type TransactionType, type TransactionWithCategory, type TransactionWithJoin, type User, type UserAddress, type Vehicle, type VehicleErrandStats, type VehicleFuelStats, type VehicleLog, type VehicleLogStatsSummary, VehicleLogType, type VehicleLogWithErrands, type VehicleMaintenanceStats, type VehiclePerformanceData, type VehiclePerformanceFilters, type VehiclePerformanceItem, type VehiclePerformanceTotals, VehicleType, type VehicleWithRider, type Vendor, WhatsappButtonType, WhatsappComponentType, WhatsappEvent, WhatsappRecipient, type WhatsappSendLog, type WhatsappTemplate, type WhatsappTemplateButton, type WhatsappTemplateComponent, WhatsappTemplateMetaStatus, WhatsappTemplateParamSource, type WhatsappTemplateSource, errandTimeline };
1352
+ export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, type BusinessCourierLink, BusinessCourierLinkStatus, type BusinessMember, type BusinessModules, type BusinessPg, type BusinessPortal, BusinessRole, type BusinessSettings, BusinessStatus, type BusinessWhatsappConfig, type City, type Collection, type Customer, type CustomerAddress, type CustomerTransactionStats, DEFAULT_BUSINESS_MODULES, DEFAULT_BUSINESS_SETTINGS, DeliveryStatus, type DraftErrand, DraftErrandStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, type ExpensePaidBy, FeePaymentStatus, FeeSettlement, type GeoPoint, GlobalRoles, type Invoice, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, InvoiceStatus, type LatLng, LinkDestination, type MaintenanceItem, type MaintenancePartUsage, type MaintenanceRecord, type MaintenanceStats, type MaintenanceStatsSummary, type MaintenanceTopItem, MembershipStatus, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type OpeningHours, type PaginateResult, ParcelSize, PaymentOptions, type PendingErrand, type PortalHandleAvailability, PortalStatus, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductOptionValue, type ProductStatus, type ProductTag, type ProductVariant, type ProductVariantPrice, type PublicPortal, type PublicPortalBusiness, RemittanceStatus, type Rider, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, type RiderWithUserDetails, RoleType, type State, type TrackerPosition, type Transaction, type TransactionCategory, type TransactionItem, type TransactionType, type TransactionWithCategory, type TransactionWithJoin, type User, type UserAddress, type Vehicle, type VehicleErrandStats, type VehicleFuelStats, type VehicleLog, type VehicleLogStatsSummary, VehicleLogType, type VehicleLogWithErrands, type VehicleMaintenanceStats, type VehiclePerformanceData, type VehiclePerformanceFilters, type VehiclePerformanceItem, type VehiclePerformanceTotals, VehicleType, type VehicleWithRider, type Vendor, WhatsappButtonType, WhatsappComponentType, WhatsappEvent, WhatsappRecipient, type WhatsappSendLog, type WhatsappTemplate, type WhatsappTemplateButton, type WhatsappTemplateComponent, WhatsappTemplateMetaStatus, WhatsappTemplateParamSource, type WhatsappTemplateSource, errandTimeline };
package/dist/index.d.ts CHANGED
@@ -404,6 +404,12 @@ type VehicleLog = {
404
404
  type VehicleLogWithErrands = VehicleLog & {
405
405
  errandsCount?: number;
406
406
  totalErrandsRevenue?: number;
407
+ /**
408
+ * Only the most recent fuel log for a vehicle is deletable — false when a
409
+ * newer log exists. Use it to enable/disable the delete affordance, but still
410
+ * handle a 400 from the delete endpoint: a newer log may land in between.
411
+ */
412
+ canDelete?: boolean;
407
413
  };
408
414
  interface VehicleErrandStats {
409
415
  count: number;
@@ -1278,6 +1284,49 @@ interface WhatsappSendLog {
1278
1284
  sentAt: string | Date;
1279
1285
  }
1280
1286
 
1287
+ declare enum PortalStatus {
1288
+ Draft = "draft",
1289
+ Published = "published"
1290
+ }
1291
+ interface BusinessPortal {
1292
+ id: string;
1293
+ businessId: string;
1294
+ /** Compose the URL yourself, e.g. `https://mydoormot.io/b/${handle}`. */
1295
+ handle: string;
1296
+ previousHandles: string[];
1297
+ status: PortalStatus;
1298
+ publishedAt?: string;
1299
+ createdAt: string;
1300
+ updatedAt: string;
1301
+ }
1302
+ interface PublicPortalBusiness {
1303
+ name?: string;
1304
+ description?: string;
1305
+ officeNumber?: string;
1306
+ address?: string;
1307
+ logoUrl?: string;
1308
+ logoBlurHash?: string;
1309
+ coverImageUrl?: string;
1310
+ coverImageBlurHash?: string;
1311
+ isOnline?: boolean;
1312
+ openingHours?: Record<string, unknown>;
1313
+ socialLinks?: Record<string, unknown>;
1314
+ }
1315
+ /** `GET /api/v2/public/b/:handle` */
1316
+ interface PublicPortal {
1317
+ handle: string;
1318
+ /** Set when the requested handle was retired — redirect to `handle`. */
1319
+ redirectedFrom?: string;
1320
+ business: PublicPortalBusiness;
1321
+ }
1322
+ /** `GET /api/v2/public/portal-handle-availability` */
1323
+ interface PortalHandleAvailability {
1324
+ /** Normalised — what you would actually be assigned. */
1325
+ handle: string;
1326
+ available: boolean;
1327
+ reason?: string;
1328
+ }
1329
+
1281
1330
  interface PaginateResult<T> {
1282
1331
  docs: T[];
1283
1332
  totalDocs: number;
@@ -1300,4 +1349,4 @@ declare enum LinkDestination {
1300
1349
  }
1301
1350
  type NullOrUndefined = null | undefined;
1302
1351
 
1303
- export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, type BusinessCourierLink, BusinessCourierLinkStatus, type BusinessMember, type BusinessModules, type BusinessPg, BusinessRole, type BusinessSettings, BusinessStatus, type BusinessWhatsappConfig, type City, type Collection, type Customer, type CustomerAddress, type CustomerTransactionStats, DEFAULT_BUSINESS_MODULES, DEFAULT_BUSINESS_SETTINGS, DeliveryStatus, type DraftErrand, DraftErrandStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, type ExpensePaidBy, FeePaymentStatus, FeeSettlement, type GeoPoint, GlobalRoles, type Invoice, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, InvoiceStatus, type LatLng, LinkDestination, type MaintenanceItem, type MaintenancePartUsage, type MaintenanceRecord, type MaintenanceStats, type MaintenanceStatsSummary, type MaintenanceTopItem, MembershipStatus, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type OpeningHours, type PaginateResult, ParcelSize, PaymentOptions, type PendingErrand, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductOptionValue, type ProductStatus, type ProductTag, type ProductVariant, type ProductVariantPrice, RemittanceStatus, type Rider, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, type RiderWithUserDetails, RoleType, type State, type TrackerPosition, type Transaction, type TransactionCategory, type TransactionItem, type TransactionType, type TransactionWithCategory, type TransactionWithJoin, type User, type UserAddress, type Vehicle, type VehicleErrandStats, type VehicleFuelStats, type VehicleLog, type VehicleLogStatsSummary, VehicleLogType, type VehicleLogWithErrands, type VehicleMaintenanceStats, type VehiclePerformanceData, type VehiclePerformanceFilters, type VehiclePerformanceItem, type VehiclePerformanceTotals, VehicleType, type VehicleWithRider, type Vendor, WhatsappButtonType, WhatsappComponentType, WhatsappEvent, WhatsappRecipient, type WhatsappSendLog, type WhatsappTemplate, type WhatsappTemplateButton, type WhatsappTemplateComponent, WhatsappTemplateMetaStatus, WhatsappTemplateParamSource, type WhatsappTemplateSource, errandTimeline };
1352
+ export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, type BusinessCourierLink, BusinessCourierLinkStatus, type BusinessMember, type BusinessModules, type BusinessPg, type BusinessPortal, BusinessRole, type BusinessSettings, BusinessStatus, type BusinessWhatsappConfig, type City, type Collection, type Customer, type CustomerAddress, type CustomerTransactionStats, DEFAULT_BUSINESS_MODULES, DEFAULT_BUSINESS_SETTINGS, DeliveryStatus, type DraftErrand, DraftErrandStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, type ExpensePaidBy, FeePaymentStatus, FeeSettlement, type GeoPoint, GlobalRoles, type Invoice, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, InvoiceStatus, type LatLng, LinkDestination, type MaintenanceItem, type MaintenancePartUsage, type MaintenanceRecord, type MaintenanceStats, type MaintenanceStatsSummary, type MaintenanceTopItem, MembershipStatus, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type OpeningHours, type PaginateResult, ParcelSize, PaymentOptions, type PendingErrand, type PortalHandleAvailability, PortalStatus, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductOptionValue, type ProductStatus, type ProductTag, type ProductVariant, type ProductVariantPrice, type PublicPortal, type PublicPortalBusiness, RemittanceStatus, type Rider, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, type RiderWithUserDetails, RoleType, type State, type TrackerPosition, type Transaction, type TransactionCategory, type TransactionItem, type TransactionType, type TransactionWithCategory, type TransactionWithJoin, type User, type UserAddress, type Vehicle, type VehicleErrandStats, type VehicleFuelStats, type VehicleLog, type VehicleLogStatsSummary, VehicleLogType, type VehicleLogWithErrands, type VehicleMaintenanceStats, type VehiclePerformanceData, type VehiclePerformanceFilters, type VehiclePerformanceItem, type VehiclePerformanceTotals, VehicleType, type VehicleWithRider, type Vendor, WhatsappButtonType, WhatsappComponentType, WhatsappEvent, WhatsappRecipient, type WhatsappSendLog, type WhatsappTemplate, type WhatsappTemplateButton, type WhatsappTemplateComponent, WhatsappTemplateMetaStatus, WhatsappTemplateParamSource, type WhatsappTemplateSource, errandTimeline };
package/dist/index.js CHANGED
@@ -277,6 +277,13 @@ var WhatsappTemplateParamSource = /* @__PURE__ */ ((WhatsappTemplateParamSource2
277
277
  return WhatsappTemplateParamSource2;
278
278
  })(WhatsappTemplateParamSource || {});
279
279
 
280
+ // src/portal.ts
281
+ var PortalStatus = /* @__PURE__ */ ((PortalStatus2) => {
282
+ PortalStatus2["Draft"] = "draft";
283
+ PortalStatus2["Published"] = "published";
284
+ return PortalStatus2;
285
+ })(PortalStatus || {});
286
+
280
287
  // src/index.ts
281
288
  var LinkDestination = /* @__PURE__ */ ((LinkDestination2) => {
282
289
  LinkDestination2["Website"] = "web";
@@ -308,6 +315,7 @@ export {
308
315
  NotificationType,
309
316
  ParcelSize,
310
317
  PaymentOptions,
318
+ PortalStatus,
311
319
  RemittanceStatus,
312
320
  RoleType,
313
321
  VehicleLogType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mydoormot/app-types",
3
- "version": "1.8.1",
3
+ "version": "1.9.0",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
package/src/index.ts CHANGED
@@ -37,3 +37,4 @@ export * from './transaction';
37
37
  export * from './stat';
38
38
  export * from './maintenance';
39
39
  export * from './whatsapp';
40
+ export * from './portal';
package/src/portal.ts ADDED
@@ -0,0 +1,46 @@
1
+ export enum PortalStatus {
2
+ Draft = 'draft',
3
+ Published = 'published',
4
+ }
5
+
6
+ export interface BusinessPortal {
7
+ id: string;
8
+ businessId: string;
9
+ /** Compose the URL yourself, e.g. `https://mydoormot.io/b/${handle}`. */
10
+ handle: string;
11
+ previousHandles: string[];
12
+ status: PortalStatus;
13
+ publishedAt?: string;
14
+ createdAt: string;
15
+ updatedAt: string;
16
+ }
17
+
18
+ export interface PublicPortalBusiness {
19
+ name?: string;
20
+ description?: string;
21
+ officeNumber?: string;
22
+ address?: string;
23
+ logoUrl?: string;
24
+ logoBlurHash?: string;
25
+ coverImageUrl?: string;
26
+ coverImageBlurHash?: string;
27
+ isOnline?: boolean;
28
+ openingHours?: Record<string, unknown>;
29
+ socialLinks?: Record<string, unknown>;
30
+ }
31
+
32
+ /** `GET /api/v2/public/b/:handle` */
33
+ export interface PublicPortal {
34
+ handle: string;
35
+ /** Set when the requested handle was retired — redirect to `handle`. */
36
+ redirectedFrom?: string;
37
+ business: PublicPortalBusiness;
38
+ }
39
+
40
+ /** `GET /api/v2/public/portal-handle-availability` */
41
+ export interface PortalHandleAvailability {
42
+ /** Normalised — what you would actually be assigned. */
43
+ handle: string;
44
+ available: boolean;
45
+ reason?: string;
46
+ }
package/src/vehicle.ts CHANGED
@@ -81,6 +81,12 @@ export type VehicleLog = {
81
81
  export type VehicleLogWithErrands = VehicleLog & {
82
82
  errandsCount?: number;
83
83
  totalErrandsRevenue?: number;
84
+ /**
85
+ * Only the most recent fuel log for a vehicle is deletable — false when a
86
+ * newer log exists. Use it to enable/disable the delete affordance, but still
87
+ * handle a 400 from the delete endpoint: a newer log may land in between.
88
+ */
89
+ canDelete?: boolean;
84
90
  };
85
91
 
86
92
  // Vehicle Performance Types