@wasto/sdk 1.0.3 → 1.0.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.
Files changed (56) hide show
  1. package/dist/index.d.mts +17 -1
  2. package/dist/index.d.ts +17 -1
  3. package/dist/index.js +7 -0
  4. package/dist/index.mjs +7 -0
  5. package/package.json +1 -1
  6. package/src/client.ts +701 -692
  7. package/src/dashboard-apps.ts +350 -350
  8. package/src/dto/cms-app-settings.ts +91 -91
  9. package/src/enums.ts +298 -298
  10. package/src/free-tier.ts +56 -56
  11. package/src/index.ts +35 -35
  12. package/src/opening-hours/constants.ts +48 -48
  13. package/src/opening-hours/convert.ts +276 -276
  14. package/src/opening-hours/format.ts +99 -99
  15. package/src/opening-hours/index.ts +9 -9
  16. package/src/opening-hours/is-open-now.ts +38 -38
  17. package/src/opening-hours/resolve.ts +71 -71
  18. package/src/opening-hours/time.ts +74 -74
  19. package/src/opening-hours/timezone.ts +34 -34
  20. package/src/opening-hours/types.ts +53 -53
  21. package/src/opening-hours/validate.ts +182 -182
  22. package/src/roi/calculations.ts +732 -732
  23. package/src/roi/index.ts +1 -1
  24. package/src/types/app-preload.types.ts +10 -0
  25. package/src/types/asset-bookings.types.ts +19 -19
  26. package/src/types/asset-interventions.types.ts +24 -24
  27. package/src/types/assets.types.ts +68 -68
  28. package/src/types/auth.types.ts +37 -37
  29. package/src/types/blog-posts.types.ts +19 -19
  30. package/src/types/calendar-pdf.types.ts +24 -24
  31. package/src/types/calendo-events.types.ts +64 -64
  32. package/src/types/challenges.types.ts +30 -30
  33. package/src/types/chatbot.types.ts +82 -82
  34. package/src/types/cities.types.ts +27 -27
  35. package/src/types/city-groups.types.ts +46 -46
  36. package/src/types/cms.types.ts +87 -87
  37. package/src/types/field-reports.types.ts +66 -66
  38. package/src/types/free-tier.types.ts +54 -54
  39. package/src/types/index.ts +33 -32
  40. package/src/types/iot.types.ts +31 -31
  41. package/src/types/maintenance.types.ts +44 -44
  42. package/src/types/mapso.types.ts +146 -146
  43. package/src/types/notifications.types.ts +68 -68
  44. package/src/types/onboarding.types.ts +117 -117
  45. package/src/types/operational-zones.types.ts +70 -70
  46. package/src/types/pagination.types.ts +33 -33
  47. package/src/types/providers.types.ts +29 -29
  48. package/src/types/quiz-questions.types.ts +59 -59
  49. package/src/types/recycling-points.types.ts +47 -47
  50. package/src/types/roi.types.ts +60 -60
  51. package/src/types/surveys.types.ts +103 -103
  52. package/src/types/tickets.types.ts +65 -65
  53. package/src/types/users.types.ts +30 -30
  54. package/src/types/waste-collection-places-query.types.ts +4 -4
  55. package/src/types/waste-collection-places.types.ts +33 -33
  56. package/src/types/waste-types.types.ts +21 -21
