@communecter/cocolight-api-client 1.0.69 → 1.0.71
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 +2 -2
- 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/api/EndpointApi.types.ts +3 -3
- package/src/api/News.ts +57 -0
- package/src/endpoints.module.ts +234 -222
- package/types/api/EndpointApi.types.d.ts +3 -3
- package/types/api/News.d.ts +24 -0
- package/types/endpoints.module.d.ts +36 -8
|
@@ -2452,7 +2452,7 @@ export interface AddOrganizationData {
|
|
|
2452
2452
|
/**
|
|
2453
2453
|
* Site web
|
|
2454
2454
|
*/
|
|
2455
|
-
url?: string;
|
|
2455
|
+
url?: string | "";
|
|
2456
2456
|
preferences?: {
|
|
2457
2457
|
/**
|
|
2458
2458
|
* Open data (true/false)
|
|
@@ -2568,7 +2568,7 @@ export interface AddProjectData {
|
|
|
2568
2568
|
/**
|
|
2569
2569
|
* Site web
|
|
2570
2570
|
*/
|
|
2571
|
-
url?: string;
|
|
2571
|
+
url?: string | "";
|
|
2572
2572
|
preferences?: {
|
|
2573
2573
|
/**
|
|
2574
2574
|
* Open data (true/false)
|
|
@@ -2816,7 +2816,7 @@ export interface AddEventData {
|
|
|
2816
2816
|
/**
|
|
2817
2817
|
* Site web
|
|
2818
2818
|
*/
|
|
2819
|
-
url?: string;
|
|
2819
|
+
url?: string | "";
|
|
2820
2820
|
/**
|
|
2821
2821
|
* Email de l’organisation
|
|
2822
2822
|
*/
|
package/types/api/News.d.ts
CHANGED
|
@@ -114,4 +114,28 @@ export declare class News extends BaseEntity<NewsItemNormalized> {
|
|
|
114
114
|
childType?: string;
|
|
115
115
|
comment?: string;
|
|
116
116
|
}): Promise<unknown>;
|
|
117
|
+
/**
|
|
118
|
+
* Vérifie si l'utilisateur connecté est l'auteur de cette actualité.
|
|
119
|
+
*
|
|
120
|
+
* Cette méthode compare l'ID de l'utilisateur connecté avec l'ID de l'auteur
|
|
121
|
+
* de l'actualité. L'auteur peut être soit un objet simple NewsAuthor, soit
|
|
122
|
+
* une instance d'entité User ou Organization.
|
|
123
|
+
*
|
|
124
|
+
* @returns `true` si l'utilisateur connecté est l'auteur, `false` sinon
|
|
125
|
+
* @throws {ApiError} Si l'utilisateur n'est pas connecté (401)
|
|
126
|
+
* @throws {ApiError} Si l'actualité n'a pas d'ID - non enregistrée (404)
|
|
127
|
+
* @throws {ApiError} Si les données serveur ne sont pas disponibles (404)
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```typescript
|
|
131
|
+
* const news = await me.news({ id: "123" });
|
|
132
|
+
* await news.get();
|
|
133
|
+
*
|
|
134
|
+
* if (news.isAuthor()) {
|
|
135
|
+
* console.log("Vous êtes l'auteur de cette actualité");
|
|
136
|
+
* await news.delete(); // Vous pouvez la supprimer
|
|
137
|
+
* }
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
isAuthor(): boolean;
|
|
117
141
|
}
|
|
@@ -1622,8 +1622,15 @@ declare const endpoints: {
|
|
|
1622
1622
|
})[];
|
|
1623
1623
|
};
|
|
1624
1624
|
url: {
|
|
1625
|
-
|
|
1626
|
-
|
|
1625
|
+
anyOf: ({
|
|
1626
|
+
format: string;
|
|
1627
|
+
type: string;
|
|
1628
|
+
const?: undefined;
|
|
1629
|
+
} | {
|
|
1630
|
+
const: string;
|
|
1631
|
+
type: string;
|
|
1632
|
+
format?: undefined;
|
|
1633
|
+
})[];
|
|
1627
1634
|
};
|
|
1628
1635
|
};
|
|
1629
1636
|
socialField?: undefined;
|
|
@@ -14452,8 +14459,15 @@ declare const endpoints: {
|
|
|
14452
14459
|
type: string;
|
|
14453
14460
|
};
|
|
14454
14461
|
url: {
|
|
14455
|
-
|
|
14456
|
-
|
|
14462
|
+
anyOf: ({
|
|
14463
|
+
format: string;
|
|
14464
|
+
type: string;
|
|
14465
|
+
const?: undefined;
|
|
14466
|
+
} | {
|
|
14467
|
+
const: string;
|
|
14468
|
+
type: string;
|
|
14469
|
+
format?: undefined;
|
|
14470
|
+
})[];
|
|
14457
14471
|
};
|
|
14458
14472
|
app?: undefined;
|
|
14459
14473
|
isInvitation?: undefined;
|
|
@@ -14782,8 +14796,15 @@ declare const endpoints: {
|
|
|
14782
14796
|
type: string;
|
|
14783
14797
|
};
|
|
14784
14798
|
url: {
|
|
14785
|
-
|
|
14786
|
-
|
|
14799
|
+
anyOf: ({
|
|
14800
|
+
format: string;
|
|
14801
|
+
type: string;
|
|
14802
|
+
const?: undefined;
|
|
14803
|
+
} | {
|
|
14804
|
+
const: string;
|
|
14805
|
+
type: string;
|
|
14806
|
+
format?: undefined;
|
|
14807
|
+
})[];
|
|
14787
14808
|
};
|
|
14788
14809
|
app?: undefined;
|
|
14789
14810
|
email?: undefined;
|
|
@@ -15516,8 +15537,15 @@ declare const endpoints: {
|
|
|
15516
15537
|
type: string;
|
|
15517
15538
|
};
|
|
15518
15539
|
url: {
|
|
15519
|
-
|
|
15520
|
-
|
|
15540
|
+
anyOf: ({
|
|
15541
|
+
format: string;
|
|
15542
|
+
type: string;
|
|
15543
|
+
const?: undefined;
|
|
15544
|
+
} | {
|
|
15545
|
+
const: string;
|
|
15546
|
+
type: string;
|
|
15547
|
+
format?: undefined;
|
|
15548
|
+
})[];
|
|
15521
15549
|
};
|
|
15522
15550
|
app?: undefined;
|
|
15523
15551
|
isInvitation?: undefined;
|