onlinescoutmanager 1.0.0
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/LICENSE +201 -0
- package/README.md +181 -0
- package/dist/index.cjs +365 -0
- package/dist/index.d.cts +368 -0
- package/dist/index.d.ts +368 -0
- package/dist/index.js +336 -0
- package/package.json +56 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
interface ClientOptions {
|
|
2
|
+
apiId: string;
|
|
3
|
+
token: string;
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
}
|
|
6
|
+
interface AuthCredentials {
|
|
7
|
+
userid: string;
|
|
8
|
+
secret: string;
|
|
9
|
+
}
|
|
10
|
+
interface AuthResponse {
|
|
11
|
+
userid: string;
|
|
12
|
+
secret: string;
|
|
13
|
+
}
|
|
14
|
+
interface MemberListItem {
|
|
15
|
+
scoutid: number;
|
|
16
|
+
firstname: string;
|
|
17
|
+
lastname: string;
|
|
18
|
+
full_name: string;
|
|
19
|
+
photo_guid: string;
|
|
20
|
+
patrolid: number;
|
|
21
|
+
patrol: string;
|
|
22
|
+
sectionid: number;
|
|
23
|
+
enddate: string | null;
|
|
24
|
+
age: string;
|
|
25
|
+
patrol_role_level_label: string;
|
|
26
|
+
active: boolean;
|
|
27
|
+
}
|
|
28
|
+
interface MembersList {
|
|
29
|
+
identifier: string;
|
|
30
|
+
photos: boolean;
|
|
31
|
+
items: MemberListItem[];
|
|
32
|
+
}
|
|
33
|
+
interface MemberDetail {
|
|
34
|
+
ok: boolean;
|
|
35
|
+
read_only: string[];
|
|
36
|
+
data: Record<string, unknown>;
|
|
37
|
+
meta: Record<string, unknown>[];
|
|
38
|
+
}
|
|
39
|
+
interface MemberTransfer {
|
|
40
|
+
direction: string;
|
|
41
|
+
member_id: number;
|
|
42
|
+
firstname: string;
|
|
43
|
+
lastname: string;
|
|
44
|
+
photo_guid: string;
|
|
45
|
+
type: string;
|
|
46
|
+
date: string;
|
|
47
|
+
section_id: number;
|
|
48
|
+
section_name: {
|
|
49
|
+
group: string;
|
|
50
|
+
section: string;
|
|
51
|
+
};
|
|
52
|
+
section_long: string;
|
|
53
|
+
mode: string;
|
|
54
|
+
id: string;
|
|
55
|
+
}
|
|
56
|
+
interface MemberTransfersResponse {
|
|
57
|
+
status: boolean;
|
|
58
|
+
error: string | null;
|
|
59
|
+
data: MemberTransfer[];
|
|
60
|
+
meta: unknown[];
|
|
61
|
+
}
|
|
62
|
+
interface PatrolMember {
|
|
63
|
+
firstname: string;
|
|
64
|
+
lastname: string;
|
|
65
|
+
scout_id: number;
|
|
66
|
+
scoutid: number;
|
|
67
|
+
photo_guid: string;
|
|
68
|
+
patrolid: number;
|
|
69
|
+
patrolleader: string;
|
|
70
|
+
patrol: string;
|
|
71
|
+
sectionid: number;
|
|
72
|
+
enddate: string | null;
|
|
73
|
+
age: string;
|
|
74
|
+
patrol_role_level_label: string;
|
|
75
|
+
active: number;
|
|
76
|
+
editable: boolean;
|
|
77
|
+
}
|
|
78
|
+
interface Patrol {
|
|
79
|
+
patrolid: string;
|
|
80
|
+
sectionid: string;
|
|
81
|
+
name: string;
|
|
82
|
+
active: string;
|
|
83
|
+
points: string;
|
|
84
|
+
census_costs: boolean;
|
|
85
|
+
members: PatrolMember[];
|
|
86
|
+
}
|
|
87
|
+
type PatrolsResponse = Record<string, Patrol>;
|
|
88
|
+
interface CensusItem {
|
|
89
|
+
scoutid: string;
|
|
90
|
+
firstname: string;
|
|
91
|
+
lastname: string;
|
|
92
|
+
joined: string;
|
|
93
|
+
photo_guid: string | null;
|
|
94
|
+
sex: string;
|
|
95
|
+
ethnicity: string;
|
|
96
|
+
disabilities: string;
|
|
97
|
+
myscout: string;
|
|
98
|
+
raw_disabilities: string[];
|
|
99
|
+
_filterString: string;
|
|
100
|
+
}
|
|
101
|
+
interface CensusResponse {
|
|
102
|
+
identifier: string;
|
|
103
|
+
items: CensusItem[];
|
|
104
|
+
}
|
|
105
|
+
interface FlexiRecordItem {
|
|
106
|
+
extraid: string;
|
|
107
|
+
name: string;
|
|
108
|
+
}
|
|
109
|
+
interface FlexiRecordsResponse {
|
|
110
|
+
identifier: string;
|
|
111
|
+
label: string;
|
|
112
|
+
items: FlexiRecordItem[];
|
|
113
|
+
}
|
|
114
|
+
interface AttendanceItem {
|
|
115
|
+
firstname: string;
|
|
116
|
+
lastname: string;
|
|
117
|
+
patrolid: number;
|
|
118
|
+
active: boolean;
|
|
119
|
+
scoutid: number;
|
|
120
|
+
total: number;
|
|
121
|
+
[date: string]: unknown;
|
|
122
|
+
}
|
|
123
|
+
interface AttendanceResponse {
|
|
124
|
+
identifier: string;
|
|
125
|
+
label: string;
|
|
126
|
+
items: AttendanceItem[];
|
|
127
|
+
meetings: Record<string, string>;
|
|
128
|
+
}
|
|
129
|
+
interface AttendanceBadgeRequirement {
|
|
130
|
+
badge_id: string;
|
|
131
|
+
badgeName: string;
|
|
132
|
+
column_id: string;
|
|
133
|
+
name: string;
|
|
134
|
+
meetingdate: string;
|
|
135
|
+
section: string;
|
|
136
|
+
sectionid: number;
|
|
137
|
+
}
|
|
138
|
+
interface UpdateAttendanceParams {
|
|
139
|
+
sectionId: string;
|
|
140
|
+
termId: string;
|
|
141
|
+
scoutIds: number[];
|
|
142
|
+
selectedDate: string;
|
|
143
|
+
present: string;
|
|
144
|
+
section: string;
|
|
145
|
+
completedBadges?: unknown[];
|
|
146
|
+
customData?: unknown[];
|
|
147
|
+
}
|
|
148
|
+
interface ProgrammeSummaryItem {
|
|
149
|
+
eveningid: string;
|
|
150
|
+
sectionid: string;
|
|
151
|
+
title: string;
|
|
152
|
+
notesforparents: string;
|
|
153
|
+
parentsrequired: string;
|
|
154
|
+
meetingdate: string;
|
|
155
|
+
starttime: string;
|
|
156
|
+
endtime: string;
|
|
157
|
+
soft_deleted: string;
|
|
158
|
+
}
|
|
159
|
+
interface ProgrammeSummaryResponse {
|
|
160
|
+
items: ProgrammeSummaryItem[];
|
|
161
|
+
}
|
|
162
|
+
interface ProgrammeDetailItem {
|
|
163
|
+
eveningid: string;
|
|
164
|
+
sectionid: string;
|
|
165
|
+
title: string;
|
|
166
|
+
meetingdate: string;
|
|
167
|
+
starttime: string;
|
|
168
|
+
endtime: string;
|
|
169
|
+
help: {
|
|
170
|
+
scoutid: string;
|
|
171
|
+
scout: string;
|
|
172
|
+
}[];
|
|
173
|
+
}
|
|
174
|
+
interface ProgrammeDetailsResponse {
|
|
175
|
+
items: ProgrammeDetailItem[];
|
|
176
|
+
badgelinks: Record<string, unknown>;
|
|
177
|
+
}
|
|
178
|
+
interface ParentRotaMember {
|
|
179
|
+
scoutid: string;
|
|
180
|
+
firstname: string;
|
|
181
|
+
lastname: string;
|
|
182
|
+
photo_guid: string;
|
|
183
|
+
patrol_id: number;
|
|
184
|
+
}
|
|
185
|
+
interface ParentRotaResponse {
|
|
186
|
+
status: boolean;
|
|
187
|
+
error: string | null;
|
|
188
|
+
data: ParentRotaMember[];
|
|
189
|
+
meta: unknown[];
|
|
190
|
+
}
|
|
191
|
+
interface BadgeTagCloudResponse {
|
|
192
|
+
tags: Record<string, number>;
|
|
193
|
+
tag_count: number;
|
|
194
|
+
badges: Record<string, number>;
|
|
195
|
+
}
|
|
196
|
+
interface DashboardResponse {
|
|
197
|
+
conf: Record<string, number>;
|
|
198
|
+
is_full_admin: boolean;
|
|
199
|
+
permissions: Record<string, unknown>;
|
|
200
|
+
patrols: Record<string, unknown>[];
|
|
201
|
+
birthdays: Record<string, unknown>[];
|
|
202
|
+
programme: Record<string, unknown>[];
|
|
203
|
+
events: Record<string, unknown>[];
|
|
204
|
+
outstandingpayments: Record<string, unknown>[];
|
|
205
|
+
notepad: {
|
|
206
|
+
raw: string;
|
|
207
|
+
html: string;
|
|
208
|
+
};
|
|
209
|
+
[key: string]: unknown;
|
|
210
|
+
}
|
|
211
|
+
interface CustomDataColumn {
|
|
212
|
+
column_id: number;
|
|
213
|
+
type: string;
|
|
214
|
+
varname: string;
|
|
215
|
+
label: string;
|
|
216
|
+
value: string | null;
|
|
217
|
+
}
|
|
218
|
+
interface CustomDataGroup {
|
|
219
|
+
group_id: number;
|
|
220
|
+
group_type: string;
|
|
221
|
+
identifier: string;
|
|
222
|
+
name: string;
|
|
223
|
+
columns: CustomDataColumn[];
|
|
224
|
+
}
|
|
225
|
+
interface CustomDataResponse {
|
|
226
|
+
status: boolean;
|
|
227
|
+
error: string | null;
|
|
228
|
+
data: CustomDataGroup[];
|
|
229
|
+
meta: Record<string, unknown>;
|
|
230
|
+
}
|
|
231
|
+
interface CustomDataUpdateResponse {
|
|
232
|
+
status: boolean;
|
|
233
|
+
error: string | null;
|
|
234
|
+
data: Record<string, unknown>;
|
|
235
|
+
meta: Record<string, unknown>;
|
|
236
|
+
}
|
|
237
|
+
interface EmailContact {
|
|
238
|
+
emails: string[];
|
|
239
|
+
firstname: string;
|
|
240
|
+
lastname: string;
|
|
241
|
+
photo_guid: string;
|
|
242
|
+
member_id: number;
|
|
243
|
+
}
|
|
244
|
+
interface SelectedEmailsResponse {
|
|
245
|
+
emails: Record<string, EmailContact>;
|
|
246
|
+
count: number;
|
|
247
|
+
blocks: unknown[];
|
|
248
|
+
daily_limit_reached: boolean;
|
|
249
|
+
}
|
|
250
|
+
interface SectionsResponse {
|
|
251
|
+
[key: string]: unknown;
|
|
252
|
+
}
|
|
253
|
+
interface RiskAssessmentCategoriesResponse {
|
|
254
|
+
status: boolean;
|
|
255
|
+
error: string | null;
|
|
256
|
+
data: {
|
|
257
|
+
name: string;
|
|
258
|
+
}[];
|
|
259
|
+
meta: Record<string, unknown>;
|
|
260
|
+
}
|
|
261
|
+
interface DeletableMembersResponse {
|
|
262
|
+
status: boolean;
|
|
263
|
+
error: string | null;
|
|
264
|
+
data: {
|
|
265
|
+
firstname: string;
|
|
266
|
+
lastname: string;
|
|
267
|
+
date_deleted: string;
|
|
268
|
+
id: number;
|
|
269
|
+
}[];
|
|
270
|
+
meta: unknown[];
|
|
271
|
+
}
|
|
272
|
+
interface OkResponse {
|
|
273
|
+
ok: boolean;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
declare class AttendanceResource {
|
|
277
|
+
private client;
|
|
278
|
+
constructor(client: OSMClient);
|
|
279
|
+
get(sectionId: string, termId: string, section: string): Promise<AttendanceResponse>;
|
|
280
|
+
getBadgeRequirements(sectionId: string, section: string, date: string): Promise<AttendanceBadgeRequirement[]>;
|
|
281
|
+
update(params: UpdateAttendanceParams): Promise<OkResponse>;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
declare class BadgesResource {
|
|
285
|
+
private client;
|
|
286
|
+
constructor(client: OSMClient);
|
|
287
|
+
getTagCloud(sectionId: string, termId: string, section: string): Promise<BadgeTagCloudResponse>;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
declare class CustomDataResource {
|
|
291
|
+
private client;
|
|
292
|
+
constructor(client: OSMClient);
|
|
293
|
+
get(sectionId: string, memberId: string): Promise<CustomDataResponse>;
|
|
294
|
+
update(sectionId: string, memberId: string, groupId: string, data: Record<string, string>): Promise<CustomDataUpdateResponse>;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
declare class DashboardResource {
|
|
298
|
+
private client;
|
|
299
|
+
constructor(client: OSMClient);
|
|
300
|
+
getNextThings(sectionId: string, termId: string, section: string): Promise<DashboardResponse>;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
declare class EmailResource {
|
|
304
|
+
private client;
|
|
305
|
+
constructor(client: OSMClient);
|
|
306
|
+
getContacts(sectionId: string): Promise<SelectedEmailsResponse>;
|
|
307
|
+
sendTemplate(sectionId: string, subject: string, emails: Record<string, unknown>, edits: Record<string, unknown>): Promise<OkResponse>;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
declare class MembersResource {
|
|
311
|
+
private client;
|
|
312
|
+
constructor(client: OSMClient);
|
|
313
|
+
list(sectionId: string, termId: string): Promise<MembersList>;
|
|
314
|
+
get(sectionId: string, scoutId: string): Promise<MemberDetail>;
|
|
315
|
+
getTransfers(sectionId: string): Promise<MemberTransfersResponse>;
|
|
316
|
+
getPatrols(sectionId: string, termId: string): Promise<PatrolsResponse>;
|
|
317
|
+
getCensus(sectionId: string, termId: string): Promise<CensusResponse>;
|
|
318
|
+
getFlexiRecords(sectionId: string, archived?: boolean): Promise<FlexiRecordsResponse>;
|
|
319
|
+
getDeletable(sectionId: string): Promise<DeletableMembersResponse>;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
declare class ProgrammeResource {
|
|
323
|
+
private client;
|
|
324
|
+
constructor(client: OSMClient);
|
|
325
|
+
getSummary(sectionId: string, termId: string): Promise<ProgrammeSummaryResponse>;
|
|
326
|
+
getDetails(sectionId: string, eveningId: string): Promise<ProgrammeDetailsResponse>;
|
|
327
|
+
getParentRotaMembers(sectionId: string, eveningId: string): Promise<ParentRotaResponse>;
|
|
328
|
+
getAttachments(sectionId: string, eveningId: string): Promise<unknown>;
|
|
329
|
+
updateMeeting(sectionId: string, eveningId: string, parts: Record<string, unknown>): Promise<ProgrammeDetailsResponse>;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
declare class SectionsResource {
|
|
333
|
+
private client;
|
|
334
|
+
constructor(client: OSMClient);
|
|
335
|
+
list(): Promise<SectionsResponse>;
|
|
336
|
+
getTerms(): Promise<unknown>;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
declare class OSMClient {
|
|
340
|
+
readonly apiId: string;
|
|
341
|
+
readonly token: string;
|
|
342
|
+
readonly baseUrl: string;
|
|
343
|
+
private auth;
|
|
344
|
+
readonly members: MembersResource;
|
|
345
|
+
readonly attendance: AttendanceResource;
|
|
346
|
+
readonly programme: ProgrammeResource;
|
|
347
|
+
readonly sections: SectionsResource;
|
|
348
|
+
readonly badges: BadgesResource;
|
|
349
|
+
readonly dashboard: DashboardResource;
|
|
350
|
+
readonly customData: CustomDataResource;
|
|
351
|
+
readonly email: EmailResource;
|
|
352
|
+
constructor(options: ClientOptions);
|
|
353
|
+
get isAuthorized(): boolean;
|
|
354
|
+
authorize(email: string, password: string): Promise<void>;
|
|
355
|
+
post<T>(path: string, body?: Record<string, string>, skipAuth?: boolean): Promise<T>;
|
|
356
|
+
get<T>(path: string, query?: Record<string, string>): Promise<T>;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
declare class OSMError extends Error {
|
|
360
|
+
readonly status: number;
|
|
361
|
+
readonly body: unknown;
|
|
362
|
+
constructor(message: string, status: number, body?: unknown);
|
|
363
|
+
}
|
|
364
|
+
declare class OSMAuthError extends OSMError {
|
|
365
|
+
constructor(message?: string);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export { type AttendanceBadgeRequirement, type AttendanceItem, type AttendanceResponse, type AuthCredentials, type AuthResponse, type BadgeTagCloudResponse, type CensusItem, type CensusResponse, type ClientOptions, type CustomDataColumn, type CustomDataGroup, type CustomDataResponse, type CustomDataUpdateResponse, type DashboardResponse, type DeletableMembersResponse, type EmailContact, type FlexiRecordItem, type FlexiRecordsResponse, type MemberDetail, type MemberListItem, type MemberTransfer, type MemberTransfersResponse, type MembersList, OSMAuthError, OSMClient, OSMError, type OkResponse, type ParentRotaMember, type ParentRotaResponse, type Patrol, type PatrolMember, type PatrolsResponse, type ProgrammeDetailItem, type ProgrammeDetailsResponse, type ProgrammeSummaryItem, type ProgrammeSummaryResponse, type RiskAssessmentCategoriesResponse, type SectionsResponse, type SelectedEmailsResponse, type UpdateAttendanceParams };
|