@sayrio/public 0.0.5
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/README.md +264 -0
- package/dist/index.cjs +356 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +258 -0
- package/dist/index.d.ts +258 -0
- package/dist/index.js +324 -0
- package/dist/index.js.map +1 -0
- package/dist/react/index.cjs +431 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.cts +88 -0
- package/dist/react/index.d.ts +88 -0
- package/dist/react/index.js +400 -0
- package/dist/react/index.js.map +1 -0
- package/package.json +46 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
interface ApiSuccess<T> {
|
|
2
|
+
success: true;
|
|
3
|
+
data: T;
|
|
4
|
+
}
|
|
5
|
+
interface ApiError {
|
|
6
|
+
success: false;
|
|
7
|
+
error: string;
|
|
8
|
+
message?: string;
|
|
9
|
+
status?: number;
|
|
10
|
+
}
|
|
11
|
+
interface Pagination {
|
|
12
|
+
limit: number;
|
|
13
|
+
page: number;
|
|
14
|
+
totalPages: number;
|
|
15
|
+
totalItems: number;
|
|
16
|
+
hasMore: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface Organization {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
slug: string;
|
|
22
|
+
logo: string | null;
|
|
23
|
+
bannerImg: string | null;
|
|
24
|
+
description: string;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
wsUrl: string;
|
|
28
|
+
}
|
|
29
|
+
interface Label {
|
|
30
|
+
id: string;
|
|
31
|
+
organizationId: string;
|
|
32
|
+
name: string;
|
|
33
|
+
color: string | null;
|
|
34
|
+
createdAt: string;
|
|
35
|
+
}
|
|
36
|
+
interface Category {
|
|
37
|
+
id: string;
|
|
38
|
+
organizationId: string;
|
|
39
|
+
name: string;
|
|
40
|
+
color: string | null;
|
|
41
|
+
icon: string | null;
|
|
42
|
+
createdAt: string;
|
|
43
|
+
}
|
|
44
|
+
type TaskStatus = "backlog" | "todo" | "in-progress" | "done" | "canceled";
|
|
45
|
+
type TaskPriority = "none" | "low" | "medium" | "high" | "urgent";
|
|
46
|
+
interface Task {
|
|
47
|
+
id: string;
|
|
48
|
+
organizationId: string;
|
|
49
|
+
shortId: number | null;
|
|
50
|
+
visible: "public" | "private";
|
|
51
|
+
createdAt: string;
|
|
52
|
+
updatedAt: string;
|
|
53
|
+
title: string | null;
|
|
54
|
+
description: unknown | null;
|
|
55
|
+
status: TaskStatus;
|
|
56
|
+
priority: TaskPriority;
|
|
57
|
+
createdBy: string | null;
|
|
58
|
+
category: string | null;
|
|
59
|
+
voteCount: number;
|
|
60
|
+
descriptionHtml: string;
|
|
61
|
+
descriptionMarkdown: string;
|
|
62
|
+
}
|
|
63
|
+
interface CommentUser {
|
|
64
|
+
name: string | null;
|
|
65
|
+
image: string | null;
|
|
66
|
+
}
|
|
67
|
+
interface CommentReaction {
|
|
68
|
+
count: number;
|
|
69
|
+
users: string[];
|
|
70
|
+
}
|
|
71
|
+
interface Comment {
|
|
72
|
+
id: string;
|
|
73
|
+
organizationId: string;
|
|
74
|
+
taskId: string | null;
|
|
75
|
+
createdAt: string;
|
|
76
|
+
updatedAt: string;
|
|
77
|
+
content: unknown | null;
|
|
78
|
+
visibility: "public" | "internal";
|
|
79
|
+
contentHtml: string;
|
|
80
|
+
contentMarkdown: string;
|
|
81
|
+
createdBy: CommentUser | null;
|
|
82
|
+
reactions?: {
|
|
83
|
+
total: number;
|
|
84
|
+
reactions: Record<string, CommentReaction>;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
type RequestOptions = {
|
|
89
|
+
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
90
|
+
headers?: Record<string, string>;
|
|
91
|
+
body?: Record<string, string>;
|
|
92
|
+
signal?: AbortSignal;
|
|
93
|
+
};
|
|
94
|
+
type Hooks = {
|
|
95
|
+
onRequest?: (url: string, opts: RequestOptions) => void;
|
|
96
|
+
onResponse?: (res: Response) => void;
|
|
97
|
+
onError?: (error: ApiError | unknown) => void;
|
|
98
|
+
};
|
|
99
|
+
declare function setToken(token?: string): void;
|
|
100
|
+
declare function setHeaders(headers?: Record<string, string>): void;
|
|
101
|
+
declare function setFetch(fn: typeof fetch): void;
|
|
102
|
+
declare function setBaseUrl(url: string): void;
|
|
103
|
+
declare function setHooks(h: Hooks): void;
|
|
104
|
+
declare function resetClient(): void;
|
|
105
|
+
|
|
106
|
+
interface Me {
|
|
107
|
+
id: string;
|
|
108
|
+
name: string | null;
|
|
109
|
+
email: string | null;
|
|
110
|
+
image: string | null;
|
|
111
|
+
createdAt: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
type Order = "asc" | "desc";
|
|
115
|
+
interface PaginationParams {
|
|
116
|
+
page?: number;
|
|
117
|
+
limit?: number;
|
|
118
|
+
}
|
|
119
|
+
interface OrderedPaginationParams extends PaginationParams {
|
|
120
|
+
order?: Order;
|
|
121
|
+
}
|
|
122
|
+
declare function buildPaginationParams(params?: OrderedPaginationParams): URLSearchParams;
|
|
123
|
+
|
|
124
|
+
declare const v1: {
|
|
125
|
+
org: {
|
|
126
|
+
tasks: {
|
|
127
|
+
list(slug: string, params?: OrderedPaginationParams, opts?: RequestOptions): Promise<{
|
|
128
|
+
data: Task[];
|
|
129
|
+
pagination: Pagination;
|
|
130
|
+
}>;
|
|
131
|
+
get(slug: string, shortId: number, opts?: RequestOptions): Promise<Task>;
|
|
132
|
+
};
|
|
133
|
+
comments: {
|
|
134
|
+
list(slug: string, shortId: number, params?: OrderedPaginationParams, opts?: RequestOptions): Promise<{
|
|
135
|
+
data: Comment[];
|
|
136
|
+
pagination: Pagination;
|
|
137
|
+
}>;
|
|
138
|
+
};
|
|
139
|
+
labels: {
|
|
140
|
+
list(slug: string, opts?: RequestOptions): Promise<Label[]>;
|
|
141
|
+
};
|
|
142
|
+
categories: {
|
|
143
|
+
list(slug: string, order?: Order, opts?: RequestOptions): Promise<Category[]>;
|
|
144
|
+
};
|
|
145
|
+
get(slug: string, opts?: RequestOptions): Promise<Organization>;
|
|
146
|
+
};
|
|
147
|
+
me: {
|
|
148
|
+
get(opts?: RequestOptions): Promise<Me>;
|
|
149
|
+
organizations(opts?: RequestOptions): Promise<Organization[]>;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
type WSMessageType = "CONNECTION_STATUS" | "SUBSCRIBED" | "ERROR" | "PING" | "PONG" | "UPDATE_ORG" | "CREATE_TASK" | "UPDATE_TASK" | "UPDATE_TASK_COMMENTS" | "UPDATE_TASK_VOTE" | "UPDATE_LABELS" | "UPDATE_VIEWS" | "UPDATE_CATEGORIES" | "UPDATE_ISSUE_TEMPLATES" | "DISCONNECTED";
|
|
154
|
+
/**
|
|
155
|
+
* String enum replacement for WS event names.
|
|
156
|
+
* Use this instead of raw strings.
|
|
157
|
+
*/
|
|
158
|
+
declare const WS_EVENTS: Record<WSMessageType, WSMessageType>;
|
|
159
|
+
interface WSMessage<T = unknown> {
|
|
160
|
+
type: WSMessageType;
|
|
161
|
+
scope: "PUBLIC";
|
|
162
|
+
data: T;
|
|
163
|
+
meta?: {
|
|
164
|
+
ts: number;
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
type Handlers = Partial<Record<WSMessageType, (data: any, msg: WSMessage) => void>>;
|
|
169
|
+
declare function ws(url: string, handlers?: Handlers): {
|
|
170
|
+
close(): void;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Sayr Public API — Version 1.
|
|
175
|
+
*
|
|
176
|
+
* @since v1.0.0
|
|
177
|
+
*/
|
|
178
|
+
declare const SayrV1: {
|
|
179
|
+
org: {
|
|
180
|
+
tasks: {
|
|
181
|
+
list(slug: string, params?: OrderedPaginationParams, opts?: RequestOptions): Promise<{
|
|
182
|
+
data: Task[];
|
|
183
|
+
pagination: Pagination;
|
|
184
|
+
}>;
|
|
185
|
+
get(slug: string, shortId: number, opts?: RequestOptions): Promise<Task>;
|
|
186
|
+
};
|
|
187
|
+
comments: {
|
|
188
|
+
list(slug: string, shortId: number, params?: OrderedPaginationParams, opts?: RequestOptions): Promise<{
|
|
189
|
+
data: Comment[];
|
|
190
|
+
pagination: Pagination;
|
|
191
|
+
}>;
|
|
192
|
+
};
|
|
193
|
+
labels: {
|
|
194
|
+
list(slug: string, opts?: RequestOptions): Promise<Label[]>;
|
|
195
|
+
};
|
|
196
|
+
categories: {
|
|
197
|
+
list(slug: string, order?: Order, opts?: RequestOptions): Promise<Category[]>;
|
|
198
|
+
};
|
|
199
|
+
get(slug: string, opts?: RequestOptions): Promise<Organization>;
|
|
200
|
+
};
|
|
201
|
+
me: {
|
|
202
|
+
get(opts?: RequestOptions): Promise<Me>;
|
|
203
|
+
organizations(opts?: RequestOptions): Promise<Organization[]>;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* Create a WebSocket connection for public real‑time updates.
|
|
208
|
+
*/
|
|
209
|
+
declare const SayrWS: typeof ws;
|
|
210
|
+
/**
|
|
211
|
+
* Typed WebSocket event constants.
|
|
212
|
+
*/
|
|
213
|
+
declare const SayrWSEvents: Record<WSMessageType, WSMessageType>;
|
|
214
|
+
/**
|
|
215
|
+
* Global client configuration helpers.
|
|
216
|
+
*/
|
|
217
|
+
declare const SayrClient: {
|
|
218
|
+
setToken: typeof setToken;
|
|
219
|
+
setHeaders: typeof setHeaders;
|
|
220
|
+
setBaseUrl: typeof setBaseUrl;
|
|
221
|
+
resetClient: typeof resetClient;
|
|
222
|
+
setHooks: typeof setHooks;
|
|
223
|
+
setFetch: typeof setFetch;
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* Sayr Public SDK.
|
|
227
|
+
*
|
|
228
|
+
* Read‑only access to public Sayr data via REST and WebSockets.
|
|
229
|
+
*
|
|
230
|
+
* @since v1.0.0
|
|
231
|
+
*/
|
|
232
|
+
declare const Sayr: {
|
|
233
|
+
/**
|
|
234
|
+
* Client configuration helpers.
|
|
235
|
+
*/
|
|
236
|
+
client: typeof SayrClient;
|
|
237
|
+
/**
|
|
238
|
+
* Versioned API namespaces.
|
|
239
|
+
*/
|
|
240
|
+
v1: typeof v1;
|
|
241
|
+
/**
|
|
242
|
+
* Alias for the current API version (`v1`).
|
|
243
|
+
*
|
|
244
|
+
* @since v1.0.0
|
|
245
|
+
*/
|
|
246
|
+
org: typeof v1.org;
|
|
247
|
+
me: typeof v1.me;
|
|
248
|
+
/**
|
|
249
|
+
* WebSocket helper for real‑time updates.
|
|
250
|
+
*/
|
|
251
|
+
ws: typeof ws;
|
|
252
|
+
/**
|
|
253
|
+
* WebSocket event constants.
|
|
254
|
+
*/
|
|
255
|
+
WS_EVENTS: typeof WS_EVENTS;
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
export { type ApiError, type ApiSuccess, type Category, type Comment, type CommentReaction, type CommentUser, type Label, type Order, type OrderedPaginationParams, type Organization, type Pagination, type PaginationParams, SayrClient, SayrV1, SayrWS, SayrWSEvents, type Task, type TaskPriority, type TaskStatus, type WSMessage, type WSMessageType, WS_EVENTS, buildPaginationParams, Sayr as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
interface ApiSuccess<T> {
|
|
2
|
+
success: true;
|
|
3
|
+
data: T;
|
|
4
|
+
}
|
|
5
|
+
interface ApiError {
|
|
6
|
+
success: false;
|
|
7
|
+
error: string;
|
|
8
|
+
message?: string;
|
|
9
|
+
status?: number;
|
|
10
|
+
}
|
|
11
|
+
interface Pagination {
|
|
12
|
+
limit: number;
|
|
13
|
+
page: number;
|
|
14
|
+
totalPages: number;
|
|
15
|
+
totalItems: number;
|
|
16
|
+
hasMore: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface Organization {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
slug: string;
|
|
22
|
+
logo: string | null;
|
|
23
|
+
bannerImg: string | null;
|
|
24
|
+
description: string;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
wsUrl: string;
|
|
28
|
+
}
|
|
29
|
+
interface Label {
|
|
30
|
+
id: string;
|
|
31
|
+
organizationId: string;
|
|
32
|
+
name: string;
|
|
33
|
+
color: string | null;
|
|
34
|
+
createdAt: string;
|
|
35
|
+
}
|
|
36
|
+
interface Category {
|
|
37
|
+
id: string;
|
|
38
|
+
organizationId: string;
|
|
39
|
+
name: string;
|
|
40
|
+
color: string | null;
|
|
41
|
+
icon: string | null;
|
|
42
|
+
createdAt: string;
|
|
43
|
+
}
|
|
44
|
+
type TaskStatus = "backlog" | "todo" | "in-progress" | "done" | "canceled";
|
|
45
|
+
type TaskPriority = "none" | "low" | "medium" | "high" | "urgent";
|
|
46
|
+
interface Task {
|
|
47
|
+
id: string;
|
|
48
|
+
organizationId: string;
|
|
49
|
+
shortId: number | null;
|
|
50
|
+
visible: "public" | "private";
|
|
51
|
+
createdAt: string;
|
|
52
|
+
updatedAt: string;
|
|
53
|
+
title: string | null;
|
|
54
|
+
description: unknown | null;
|
|
55
|
+
status: TaskStatus;
|
|
56
|
+
priority: TaskPriority;
|
|
57
|
+
createdBy: string | null;
|
|
58
|
+
category: string | null;
|
|
59
|
+
voteCount: number;
|
|
60
|
+
descriptionHtml: string;
|
|
61
|
+
descriptionMarkdown: string;
|
|
62
|
+
}
|
|
63
|
+
interface CommentUser {
|
|
64
|
+
name: string | null;
|
|
65
|
+
image: string | null;
|
|
66
|
+
}
|
|
67
|
+
interface CommentReaction {
|
|
68
|
+
count: number;
|
|
69
|
+
users: string[];
|
|
70
|
+
}
|
|
71
|
+
interface Comment {
|
|
72
|
+
id: string;
|
|
73
|
+
organizationId: string;
|
|
74
|
+
taskId: string | null;
|
|
75
|
+
createdAt: string;
|
|
76
|
+
updatedAt: string;
|
|
77
|
+
content: unknown | null;
|
|
78
|
+
visibility: "public" | "internal";
|
|
79
|
+
contentHtml: string;
|
|
80
|
+
contentMarkdown: string;
|
|
81
|
+
createdBy: CommentUser | null;
|
|
82
|
+
reactions?: {
|
|
83
|
+
total: number;
|
|
84
|
+
reactions: Record<string, CommentReaction>;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
type RequestOptions = {
|
|
89
|
+
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
90
|
+
headers?: Record<string, string>;
|
|
91
|
+
body?: Record<string, string>;
|
|
92
|
+
signal?: AbortSignal;
|
|
93
|
+
};
|
|
94
|
+
type Hooks = {
|
|
95
|
+
onRequest?: (url: string, opts: RequestOptions) => void;
|
|
96
|
+
onResponse?: (res: Response) => void;
|
|
97
|
+
onError?: (error: ApiError | unknown) => void;
|
|
98
|
+
};
|
|
99
|
+
declare function setToken(token?: string): void;
|
|
100
|
+
declare function setHeaders(headers?: Record<string, string>): void;
|
|
101
|
+
declare function setFetch(fn: typeof fetch): void;
|
|
102
|
+
declare function setBaseUrl(url: string): void;
|
|
103
|
+
declare function setHooks(h: Hooks): void;
|
|
104
|
+
declare function resetClient(): void;
|
|
105
|
+
|
|
106
|
+
interface Me {
|
|
107
|
+
id: string;
|
|
108
|
+
name: string | null;
|
|
109
|
+
email: string | null;
|
|
110
|
+
image: string | null;
|
|
111
|
+
createdAt: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
type Order = "asc" | "desc";
|
|
115
|
+
interface PaginationParams {
|
|
116
|
+
page?: number;
|
|
117
|
+
limit?: number;
|
|
118
|
+
}
|
|
119
|
+
interface OrderedPaginationParams extends PaginationParams {
|
|
120
|
+
order?: Order;
|
|
121
|
+
}
|
|
122
|
+
declare function buildPaginationParams(params?: OrderedPaginationParams): URLSearchParams;
|
|
123
|
+
|
|
124
|
+
declare const v1: {
|
|
125
|
+
org: {
|
|
126
|
+
tasks: {
|
|
127
|
+
list(slug: string, params?: OrderedPaginationParams, opts?: RequestOptions): Promise<{
|
|
128
|
+
data: Task[];
|
|
129
|
+
pagination: Pagination;
|
|
130
|
+
}>;
|
|
131
|
+
get(slug: string, shortId: number, opts?: RequestOptions): Promise<Task>;
|
|
132
|
+
};
|
|
133
|
+
comments: {
|
|
134
|
+
list(slug: string, shortId: number, params?: OrderedPaginationParams, opts?: RequestOptions): Promise<{
|
|
135
|
+
data: Comment[];
|
|
136
|
+
pagination: Pagination;
|
|
137
|
+
}>;
|
|
138
|
+
};
|
|
139
|
+
labels: {
|
|
140
|
+
list(slug: string, opts?: RequestOptions): Promise<Label[]>;
|
|
141
|
+
};
|
|
142
|
+
categories: {
|
|
143
|
+
list(slug: string, order?: Order, opts?: RequestOptions): Promise<Category[]>;
|
|
144
|
+
};
|
|
145
|
+
get(slug: string, opts?: RequestOptions): Promise<Organization>;
|
|
146
|
+
};
|
|
147
|
+
me: {
|
|
148
|
+
get(opts?: RequestOptions): Promise<Me>;
|
|
149
|
+
organizations(opts?: RequestOptions): Promise<Organization[]>;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
type WSMessageType = "CONNECTION_STATUS" | "SUBSCRIBED" | "ERROR" | "PING" | "PONG" | "UPDATE_ORG" | "CREATE_TASK" | "UPDATE_TASK" | "UPDATE_TASK_COMMENTS" | "UPDATE_TASK_VOTE" | "UPDATE_LABELS" | "UPDATE_VIEWS" | "UPDATE_CATEGORIES" | "UPDATE_ISSUE_TEMPLATES" | "DISCONNECTED";
|
|
154
|
+
/**
|
|
155
|
+
* String enum replacement for WS event names.
|
|
156
|
+
* Use this instead of raw strings.
|
|
157
|
+
*/
|
|
158
|
+
declare const WS_EVENTS: Record<WSMessageType, WSMessageType>;
|
|
159
|
+
interface WSMessage<T = unknown> {
|
|
160
|
+
type: WSMessageType;
|
|
161
|
+
scope: "PUBLIC";
|
|
162
|
+
data: T;
|
|
163
|
+
meta?: {
|
|
164
|
+
ts: number;
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
type Handlers = Partial<Record<WSMessageType, (data: any, msg: WSMessage) => void>>;
|
|
169
|
+
declare function ws(url: string, handlers?: Handlers): {
|
|
170
|
+
close(): void;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Sayr Public API — Version 1.
|
|
175
|
+
*
|
|
176
|
+
* @since v1.0.0
|
|
177
|
+
*/
|
|
178
|
+
declare const SayrV1: {
|
|
179
|
+
org: {
|
|
180
|
+
tasks: {
|
|
181
|
+
list(slug: string, params?: OrderedPaginationParams, opts?: RequestOptions): Promise<{
|
|
182
|
+
data: Task[];
|
|
183
|
+
pagination: Pagination;
|
|
184
|
+
}>;
|
|
185
|
+
get(slug: string, shortId: number, opts?: RequestOptions): Promise<Task>;
|
|
186
|
+
};
|
|
187
|
+
comments: {
|
|
188
|
+
list(slug: string, shortId: number, params?: OrderedPaginationParams, opts?: RequestOptions): Promise<{
|
|
189
|
+
data: Comment[];
|
|
190
|
+
pagination: Pagination;
|
|
191
|
+
}>;
|
|
192
|
+
};
|
|
193
|
+
labels: {
|
|
194
|
+
list(slug: string, opts?: RequestOptions): Promise<Label[]>;
|
|
195
|
+
};
|
|
196
|
+
categories: {
|
|
197
|
+
list(slug: string, order?: Order, opts?: RequestOptions): Promise<Category[]>;
|
|
198
|
+
};
|
|
199
|
+
get(slug: string, opts?: RequestOptions): Promise<Organization>;
|
|
200
|
+
};
|
|
201
|
+
me: {
|
|
202
|
+
get(opts?: RequestOptions): Promise<Me>;
|
|
203
|
+
organizations(opts?: RequestOptions): Promise<Organization[]>;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* Create a WebSocket connection for public real‑time updates.
|
|
208
|
+
*/
|
|
209
|
+
declare const SayrWS: typeof ws;
|
|
210
|
+
/**
|
|
211
|
+
* Typed WebSocket event constants.
|
|
212
|
+
*/
|
|
213
|
+
declare const SayrWSEvents: Record<WSMessageType, WSMessageType>;
|
|
214
|
+
/**
|
|
215
|
+
* Global client configuration helpers.
|
|
216
|
+
*/
|
|
217
|
+
declare const SayrClient: {
|
|
218
|
+
setToken: typeof setToken;
|
|
219
|
+
setHeaders: typeof setHeaders;
|
|
220
|
+
setBaseUrl: typeof setBaseUrl;
|
|
221
|
+
resetClient: typeof resetClient;
|
|
222
|
+
setHooks: typeof setHooks;
|
|
223
|
+
setFetch: typeof setFetch;
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* Sayr Public SDK.
|
|
227
|
+
*
|
|
228
|
+
* Read‑only access to public Sayr data via REST and WebSockets.
|
|
229
|
+
*
|
|
230
|
+
* @since v1.0.0
|
|
231
|
+
*/
|
|
232
|
+
declare const Sayr: {
|
|
233
|
+
/**
|
|
234
|
+
* Client configuration helpers.
|
|
235
|
+
*/
|
|
236
|
+
client: typeof SayrClient;
|
|
237
|
+
/**
|
|
238
|
+
* Versioned API namespaces.
|
|
239
|
+
*/
|
|
240
|
+
v1: typeof v1;
|
|
241
|
+
/**
|
|
242
|
+
* Alias for the current API version (`v1`).
|
|
243
|
+
*
|
|
244
|
+
* @since v1.0.0
|
|
245
|
+
*/
|
|
246
|
+
org: typeof v1.org;
|
|
247
|
+
me: typeof v1.me;
|
|
248
|
+
/**
|
|
249
|
+
* WebSocket helper for real‑time updates.
|
|
250
|
+
*/
|
|
251
|
+
ws: typeof ws;
|
|
252
|
+
/**
|
|
253
|
+
* WebSocket event constants.
|
|
254
|
+
*/
|
|
255
|
+
WS_EVENTS: typeof WS_EVENTS;
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
export { type ApiError, type ApiSuccess, type Category, type Comment, type CommentReaction, type CommentUser, type Label, type Order, type OrderedPaginationParams, type Organization, type Pagination, type PaginationParams, SayrClient, SayrV1, SayrWS, SayrWSEvents, type Task, type TaskPriority, type TaskStatus, type WSMessage, type WSMessageType, WS_EVENTS, buildPaginationParams, Sayr as default };
|