stadata-js 0.1.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 +21 -0
- package/README.md +318 -0
- package/dist/index.d.mts +1117 -0
- package/dist/index.d.ts +1117 -0
- package/dist/index.js +2 -0
- package/dist/index.mjs +2 -0
- package/package.json +77 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,1117 @@
|
|
|
1
|
+
import { Result } from 'neverthrow';
|
|
2
|
+
|
|
3
|
+
declare abstract class Failure {
|
|
4
|
+
readonly message: string;
|
|
5
|
+
readonly code?: string | undefined;
|
|
6
|
+
constructor(message: string, code?: string | undefined);
|
|
7
|
+
toString(): string;
|
|
8
|
+
equals(other: unknown): boolean;
|
|
9
|
+
}
|
|
10
|
+
declare class ApiFailure extends Failure {
|
|
11
|
+
readonly statusCode?: number | undefined;
|
|
12
|
+
constructor(message: string, statusCode?: number | undefined, code?: string);
|
|
13
|
+
}
|
|
14
|
+
declare class CancelledFailure extends Failure {
|
|
15
|
+
constructor(message?: string);
|
|
16
|
+
}
|
|
17
|
+
declare class NetworkFailure extends Failure {
|
|
18
|
+
constructor(message: string);
|
|
19
|
+
}
|
|
20
|
+
declare class TimeoutFailure extends Failure {
|
|
21
|
+
constructor(message?: string);
|
|
22
|
+
}
|
|
23
|
+
declare class NotFoundFailure extends ApiFailure {
|
|
24
|
+
constructor(message?: string);
|
|
25
|
+
}
|
|
26
|
+
declare class UnauthorizedFailure extends ApiFailure {
|
|
27
|
+
constructor(message?: string);
|
|
28
|
+
}
|
|
29
|
+
declare class ForbiddenFailure extends ApiFailure {
|
|
30
|
+
constructor(message?: string);
|
|
31
|
+
}
|
|
32
|
+
declare class ServerFailure extends ApiFailure {
|
|
33
|
+
constructor(message?: string, statusCode?: number);
|
|
34
|
+
}
|
|
35
|
+
declare class ParseFailure extends Failure {
|
|
36
|
+
constructor(message: string);
|
|
37
|
+
}
|
|
38
|
+
declare class ValidationFailure extends Failure {
|
|
39
|
+
constructor(message: string);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface NetworkInterceptor {
|
|
43
|
+
onRequest?(url: string, init: RequestInit): RequestInit | Promise<RequestInit>;
|
|
44
|
+
onResponse?(response: Response): Response | Promise<Response>;
|
|
45
|
+
onError?(error: Error): Error | Promise<Error> | null;
|
|
46
|
+
}
|
|
47
|
+
declare abstract class BaseNetworkInterceptor implements NetworkInterceptor {
|
|
48
|
+
onRequest?(url: string, init: RequestInit): RequestInit | Promise<RequestInit>;
|
|
49
|
+
onResponse?(response: Response): Response | Promise<Response>;
|
|
50
|
+
onError?(error: Error): Error | Promise<Error> | null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
declare class AuthInterceptor extends BaseNetworkInterceptor {
|
|
54
|
+
private apiKey;
|
|
55
|
+
constructor(apiKey: string);
|
|
56
|
+
onRequest(url: string, init: RequestInit): RequestInit;
|
|
57
|
+
setApiKey(apiKey: string): void;
|
|
58
|
+
getApiKey(): string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
declare enum LogLevel {
|
|
62
|
+
DEBUG = 0,
|
|
63
|
+
INFO = 1,
|
|
64
|
+
WARN = 2,
|
|
65
|
+
ERROR = 3,
|
|
66
|
+
FATAL = 4,
|
|
67
|
+
NONE = 5
|
|
68
|
+
}
|
|
69
|
+
interface LogEntry {
|
|
70
|
+
level: LogLevel;
|
|
71
|
+
message: string;
|
|
72
|
+
timestamp: Date;
|
|
73
|
+
data?: unknown;
|
|
74
|
+
error?: Error;
|
|
75
|
+
}
|
|
76
|
+
interface LogPrinter {
|
|
77
|
+
print(entry: LogEntry): void;
|
|
78
|
+
}
|
|
79
|
+
interface LogFilter {
|
|
80
|
+
shouldLog(entry: LogEntry): boolean;
|
|
81
|
+
}
|
|
82
|
+
declare class ConsoleLogPrinter implements LogPrinter {
|
|
83
|
+
print(entry: LogEntry): void;
|
|
84
|
+
}
|
|
85
|
+
declare class ProductionLogFilter implements LogFilter {
|
|
86
|
+
private minLevel;
|
|
87
|
+
constructor(minLevel?: LogLevel);
|
|
88
|
+
shouldLog(entry: LogEntry): boolean;
|
|
89
|
+
}
|
|
90
|
+
declare class Logger {
|
|
91
|
+
private static instance;
|
|
92
|
+
private printer;
|
|
93
|
+
private filter;
|
|
94
|
+
private enabled;
|
|
95
|
+
private constructor();
|
|
96
|
+
static getInstance(): Logger;
|
|
97
|
+
configure(options: {
|
|
98
|
+
printer?: LogPrinter;
|
|
99
|
+
filter?: LogFilter;
|
|
100
|
+
enabled?: boolean;
|
|
101
|
+
}): void;
|
|
102
|
+
debug(message: string, data?: unknown): void;
|
|
103
|
+
info(message: string, data?: unknown): void;
|
|
104
|
+
warn(message: string, data?: unknown): void;
|
|
105
|
+
error(message: string, error?: unknown): void;
|
|
106
|
+
fatal(message: string, error?: unknown): void;
|
|
107
|
+
private log;
|
|
108
|
+
enable(): void;
|
|
109
|
+
disable(): void;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
declare class LoggingInterceptor extends BaseNetworkInterceptor {
|
|
113
|
+
private logger;
|
|
114
|
+
constructor(logger?: Logger);
|
|
115
|
+
onRequest(url: string, init: RequestInit): RequestInit;
|
|
116
|
+
onResponse(response: Response): Response;
|
|
117
|
+
onError(error: Error): Error;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
interface RetryConfig {
|
|
121
|
+
maxRetries: number;
|
|
122
|
+
retryDelay: number;
|
|
123
|
+
retryableStatusCodes?: number[];
|
|
124
|
+
exponentialBackoff?: boolean;
|
|
125
|
+
}
|
|
126
|
+
declare class RetryInterceptor extends BaseNetworkInterceptor {
|
|
127
|
+
private logger;
|
|
128
|
+
private config;
|
|
129
|
+
private retryCount;
|
|
130
|
+
constructor(config?: Partial<RetryConfig>, logger?: Logger);
|
|
131
|
+
onResponse(response: Response): Promise<Response>;
|
|
132
|
+
private sleep;
|
|
133
|
+
resetRetryCount(url: string): void;
|
|
134
|
+
clearAllRetryCounts(): void;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
declare class CancelToken {
|
|
138
|
+
private abortController;
|
|
139
|
+
private _isCancelled;
|
|
140
|
+
private _reason?;
|
|
141
|
+
constructor();
|
|
142
|
+
get signal(): AbortSignal;
|
|
143
|
+
get isCancelled(): boolean;
|
|
144
|
+
get reason(): string | undefined;
|
|
145
|
+
cancel(reason?: string): void;
|
|
146
|
+
throwIfCancelled(): void;
|
|
147
|
+
static create(): CancelToken;
|
|
148
|
+
static source(): {
|
|
149
|
+
token: CancelToken;
|
|
150
|
+
cancel: (reason?: string) => void;
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
declare class DateHelper {
|
|
155
|
+
static parse(dateString: string | null | undefined): Date | null;
|
|
156
|
+
static format(date: Date | null | undefined): string | null;
|
|
157
|
+
static formatReadable(date: Date | null | undefined): string | null;
|
|
158
|
+
static isValid(dateString: string): boolean;
|
|
159
|
+
static toTimestamp(dateString: string): number | null;
|
|
160
|
+
static fromTimestamp(timestamp: number): Date;
|
|
161
|
+
static now(): string;
|
|
162
|
+
static nowTimestamp(): number;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
interface NetworkClientConfig {
|
|
166
|
+
baseURL?: string;
|
|
167
|
+
timeout?: number;
|
|
168
|
+
headers?: Record<string, string>;
|
|
169
|
+
interceptors?: NetworkInterceptor[];
|
|
170
|
+
}
|
|
171
|
+
interface RequestOptions {
|
|
172
|
+
headers?: Record<string, string>;
|
|
173
|
+
body?: unknown;
|
|
174
|
+
cancelToken?: CancelToken;
|
|
175
|
+
timeout?: number;
|
|
176
|
+
}
|
|
177
|
+
declare class NetworkClient {
|
|
178
|
+
private baseURL;
|
|
179
|
+
private timeout;
|
|
180
|
+
private defaultHeaders;
|
|
181
|
+
private interceptors;
|
|
182
|
+
constructor(config?: NetworkClientConfig);
|
|
183
|
+
addInterceptor(interceptor: NetworkInterceptor): void;
|
|
184
|
+
removeInterceptor(interceptor: NetworkInterceptor): void;
|
|
185
|
+
get<T>(url: string, options?: RequestOptions): Promise<Result<T, ApiFailure>>;
|
|
186
|
+
post<T>(url: string, options?: RequestOptions): Promise<Result<T, ApiFailure>>;
|
|
187
|
+
put<T>(url: string, options?: RequestOptions): Promise<Result<T, ApiFailure>>;
|
|
188
|
+
delete<T>(url: string, options?: RequestOptions): Promise<Result<T, ApiFailure>>;
|
|
189
|
+
patch<T>(url: string, options?: RequestOptions): Promise<Result<T, ApiFailure>>;
|
|
190
|
+
private request;
|
|
191
|
+
private fetchWithTimeout;
|
|
192
|
+
private combineSignals;
|
|
193
|
+
private buildUrl;
|
|
194
|
+
private handleErrorResponse;
|
|
195
|
+
private handleError;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
interface IBaseEntity {
|
|
199
|
+
toJson(): Record<string, unknown>;
|
|
200
|
+
equals(other: unknown): boolean;
|
|
201
|
+
}
|
|
202
|
+
declare abstract class BaseEntity implements IBaseEntity {
|
|
203
|
+
abstract toJson(): Record<string, unknown>;
|
|
204
|
+
toString(): string;
|
|
205
|
+
equals(other: unknown): boolean;
|
|
206
|
+
copyWith(updates: Partial<Record<string, unknown>>): this;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
declare abstract class UseCase<Params, Type> {
|
|
210
|
+
abstract execute(params: Params): Promise<Result<Type, Failure>>;
|
|
211
|
+
dispose?(): void;
|
|
212
|
+
}
|
|
213
|
+
declare abstract class NoParamsUseCase<Type> extends UseCase<void, Type> {
|
|
214
|
+
abstract execute(): Promise<Result<Type, Failure>>;
|
|
215
|
+
call(): Promise<Result<Type, Failure>>;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
declare class Pagination extends BaseEntity {
|
|
219
|
+
readonly page: number;
|
|
220
|
+
readonly perPage: number;
|
|
221
|
+
readonly total: number;
|
|
222
|
+
readonly pages: number;
|
|
223
|
+
readonly count: number;
|
|
224
|
+
constructor(page: number, perPage: number, total: number, pages: number, count: number);
|
|
225
|
+
get hasNextPage(): boolean;
|
|
226
|
+
get hasPreviousPage(): boolean;
|
|
227
|
+
get nextPage(): number | null;
|
|
228
|
+
get previousPage(): number | null;
|
|
229
|
+
toJson(): Record<string, unknown>;
|
|
230
|
+
static fromJson(json: Record<string, unknown>): Pagination;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
declare class ApiResponse<T> extends BaseEntity {
|
|
234
|
+
readonly data: T[];
|
|
235
|
+
readonly dataAvailability: string;
|
|
236
|
+
readonly pagination?: Pagination | undefined;
|
|
237
|
+
constructor(data: T[], dataAvailability: string, pagination?: Pagination | undefined);
|
|
238
|
+
get isAvailable(): boolean;
|
|
239
|
+
get totalItems(): number;
|
|
240
|
+
get hasData(): boolean;
|
|
241
|
+
toJson(): Record<string, unknown>;
|
|
242
|
+
static fromJson<T>(json: Record<string, unknown>, itemFactory: (item: Record<string, unknown>) => T): ApiResponse<T>;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
declare class ListResult<T> extends BaseEntity {
|
|
246
|
+
readonly data: T[];
|
|
247
|
+
readonly pagination: Pagination;
|
|
248
|
+
constructor(data: T[], pagination: Pagination);
|
|
249
|
+
get hasMore(): boolean;
|
|
250
|
+
get totalItems(): number;
|
|
251
|
+
get items(): T[];
|
|
252
|
+
get itemCount(): number;
|
|
253
|
+
toJson(): Record<string, unknown>;
|
|
254
|
+
static fromJson<T>(json: Record<string, unknown>, itemFactory: (item: Record<string, unknown>) => T): ListResult<T>;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
declare enum DataLanguage {
|
|
258
|
+
ID = "ind",
|
|
259
|
+
EN = "eng"
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
declare enum DataAvailability {
|
|
263
|
+
AVAILABLE = "available",
|
|
264
|
+
NOT_AVAILABLE = "not-available",
|
|
265
|
+
LIST_NOT_AVAILABLE = "list-not-available"
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
type JSON = Record<string, unknown>;
|
|
269
|
+
interface BaseListParams {
|
|
270
|
+
domain?: string;
|
|
271
|
+
lang?: DataLanguage;
|
|
272
|
+
page?: number;
|
|
273
|
+
perPage?: number;
|
|
274
|
+
cancelToken?: CancelToken;
|
|
275
|
+
}
|
|
276
|
+
interface DomainListParams extends Omit<BaseListParams, 'domain'> {
|
|
277
|
+
keyword?: string;
|
|
278
|
+
}
|
|
279
|
+
interface PublicationListParams extends BaseListParams {
|
|
280
|
+
keyword?: string;
|
|
281
|
+
month?: number;
|
|
282
|
+
year?: number;
|
|
283
|
+
}
|
|
284
|
+
interface InfographicListParams extends BaseListParams {
|
|
285
|
+
keyword?: string;
|
|
286
|
+
}
|
|
287
|
+
interface StaticTableListParams extends BaseListParams {
|
|
288
|
+
keyword?: string;
|
|
289
|
+
month?: number;
|
|
290
|
+
year?: number;
|
|
291
|
+
}
|
|
292
|
+
interface NewsListParams extends BaseListParams {
|
|
293
|
+
keyword?: string;
|
|
294
|
+
month?: number;
|
|
295
|
+
year?: number;
|
|
296
|
+
newsCategoryId?: string;
|
|
297
|
+
}
|
|
298
|
+
interface NewsCategoryListParams extends BaseListParams {
|
|
299
|
+
}
|
|
300
|
+
interface PressReleaseListParams extends BaseListParams {
|
|
301
|
+
keyword?: string;
|
|
302
|
+
month?: number;
|
|
303
|
+
year?: number;
|
|
304
|
+
}
|
|
305
|
+
interface SubjectListParams extends BaseListParams {
|
|
306
|
+
}
|
|
307
|
+
interface SubjectCategoryListParams extends BaseListParams {
|
|
308
|
+
}
|
|
309
|
+
interface StrategicIndicatorListParams extends BaseListParams {
|
|
310
|
+
}
|
|
311
|
+
interface VariableListParams extends BaseListParams {
|
|
312
|
+
subjectId?: number;
|
|
313
|
+
showDeleted?: boolean;
|
|
314
|
+
}
|
|
315
|
+
interface VerticalVariableListParams extends BaseListParams {
|
|
316
|
+
variableId: number;
|
|
317
|
+
}
|
|
318
|
+
interface UnitListParams extends BaseListParams {
|
|
319
|
+
}
|
|
320
|
+
interface PeriodListParams extends BaseListParams {
|
|
321
|
+
variableId: number;
|
|
322
|
+
}
|
|
323
|
+
interface DerivedPeriodListParams extends BaseListParams {
|
|
324
|
+
variableId: number;
|
|
325
|
+
}
|
|
326
|
+
interface DerivedVariableListParams extends BaseListParams {
|
|
327
|
+
variableId: number;
|
|
328
|
+
}
|
|
329
|
+
interface DynamicTableParams extends BaseListParams {
|
|
330
|
+
tableId: string;
|
|
331
|
+
variableId: number;
|
|
332
|
+
periodId?: number;
|
|
333
|
+
derivedVariableId?: number;
|
|
334
|
+
derivedPeriodId?: number;
|
|
335
|
+
}
|
|
336
|
+
interface StatisticClassificationListParams extends BaseListParams {
|
|
337
|
+
keyword?: string;
|
|
338
|
+
}
|
|
339
|
+
interface CensusListParams extends BaseListParams {
|
|
340
|
+
}
|
|
341
|
+
interface ViewParams {
|
|
342
|
+
id: number | string;
|
|
343
|
+
domain: string;
|
|
344
|
+
lang?: DataLanguage;
|
|
345
|
+
cancelToken?: CancelToken;
|
|
346
|
+
}
|
|
347
|
+
declare enum TradeSource {
|
|
348
|
+
Export = 1,
|
|
349
|
+
Import = 2
|
|
350
|
+
}
|
|
351
|
+
declare enum TradePeriod {
|
|
352
|
+
Monthly = 1,
|
|
353
|
+
Annually = 2
|
|
354
|
+
}
|
|
355
|
+
declare enum HSCodeType {
|
|
356
|
+
TwoDigit = 1,
|
|
357
|
+
Full = 2
|
|
358
|
+
}
|
|
359
|
+
interface TradeParams {
|
|
360
|
+
source: TradeSource;
|
|
361
|
+
period: TradePeriod;
|
|
362
|
+
hsCode: string;
|
|
363
|
+
hsType: HSCodeType;
|
|
364
|
+
year: string;
|
|
365
|
+
cancelToken?: CancelToken;
|
|
366
|
+
}
|
|
367
|
+
type RequestData = Record<string, string | number | boolean | undefined>;
|
|
368
|
+
type ResponseData<T> = {
|
|
369
|
+
data: T[];
|
|
370
|
+
'data-availability': string;
|
|
371
|
+
pagination?: {
|
|
372
|
+
page: number;
|
|
373
|
+
per_page: number;
|
|
374
|
+
total: number;
|
|
375
|
+
pages: number;
|
|
376
|
+
count: number;
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
declare class Domain extends BaseEntity {
|
|
381
|
+
readonly id: string;
|
|
382
|
+
readonly name: string;
|
|
383
|
+
readonly url: string;
|
|
384
|
+
constructor(id: string, name: string, url: string);
|
|
385
|
+
toJson(): Record<string, unknown>;
|
|
386
|
+
static fromJson(json: Record<string, unknown>): Domain;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
interface DomainRepository {
|
|
390
|
+
getAll(params?: DomainListParams): Promise<Result<ListResult<Domain>, ApiFailure>>;
|
|
391
|
+
getById(params: ViewParams): Promise<Result<Domain, ApiFailure>>;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
declare class GetAllDomains extends UseCase<DomainListParams | undefined, ListResult<Domain>> {
|
|
395
|
+
private repository;
|
|
396
|
+
constructor(repository: DomainRepository);
|
|
397
|
+
execute(params?: DomainListParams): Promise<Result<ListResult<Domain>, ApiFailure>>;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
declare class GetDomainById extends UseCase<ViewParams, Domain> {
|
|
401
|
+
private repository;
|
|
402
|
+
constructor(repository: DomainRepository);
|
|
403
|
+
execute(params: ViewParams): Promise<Result<Domain, ApiFailure>>;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
declare class Injector {
|
|
407
|
+
private static instance;
|
|
408
|
+
private container;
|
|
409
|
+
private factories;
|
|
410
|
+
private constructor();
|
|
411
|
+
static getInstance(): Injector;
|
|
412
|
+
register<T>(key: string, instance: T): void;
|
|
413
|
+
registerFactory<T>(key: string, factory: () => T): void;
|
|
414
|
+
resolve<T>(key: string): T;
|
|
415
|
+
has(key: string): boolean;
|
|
416
|
+
clear(): void;
|
|
417
|
+
remove(key: string): void;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
declare class RelatedPublication extends BaseEntity {
|
|
421
|
+
readonly id: string;
|
|
422
|
+
readonly title: string;
|
|
423
|
+
readonly releaseDate: Date;
|
|
424
|
+
readonly url: string;
|
|
425
|
+
readonly cover: string;
|
|
426
|
+
constructor(id: string, title: string, releaseDate: Date, url: string, cover: string);
|
|
427
|
+
toJson(): Record<string, unknown>;
|
|
428
|
+
static fromJson(json: Record<string, unknown>): RelatedPublication;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
declare class Publication extends BaseEntity {
|
|
432
|
+
readonly id: string;
|
|
433
|
+
readonly title: string;
|
|
434
|
+
readonly issn: string;
|
|
435
|
+
readonly cover: string;
|
|
436
|
+
readonly pdf: string;
|
|
437
|
+
readonly size: string;
|
|
438
|
+
readonly scheduledDate: Date | null;
|
|
439
|
+
readonly releaseDate: Date | null;
|
|
440
|
+
readonly updateDate: Date | null;
|
|
441
|
+
readonly abstract: string | null;
|
|
442
|
+
readonly catalogueNumber: string | null;
|
|
443
|
+
readonly publicationNumber: string | null;
|
|
444
|
+
readonly relatedPublications: RelatedPublication[];
|
|
445
|
+
constructor(id: string, title: string, issn: string, cover: string, pdf: string, size: string, scheduledDate: Date | null, releaseDate: Date | null, updateDate: Date | null, abstract: string | null, catalogueNumber: string | null, publicationNumber: string | null, relatedPublications: RelatedPublication[]);
|
|
446
|
+
toJson(): Record<string, unknown>;
|
|
447
|
+
static fromJson(json: Record<string, unknown>): Publication;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
interface PublicationRepository {
|
|
451
|
+
getAll(params: PublicationListParams): Promise<Result<ListResult<Publication>, ApiFailure>>;
|
|
452
|
+
getById(params: ViewParams): Promise<Result<Publication, ApiFailure>>;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
declare class GetAllPublications {
|
|
456
|
+
private readonly repository;
|
|
457
|
+
constructor(repository: PublicationRepository);
|
|
458
|
+
execute(params: PublicationListParams): Promise<Result<ListResult<Publication>, ApiFailure>>;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
declare class GetPublicationById {
|
|
462
|
+
private readonly repository;
|
|
463
|
+
constructor(repository: PublicationRepository);
|
|
464
|
+
execute(params: ViewParams): Promise<Result<Publication, ApiFailure>>;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
declare class Infographic extends BaseEntity {
|
|
468
|
+
readonly id: string;
|
|
469
|
+
readonly title: string;
|
|
470
|
+
readonly image: string;
|
|
471
|
+
readonly category: number;
|
|
472
|
+
readonly downloadUrl: string;
|
|
473
|
+
readonly description: string | null;
|
|
474
|
+
constructor(id: string, title: string, image: string, category: number, downloadUrl: string, description: string | null);
|
|
475
|
+
toJson(): Record<string, unknown>;
|
|
476
|
+
static fromJson(json: Record<string, unknown>): Infographic;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
interface InfographicRepository {
|
|
480
|
+
getAll(params: InfographicListParams): Promise<Result<ListResult<Infographic>, ApiFailure>>;
|
|
481
|
+
getById(params: ViewParams): Promise<Result<Infographic, ApiFailure>>;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
declare class GetAllInfographics {
|
|
485
|
+
private readonly repository;
|
|
486
|
+
constructor(repository: InfographicRepository);
|
|
487
|
+
execute(params: InfographicListParams): Promise<Result<ListResult<Infographic>, ApiFailure>>;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
declare class GetInfographicById {
|
|
491
|
+
private readonly repository;
|
|
492
|
+
constructor(repository: InfographicRepository);
|
|
493
|
+
execute(params: ViewParams): Promise<Result<Infographic, ApiFailure>>;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
declare const ApiConstant: {
|
|
497
|
+
readonly BASE_URL: "https://webapi.bps.go.id/v1/api";
|
|
498
|
+
readonly DEFAULT_TIMEOUT: 30000;
|
|
499
|
+
readonly API_VERSION: "v1";
|
|
500
|
+
readonly DEFAULT_PAGE_SIZE: 10;
|
|
501
|
+
readonly MAX_PAGE_SIZE: 100;
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
declare const ApiEndpoint: {
|
|
505
|
+
readonly DOMAIN_LIST: "/list/domain";
|
|
506
|
+
readonly DOMAIN_VIEW: "/view/domain";
|
|
507
|
+
readonly PUBLICATION_LIST: "/list/publication";
|
|
508
|
+
readonly PUBLICATION_VIEW: "/view/publication";
|
|
509
|
+
readonly INFOGRAPHIC_LIST: "/list/infographic";
|
|
510
|
+
readonly INFOGRAPHIC_VIEW: "/view/infographic";
|
|
511
|
+
readonly STATIC_TABLE_LIST: "/list/statictable";
|
|
512
|
+
readonly STATIC_TABLE_VIEW: "/view/statictable";
|
|
513
|
+
readonly NEWS_LIST: "/list/news";
|
|
514
|
+
readonly NEWS_VIEW: "/view/news";
|
|
515
|
+
readonly NEWS_CATEGORY_LIST: "/list/newscategory";
|
|
516
|
+
readonly NEWS_CATEGORY_VIEW: "/view/newscategory";
|
|
517
|
+
readonly PRESS_RELEASE_LIST: "/list/pressrelease";
|
|
518
|
+
readonly PRESS_RELEASE_VIEW: "/view/pressrelease";
|
|
519
|
+
readonly SUBJECT_LIST: "/list/subject";
|
|
520
|
+
readonly SUBJECT_VIEW: "/view/subject";
|
|
521
|
+
readonly SUBJECT_CATEGORY_LIST: "/list/subjectcat";
|
|
522
|
+
readonly SUBJECT_CATEGORY_VIEW: "/view/subjectcat";
|
|
523
|
+
readonly STRATEGIC_INDICATOR_LIST: "/list/stratind";
|
|
524
|
+
readonly STRATEGIC_INDICATOR_VIEW: "/view/stratind";
|
|
525
|
+
readonly VARIABLE_LIST: "/list/var";
|
|
526
|
+
readonly VARIABLE_VIEW: "/view/var";
|
|
527
|
+
readonly VERTICAL_VARIABLE_LIST: "/list/vervar";
|
|
528
|
+
readonly VERTICAL_VARIABLE_VIEW: "/view/vervar";
|
|
529
|
+
readonly UNIT_LIST: "/list/unit";
|
|
530
|
+
readonly UNIT_VIEW: "/view/unit";
|
|
531
|
+
readonly PERIOD_LIST: "/list/period";
|
|
532
|
+
readonly PERIOD_VIEW: "/view/period";
|
|
533
|
+
readonly DERIVED_PERIOD_LIST: "/list/turth";
|
|
534
|
+
readonly DERIVED_PERIOD_VIEW: "/view/turth";
|
|
535
|
+
readonly DERIVED_VARIABLE_LIST: "/list/turvar";
|
|
536
|
+
readonly DERIVED_VARIABLE_VIEW: "/view/turvar";
|
|
537
|
+
readonly DYNAMIC_TABLE_LIST: "/list/dynamictable";
|
|
538
|
+
readonly STATISTIC_CLASSIFICATION_LIST: "/list/kbli";
|
|
539
|
+
readonly STATISTIC_CLASSIFICATION_VIEW: "/view/kbli";
|
|
540
|
+
readonly CENSUS_LIST: "/list/sensus";
|
|
541
|
+
readonly CENSUS_VIEW: "/view/sensus";
|
|
542
|
+
readonly TRADE: "/dataexim";
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
declare const QueryParamConstant: {
|
|
546
|
+
readonly KEY: "key";
|
|
547
|
+
readonly DOMAIN: "domain";
|
|
548
|
+
readonly LANG: "lang";
|
|
549
|
+
readonly PAGE: "page";
|
|
550
|
+
readonly PER_PAGE: "per_page";
|
|
551
|
+
readonly KEYWORD: "keyword";
|
|
552
|
+
readonly MONTH: "month";
|
|
553
|
+
readonly YEAR: "year";
|
|
554
|
+
readonly SUBJECT: "subj";
|
|
555
|
+
readonly VARIABLE: "var";
|
|
556
|
+
readonly TURVAR: "turvar";
|
|
557
|
+
readonly TURTH: "turth";
|
|
558
|
+
readonly PERIOD: "th";
|
|
559
|
+
readonly TYPE: "type";
|
|
560
|
+
readonly TABLE: "table";
|
|
561
|
+
readonly MODEL: "model";
|
|
562
|
+
readonly ID: "id";
|
|
563
|
+
readonly SHOW_DELETED: "show_deleted";
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
declare class StadataException extends Error {
|
|
567
|
+
constructor(message: string);
|
|
568
|
+
}
|
|
569
|
+
declare class ApiException extends StadataException {
|
|
570
|
+
readonly statusCode?: number | undefined;
|
|
571
|
+
readonly response?: unknown | undefined;
|
|
572
|
+
constructor(message: string, statusCode?: number | undefined, response?: unknown | undefined);
|
|
573
|
+
}
|
|
574
|
+
declare class CancelledException extends StadataException {
|
|
575
|
+
constructor(message?: string);
|
|
576
|
+
}
|
|
577
|
+
declare class NetworkException extends StadataException {
|
|
578
|
+
constructor(message: string);
|
|
579
|
+
}
|
|
580
|
+
declare class TimeoutException extends StadataException {
|
|
581
|
+
constructor(message?: string);
|
|
582
|
+
}
|
|
583
|
+
declare class NotFoundException extends ApiException {
|
|
584
|
+
constructor(message?: string);
|
|
585
|
+
}
|
|
586
|
+
declare class UnauthorizedException extends ApiException {
|
|
587
|
+
constructor(message?: string);
|
|
588
|
+
}
|
|
589
|
+
declare class ForbiddenException extends ApiException {
|
|
590
|
+
constructor(message?: string);
|
|
591
|
+
}
|
|
592
|
+
declare class ServerException extends ApiException {
|
|
593
|
+
constructor(message?: string, statusCode?: number);
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
declare class News extends BaseEntity {
|
|
597
|
+
readonly id: string;
|
|
598
|
+
readonly title: string;
|
|
599
|
+
readonly content: string;
|
|
600
|
+
readonly releaseDate: string;
|
|
601
|
+
readonly categoryId: number;
|
|
602
|
+
readonly picture: string | null;
|
|
603
|
+
constructor(id: string, title: string, content: string, releaseDate: string, categoryId: number, picture: string | null);
|
|
604
|
+
toJson(): Record<string, unknown>;
|
|
605
|
+
static fromJson(json: Record<string, unknown>): News;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
interface NewsRepository {
|
|
609
|
+
getAll(params: NewsListParams): Promise<Result<ListResult<News>, ApiFailure>>;
|
|
610
|
+
getById(params: ViewParams): Promise<Result<News, ApiFailure>>;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
declare class GetAllNews {
|
|
614
|
+
private readonly repository;
|
|
615
|
+
constructor(repository: NewsRepository);
|
|
616
|
+
execute(params: NewsListParams): Promise<Result<ListResult<News>, ApiFailure>>;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
declare class GetNewsById {
|
|
620
|
+
private readonly repository;
|
|
621
|
+
constructor(repository: NewsRepository);
|
|
622
|
+
execute(params: ViewParams): Promise<Result<News, ApiFailure>>;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
declare class NewsCategory extends BaseEntity {
|
|
626
|
+
readonly id: string;
|
|
627
|
+
readonly name: string;
|
|
628
|
+
constructor(id: string, name: string);
|
|
629
|
+
toJson(): Record<string, unknown>;
|
|
630
|
+
static fromJson(json: Record<string, unknown>): NewsCategory;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
interface NewsCategoryRepository {
|
|
634
|
+
getAll(params?: NewsCategoryListParams): Promise<Result<ListResult<NewsCategory>, ApiFailure>>;
|
|
635
|
+
getById(params: ViewParams): Promise<Result<NewsCategory, ApiFailure>>;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
declare class GetAllNewsCategories implements UseCase<NewsCategoryListParams | undefined, ListResult<NewsCategory>> {
|
|
639
|
+
private readonly repository;
|
|
640
|
+
constructor(repository: NewsCategoryRepository);
|
|
641
|
+
execute(params?: NewsCategoryListParams): Promise<Result<ListResult<NewsCategory>, ApiFailure>>;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
declare class GetNewsCategoryById implements UseCase<ViewParams, NewsCategory> {
|
|
645
|
+
private readonly repository;
|
|
646
|
+
constructor(repository: NewsCategoryRepository);
|
|
647
|
+
execute(params: ViewParams): Promise<Result<NewsCategory, ApiFailure>>;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
declare class PressRelease extends BaseEntity {
|
|
651
|
+
readonly id: string;
|
|
652
|
+
readonly title: string;
|
|
653
|
+
readonly abstract: string;
|
|
654
|
+
readonly releaseDate: string;
|
|
655
|
+
readonly picture: string | null;
|
|
656
|
+
constructor(id: string, title: string, abstract: string, releaseDate: string, picture: string | null);
|
|
657
|
+
toJson(): Record<string, unknown>;
|
|
658
|
+
static fromJson(json: Record<string, unknown>): PressRelease;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
interface PressReleaseRepository {
|
|
662
|
+
getAll(params: PressReleaseListParams): Promise<Result<ListResult<PressRelease>, ApiFailure>>;
|
|
663
|
+
getById(params: ViewParams): Promise<Result<PressRelease, ApiFailure>>;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
declare class GetAllPressReleases {
|
|
667
|
+
private readonly repository;
|
|
668
|
+
constructor(repository: PressReleaseRepository);
|
|
669
|
+
execute(params: PressReleaseListParams): Promise<Result<ListResult<PressRelease>, ApiFailure>>;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
declare class GetPressReleaseById {
|
|
673
|
+
private readonly repository;
|
|
674
|
+
constructor(repository: PressReleaseRepository);
|
|
675
|
+
execute(params: ViewParams): Promise<Result<PressRelease, ApiFailure>>;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
declare class StaticTable extends BaseEntity {
|
|
679
|
+
readonly id: string;
|
|
680
|
+
readonly title: string;
|
|
681
|
+
readonly subjectId: number;
|
|
682
|
+
readonly size: string;
|
|
683
|
+
readonly updatedAt: string;
|
|
684
|
+
readonly excelUrl: string;
|
|
685
|
+
constructor(id: string, title: string, subjectId: number, size: string, updatedAt: string, excelUrl: string);
|
|
686
|
+
toJson(): Record<string, unknown>;
|
|
687
|
+
static fromJson(json: Record<string, unknown>): StaticTable;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
interface StaticTableRepository {
|
|
691
|
+
getAll(params: StaticTableListParams): Promise<Result<ListResult<StaticTable>, ApiFailure>>;
|
|
692
|
+
getById(params: ViewParams): Promise<Result<StaticTable, ApiFailure>>;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
declare class GetAllStaticTables {
|
|
696
|
+
private readonly repository;
|
|
697
|
+
constructor(repository: StaticTableRepository);
|
|
698
|
+
execute(params: StaticTableListParams): Promise<Result<ListResult<StaticTable>, ApiFailure>>;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
declare class GetStaticTableById {
|
|
702
|
+
private readonly repository;
|
|
703
|
+
constructor(repository: StaticTableRepository);
|
|
704
|
+
execute(params: ViewParams): Promise<Result<StaticTable, ApiFailure>>;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
declare class Subject extends BaseEntity {
|
|
708
|
+
readonly id: number;
|
|
709
|
+
readonly name: string;
|
|
710
|
+
readonly categoryId: number;
|
|
711
|
+
constructor(id: number, name: string, categoryId: number);
|
|
712
|
+
toJson(): Record<string, unknown>;
|
|
713
|
+
static fromJson(json: Record<string, unknown>): Subject;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
interface SubjectRepository {
|
|
717
|
+
getAll(params?: SubjectListParams): Promise<Result<ListResult<Subject>, ApiFailure>>;
|
|
718
|
+
getById(params: ViewParams): Promise<Result<Subject, ApiFailure>>;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
declare class GetAllSubjects implements UseCase<SubjectListParams | undefined, ListResult<Subject>> {
|
|
722
|
+
private readonly repository;
|
|
723
|
+
constructor(repository: SubjectRepository);
|
|
724
|
+
execute(params?: SubjectListParams): Promise<Result<ListResult<Subject>, ApiFailure>>;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
declare class GetSubjectById implements UseCase<ViewParams, Subject> {
|
|
728
|
+
private readonly repository;
|
|
729
|
+
constructor(repository: SubjectRepository);
|
|
730
|
+
execute(params: ViewParams): Promise<Result<Subject, ApiFailure>>;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
declare class SubjectCategory extends BaseEntity {
|
|
734
|
+
readonly id: number;
|
|
735
|
+
readonly name: string;
|
|
736
|
+
constructor(id: number, name: string);
|
|
737
|
+
toJson(): Record<string, unknown>;
|
|
738
|
+
static fromJson(json: Record<string, unknown>): SubjectCategory;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
interface SubjectCategoryRepository {
|
|
742
|
+
getAll(params?: SubjectCategoryListParams): Promise<Result<ListResult<SubjectCategory>, ApiFailure>>;
|
|
743
|
+
getById(params: ViewParams): Promise<Result<SubjectCategory, ApiFailure>>;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
declare class GetAllSubjectCategories implements UseCase<SubjectCategoryListParams | undefined, ListResult<SubjectCategory>> {
|
|
747
|
+
private readonly repository;
|
|
748
|
+
constructor(repository: SubjectCategoryRepository);
|
|
749
|
+
execute(params?: SubjectCategoryListParams): Promise<Result<ListResult<SubjectCategory>, ApiFailure>>;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
declare class GetSubjectCategoryById implements UseCase<ViewParams, SubjectCategory> {
|
|
753
|
+
private readonly repository;
|
|
754
|
+
constructor(repository: SubjectCategoryRepository);
|
|
755
|
+
execute(params: ViewParams): Promise<Result<SubjectCategory, ApiFailure>>;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
declare class StrategicIndicator extends BaseEntity {
|
|
759
|
+
readonly id: number;
|
|
760
|
+
readonly name: string;
|
|
761
|
+
constructor(id: number, name: string);
|
|
762
|
+
toJson(): Record<string, unknown>;
|
|
763
|
+
static fromJson(json: Record<string, unknown>): StrategicIndicator;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
interface StrategicIndicatorRepository {
|
|
767
|
+
getAll(params?: StrategicIndicatorListParams): Promise<Result<ListResult<StrategicIndicator>, ApiFailure>>;
|
|
768
|
+
getById(params: ViewParams): Promise<Result<StrategicIndicator, ApiFailure>>;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
declare class GetAllStrategicIndicators implements UseCase<StrategicIndicatorListParams | undefined, ListResult<StrategicIndicator>> {
|
|
772
|
+
private readonly repository;
|
|
773
|
+
constructor(repository: StrategicIndicatorRepository);
|
|
774
|
+
execute(params?: StrategicIndicatorListParams): Promise<Result<ListResult<StrategicIndicator>, ApiFailure>>;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
declare class GetStrategicIndicatorById implements UseCase<ViewParams, StrategicIndicator> {
|
|
778
|
+
private readonly repository;
|
|
779
|
+
constructor(repository: StrategicIndicatorRepository);
|
|
780
|
+
execute(params: ViewParams): Promise<Result<StrategicIndicator, ApiFailure>>;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
declare class Variable extends BaseEntity {
|
|
784
|
+
readonly id: number;
|
|
785
|
+
readonly title: string;
|
|
786
|
+
readonly subjectId: number;
|
|
787
|
+
readonly unit: string;
|
|
788
|
+
readonly verticalVariableCount: number;
|
|
789
|
+
readonly derivedVariableCount: number;
|
|
790
|
+
readonly graph: string[];
|
|
791
|
+
constructor(id: number, title: string, subjectId: number, unit: string, verticalVariableCount: number, derivedVariableCount: number, graph: string[]);
|
|
792
|
+
toJson(): Record<string, unknown>;
|
|
793
|
+
static fromJson(json: Record<string, unknown>): Variable;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
interface VariableRepository {
|
|
797
|
+
getAll(params?: VariableListParams): Promise<Result<ListResult<Variable>, ApiFailure>>;
|
|
798
|
+
getById(params: ViewParams): Promise<Result<Variable, ApiFailure>>;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
declare class GetAllVariables implements UseCase<VariableListParams | undefined, ListResult<Variable>> {
|
|
802
|
+
private readonly repository;
|
|
803
|
+
constructor(repository: VariableRepository);
|
|
804
|
+
execute(params?: VariableListParams): Promise<Result<ListResult<Variable>, ApiFailure>>;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
declare class GetVariableById implements UseCase<ViewParams, Variable> {
|
|
808
|
+
private readonly repository;
|
|
809
|
+
constructor(repository: VariableRepository);
|
|
810
|
+
execute(params: ViewParams): Promise<Result<Variable, ApiFailure>>;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
declare class VerticalVariable extends BaseEntity {
|
|
814
|
+
readonly id: number;
|
|
815
|
+
readonly variableId: number;
|
|
816
|
+
readonly label: string;
|
|
817
|
+
readonly alias: string;
|
|
818
|
+
constructor(id: number, variableId: number, label: string, alias: string);
|
|
819
|
+
toJson(): Record<string, unknown>;
|
|
820
|
+
static fromJson(json: Record<string, unknown>): VerticalVariable;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
interface VerticalVariableRepository {
|
|
824
|
+
getAll(params: VerticalVariableListParams): Promise<Result<ListResult<VerticalVariable>, ApiFailure>>;
|
|
825
|
+
getById(params: ViewParams): Promise<Result<VerticalVariable, ApiFailure>>;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
declare class GetAllVerticalVariables implements UseCase<VerticalVariableListParams, ListResult<VerticalVariable>> {
|
|
829
|
+
private readonly repository;
|
|
830
|
+
constructor(repository: VerticalVariableRepository);
|
|
831
|
+
execute(params: VerticalVariableListParams): Promise<Result<ListResult<VerticalVariable>, ApiFailure>>;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
declare class GetVerticalVariableById implements UseCase<ViewParams, VerticalVariable> {
|
|
835
|
+
private readonly repository;
|
|
836
|
+
constructor(repository: VerticalVariableRepository);
|
|
837
|
+
execute(params: ViewParams): Promise<Result<VerticalVariable, ApiFailure>>;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
declare class Unit extends BaseEntity {
|
|
841
|
+
readonly id: number;
|
|
842
|
+
readonly name: string;
|
|
843
|
+
constructor(id: number, name: string);
|
|
844
|
+
toJson(): Record<string, unknown>;
|
|
845
|
+
static fromJson(json: Record<string, unknown>): Unit;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
interface UnitRepository {
|
|
849
|
+
getAll(params?: UnitListParams): Promise<Result<ListResult<Unit>, ApiFailure>>;
|
|
850
|
+
getById(params: ViewParams): Promise<Result<Unit, ApiFailure>>;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
declare class GetAllUnits implements UseCase<UnitListParams | undefined, ListResult<Unit>> {
|
|
854
|
+
private readonly repository;
|
|
855
|
+
constructor(repository: UnitRepository);
|
|
856
|
+
execute(params?: UnitListParams): Promise<Result<ListResult<Unit>, ApiFailure>>;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
declare class GetUnitById implements UseCase<ViewParams, Unit> {
|
|
860
|
+
private readonly repository;
|
|
861
|
+
constructor(repository: UnitRepository);
|
|
862
|
+
execute(params: ViewParams): Promise<Result<Unit, ApiFailure>>;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
declare class Period extends BaseEntity {
|
|
866
|
+
readonly id: number;
|
|
867
|
+
readonly label: string;
|
|
868
|
+
constructor(id: number, label: string);
|
|
869
|
+
toJson(): Record<string, unknown>;
|
|
870
|
+
static fromJson(json: Record<string, unknown>): Period;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
interface PeriodRepository {
|
|
874
|
+
getAll(params: PeriodListParams): Promise<Result<ListResult<Period>, ApiFailure>>;
|
|
875
|
+
getById(params: ViewParams): Promise<Result<Period, ApiFailure>>;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
declare class GetAllPeriods implements UseCase<PeriodListParams, ListResult<Period>> {
|
|
879
|
+
private readonly repository;
|
|
880
|
+
constructor(repository: PeriodRepository);
|
|
881
|
+
execute(params: PeriodListParams): Promise<Result<ListResult<Period>, ApiFailure>>;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
declare class GetPeriodById implements UseCase<ViewParams, Period> {
|
|
885
|
+
private readonly repository;
|
|
886
|
+
constructor(repository: PeriodRepository);
|
|
887
|
+
execute(params: ViewParams): Promise<Result<Period, ApiFailure>>;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
declare class DerivedPeriod extends BaseEntity {
|
|
891
|
+
readonly id: number;
|
|
892
|
+
readonly label: string;
|
|
893
|
+
constructor(id: number, label: string);
|
|
894
|
+
toJson(): Record<string, unknown>;
|
|
895
|
+
static fromJson(json: Record<string, unknown>): DerivedPeriod;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
interface DerivedPeriodRepository {
|
|
899
|
+
getAll(params: DerivedPeriodListParams): Promise<Result<ListResult<DerivedPeriod>, ApiFailure>>;
|
|
900
|
+
getById(params: ViewParams): Promise<Result<DerivedPeriod, ApiFailure>>;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
declare class GetAllDerivedPeriods {
|
|
904
|
+
private readonly repository;
|
|
905
|
+
constructor(repository: DerivedPeriodRepository);
|
|
906
|
+
execute(params: DerivedPeriodListParams): Promise<Result<ListResult<DerivedPeriod>, ApiFailure>>;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
declare class GetDerivedPeriodById {
|
|
910
|
+
private readonly repository;
|
|
911
|
+
constructor(repository: DerivedPeriodRepository);
|
|
912
|
+
execute(params: ViewParams): Promise<Result<DerivedPeriod, ApiFailure>>;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
declare class DerivedVariable extends BaseEntity {
|
|
916
|
+
readonly id: number;
|
|
917
|
+
readonly name: string;
|
|
918
|
+
constructor(id: number, name: string);
|
|
919
|
+
toJson(): Record<string, unknown>;
|
|
920
|
+
static fromJson(json: Record<string, unknown>): DerivedVariable;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
interface DerivedVariableRepository {
|
|
924
|
+
getAll(params: DerivedVariableListParams): Promise<Result<ListResult<DerivedVariable>, ApiFailure>>;
|
|
925
|
+
getById(params: ViewParams): Promise<Result<DerivedVariable, ApiFailure>>;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
declare class GetAllDerivedVariables {
|
|
929
|
+
private readonly repository;
|
|
930
|
+
constructor(repository: DerivedVariableRepository);
|
|
931
|
+
execute(params: DerivedVariableListParams): Promise<Result<ListResult<DerivedVariable>, ApiFailure>>;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
declare class GetDerivedVariableById {
|
|
935
|
+
private readonly repository;
|
|
936
|
+
constructor(repository: DerivedVariableRepository);
|
|
937
|
+
execute(params: ViewParams): Promise<Result<DerivedVariable, ApiFailure>>;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
declare class StatisticClassification extends BaseEntity {
|
|
941
|
+
readonly id: string;
|
|
942
|
+
readonly title: string;
|
|
943
|
+
constructor(id: string, title: string);
|
|
944
|
+
toJson(): Record<string, unknown>;
|
|
945
|
+
static fromJson(json: Record<string, unknown>): StatisticClassification;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
interface StatisticClassificationRepository {
|
|
949
|
+
getAll(params?: StatisticClassificationListParams): Promise<Result<ListResult<StatisticClassification>, ApiFailure>>;
|
|
950
|
+
getById(params: ViewParams): Promise<Result<StatisticClassification, ApiFailure>>;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
declare class GetAllStatisticClassifications {
|
|
954
|
+
private readonly repository;
|
|
955
|
+
constructor(repository: StatisticClassificationRepository);
|
|
956
|
+
execute(params?: StatisticClassificationListParams): Promise<Result<ListResult<StatisticClassification>, ApiFailure>>;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
declare class GetStatisticClassificationById {
|
|
960
|
+
private readonly repository;
|
|
961
|
+
constructor(repository: StatisticClassificationRepository);
|
|
962
|
+
execute(params: ViewParams): Promise<Result<StatisticClassification, ApiFailure>>;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
declare class Census extends BaseEntity {
|
|
966
|
+
readonly id: number;
|
|
967
|
+
readonly activity: string;
|
|
968
|
+
readonly year: string;
|
|
969
|
+
constructor(id: number, activity: string, year: string);
|
|
970
|
+
toJson(): Record<string, unknown>;
|
|
971
|
+
static fromJson(json: Record<string, unknown>): Census;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
interface CensusRepository {
|
|
975
|
+
getAll(params?: CensusListParams): Promise<Result<ListResult<Census>, ApiFailure>>;
|
|
976
|
+
getById(params: ViewParams): Promise<Result<Census, ApiFailure>>;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
declare class GetAllCensuses implements UseCase<CensusListParams | undefined, ListResult<Census>> {
|
|
980
|
+
private repository;
|
|
981
|
+
constructor(repository: CensusRepository);
|
|
982
|
+
execute(params?: CensusListParams): Promise<Result<ListResult<Census>, ApiFailure>>;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
declare class GetCensusById implements UseCase<ViewParams, Census> {
|
|
986
|
+
private repository;
|
|
987
|
+
constructor(repository: CensusRepository);
|
|
988
|
+
execute(params: ViewParams): Promise<Result<Census, ApiFailure>>;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
declare class DynamicTable extends BaseEntity {
|
|
992
|
+
readonly variableId: number;
|
|
993
|
+
readonly title: string;
|
|
994
|
+
readonly subjectId: number;
|
|
995
|
+
readonly subjectName: string;
|
|
996
|
+
readonly notes: string;
|
|
997
|
+
readonly unit: string;
|
|
998
|
+
readonly verticalVariableId: number;
|
|
999
|
+
readonly domain: string;
|
|
1000
|
+
readonly csaSubjectId?: number | undefined;
|
|
1001
|
+
readonly csaSubjectName?: string | undefined;
|
|
1002
|
+
readonly graphId?: number | undefined;
|
|
1003
|
+
readonly graphName?: string | undefined;
|
|
1004
|
+
constructor(variableId: number, title: string, subjectId: number, subjectName: string, notes: string, unit: string, verticalVariableId: number, domain: string, csaSubjectId?: number | undefined, csaSubjectName?: string | undefined, graphId?: number | undefined, graphName?: string | undefined);
|
|
1005
|
+
toJson(): Record<string, unknown>;
|
|
1006
|
+
static fromJson(json: Record<string, unknown>): DynamicTable;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
interface DynamicTableRepository {
|
|
1010
|
+
getAll(params: DynamicTableParams): Promise<Result<ListResult<DynamicTable>, ApiFailure>>;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
declare class GetAllDynamicTables implements UseCase<DynamicTableParams, ListResult<DynamicTable>> {
|
|
1014
|
+
private repository;
|
|
1015
|
+
constructor(repository: DynamicTableRepository);
|
|
1016
|
+
execute(params: DynamicTableParams): Promise<Result<ListResult<DynamicTable>, ApiFailure>>;
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
interface StadataList {
|
|
1020
|
+
domains(params?: DomainListParams): Promise<Result<ListResult<Domain>, ApiFailure>>;
|
|
1021
|
+
publications(params: PublicationListParams): Promise<Result<ListResult<Publication>, ApiFailure>>;
|
|
1022
|
+
infographics(params: InfographicListParams): Promise<Result<ListResult<Infographic>, ApiFailure>>;
|
|
1023
|
+
news(params: NewsListParams): Promise<Result<ListResult<News>, ApiFailure>>;
|
|
1024
|
+
newsCategories(params?: NewsCategoryListParams): Promise<Result<ListResult<NewsCategory>, ApiFailure>>;
|
|
1025
|
+
pressReleases(params: PressReleaseListParams): Promise<Result<ListResult<PressRelease>, ApiFailure>>;
|
|
1026
|
+
staticTables(params: StaticTableListParams): Promise<Result<ListResult<StaticTable>, ApiFailure>>;
|
|
1027
|
+
subjects(params?: SubjectListParams): Promise<Result<ListResult<Subject>, ApiFailure>>;
|
|
1028
|
+
subjectCategories(params?: SubjectCategoryListParams): Promise<Result<ListResult<SubjectCategory>, ApiFailure>>;
|
|
1029
|
+
strategicIndicators(params?: StrategicIndicatorListParams): Promise<Result<ListResult<StrategicIndicator>, ApiFailure>>;
|
|
1030
|
+
variables(params?: VariableListParams): Promise<Result<ListResult<Variable>, ApiFailure>>;
|
|
1031
|
+
verticalVariables(params: VerticalVariableListParams): Promise<Result<ListResult<VerticalVariable>, ApiFailure>>;
|
|
1032
|
+
units(params?: UnitListParams): Promise<Result<ListResult<Unit>, ApiFailure>>;
|
|
1033
|
+
periods(params: PeriodListParams): Promise<Result<ListResult<Period>, ApiFailure>>;
|
|
1034
|
+
derivedPeriods(params: DerivedPeriodListParams): Promise<Result<ListResult<DerivedPeriod>, ApiFailure>>;
|
|
1035
|
+
derivedVariables(params: DerivedVariableListParams): Promise<Result<ListResult<DerivedVariable>, ApiFailure>>;
|
|
1036
|
+
statisticClassifications(params?: StatisticClassificationListParams): Promise<Result<ListResult<StatisticClassification>, ApiFailure>>;
|
|
1037
|
+
censuses(params?: CensusListParams): Promise<Result<ListResult<Census>, ApiFailure>>;
|
|
1038
|
+
dynamicTables(params: DynamicTableParams): Promise<Result<ListResult<DynamicTable>, ApiFailure>>;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
interface StadataView {
|
|
1042
|
+
domain(params: ViewParams): Promise<Result<Domain, ApiFailure>>;
|
|
1043
|
+
publication(params: ViewParams): Promise<Result<Publication, ApiFailure>>;
|
|
1044
|
+
infographic(params: ViewParams): Promise<Result<Infographic, ApiFailure>>;
|
|
1045
|
+
news(params: ViewParams): Promise<Result<News, ApiFailure>>;
|
|
1046
|
+
newsCategory(params: ViewParams): Promise<Result<NewsCategory, ApiFailure>>;
|
|
1047
|
+
pressRelease(params: ViewParams): Promise<Result<PressRelease, ApiFailure>>;
|
|
1048
|
+
staticTable(params: ViewParams): Promise<Result<StaticTable, ApiFailure>>;
|
|
1049
|
+
subject(params: ViewParams): Promise<Result<Subject, ApiFailure>>;
|
|
1050
|
+
subjectCategory(params: ViewParams): Promise<Result<SubjectCategory, ApiFailure>>;
|
|
1051
|
+
strategicIndicator(params: ViewParams): Promise<Result<StrategicIndicator, ApiFailure>>;
|
|
1052
|
+
variable(params: ViewParams): Promise<Result<Variable, ApiFailure>>;
|
|
1053
|
+
verticalVariable(params: ViewParams): Promise<Result<VerticalVariable, ApiFailure>>;
|
|
1054
|
+
unit(params: ViewParams): Promise<Result<Unit, ApiFailure>>;
|
|
1055
|
+
period(params: ViewParams): Promise<Result<Period, ApiFailure>>;
|
|
1056
|
+
derivedPeriod(params: ViewParams): Promise<Result<DerivedPeriod, ApiFailure>>;
|
|
1057
|
+
derivedVariable(params: ViewParams): Promise<Result<DerivedVariable, ApiFailure>>;
|
|
1058
|
+
statisticClassification(params: ViewParams): Promise<Result<StatisticClassification, ApiFailure>>;
|
|
1059
|
+
census(params: ViewParams): Promise<Result<Census, ApiFailure>>;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
interface StadataJSConfig {
|
|
1063
|
+
apiKey: string;
|
|
1064
|
+
baseURL?: string;
|
|
1065
|
+
timeout?: number;
|
|
1066
|
+
interceptors?: NetworkInterceptor[];
|
|
1067
|
+
debug?: boolean;
|
|
1068
|
+
logLevel?: LogLevel;
|
|
1069
|
+
}
|
|
1070
|
+
declare class StadataJS {
|
|
1071
|
+
private static _instance;
|
|
1072
|
+
private _list;
|
|
1073
|
+
private _view;
|
|
1074
|
+
private injector;
|
|
1075
|
+
private networkClient;
|
|
1076
|
+
private authInterceptor;
|
|
1077
|
+
private logger;
|
|
1078
|
+
private constructor();
|
|
1079
|
+
static get instance(): StadataJS;
|
|
1080
|
+
static init(config: StadataJSConfig): StadataJS;
|
|
1081
|
+
static isInitialized(): boolean;
|
|
1082
|
+
static destroy(): void;
|
|
1083
|
+
get list(): StadataList;
|
|
1084
|
+
get view(): StadataView;
|
|
1085
|
+
setApiKey(apiKey: string): void;
|
|
1086
|
+
addInterceptor(interceptor: NetworkInterceptor): void;
|
|
1087
|
+
removeInterceptor(interceptor: NetworkInterceptor): void;
|
|
1088
|
+
enableDebug(): void;
|
|
1089
|
+
disableDebug(): void;
|
|
1090
|
+
trade(params: TradeParams): Promise<Result<ResponseData<Record<string, unknown>>, ApiFailure>>;
|
|
1091
|
+
private setupDependencies;
|
|
1092
|
+
private cleanup;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
declare class Trade extends BaseEntity {
|
|
1096
|
+
readonly value: number;
|
|
1097
|
+
readonly netWeight: number;
|
|
1098
|
+
readonly hsCode: string;
|
|
1099
|
+
readonly port: string;
|
|
1100
|
+
readonly country: string;
|
|
1101
|
+
readonly year: string;
|
|
1102
|
+
constructor(value: number, netWeight: number, hsCode: string, port: string, country: string, year: string);
|
|
1103
|
+
toJson(): Record<string, unknown>;
|
|
1104
|
+
static fromJson(json: Record<string, unknown>): Trade;
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
interface TradeRepository {
|
|
1108
|
+
get(params: TradeParams): Promise<Result<ResponseData<Record<string, unknown>>, ApiFailure>>;
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
declare class GetTrade implements UseCase<TradeParams, ResponseData<Record<string, unknown>>> {
|
|
1112
|
+
private repository;
|
|
1113
|
+
constructor(repository: TradeRepository);
|
|
1114
|
+
execute(params: TradeParams): Promise<Result<ResponseData<Record<string, unknown>>, ApiFailure>>;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
export { ApiConstant, ApiEndpoint, ApiException, ApiFailure, ApiResponse, AuthInterceptor, BaseEntity, type BaseListParams, CancelToken, CancelledException, CancelledFailure, Census, type CensusListParams, type CensusRepository, ConsoleLogPrinter, DataAvailability, DataLanguage, DateHelper, DerivedPeriod, type DerivedPeriodListParams, type DerivedPeriodRepository, DerivedVariable, type DerivedVariableListParams, type DerivedVariableRepository, Domain, type DomainListParams, type DomainRepository, DynamicTable, type DynamicTableParams, type DynamicTableRepository, Failure, ForbiddenException, ForbiddenFailure, GetAllCensuses, GetAllDerivedPeriods, GetAllDerivedVariables, GetAllDomains, GetAllDynamicTables, GetAllInfographics, GetAllNews, GetAllNewsCategories, GetAllPeriods, GetAllPressReleases, GetAllPublications, GetAllStaticTables, GetAllStatisticClassifications, GetAllStrategicIndicators, GetAllSubjectCategories, GetAllSubjects, GetAllUnits, GetAllVariables, GetAllVerticalVariables, GetCensusById, GetDerivedPeriodById, GetDerivedVariableById, GetDomainById, GetInfographicById, GetNewsById, GetNewsCategoryById, GetPeriodById, GetPressReleaseById, GetPublicationById, GetStaticTableById, GetStatisticClassificationById, GetStrategicIndicatorById, GetSubjectById, GetSubjectCategoryById, GetTrade, GetUnitById, GetVariableById, GetVerticalVariableById, HSCodeType, Infographic, type InfographicListParams, type InfographicRepository, Injector, type JSON, ListResult, type LogEntry, type LogFilter, LogLevel, type LogPrinter, Logger, LoggingInterceptor, NetworkClient, type NetworkClientConfig, NetworkException, NetworkFailure, type NetworkInterceptor, News, NewsCategory, type NewsCategoryListParams, type NewsCategoryRepository, type NewsListParams, type NewsRepository, NoParamsUseCase, NotFoundException, NotFoundFailure, Pagination, ParseFailure, Period, type PeriodListParams, type PeriodRepository, PressRelease, type PressReleaseListParams, type PressReleaseRepository, ProductionLogFilter, Publication, type PublicationListParams, type PublicationRepository, QueryParamConstant, RelatedPublication, type RequestData, type RequestOptions, type ResponseData, RetryInterceptor, ServerException, ServerFailure, StadataException, StadataJS, type StadataJSConfig, type StadataList, type StadataView, StaticTable, type StaticTableListParams, type StaticTableRepository, StatisticClassification, type StatisticClassificationListParams, type StatisticClassificationRepository, StrategicIndicator, type StrategicIndicatorListParams, type StrategicIndicatorRepository, Subject, SubjectCategory, type SubjectCategoryListParams, type SubjectCategoryRepository, type SubjectListParams, type SubjectRepository, TimeoutException, TimeoutFailure, Trade, type TradeParams, TradePeriod, type TradeRepository, TradeSource, UnauthorizedException, UnauthorizedFailure, Unit, type UnitListParams, type UnitRepository, UseCase, ValidationFailure, Variable, type VariableListParams, type VariableRepository, VerticalVariable, type VerticalVariableListParams, type VerticalVariableRepository, type ViewParams };
|