@communecter/cocolight-api-client 1.0.88 → 1.0.89

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@communecter/cocolight-api-client",
3
- "version": "1.0.88",
3
+ "version": "1.0.89",
4
4
  "description": "Client Axios simplifié pour l'API cocolight",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,11 +20,39 @@ export interface EventLinksBlock {
20
20
  [k: string]: unknown;
21
21
  }
22
22
 
23
+ /**
24
+ * Types d'événements supportés
25
+ */
26
+ export const EVENT_TYPES = [
27
+ "workshop",
28
+ "competition",
29
+ "concert",
30
+ "contest",
31
+ "conference",
32
+ "debate",
33
+ "exhibition",
34
+ "festival",
35
+ "crowdfunding",
36
+ "fair",
37
+ "course",
38
+ "protest",
39
+ "market",
40
+ "film",
41
+ "getTogether",
42
+ "meeting",
43
+ "spectacle",
44
+ "internship",
45
+ "stand",
46
+ "others",
47
+ ] as const;
48
+
49
+ export type EventType = (typeof EVENT_TYPES)[number];
50
+
23
51
  export interface EventItemJson {
24
52
  _id: IdObject;
25
53
  collection: "events";
26
54
  name: string;
27
- type: string;
55
+ type?: EventType;
28
56
  startDate: DateValue;
29
57
  endDate: DateValue;
30
58
  created?: DateValue;
@@ -54,7 +82,7 @@ export interface EventItemNormalized {
54
82
  _id: ObjectID;
55
83
  collection: "events";
56
84
  name: string;
57
- type: string;
85
+ type?: EventType;
58
86
  startDate: Date;
59
87
  endDate: Date;
60
88
  created?: Date;
@@ -24,6 +24,19 @@ export interface OrganizationLinksBlock {
24
24
  [k: string]: unknown;
25
25
  }
26
26
 
27
+ /**
28
+ * Types d'organisations supportés
29
+ */
30
+ export const ORGANIZATION_TYPES = [
31
+ "NGO",
32
+ "LocalBusiness",
33
+ "Group",
34
+ "GovernmentOrganization",
35
+ "Cooperative",
36
+ ] as const;
37
+
38
+ export type OrganizationType = (typeof ORGANIZATION_TYPES)[number];
39
+
27
40
  export interface OrganizationItemJson {
28
41
  _id: IdObject;
29
42
  collection: "organizations";
@@ -35,7 +48,7 @@ export interface OrganizationItemJson {
35
48
  description?: string;
36
49
  shortDescription?: string;
37
50
  slug?: string;
38
- type?: "NGO" | "LocalBusiness" | "Group" | "GovernmentOrganization" | "Cooperative";
51
+ type?: OrganizationType;
39
52
  address?: PostalAddress;
40
53
  geo?: GeoCoordinates;
41
54
  geoPosition?: GeoPosition;
@@ -63,7 +76,7 @@ export interface OrganizationItemNormalized {
63
76
  description?: string;
64
77
  shortDescription?: string;
65
78
  slug?: string;
66
- type?: "NGO" | "LocalBusiness" | "Group" | "GovernmentOrganization" | "Cooperative";
79
+ type?: OrganizationType;
67
80
  address?: PostalAddress;
68
81
  geo?: GeoCoordinates;
69
82
  geoPosition?: GeoPosition;
package/src/index.ts CHANGED
@@ -75,6 +75,10 @@ export type { Answer } from "./api/Answer.js";
75
75
  // Types ServerData (données normalisées reçues du serveur)
76
76
  export type * from "./api/serverDataType/User.js";
77
77
  export type * from "./api/serverDataType/Organization.js";
78
+
79
+ // Export des constantes de types d'entités
80
+ export { ORGANIZATION_TYPES } from "./api/serverDataType/Organization.js";
81
+ export { EVENT_TYPES } from "./api/serverDataType/Event.js";
78
82
  export type * from "./api/serverDataType/Project.js";
79
83
  export type * from "./api/serverDataType/Event.js";
80
84
  export type * from "./api/serverDataType/News.js";
@@ -7,11 +7,16 @@ export interface EventLinksBlock {
7
7
  organizer?: Record<string, LinkOrganizerRef>;
8
8
  [k: string]: unknown;
9
9
  }
10
+ /**
11
+ * Types d'événements supportés
12
+ */
13
+ export declare const EVENT_TYPES: readonly ["workshop", "competition", "concert", "contest", "conference", "debate", "exhibition", "festival", "crowdfunding", "fair", "course", "protest", "market", "film", "getTogether", "meeting", "spectacle", "internship", "stand", "others"];
14
+ export type EventType = (typeof EVENT_TYPES)[number];
10
15
  export interface EventItemJson {
11
16
  _id: IdObject;
12
17
  collection: "events";
13
18
  name: string;
14
- type: string;
19
+ type?: EventType;
15
20
  startDate: DateValue;
16
21
  endDate: DateValue;
17
22
  created?: DateValue;
@@ -40,7 +45,7 @@ export interface EventItemNormalized {
40
45
  _id: ObjectID;
41
46
  collection: "events";
42
47
  name: string;
43
- type: string;
48
+ type?: EventType;
44
49
  startDate: Date;
45
50
  endDate: Date;
46
51
  created?: Date;
@@ -9,6 +9,11 @@ export interface OrganizationLinksBlock {
9
9
  events?: Record<string, LinkEventsRef>;
10
10
  [k: string]: unknown;
11
11
  }
12
+ /**
13
+ * Types d'organisations supportés
14
+ */
15
+ export declare const ORGANIZATION_TYPES: readonly ["NGO", "LocalBusiness", "Group", "GovernmentOrganization", "Cooperative"];
16
+ export type OrganizationType = (typeof ORGANIZATION_TYPES)[number];
12
17
  export interface OrganizationItemJson {
13
18
  _id: IdObject;
14
19
  collection: "organizations";
@@ -20,7 +25,7 @@ export interface OrganizationItemJson {
20
25
  description?: string;
21
26
  shortDescription?: string;
22
27
  slug?: string;
23
- type?: "NGO" | "LocalBusiness" | "Group" | "GovernmentOrganization" | "Cooperative";
28
+ type?: OrganizationType;
24
29
  address?: PostalAddress;
25
30
  geo?: GeoCoordinates;
26
31
  geoPosition?: GeoPosition;
@@ -47,7 +52,7 @@ export interface OrganizationItemNormalized {
47
52
  description?: string;
48
53
  shortDescription?: string;
49
54
  slug?: string;
50
- type?: "NGO" | "LocalBusiness" | "Group" | "GovernmentOrganization" | "Cooperative";
55
+ type?: OrganizationType;
51
56
  address?: PostalAddress;
52
57
  geo?: GeoCoordinates;
53
58
  geoPosition?: GeoPosition;
package/types/index.d.ts CHANGED
@@ -54,6 +54,8 @@ export type { Comment } from "./api/Comment.js";
54
54
  export type { Answer } from "./api/Answer.js";
55
55
  export type * from "./api/serverDataType/User.js";
56
56
  export type * from "./api/serverDataType/Organization.js";
57
+ export { ORGANIZATION_TYPES } from "./api/serverDataType/Organization.js";
58
+ export { EVENT_TYPES } from "./api/serverDataType/Event.js";
57
59
  export type * from "./api/serverDataType/Project.js";
58
60
  export type * from "./api/serverDataType/Event.js";
59
61
  export type * from "./api/serverDataType/News.js";