@@ -1,82 +1,82 @@
1
- import type { ChatStatus } from '../enums';
2
-
3
- export interface CreateConversationRequest {
4
- deviceId: string;
5
- cityId?: string;
6
- /** Scope collectivité entière (sans picker ville). */
7
- cityGroupId?: string;
8
- }
9
-
10
- export interface SetConversationLocationRequest {
11
- cityId: string;
12
- placeId?: string;
13
- }
14
-
15
- export interface AssignConversationRequest {
16
- agentId: string;
17
- }
18
-
19
- export interface UpdateConversationStatusRequest {
20
- status: ChatStatus;
21
- }
22
-
23
- export interface SendMessageRequest {
24
- content: string;
25
- actionOptionId?: string;
26
- /** Lieu / secteur sélectionné (filtre calendrier RAG). */
27
- placeId?: string;
28
- }
29
-
30
- /** Détail matériau d’une fiche type de déchet (référentiel). */
31
- export interface ChatWasteTypeDetail {
32
- id: string;
33
- material: string;
34
- description?: string | null;
35
- instructions?: string | null;
36
- imageUrl?: string | null;
37
- }
38
-
39
- /** Fiche WasteType renvoyée par le chat (même source que console / app). */
40
- export interface ChatWasteTypeFiche {
41
- id: string;
42
- name: string;
43
- description?: string | null;
44
- instructions?: string | null;
45
- color?: string | null;
46
- colorLight?: string | null;
47
- icon?: string | null;
48
- imageUrl?: string | null;
49
- rules: string[];
50
- details: ChatWasteTypeDetail[];
51
- matchedMaterial?: string;
52
- }
53
-
54
- export interface ChatLink {
55
- id: string;
56
- label: string;
57
- url: string;
58
- }
59
-
60
- export interface ChatActionOption {
61
- id: string;
62
- label: string;
63
- nextStep?: string;
64
- }
65
-
66
- export interface ChatAction {
67
- type: 'action';
68
- id: string;
69
- message: string;
70
- options: ChatActionOption[];
71
- }
72
-
73
- export interface ChatTextResponse {
74
- type: 'text';
75
- content: string;
76
- links?: ChatLink[];
77
- /** Fiches types de déchets du référentiel (affichage card UI). */
78
- wasteTypes?: ChatWasteTypeFiche[];
79
- }
80
-
81
- export type ChatResponse = ChatTextResponse | ChatAction;
82
-
1
+ import type { ChatStatus } from '../enums';
2
+
3
+ export interface CreateConversationRequest {
4
+ deviceId: string;
5
+ cityId?: string;
6
+ /** Scope collectivité entière (sans picker ville). */
7
+ cityGroupId?: string;
8
+ }
9
+
10
+ export interface SetConversationLocationRequest {
11
+ cityId: string;
12
+ placeId?: string;
13
+ }
14
+
15
+ export interface AssignConversationRequest {
16
+ agentId: string;
17
+ }
18
+
19
+ export interface UpdateConversationStatusRequest {
20
+ status: ChatStatus;
21
+ }
22
+
23
+ export interface SendMessageRequest {
24
+ content: string;
25
+ actionOptionId?: string;
26
+ /** Lieu / secteur sélectionné (filtre calendrier RAG). */
27
+ placeId?: string;
28
+ }
29
+
30
+ /** Détail matériau d’une fiche type de déchet (référentiel). */
31
+ export interface ChatWasteTypeDetail {
32
+ id: string;
33
+ material: string;
34
+ description?: string | null;
35
+ instructions?: string | null;
36
+ imageUrl?: string | null;
37
+ }
38
+
39
+ /** Fiche WasteType renvoyée par le chat (même source que console / app). */
40
+ export interface ChatWasteTypeFiche {
41
+ id: string;
42
+ name: string;
43
+ description?: string | null;
44
+ instructions?: string | null;
45
+ color?: string | null;
46
+ colorLight?: string | null;
47
+ icon?: string | null;
48
+ imageUrl?: string | null;
49
+ rules: string[];
50
+ details: ChatWasteTypeDetail[];
51
+ matchedMaterial?: string;
52
+ }
53
+
54
+ export interface ChatLink {
55
+ id: string;
56
+ label: string;
57
+ url: string;
58
+ }
59
+
60
+ export interface ChatActionOption {
61
+ id: string;
62
+ label: string;
63
+ nextStep?: string;
64
+ }
65
+
66
+ export interface ChatAction {
67
+ type: 'action';
68
+ id: string;
69
+ message: string;
70
+ options: ChatActionOption[];
71
+ }
72
+
73
+ export interface ChatTextResponse {
74
+ type: 'text';
75
+ content: string;
76
+ links?: ChatLink[];
77
+ /** Fiches types de déchets du référentiel (affichage card UI). */
78
+ wasteTypes?: ChatWasteTypeFiche[];
79
+ }
80
+
81
+ export type ChatResponse = ChatTextResponse | ChatAction;
82
+
@@ -1,27 +1,27 @@
1
- import type { CityStatus } from '../enums';
2
-
3
- export interface CreateCityRequest {
4
- name: string;
5
- country: string;
6
- population?: number;
7
- status?: CityStatus;
8
- outOfTheBins?: string;
9
- presentationOfBins?: string;
10
- returnOfBins?: string;
11
- respectOfCalendar?: string;
12
- holidays?: string;
13
- logoMediaId?: string | null;
14
- }
15
-
16
- export interface UpdateCityRequest {
17
- name?: string;
18
- country?: string;
19
- population?: number;
20
- status?: CityStatus;
21
- outOfTheBins?: string;
22
- presentationOfBins?: string;
23
- returnOfBins?: string;
24
- respectOfCalendar?: string;
25
- holidays?: string;
26
- logoMediaId?: string | null;
27
- }
1
+ import type { CityStatus } from '../enums';
2
+
3
+ export interface CreateCityRequest {
4
+ name: string;
5
+ country: string;
6
+ population?: number;
7
+ status?: CityStatus;
8
+ outOfTheBins?: string;
9
+ presentationOfBins?: string;
10
+ returnOfBins?: string;
11
+ respectOfCalendar?: string;
12
+ holidays?: string;
13
+ logoMediaId?: string | null;
14
+ }
15
+
16
+ export interface UpdateCityRequest {
17
+ name?: string;
18
+ country?: string;
19
+ population?: number;
20
+ status?: CityStatus;
21
+ outOfTheBins?: string;
22
+ presentationOfBins?: string;
23
+ returnOfBins?: string;
24
+ respectOfCalendar?: string;
25
+ holidays?: string;
26
+ logoMediaId?: string | null;
27
+ }
@@ -1,46 +1,46 @@
1
- import type { CityGroupType } from '../enums';
2
- import type { DashboardAppSlug } from '../dashboard-apps';
3
-
4
- export interface CreateCityGroupRequest {
5
- name: string;
6
- type: CityGroupType;
7
- code?: string;
8
- siren?: string;
9
- cityIds?: string[];
10
- }
11
-
12
- export interface UpdateCityGroupRequest {
13
- name?: string;
14
- type?: CityGroupType;
15
- code?: string;
16
- siren?: string;
17
- cityIds?: string[];
18
- }
19
-
20
- export interface CityGroupDashboardAppAccessItem {
21
- slug: DashboardAppSlug;
22
- key: string;
23
- label: string;
24
- dashboardPath: string;
25
- isDevOnly?: boolean;
26
- enabled: boolean;
27
- }
28
-
29
- export interface CityGroupDashboardAppsResponse {
30
- cityGroupId: string;
31
- apps: CityGroupDashboardAppAccessItem[];
32
- /** Slugs activés (clés Prisma) — vide si configuration explicite absente côté API */
33
- enabledSlugs: DashboardAppSlug[];
34
- }
35
-
36
- export interface SetCityGroupDashboardAppsRequest {
37
- enabledSlugs: DashboardAppSlug[];
38
- }
39
-
40
- export interface AccessibleCityGroup {
41
- id: string;
42
- name: string;
43
- type: CityGroupType;
44
- code?: string | null;
45
- enabledDashboardAppSlugs?: DashboardAppSlug[];
46
- }
1
+ import type { CityGroupType } from '../enums';
2
+ import type { DashboardAppSlug } from '../dashboard-apps';
3
+
4
+ export interface CreateCityGroupRequest {
5
+ name: string;
6
+ type: CityGroupType;
7
+ code?: string;
8
+ siren?: string;
9
+ cityIds?: string[];
10
+ }
11
+
12
+ export interface UpdateCityGroupRequest {
13
+ name?: string;
14
+ type?: CityGroupType;
15
+ code?: string;
16
+ siren?: string;
17
+ cityIds?: string[];
18
+ }
19
+
20
+ export interface CityGroupDashboardAppAccessItem {
21
+ slug: DashboardAppSlug;
22
+ key: string;
23
+ label: string;
24
+ dashboardPath: string;
25
+ isDevOnly?: boolean;
26
+ enabled: boolean;
27
+ }
28
+
29
+ export interface CityGroupDashboardAppsResponse {
30
+ cityGroupId: string;
31
+ apps: CityGroupDashboardAppAccessItem[];
32
+ /** Slugs activés (clés Prisma) — vide si configuration explicite absente côté API */
33
+ enabledSlugs: DashboardAppSlug[];
34
+ }
35
+
36
+ export interface SetCityGroupDashboardAppsRequest {
37
+ enabledSlugs: DashboardAppSlug[];
38
+ }
39
+
40
+ export interface AccessibleCityGroup {
41
+ id: string;
42
+ name: string;
43
+ type: CityGroupType;
44
+ code?: string | null;
45
+ enabledDashboardAppSlugs?: DashboardAppSlug[];
46
+ }
@@ -1,87 +1,87 @@
1
- import type { CmsMenuLinkType, CmsSiteType } from '../enums';
2
-
3
- export interface CreateCmsSiteRequest {
4
- name: string;
5
- slug: string;
6
- type?: CmsSiteType;
7
- domain?: string;
8
- cityGroupId?: string;
9
- settings?: Record<string, unknown>;
10
- }
11
-
12
- export interface UpdateCmsSiteRequest {
13
- name?: string;
14
- slug?: string;
15
- type?: CmsSiteType;
16
- domain?: string;
17
- cityGroupId?: string;
18
- settings?: Record<string, unknown>;
19
- }
20
-
21
- export interface CreateCmsPageRequest {
22
- siteId: string;
23
- title: string;
24
- slug: string;
25
- path: string;
26
- content: Record<string, unknown>;
27
- published?: boolean;
28
- publishedAt?: string;
29
- seoMetadata?: Record<string, unknown>;
30
- layoutId?: string;
31
- }
32
-
33
- export interface UpdateCmsPageRequest {
34
- siteId?: string;
35
- title?: string;
36
- slug?: string;
37
- path?: string;
38
- content?: Record<string, unknown>;
39
- published?: boolean;
40
- publishedAt?: string;
41
- seoMetadata?: Record<string, unknown>;
42
- layoutId?: string;
43
- }
44
-
45
- export interface CreateCmsLayoutRequest {
46
- siteId: string;
47
- name: string;
48
- description?: string;
49
- type: CmsSiteType;
50
- structure: Record<string, unknown>;
51
- isDefault?: boolean;
52
- }
53
-
54
- export interface UpdateCmsLayoutRequest {
55
- siteId?: string;
56
- name?: string;
57
- description?: string;
58
- type?: CmsSiteType;
59
- structure?: Record<string, unknown>;
60
- isDefault?: boolean;
61
- }
62
-
63
- export interface CreateCmsMenuItemRequest {
64
- label: string;
65
- icon?: string;
66
- order: number;
67
- linkType: CmsMenuLinkType;
68
- pageId?: string;
69
- externalUrl?: string;
70
- componentId?: string;
71
- parentId?: string;
72
- metadata?: Record<string, unknown>;
73
- }
74
-
75
- export interface CreateCmsMenuRequest {
76
- siteId: string;
77
- name: string;
78
- location?: string;
79
- items?: CreateCmsMenuItemRequest[];
80
- }
81
-
82
- export interface UpdateCmsMenuRequest {
83
- siteId?: string;
84
- name?: string;
85
- location?: string;
86
- items?: CreateCmsMenuItemRequest[];
87
- }
1
+ import type { CmsMenuLinkType, CmsSiteType } from '../enums';
2
+
3
+ export interface CreateCmsSiteRequest {
4
+ name: string;
5
+ slug: string;
6
+ type?: CmsSiteType;
7
+ domain?: string;
8
+ cityGroupId?: string;
9
+ settings?: Record<string, unknown>;
10
+ }
11
+
12
+ export interface UpdateCmsSiteRequest {
13
+ name?: string;
14
+ slug?: string;
15
+ type?: CmsSiteType;
16
+ domain?: string;
17
+ cityGroupId?: string;
18
+ settings?: Record<string, unknown>;
19
+ }
20
+
21
+ export interface CreateCmsPageRequest {
22
+ siteId: string;
23
+ title: string;
24
+ slug: string;
25
+ path: string;
26
+ content: Record<string, unknown>;
27
+ published?: boolean;
28
+ publishedAt?: string;
29
+ seoMetadata?: Record<string, unknown>;
30
+ layoutId?: string;
31
+ }
32
+
33
+ export interface UpdateCmsPageRequest {
34
+ siteId?: string;
35
+ title?: string;
36
+ slug?: string;
37
+ path?: string;
38
+ content?: Record<string, unknown>;
39
+ published?: boolean;
40
+ publishedAt?: string;
41
+ seoMetadata?: Record<string, unknown>;
42
+ layoutId?: string;
43
+ }
44
+
45
+ export interface CreateCmsLayoutRequest {
46
+ siteId: string;
47
+ name: string;
48
+ description?: string;
49
+ type: CmsSiteType;
50
+ structure: Record<string, unknown>;
51
+ isDefault?: boolean;
52
+ }
53
+
54
+ export interface UpdateCmsLayoutRequest {
55
+ siteId?: string;
56
+ name?: string;
57
+ description?: string;
58
+ type?: CmsSiteType;
59
+ structure?: Record<string, unknown>;
60
+ isDefault?: boolean;
61
+ }
62
+
63
+ export interface CreateCmsMenuItemRequest {
64
+ label: string;
65
+ icon?: string;
66
+ order: number;
67
+ linkType: CmsMenuLinkType;
68
+ pageId?: string;
69
+ externalUrl?: string;
70
+ componentId?: string;
71
+ parentId?: string;
72
+ metadata?: Record<string, unknown>;
73
+ }
74
+
75
+ export interface CreateCmsMenuRequest {
76
+ siteId: string;
77
+ name: string;
78
+ location?: string;
79
+ items?: CreateCmsMenuItemRequest[];
80
+ }
81
+
82
+ export interface UpdateCmsMenuRequest {
83
+ siteId?: string;
84
+ name?: string;
85
+ location?: string;
86
+ items?: CreateCmsMenuItemRequest[];
87
+ }
@@ -1,66 +1,66 @@
1
- import type {
2
- FieldReportFormStatus,
3
- FieldReportStatus,
4
- QuestionType,
5
- } from '../enums';
6
-
7
- export interface FieldReportValueRequest {
8
- fieldId: string;
9
- value: unknown;
10
- photoUrl?: string;
11
- }
12
-
13
- export interface CreateFieldReportRequest {
14
- formId: string;
15
- values: FieldReportValueRequest[];
16
- latitude?: number;
17
- longitude?: number;
18
- cityId?: string;
19
- cityGroupId?: string;
20
- }
21
-
22
- export interface UpdateFieldReportRequest {
23
- status?: FieldReportStatus;
24
- assignedToId?: string | null;
25
- values?: FieldReportValueRequest[];
26
- latitude?: number;
27
- longitude?: number;
28
- }
29
-
30
- export interface UpdateFieldReportStatusRequest {
31
- status: FieldReportStatus;
32
- }
33
-
34
- export interface CreateFieldReportFieldRequest {
35
- type: QuestionType;
36
- label: string;
37
- description?: string;
38
- required?: boolean;
39
- order?: number;
40
- options?: unknown;
41
- minValue?: number;
42
- maxValue?: number;
43
- }
44
-
45
- export interface UpdateFieldReportFieldRequest
46
- extends CreateFieldReportFieldRequest {
47
- id?: string;
48
- }
49
-
50
- export interface CreateFieldReportFormRequest {
51
- title: string;
52
- description?: string;
53
- status?: FieldReportFormStatus;
54
- cityId?: string;
55
- cityGroupId?: string;
56
- fields?: CreateFieldReportFieldRequest[];
57
- }
58
-
59
- export interface UpdateFieldReportFormRequest {
60
- title?: string;
61
- description?: string;
62
- status?: FieldReportFormStatus;
63
- cityId?: string;
64
- cityGroupId?: string;
65
- fields?: UpdateFieldReportFieldRequest[];
66
- }
1
+ import type {
2
+ FieldReportFormStatus,
3
+ FieldReportStatus,
4
+ QuestionType,
5
+ } from '../enums';
6
+
7
+ export interface FieldReportValueRequest {
8
+ fieldId: string;
9
+ value: unknown;
10
+ photoUrl?: string;
11
+ }
12
+
13
+ export interface CreateFieldReportRequest {
14
+ formId: string;
15
+ values: FieldReportValueRequest[];
16
+ latitude?: number;
17
+ longitude?: number;
18
+ cityId?: string;
19
+ cityGroupId?: string;
20
+ }
21
+
22
+ export interface UpdateFieldReportRequest {
23
+ status?: FieldReportStatus;
24
+ assignedToId?: string | null;
25
+ values?: FieldReportValueRequest[];
26
+ latitude?: number;
27
+ longitude?: number;
28
+ }
29
+
30
+ export interface UpdateFieldReportStatusRequest {
31
+ status: FieldReportStatus;
32
+ }
33
+
34
+ export interface CreateFieldReportFieldRequest {
35
+ type: QuestionType;
36
+ label: string;
37
+ description?: string;
38
+ required?: boolean;
39
+ order?: number;
40
+ options?: unknown;
41
+ minValue?: number;
42
+ maxValue?: number;
43
+ }
44
+
45
+ export interface UpdateFieldReportFieldRequest
46
+ extends CreateFieldReportFieldRequest {
47
+ id?: string;
48
+ }
49
+
50
+ export interface CreateFieldReportFormRequest {
51
+ title: string;
52
+ description?: string;
53
+ status?: FieldReportFormStatus;
54
+ cityId?: string;
55
+ cityGroupId?: string;
56
+ fields?: CreateFieldReportFieldRequest[];
57
+ }
58
+
59
+ export interface UpdateFieldReportFormRequest {
60
+ title?: string;
61
+ description?: string;
62
+ status?: FieldReportFormStatus;
63
+ cityId?: string;
64
+ cityGroupId?: string;
65
+ fields?: UpdateFieldReportFieldRequest[];
66
+ }