@wasto/sdk 1.0.3 → 1.0.5
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/index.d.mts +60 -3
- package/dist/index.d.ts +60 -3
- package/dist/index.js +79 -0
- package/dist/index.mjs +79 -0
- package/package.json +1 -1
- package/src/client.ts +791 -692
- package/src/dashboard-apps.ts +367 -350
- package/src/dto/cms-app-settings.ts +91 -91
- package/src/enums.ts +298 -298
- package/src/free-tier.ts +56 -56
- package/src/index.ts +35 -35
- package/src/opening-hours/constants.ts +48 -48
- package/src/opening-hours/convert.ts +276 -276
- package/src/opening-hours/format.ts +99 -99
- package/src/opening-hours/index.ts +9 -9
- package/src/opening-hours/is-open-now.ts +38 -38
- package/src/opening-hours/resolve.ts +71 -71
- package/src/opening-hours/time.ts +74 -74
- package/src/opening-hours/timezone.ts +34 -34
- package/src/opening-hours/types.ts +53 -53
- package/src/opening-hours/validate.ts +182 -182
- package/src/roi/calculations.ts +732 -732
- package/src/roi/index.ts +1 -1
- package/src/types/app-preload.types.ts +10 -0
- package/src/types/asset-bookings.types.ts +19 -19
- package/src/types/asset-interventions.types.ts +24 -24
- package/src/types/assets.types.ts +68 -68
- package/src/types/auth.types.ts +37 -37
- package/src/types/blog-posts.types.ts +19 -19
- package/src/types/calendar-pdf.types.ts +24 -24
- package/src/types/calendo-events.types.ts +64 -64
- package/src/types/challenges.types.ts +30 -30
- package/src/types/chatbot.types.ts +82 -82
- package/src/types/cities.types.ts +27 -27
- package/src/types/city-groups.types.ts +46 -46
- package/src/types/cms.types.ts +87 -87
- package/src/types/field-reports.types.ts +66 -66
- package/src/types/free-tier.types.ts +54 -54
- package/src/types/index.ts +33 -32
- package/src/types/iot.types.ts +31 -31
- package/src/types/maintenance.types.ts +44 -44
- package/src/types/mapso.types.ts +146 -146
- package/src/types/notifications.types.ts +68 -68
- package/src/types/onboarding.types.ts +117 -117
- package/src/types/operational-zones.types.ts +70 -70
- package/src/types/pagination.types.ts +33 -33
- package/src/types/providers.types.ts +29 -29
- package/src/types/quiz-questions.types.ts +59 -59
- package/src/types/recycling-points.types.ts +47 -47
- package/src/types/roi.types.ts +60 -60
- package/src/types/surveys.types.ts +103 -103
- package/src/types/tickets.types.ts +65 -65
- package/src/types/users.types.ts +30 -30
- package/src/types/waste-collection-places-query.types.ts +4 -4
- package/src/types/waste-collection-places.types.ts +34 -33
- package/src/types/waste-types.types.ts +21 -21
package/src/free-tier.ts
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import type { FreeTierFeature, FreeTierResource } from './types/free-tier.types';
|
|
2
|
-
|
|
3
|
-
/** Quotas numériques offre gratuite — valeurs ajustables sans changer la logique. */
|
|
4
|
-
export const FREE_TIER_LIMITS = {
|
|
5
|
-
cmsApps: 1,
|
|
6
|
-
cmsPages: 5,
|
|
7
|
-
blogPosts: 10,
|
|
8
|
-
cmsMedia: 50,
|
|
9
|
-
cmsMediaBytesMb: 50,
|
|
10
|
-
wasteTypes: 15,
|
|
11
|
-
collectionPlaces: 10,
|
|
12
|
-
printCalendarTemplates: 3,
|
|
13
|
-
} as const;
|
|
14
|
-
|
|
15
|
-
/** Feature gates offre gratuite — `false` = bloqué. */
|
|
16
|
-
export const FREE_TIER_FEATURES: Record<FreeTierFeature, boolean> = {
|
|
17
|
-
challenges: false,
|
|
18
|
-
roi: false,
|
|
19
|
-
notifications: false,
|
|
20
|
-
recyclingPoints: false,
|
|
21
|
-
assets: false,
|
|
22
|
-
nativeStorePublication: false,
|
|
23
|
-
inviteMembers: false,
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const FREE_TIER_RESOURCES: readonly FreeTierResource[] = [
|
|
27
|
-
'cmsApps',
|
|
28
|
-
'cmsPages',
|
|
29
|
-
'blogPosts',
|
|
30
|
-
'cmsMedia',
|
|
31
|
-
'wasteTypes',
|
|
32
|
-
'collectionPlaces',
|
|
33
|
-
'printCalendarTemplates',
|
|
34
|
-
] as const;
|
|
35
|
-
|
|
36
|
-
export const FREE_TIER_FEATURE_KEYS: readonly FreeTierFeature[] = [
|
|
37
|
-
'challenges',
|
|
38
|
-
'roi',
|
|
39
|
-
'notifications',
|
|
40
|
-
'recyclingPoints',
|
|
41
|
-
'assets',
|
|
42
|
-
'nativeStorePublication',
|
|
43
|
-
'inviteMembers',
|
|
44
|
-
] as const;
|
|
45
|
-
|
|
46
|
-
export function getFreeTierLimit(resource: FreeTierResource): number {
|
|
47
|
-
return FREE_TIER_LIMITS[resource];
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function getFreeTierMediaBytesLimit(): number {
|
|
51
|
-
return FREE_TIER_LIMITS.cmsMediaBytesMb * 1024 * 1024;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export function isFreeTierFeatureEnabled(feature: FreeTierFeature): boolean {
|
|
55
|
-
return FREE_TIER_FEATURES[feature] === true;
|
|
56
|
-
}
|
|
1
|
+
import type { FreeTierFeature, FreeTierResource } from './types/free-tier.types';
|
|
2
|
+
|
|
3
|
+
/** Quotas numériques offre gratuite — valeurs ajustables sans changer la logique. */
|
|
4
|
+
export const FREE_TIER_LIMITS = {
|
|
5
|
+
cmsApps: 1,
|
|
6
|
+
cmsPages: 5,
|
|
7
|
+
blogPosts: 10,
|
|
8
|
+
cmsMedia: 50,
|
|
9
|
+
cmsMediaBytesMb: 50,
|
|
10
|
+
wasteTypes: 15,
|
|
11
|
+
collectionPlaces: 10,
|
|
12
|
+
printCalendarTemplates: 3,
|
|
13
|
+
} as const;
|
|
14
|
+
|
|
15
|
+
/** Feature gates offre gratuite — `false` = bloqué. */
|
|
16
|
+
export const FREE_TIER_FEATURES: Record<FreeTierFeature, boolean> = {
|
|
17
|
+
challenges: false,
|
|
18
|
+
roi: false,
|
|
19
|
+
notifications: false,
|
|
20
|
+
recyclingPoints: false,
|
|
21
|
+
assets: false,
|
|
22
|
+
nativeStorePublication: false,
|
|
23
|
+
inviteMembers: false,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const FREE_TIER_RESOURCES: readonly FreeTierResource[] = [
|
|
27
|
+
'cmsApps',
|
|
28
|
+
'cmsPages',
|
|
29
|
+
'blogPosts',
|
|
30
|
+
'cmsMedia',
|
|
31
|
+
'wasteTypes',
|
|
32
|
+
'collectionPlaces',
|
|
33
|
+
'printCalendarTemplates',
|
|
34
|
+
] as const;
|
|
35
|
+
|
|
36
|
+
export const FREE_TIER_FEATURE_KEYS: readonly FreeTierFeature[] = [
|
|
37
|
+
'challenges',
|
|
38
|
+
'roi',
|
|
39
|
+
'notifications',
|
|
40
|
+
'recyclingPoints',
|
|
41
|
+
'assets',
|
|
42
|
+
'nativeStorePublication',
|
|
43
|
+
'inviteMembers',
|
|
44
|
+
] as const;
|
|
45
|
+
|
|
46
|
+
export function getFreeTierLimit(resource: FreeTierResource): number {
|
|
47
|
+
return FREE_TIER_LIMITS[resource];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function getFreeTierMediaBytesLimit(): number {
|
|
51
|
+
return FREE_TIER_LIMITS.cmsMediaBytesMb * 1024 * 1024;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function isFreeTierFeatureEnabled(feature: FreeTierFeature): boolean {
|
|
55
|
+
return FREE_TIER_FEATURES[feature] === true;
|
|
56
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
// Enums
|
|
2
|
-
export * from './enums';
|
|
3
|
-
export * from './dashboard-apps';
|
|
4
|
-
export * from './free-tier';
|
|
5
|
-
|
|
6
|
-
// Types (interfaces Request/Response, pagination, etc.) — no decorators; DTOs with validation live in API
|
|
7
|
-
export * from './types';
|
|
8
|
-
|
|
9
|
-
// ROI déchets — formules GEC / CEN / ROI (runtime)
|
|
10
|
-
export * from './roi';
|
|
11
|
-
|
|
12
|
-
// Horaires d'ouverture structurés (UTC)
|
|
13
|
-
export * from './opening-hours';
|
|
14
|
-
|
|
15
|
-
// CMS app settings (interfaces only)
|
|
16
|
-
export type {
|
|
17
|
-
AppSplashSettings,
|
|
18
|
-
AppAdaptiveIconSettings,
|
|
19
|
-
AppIconSettings,
|
|
20
|
-
AppThemeGradient,
|
|
21
|
-
AppThemeSettings,
|
|
22
|
-
AppLayoutsConfig,
|
|
23
|
-
AppTabConfig,
|
|
24
|
-
AppStackScreenConfig,
|
|
25
|
-
AppSettings,
|
|
26
|
-
} from './dto/cms-app-settings';
|
|
27
|
-
|
|
28
|
-
// HTTP client
|
|
29
|
-
export {
|
|
30
|
-
createWastoClient,
|
|
31
|
-
WastoApiError,
|
|
32
|
-
type WastoClientConfig,
|
|
33
|
-
type WastoClient,
|
|
34
|
-
type WastoRequestErrorContext,
|
|
35
|
-
} from './client';
|
|
1
|
+
// Enums
|
|
2
|
+
export * from './enums';
|
|
3
|
+
export * from './dashboard-apps';
|
|
4
|
+
export * from './free-tier';
|
|
5
|
+
|
|
6
|
+
// Types (interfaces Request/Response, pagination, etc.) — no decorators; DTOs with validation live in API
|
|
7
|
+
export * from './types';
|
|
8
|
+
|
|
9
|
+
// ROI déchets — formules GEC / CEN / ROI (runtime)
|
|
10
|
+
export * from './roi';
|
|
11
|
+
|
|
12
|
+
// Horaires d'ouverture structurés (UTC)
|
|
13
|
+
export * from './opening-hours';
|
|
14
|
+
|
|
15
|
+
// CMS app settings (interfaces only)
|
|
16
|
+
export type {
|
|
17
|
+
AppSplashSettings,
|
|
18
|
+
AppAdaptiveIconSettings,
|
|
19
|
+
AppIconSettings,
|
|
20
|
+
AppThemeGradient,
|
|
21
|
+
AppThemeSettings,
|
|
22
|
+
AppLayoutsConfig,
|
|
23
|
+
AppTabConfig,
|
|
24
|
+
AppStackScreenConfig,
|
|
25
|
+
AppSettings,
|
|
26
|
+
} from './dto/cms-app-settings';
|
|
27
|
+
|
|
28
|
+
// HTTP client
|
|
29
|
+
export {
|
|
30
|
+
createWastoClient,
|
|
31
|
+
WastoApiError,
|
|
32
|
+
type WastoClientConfig,
|
|
33
|
+
type WastoClient,
|
|
34
|
+
type WastoRequestErrorContext,
|
|
35
|
+
} from './client';
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import type { Weekday } from './types';
|
|
2
|
-
|
|
3
|
-
/** Dates de référence (semaine du 2024-01-01, lundi) pour conversions TZ */
|
|
4
|
-
export const WEEKDAY_REF_DATES: Record<Weekday, string> = {
|
|
5
|
-
monday: '2024-01-01',
|
|
6
|
-
tuesday: '2024-01-02',
|
|
7
|
-
wednesday: '2024-01-03',
|
|
8
|
-
thursday: '2024-01-04',
|
|
9
|
-
friday: '2024-01-05',
|
|
10
|
-
saturday: '2024-01-06',
|
|
11
|
-
sunday: '2024-01-07',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const WEEKDAY_LABELS_FR: Record<Weekday, string> = {
|
|
15
|
-
monday: 'Lundi',
|
|
16
|
-
tuesday: 'Mardi',
|
|
17
|
-
wednesday: 'Mercredi',
|
|
18
|
-
thursday: 'Jeudi',
|
|
19
|
-
friday: 'Vendredi',
|
|
20
|
-
saturday: 'Samedi',
|
|
21
|
-
sunday: 'Dimanche',
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const WEEKDAY_LABELS_FR_SHORT: Record<Weekday, string> = {
|
|
25
|
-
monday: 'Lun',
|
|
26
|
-
tuesday: 'Mar',
|
|
27
|
-
wednesday: 'Mer',
|
|
28
|
-
thursday: 'Jeu',
|
|
29
|
-
friday: 'Ven',
|
|
30
|
-
saturday: 'Sam',
|
|
31
|
-
sunday: 'Dim',
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const WEEKDAY_INDEX: Record<Weekday, number> = {
|
|
35
|
-
monday: 0,
|
|
36
|
-
tuesday: 1,
|
|
37
|
-
wednesday: 2,
|
|
38
|
-
thursday: 3,
|
|
39
|
-
friday: 4,
|
|
40
|
-
saturday: 5,
|
|
41
|
-
sunday: 6,
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const PRESET_SLOTS = {
|
|
45
|
-
morning: { open: '08:00', close: '12:00' },
|
|
46
|
-
afternoon: { open: '14:00', close: '18:00' },
|
|
47
|
-
fullDay: { open: '08:00', close: '18:00' },
|
|
48
|
-
} as const;
|
|
1
|
+
import type { Weekday } from './types';
|
|
2
|
+
|
|
3
|
+
/** Dates de référence (semaine du 2024-01-01, lundi) pour conversions TZ */
|
|
4
|
+
export const WEEKDAY_REF_DATES: Record<Weekday, string> = {
|
|
5
|
+
monday: '2024-01-01',
|
|
6
|
+
tuesday: '2024-01-02',
|
|
7
|
+
wednesday: '2024-01-03',
|
|
8
|
+
thursday: '2024-01-04',
|
|
9
|
+
friday: '2024-01-05',
|
|
10
|
+
saturday: '2024-01-06',
|
|
11
|
+
sunday: '2024-01-07',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const WEEKDAY_LABELS_FR: Record<Weekday, string> = {
|
|
15
|
+
monday: 'Lundi',
|
|
16
|
+
tuesday: 'Mardi',
|
|
17
|
+
wednesday: 'Mercredi',
|
|
18
|
+
thursday: 'Jeudi',
|
|
19
|
+
friday: 'Vendredi',
|
|
20
|
+
saturday: 'Samedi',
|
|
21
|
+
sunday: 'Dimanche',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const WEEKDAY_LABELS_FR_SHORT: Record<Weekday, string> = {
|
|
25
|
+
monday: 'Lun',
|
|
26
|
+
tuesday: 'Mar',
|
|
27
|
+
wednesday: 'Mer',
|
|
28
|
+
thursday: 'Jeu',
|
|
29
|
+
friday: 'Ven',
|
|
30
|
+
saturday: 'Sam',
|
|
31
|
+
sunday: 'Dim',
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const WEEKDAY_INDEX: Record<Weekday, number> = {
|
|
35
|
+
monday: 0,
|
|
36
|
+
tuesday: 1,
|
|
37
|
+
wednesday: 2,
|
|
38
|
+
thursday: 3,
|
|
39
|
+
friday: 4,
|
|
40
|
+
saturday: 5,
|
|
41
|
+
sunday: 6,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const PRESET_SLOTS = {
|
|
45
|
+
morning: { open: '08:00', close: '12:00' },
|
|
46
|
+
afternoon: { open: '14:00', close: '18:00' },
|
|
47
|
+
fullDay: { open: '08:00', close: '18:00' },
|
|
48
|
+
} as const;
|