@communecter/cocolight-api-client 1.0.91 → 1.0.93
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/cocolight-api-client.browser.js +1 -1
- package/dist/cocolight-api-client.cjs +1 -1
- package/dist/cocolight-api-client.mjs.js +1 -1
- package/dist/cocolight-api-client.vite.mjs.js +1 -1
- package/dist/cocolight-api-client.vite.mjs.js.map +1 -1
- package/package.json +1 -1
- package/src/ApiClient.ts +8 -0
- package/src/api/EndpointApi.types.ts +31 -29
- package/src/endpoints.module.ts +305 -226
- package/types/api/EndpointApi.types.d.ts +3 -3
- package/types/endpoints.module.d.ts +80 -53
package/package.json
CHANGED
package/src/ApiClient.ts
CHANGED
|
@@ -1593,6 +1593,12 @@ export default class ApiClient extends EventEmitter {
|
|
|
1593
1593
|
return { $date: value.sec * 1000 };
|
|
1594
1594
|
} else if (typeof value === "number") {
|
|
1595
1595
|
return { $date: value * 1000 };
|
|
1596
|
+
} else if (typeof value === "string" && value.trim() !== "") {
|
|
1597
|
+
const date = new Date(value);
|
|
1598
|
+
// Vérifier que la date est valide (pas NaN)
|
|
1599
|
+
if (!isNaN(date.getTime())) {
|
|
1600
|
+
return EJSON.toJSONValue(date);
|
|
1601
|
+
}
|
|
1596
1602
|
}
|
|
1597
1603
|
return value;
|
|
1598
1604
|
}
|
|
@@ -1667,7 +1673,9 @@ export default class ApiClient extends EventEmitter {
|
|
|
1667
1673
|
|
|
1668
1674
|
// Si la clé correspond à un champ de date, on applique la normalisation de date.
|
|
1669
1675
|
if (this._dateFields.includes(key)) {
|
|
1676
|
+
console.log(key, value);
|
|
1670
1677
|
value = this._normalizeDate(value);
|
|
1678
|
+
console.log("Date", key, value);
|
|
1671
1679
|
}
|
|
1672
1680
|
|
|
1673
1681
|
// Si la clé correspond à un champ d'image, on applique la normalisation d'image.
|
|
@@ -3088,7 +3088,7 @@ export interface AddEventData {
|
|
|
3088
3088
|
* Description courte
|
|
3089
3089
|
*/
|
|
3090
3090
|
shortDescription?: string;
|
|
3091
|
-
tags?: string[];
|
|
3091
|
+
tags?: string[] | "";
|
|
3092
3092
|
/**
|
|
3093
3093
|
* Site web
|
|
3094
3094
|
*/
|
|
@@ -3096,7 +3096,7 @@ export interface AddEventData {
|
|
|
3096
3096
|
/**
|
|
3097
3097
|
* Email de l’organisation
|
|
3098
3098
|
*/
|
|
3099
|
-
email?: string;
|
|
3099
|
+
email?: string | "";
|
|
3100
3100
|
preferences?: {
|
|
3101
3101
|
/**
|
|
3102
3102
|
* Open data (true/false)
|
|
@@ -3315,33 +3315,35 @@ export interface AddEventData {
|
|
|
3315
3315
|
float: true;
|
|
3316
3316
|
[k: string]: unknown;
|
|
3317
3317
|
};
|
|
3318
|
-
address?:
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3318
|
+
address?:
|
|
3319
|
+
| ""
|
|
3320
|
+
| {
|
|
3321
|
+
"@type": "PostalAddress";
|
|
3322
|
+
addressCountry: string;
|
|
3323
|
+
codeInsee: string;
|
|
3324
|
+
addressLocality: string;
|
|
3325
|
+
localityId: string;
|
|
3326
|
+
level1: string;
|
|
3327
|
+
level1Name: string;
|
|
3328
|
+
/**
|
|
3329
|
+
* ID du département. Peut être vide pour les pays étrangers.
|
|
3330
|
+
*/
|
|
3331
|
+
level3?: string;
|
|
3332
|
+
/**
|
|
3333
|
+
* Nom du département. Peut être vide pour les pays étrangers.
|
|
3334
|
+
*/
|
|
3335
|
+
level3Name?: string;
|
|
3336
|
+
/**
|
|
3337
|
+
* ID de la commune. Peut être vide pour les pays étrangers.
|
|
3338
|
+
*/
|
|
3339
|
+
level4?: string;
|
|
3340
|
+
/**
|
|
3341
|
+
* Nom de la commune. Peut être vide pour les pays étrangers.
|
|
3342
|
+
*/
|
|
3343
|
+
level4Name?: string;
|
|
3344
|
+
postalCode?: string;
|
|
3345
|
+
streetAddress?: string;
|
|
3346
|
+
};
|
|
3345
3347
|
scope: "";
|
|
3346
3348
|
[k: string]: unknown;
|
|
3347
3349
|
}
|