@communecter/cocolight-api-client 1.0.97 → 1.0.99
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/Api.ts +4 -4
- package/src/api/serverDataType/Organization.ts +4 -1
- package/src/api/serverDataType/Poi.ts +2 -2
- package/src/api/serverDataType/Project.ts +4 -1
- package/src/api/serverDataType/User.ts +4 -1
- package/src/api/serverDataType/common.ts +4 -1
- package/types/Api.d.ts +1 -1
- package/types/api/serverDataType/Organization.d.ts +3 -1
- package/types/api/serverDataType/Poi.d.ts +2 -2
- package/types/api/serverDataType/Project.d.ts +3 -1
- package/types/api/serverDataType/User.d.ts +3 -1
- package/types/api/serverDataType/common.d.ts +1 -0
package/package.json
CHANGED
package/src/Api.ts
CHANGED
|
@@ -193,11 +193,11 @@ export default class Api {
|
|
|
193
193
|
/**
|
|
194
194
|
* Creates a new Poi instance and optionally retrieves its profile.
|
|
195
195
|
*/
|
|
196
|
-
async poi(
|
|
196
|
+
async poi(poiData: EntityData): Promise<Poi> {
|
|
197
197
|
try {
|
|
198
|
-
const poi = new Poi(this._client,
|
|
199
|
-
if (!
|
|
200
|
-
throw new Error("Vous devez fournir un id ou un slug pour créer une instance
|
|
198
|
+
const poi = new Poi(this._client, poiData, { EndpointApi, User, Organization, Project, Poi, Badge, News, Comment });
|
|
199
|
+
if (!poiData.id && !poiData.slug) {
|
|
200
|
+
throw new Error("Vous devez fournir un id ou un slug pour créer une instance Poi.");
|
|
201
201
|
}
|
|
202
202
|
await poi.get();
|
|
203
203
|
return poi;
|
|
@@ -9,7 +9,8 @@ import type {
|
|
|
9
9
|
OpeningHoursEntry,
|
|
10
10
|
ParentsMap,
|
|
11
11
|
PostalAddress,
|
|
12
|
-
DateValue
|
|
12
|
+
DateValue,
|
|
13
|
+
SocialNetwork
|
|
13
14
|
} from "./common.js";
|
|
14
15
|
import type EJSONType from "../../EJSONType.js";
|
|
15
16
|
|
|
@@ -61,6 +62,7 @@ export interface OrganizationItemJson {
|
|
|
61
62
|
profilThumbImageUrl?: string;
|
|
62
63
|
profilMarkerImageUrl?: string;
|
|
63
64
|
email?: string;
|
|
65
|
+
socialNetwork?: SocialNetwork;
|
|
64
66
|
[key: string]: unknown;
|
|
65
67
|
}
|
|
66
68
|
|
|
@@ -89,5 +91,6 @@ export interface OrganizationItemNormalized {
|
|
|
89
91
|
profilThumbImageUrl?: string;
|
|
90
92
|
profilMarkerImageUrl?: string;
|
|
91
93
|
email?: string;
|
|
94
|
+
socialNetwork?: SocialNetwork;
|
|
92
95
|
[key: string]: unknown;
|
|
93
96
|
}
|
|
@@ -40,7 +40,7 @@ export interface PoiItemJson {
|
|
|
40
40
|
geo?: GeoCoordinates;
|
|
41
41
|
geoPosition?: GeoPosition;
|
|
42
42
|
tags?: string[];
|
|
43
|
-
|
|
43
|
+
urls?: string[];
|
|
44
44
|
creator?: string;
|
|
45
45
|
profilImageUrl?: string;
|
|
46
46
|
profilMediumImageUrl?: string;
|
|
@@ -65,7 +65,7 @@ export interface PoiItemNormalized {
|
|
|
65
65
|
geo?: GeoCoordinates;
|
|
66
66
|
geoPosition?: GeoPosition;
|
|
67
67
|
tags?: string[];
|
|
68
|
-
|
|
68
|
+
urls?: string[];
|
|
69
69
|
creator?: string;
|
|
70
70
|
profilImageUrl?: string;
|
|
71
71
|
profilMediumImageUrl?: string;
|
|
@@ -7,7 +7,8 @@ import type {
|
|
|
7
7
|
LinkEventsRef,
|
|
8
8
|
ParentsMap,
|
|
9
9
|
PostalAddress,
|
|
10
|
-
DateValue
|
|
10
|
+
DateValue,
|
|
11
|
+
SocialNetwork
|
|
11
12
|
} from "./common.js";
|
|
12
13
|
import type EJSONType from "../../EJSONType.js";
|
|
13
14
|
|
|
@@ -61,6 +62,7 @@ export interface ProjectItemJson {
|
|
|
61
62
|
profilMediumImageUrl?: string;
|
|
62
63
|
profilThumbImageUrl?: string;
|
|
63
64
|
profilMarkerImageUrl?: string;
|
|
65
|
+
socialNetwork?: SocialNetwork;
|
|
64
66
|
[key: string]: unknown;
|
|
65
67
|
}
|
|
66
68
|
|
|
@@ -87,5 +89,6 @@ export interface ProjectItemNormalized {
|
|
|
87
89
|
profilMediumImageUrl?: string;
|
|
88
90
|
profilThumbImageUrl?: string;
|
|
89
91
|
profilMarkerImageUrl?: string;
|
|
92
|
+
socialNetwork?: SocialNetwork;
|
|
90
93
|
[key: string]: unknown;
|
|
91
94
|
}
|
|
@@ -9,7 +9,8 @@ import type {
|
|
|
9
9
|
LinkFollowsUserRef,
|
|
10
10
|
LinkFollowersUserRef,
|
|
11
11
|
PostalAddress,
|
|
12
|
-
DateValue
|
|
12
|
+
DateValue,
|
|
13
|
+
SocialNetwork
|
|
13
14
|
} from "./common.js";
|
|
14
15
|
import type EJSONType from "../../EJSONType.js";
|
|
15
16
|
|
|
@@ -68,6 +69,7 @@ export interface UserItemJson {
|
|
|
68
69
|
profilBannerUrl?: string;
|
|
69
70
|
profilRealBannerUrl?: string;
|
|
70
71
|
preferences?: UserPreferences;
|
|
72
|
+
socialNetwork?: SocialNetwork;
|
|
71
73
|
[key: string]: unknown;
|
|
72
74
|
}
|
|
73
75
|
|
|
@@ -99,5 +101,6 @@ export interface UserItemNormalized {
|
|
|
99
101
|
profilBannerUrl?: string;
|
|
100
102
|
profilRealBannerUrl?: string;
|
|
101
103
|
preferences?: UserPreferences;
|
|
104
|
+
socialNetwork?: SocialNetwork;
|
|
102
105
|
[key: string]: unknown;
|
|
103
106
|
}
|
|
@@ -78,4 +78,7 @@ export interface OpeningHourSpan {
|
|
|
78
78
|
export interface OpeningHoursEntry {
|
|
79
79
|
dayOfWeek: DayOfWeek;
|
|
80
80
|
hours: OpeningHourSpan[];
|
|
81
|
-
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Réexport de SocialNetworkPayload comme SocialNetwork pour les types serverDataType
|
|
84
|
+
export type { SocialNetworkPayload as SocialNetwork } from "../../types/payloads.js";
|
package/types/Api.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export default class Api {
|
|
|
51
51
|
/**
|
|
52
52
|
* Creates a new Poi instance and optionally retrieves its profile.
|
|
53
53
|
*/
|
|
54
|
-
poi(
|
|
54
|
+
poi(poiData: EntityData): Promise<Poi>;
|
|
55
55
|
/**
|
|
56
56
|
* Creates a new Answer instance and optionally retrieves answer data.
|
|
57
57
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GeoCoordinates, GeoPosition, IdObject, LinkMemberOfRef, LinkMemberRef, LinkProjectRef, LinkEventsRef, OpeningHoursEntry, ParentsMap, PostalAddress, DateValue } from "./common.js";
|
|
1
|
+
import type { GeoCoordinates, GeoPosition, IdObject, LinkMemberOfRef, LinkMemberRef, LinkProjectRef, LinkEventsRef, OpeningHoursEntry, ParentsMap, PostalAddress, DateValue, SocialNetwork } from "./common.js";
|
|
2
2
|
import type EJSONType from "../../EJSONType.js";
|
|
3
3
|
type ObjectIDCtor = typeof EJSONType["ObjectID"];
|
|
4
4
|
type ObjectID = InstanceType<ObjectIDCtor>;
|
|
@@ -38,6 +38,7 @@ export interface OrganizationItemJson {
|
|
|
38
38
|
profilThumbImageUrl?: string;
|
|
39
39
|
profilMarkerImageUrl?: string;
|
|
40
40
|
email?: string;
|
|
41
|
+
socialNetwork?: SocialNetwork;
|
|
41
42
|
[key: string]: unknown;
|
|
42
43
|
}
|
|
43
44
|
export interface OrganizationItemNormalized {
|
|
@@ -65,6 +66,7 @@ export interface OrganizationItemNormalized {
|
|
|
65
66
|
profilThumbImageUrl?: string;
|
|
66
67
|
profilMarkerImageUrl?: string;
|
|
67
68
|
email?: string;
|
|
69
|
+
socialNetwork?: SocialNetwork;
|
|
68
70
|
[key: string]: unknown;
|
|
69
71
|
}
|
|
70
72
|
export {};
|
|
@@ -22,7 +22,7 @@ export interface PoiItemJson {
|
|
|
22
22
|
geo?: GeoCoordinates;
|
|
23
23
|
geoPosition?: GeoPosition;
|
|
24
24
|
tags?: string[];
|
|
25
|
-
|
|
25
|
+
urls?: string[];
|
|
26
26
|
creator?: string;
|
|
27
27
|
profilImageUrl?: string;
|
|
28
28
|
profilMediumImageUrl?: string;
|
|
@@ -46,7 +46,7 @@ export interface PoiItemNormalized {
|
|
|
46
46
|
geo?: GeoCoordinates;
|
|
47
47
|
geoPosition?: GeoPosition;
|
|
48
48
|
tags?: string[];
|
|
49
|
-
|
|
49
|
+
urls?: string[];
|
|
50
50
|
creator?: string;
|
|
51
51
|
profilImageUrl?: string;
|
|
52
52
|
profilMediumImageUrl?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GeoCoordinates, GeoPosition, IdObject, LinkContributorsRef, LinkProjectRef, LinkEventsRef, ParentsMap, PostalAddress, DateValue } from "./common.js";
|
|
1
|
+
import type { GeoCoordinates, GeoPosition, IdObject, LinkContributorsRef, LinkProjectRef, LinkEventsRef, ParentsMap, PostalAddress, DateValue, SocialNetwork } from "./common.js";
|
|
2
2
|
import type EJSONType from "../../EJSONType.js";
|
|
3
3
|
type ObjectIDCtor = typeof EJSONType["ObjectID"];
|
|
4
4
|
type ObjectID = InstanceType<ObjectIDCtor>;
|
|
@@ -35,6 +35,7 @@ export interface ProjectItemJson {
|
|
|
35
35
|
profilMediumImageUrl?: string;
|
|
36
36
|
profilThumbImageUrl?: string;
|
|
37
37
|
profilMarkerImageUrl?: string;
|
|
38
|
+
socialNetwork?: SocialNetwork;
|
|
38
39
|
[key: string]: unknown;
|
|
39
40
|
}
|
|
40
41
|
export interface ProjectItemNormalized {
|
|
@@ -60,6 +61,7 @@ export interface ProjectItemNormalized {
|
|
|
60
61
|
profilMediumImageUrl?: string;
|
|
61
62
|
profilThumbImageUrl?: string;
|
|
62
63
|
profilMarkerImageUrl?: string;
|
|
64
|
+
socialNetwork?: SocialNetwork;
|
|
63
65
|
[key: string]: unknown;
|
|
64
66
|
}
|
|
65
67
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GeoCoordinates, GeoPosition, IdObject, LinkMemberOfUserRef, LinkProjectRef, LinkEventsRef, LinkfriendsRef, LinkFollowsUserRef, LinkFollowersUserRef, PostalAddress, DateValue } from "./common.js";
|
|
1
|
+
import type { GeoCoordinates, GeoPosition, IdObject, LinkMemberOfUserRef, LinkProjectRef, LinkEventsRef, LinkfriendsRef, LinkFollowsUserRef, LinkFollowersUserRef, PostalAddress, DateValue, SocialNetwork } from "./common.js";
|
|
2
2
|
import type EJSONType from "../../EJSONType.js";
|
|
3
3
|
type ObjectIDCtor = typeof EJSONType["ObjectID"];
|
|
4
4
|
type ObjectID = InstanceType<ObjectIDCtor>;
|
|
@@ -51,6 +51,7 @@ export interface UserItemJson {
|
|
|
51
51
|
profilBannerUrl?: string;
|
|
52
52
|
profilRealBannerUrl?: string;
|
|
53
53
|
preferences?: UserPreferences;
|
|
54
|
+
socialNetwork?: SocialNetwork;
|
|
54
55
|
[key: string]: unknown;
|
|
55
56
|
}
|
|
56
57
|
export interface UserItemNormalized {
|
|
@@ -81,6 +82,7 @@ export interface UserItemNormalized {
|
|
|
81
82
|
profilBannerUrl?: string;
|
|
82
83
|
profilRealBannerUrl?: string;
|
|
83
84
|
preferences?: UserPreferences;
|
|
85
|
+
socialNetwork?: SocialNetwork;
|
|
84
86
|
[key: string]: unknown;
|
|
85
87
|
}
|
|
86
88
|
export {};
|