stadata-js 1.1.0 → 2.0.1

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/index.d.mts CHANGED
@@ -48,19 +48,6 @@ interface NetworkInterceptor {
48
48
  onResponse?(response: Response): Response | Promise<Response>;
49
49
  onError?(error: Error): Error | Promise<Error> | null;
50
50
  }
51
- declare abstract class BaseNetworkInterceptor implements NetworkInterceptor {
52
- onRequest?(url: string, init: RequestInit): InterceptedRequest | Promise<InterceptedRequest>;
53
- onResponse?(response: Response): Response | Promise<Response>;
54
- onError?(error: Error): Error | Promise<Error> | null;
55
- }
56
-
57
- declare class AuthInterceptor extends BaseNetworkInterceptor {
58
- private apiKey;
59
- constructor(apiKey: string);
60
- onRequest(url: string, init: RequestInit): InterceptedRequest;
61
- setApiKey(apiKey: string): void;
62
- getApiKey(): string;
63
- }
64
51
 
65
52
  declare enum LogLevel {
66
53
  DEBUG = 0,
@@ -70,73 +57,6 @@ declare enum LogLevel {
70
57
  FATAL = 4,
71
58
  NONE = 5
72
59
  }
73
- interface LogEntry {
74
- level: LogLevel;
75
- message: string;
76
- timestamp: Date;
77
- data?: unknown;
78
- error?: Error;
79
- }
80
- interface LogPrinter {
81
- print(entry: LogEntry): void;
82
- }
83
- interface LogFilter {
84
- shouldLog(entry: LogEntry): boolean;
85
- }
86
- declare class ConsoleLogPrinter implements LogPrinter {
87
- print(entry: LogEntry): void;
88
- }
89
- declare class ProductionLogFilter implements LogFilter {
90
- private minLevel;
91
- constructor(minLevel?: LogLevel);
92
- shouldLog(entry: LogEntry): boolean;
93
- }
94
- declare class Logger {
95
- private static instance;
96
- private printer;
97
- private filter;
98
- private enabled;
99
- private constructor();
100
- static getInstance(): Logger;
101
- configure(options: {
102
- printer?: LogPrinter;
103
- filter?: LogFilter;
104
- enabled?: boolean;
105
- }): void;
106
- debug(message: string, data?: unknown): void;
107
- info(message: string, data?: unknown): void;
108
- warn(message: string, data?: unknown): void;
109
- error(message: string, error?: unknown): void;
110
- fatal(message: string, error?: unknown): void;
111
- private log;
112
- enable(): void;
113
- disable(): void;
114
- }
115
-
116
- declare class LoggingInterceptor extends BaseNetworkInterceptor {
117
- private logger;
118
- constructor(logger?: Logger);
119
- onRequest(url: string, init: RequestInit): InterceptedRequest;
120
- onResponse(response: Response): Response;
121
- onError(error: Error): Error;
122
- }
123
-
124
- interface RetryConfig {
125
- maxRetries: number;
126
- retryDelay: number;
127
- retryableStatusCodes?: number[];
128
- exponentialBackoff?: boolean;
129
- }
130
- declare class RetryInterceptor extends BaseNetworkInterceptor {
131
- private logger;
132
- private config;
133
- private retryCount;
134
- constructor(config?: Partial<RetryConfig>, logger?: Logger);
135
- onResponse(response: Response): Promise<Response>;
136
- private sleep;
137
- resetRetryCount(url: string): void;
138
- clearAllRetryCounts(): void;
139
- }
140
60
 
141
61
  declare class CancelToken {
142
62
  private abortController;
@@ -155,17 +75,6 @@ declare class CancelToken {
155
75
  };
156
76
  }
157
77
 
158
- declare class DateHelper {
159
- static parse(dateString: string | null | undefined): Date | null;
160
- static format(date: Date | null | undefined): string | null;
161
- static formatReadable(date: Date | null | undefined): string | null;
162
- static isValid(dateString: string): boolean;
163
- static toTimestamp(dateString: string): number | null;
164
- static fromTimestamp(timestamp: number): Date;
165
- static now(): string;
166
- static nowTimestamp(): number;
167
- }
168
-
169
78
  interface NetworkClientConfig {
170
79
  baseURL?: string;
171
80
  timeout?: number;
@@ -210,13 +119,13 @@ declare abstract class BaseEntity implements IBaseEntity {
210
119
  copyWith(updates: Partial<Record<string, unknown>>): this;
211
120
  }
212
121
 
213
- declare abstract class UseCase<Params, Type> {
214
- abstract execute(params: Params): Promise<Result<Type, Failure>>;
215
- dispose?(): void;
216
- }
217
- declare abstract class NoParamsUseCase<Type> extends UseCase<void, Type> {
218
- abstract execute(): Promise<Result<Type, Failure>>;
219
- call(): Promise<Result<Type, Failure>>;
122
+ declare class Domain extends BaseEntity {
123
+ readonly id: string;
124
+ readonly name: string;
125
+ readonly url: string;
126
+ constructor(id: string, name: string, url: string);
127
+ toJson(): Record<string, unknown>;
128
+ static fromJson(json: Record<string, unknown>): Domain;
220
129
  }
221
130
 
222
131
  declare class Pagination extends BaseEntity {
@@ -234,18 +143,6 @@ declare class Pagination extends BaseEntity {
234
143
  static fromJson(json: Record<string, unknown>): Pagination;
235
144
  }
236
145
 
237
- declare class ApiResponse<T> extends BaseEntity {
238
- readonly data: T[];
239
- readonly dataAvailability: string;
240
- readonly pagination?: Pagination | undefined;
241
- constructor(data: T[], dataAvailability: string, pagination?: Pagination | undefined);
242
- get isAvailable(): boolean;
243
- get totalItems(): number;
244
- get hasData(): boolean;
245
- toJson(): Record<string, unknown>;
246
- static fromJson<T>(json: Record<string, unknown>, itemFactory: (item: Record<string, unknown>) => T): ApiResponse<T>;
247
- }
248
-
249
146
  declare class ListResult<T> extends BaseEntity {
250
147
  readonly data: T[];
251
148
  readonly pagination: Pagination;
@@ -303,68 +200,76 @@ declare enum DomainType {
303
200
 
304
201
  type JSON = Record<string, unknown>;
305
202
  interface BaseListParams {
306
- domain?: string;
307
203
  lang?: DataLanguage;
308
204
  page?: number;
309
205
  perPage?: number;
310
206
  cancelToken?: CancelToken;
311
207
  }
312
- interface DomainListParams extends Omit<BaseListParams, 'domain'> {
208
+ interface BaseDomainListParams extends BaseListParams {
209
+ domain: string;
210
+ }
211
+ interface DomainListParams extends BaseListParams {
313
212
  type: DomainType;
314
213
  provinceCode?: string;
315
214
  keyword?: string;
316
215
  }
317
- interface PublicationListParams extends BaseListParams {
216
+ interface PublicationListParams extends BaseDomainListParams {
318
217
  keyword?: string;
319
218
  month?: number;
320
219
  year?: number;
321
220
  }
322
- interface InfographicListParams extends BaseListParams {
221
+ interface InfographicListParams extends BaseDomainListParams {
323
222
  keyword?: string;
324
223
  }
325
- interface StaticTableListParams extends BaseListParams {
224
+ interface StaticTableListParams extends BaseDomainListParams {
326
225
  keyword?: string;
327
226
  month?: number;
328
227
  year?: number;
329
228
  }
330
- interface NewsListParams extends BaseListParams {
229
+ interface NewsListParams extends BaseDomainListParams {
331
230
  keyword?: string;
332
231
  month?: number;
333
232
  year?: number;
334
233
  newsCategoryId?: string;
335
234
  }
336
- interface NewsCategoryListParams extends BaseListParams {
235
+ interface NewsCategoryListParams extends BaseDomainListParams {
337
236
  }
338
- interface PressReleaseListParams extends BaseListParams {
237
+ interface PressReleaseListParams extends BaseDomainListParams {
339
238
  keyword?: string;
340
239
  month?: number;
341
240
  year?: number;
342
241
  }
343
- interface SubjectListParams extends BaseListParams {
242
+ interface SubjectListParams extends BaseDomainListParams {
243
+ subjectCategoryId?: number;
344
244
  }
345
- interface SubjectCategoryListParams extends BaseListParams {
245
+ interface SubjectCategoryListParams extends BaseDomainListParams {
346
246
  }
347
- interface StrategicIndicatorListParams extends BaseListParams {
247
+ interface StrategicIndicatorListParams extends BaseDomainListParams {
248
+ variableId?: number;
348
249
  }
349
- interface VariableListParams extends BaseListParams {
250
+ interface VariableListParams extends BaseDomainListParams {
350
251
  subjectId?: number;
252
+ year?: number;
253
+ showExistingVariables?: boolean;
351
254
  showDeleted?: boolean;
352
255
  }
353
- interface VerticalVariableListParams extends BaseListParams {
256
+ interface VerticalVariableListParams extends BaseDomainListParams {
354
257
  variableId?: number;
355
258
  }
356
- interface UnitListParams extends BaseListParams {
259
+ interface UnitListParams extends BaseDomainListParams {
260
+ variableId?: number;
357
261
  }
358
- interface PeriodListParams extends BaseListParams {
262
+ interface PeriodListParams extends BaseDomainListParams {
359
263
  variableId?: number;
360
264
  }
361
- interface DerivedPeriodListParams extends BaseListParams {
265
+ interface DerivedPeriodListParams extends BaseDomainListParams {
362
266
  variableId?: number;
363
267
  }
364
- interface DerivedVariableListParams extends BaseListParams {
268
+ interface DerivedVariableListParams extends BaseDomainListParams {
365
269
  variableId?: number;
270
+ verticalGroup?: number;
366
271
  }
367
- interface DynamicTableParams extends BaseListParams {
272
+ interface DynamicTableParams extends BaseDomainListParams {
368
273
  variableId: number;
369
274
  periodId: string;
370
275
  derivedVariableId?: number;
@@ -372,6 +277,7 @@ interface DynamicTableParams extends BaseListParams {
372
277
  derivedPeriodId?: string;
373
278
  }
374
279
  interface StatisticClassificationListParams extends BaseListParams {
280
+ domain?: string;
375
281
  type?: ClassificationType;
376
282
  level?: ClassificationLevel;
377
283
  keyword?: string;
@@ -423,38 +329,10 @@ type ResponseData<T> = {
423
329
  };
424
330
  };
425
331
 
426
- declare class Domain extends BaseEntity {
427
- readonly id: string;
428
- readonly name: string;
429
- readonly url: string;
430
- constructor(id: string, name: string, url: string);
431
- toJson(): Record<string, unknown>;
432
- static fromJson(json: Record<string, unknown>): Domain;
433
- }
434
-
435
- interface DomainRepository {
436
- getAll(params?: DomainListParams): Promise<Result<ListResult<Domain>, ApiFailure>>;
437
- }
438
-
439
- declare class GetAllDomains extends UseCase<DomainListParams | undefined, ListResult<Domain>> {
440
- private repository;
441
- constructor(repository: DomainRepository);
442
- execute(params?: DomainListParams): Promise<Result<ListResult<Domain>, ApiFailure>>;
443
- }
444
-
445
- declare class Injector {
446
- private static instance;
447
- private container;
448
- private factories;
449
- private constructor();
450
- static getInstance(): Injector;
451
- register<T>(key: string, instance: T): void;
452
- registerFactory<T>(key: string, factory: () => T): void;
453
- resolve<T>(key: string): T;
454
- has(key: string): boolean;
455
- clear(): void;
456
- remove(key: string): void;
332
+ interface UseDomains {
333
+ fetchDomainList: (params: DomainListParams) => Promise<Result<ListResult<Domain>, ApiFailure>>;
457
334
  }
335
+ declare function useDomains(client?: StadataClient): UseDomains;
458
336
 
459
337
  declare class RelatedPublication extends BaseEntity {
460
338
  readonly id: string;
@@ -486,51 +364,11 @@ declare class Publication extends BaseEntity {
486
364
  static fromJson(json: Record<string, unknown>): Publication;
487
365
  }
488
366
 
489
- interface PublicationRepository {
490
- getAll(params: PublicationListParams): Promise<Result<ListResult<Publication>, ApiFailure>>;
491
- getById(params: ViewParams): Promise<Result<Publication, ApiFailure>>;
492
- }
493
-
494
- declare class GetAllPublications {
495
- private readonly repository;
496
- constructor(repository: PublicationRepository);
497
- execute(params: PublicationListParams): Promise<Result<ListResult<Publication>, ApiFailure>>;
498
- }
499
-
500
- declare class GetPublicationById {
501
- private readonly repository;
502
- constructor(repository: PublicationRepository);
503
- execute(params: ViewParams): Promise<Result<Publication, ApiFailure>>;
504
- }
505
-
506
- declare class Infographic extends BaseEntity {
507
- readonly id: string;
508
- readonly title: string;
509
- readonly image: string;
510
- readonly category: number;
511
- readonly downloadUrl: string;
512
- readonly description: string | null;
513
- constructor(id: string, title: string, image: string, category: number, downloadUrl: string, description: string | null);
514
- toJson(): Record<string, unknown>;
515
- static fromJson(json: Record<string, unknown>): Infographic;
516
- }
517
-
518
- interface InfographicRepository {
519
- getAll(params: InfographicListParams): Promise<Result<ListResult<Infographic>, ApiFailure>>;
520
- getById(params: ViewParams): Promise<Result<Infographic, ApiFailure>>;
521
- }
522
-
523
- declare class GetAllInfographics {
524
- private readonly repository;
525
- constructor(repository: InfographicRepository);
526
- execute(params: InfographicListParams): Promise<Result<ListResult<Infographic>, ApiFailure>>;
527
- }
528
-
529
- declare class GetInfographicById {
530
- private readonly repository;
531
- constructor(repository: InfographicRepository);
532
- execute(params: ViewParams): Promise<Result<Infographic, ApiFailure>>;
367
+ interface UsePublications {
368
+ fetchPublicationList: (params: PublicationListParams) => Promise<Result<ListResult<Publication>, ApiFailure>>;
369
+ fetchPublicationDetail: (params: ViewParams) => Promise<Result<Publication, ApiFailure>>;
533
370
  }
371
+ declare function usePublications(client?: StadataClient): UsePublications;
534
372
 
535
373
  declare const ApiConstant: {
536
374
  readonly BASE_URL: "https://webapi.bps.go.id/v1/api";
@@ -578,111 +416,6 @@ declare const ApiEndpoint: {
578
416
  readonly TRADE: "/dataexim";
579
417
  };
580
418
 
581
- declare const QueryParamConstant: {
582
- readonly KEY: "key";
583
- readonly DOMAIN: "domain";
584
- readonly LANG: "lang";
585
- readonly PAGE: "page";
586
- readonly PER_PAGE: "per_page";
587
- readonly KEYWORD: "keyword";
588
- readonly MONTH: "month";
589
- readonly YEAR: "year";
590
- readonly SUBJECT: "subj";
591
- readonly VARIABLE: "var";
592
- readonly TURVAR: "turvar";
593
- readonly TURTH: "turth";
594
- readonly PERIOD: "th";
595
- readonly TYPE: "type";
596
- readonly TABLE: "table";
597
- readonly MODEL: "model";
598
- readonly ID: "id";
599
- readonly SHOW_DELETED: "show_deleted";
600
- };
601
-
602
- declare class StadataException extends Error {
603
- constructor(message: string);
604
- }
605
- declare class ApiException extends StadataException {
606
- readonly statusCode?: number | undefined;
607
- readonly response?: unknown | undefined;
608
- constructor(message: string, statusCode?: number | undefined, response?: unknown | undefined);
609
- }
610
- declare class CancelledException extends StadataException {
611
- constructor(message?: string);
612
- }
613
- declare class NetworkException extends StadataException {
614
- constructor(message: string);
615
- }
616
- declare class TimeoutException extends StadataException {
617
- constructor(message?: string);
618
- }
619
- declare class NotFoundException extends ApiException {
620
- constructor(message?: string);
621
- }
622
- declare class UnauthorizedException extends ApiException {
623
- constructor(message?: string);
624
- }
625
- declare class ForbiddenException extends ApiException {
626
- constructor(message?: string);
627
- }
628
- declare class ServerException extends ApiException {
629
- constructor(message?: string, statusCode?: number);
630
- }
631
-
632
- declare class News extends BaseEntity {
633
- readonly id: string;
634
- readonly title: string;
635
- readonly content: string;
636
- readonly releaseDate: string;
637
- readonly categoryId: number;
638
- readonly picture: string | null;
639
- constructor(id: string, title: string, content: string, releaseDate: string, categoryId: number, picture: string | null);
640
- toJson(): Record<string, unknown>;
641
- static fromJson(json: Record<string, unknown>): News;
642
- }
643
-
644
- interface NewsRepository {
645
- getAll(params: NewsListParams): Promise<Result<ListResult<News>, ApiFailure>>;
646
- getById(params: ViewParams): Promise<Result<News, ApiFailure>>;
647
- }
648
-
649
- declare class GetAllNews {
650
- private readonly repository;
651
- constructor(repository: NewsRepository);
652
- execute(params: NewsListParams): Promise<Result<ListResult<News>, ApiFailure>>;
653
- }
654
-
655
- declare class GetNewsById {
656
- private readonly repository;
657
- constructor(repository: NewsRepository);
658
- execute(params: ViewParams): Promise<Result<News, ApiFailure>>;
659
- }
660
-
661
- declare class NewsCategory extends BaseEntity {
662
- readonly id: string;
663
- readonly name: string;
664
- constructor(id: string, name: string);
665
- toJson(): Record<string, unknown>;
666
- static fromJson(json: Record<string, unknown>): NewsCategory;
667
- }
668
-
669
- interface NewsCategoryRepository {
670
- getAll(params?: NewsCategoryListParams): Promise<Result<ListResult<NewsCategory>, ApiFailure>>;
671
- getById(params: ViewParams): Promise<Result<NewsCategory, ApiFailure>>;
672
- }
673
-
674
- declare class GetAllNewsCategories implements UseCase<NewsCategoryListParams | undefined, ListResult<NewsCategory>> {
675
- private readonly repository;
676
- constructor(repository: NewsCategoryRepository);
677
- execute(params?: NewsCategoryListParams): Promise<Result<ListResult<NewsCategory>, ApiFailure>>;
678
- }
679
-
680
- declare class GetNewsCategoryById implements UseCase<ViewParams, NewsCategory> {
681
- private readonly repository;
682
- constructor(repository: NewsCategoryRepository);
683
- execute(params: ViewParams): Promise<Result<NewsCategory, ApiFailure>>;
684
- }
685
-
686
419
  declare class PressRelease extends BaseEntity {
687
420
  readonly id: number;
688
421
  readonly subjectId: number;
@@ -700,22 +433,11 @@ declare class PressRelease extends BaseEntity {
700
433
  static fromJson(json: Record<string, unknown>): PressRelease;
701
434
  }
702
435
 
703
- interface PressReleaseRepository {
704
- getAll(params: PressReleaseListParams): Promise<Result<ListResult<PressRelease>, ApiFailure>>;
705
- getById(params: ViewParams): Promise<Result<PressRelease, ApiFailure>>;
706
- }
707
-
708
- declare class GetAllPressReleases {
709
- private readonly repository;
710
- constructor(repository: PressReleaseRepository);
711
- execute(params: PressReleaseListParams): Promise<Result<ListResult<PressRelease>, ApiFailure>>;
712
- }
713
-
714
- declare class GetPressReleaseById {
715
- private readonly repository;
716
- constructor(repository: PressReleaseRepository);
717
- execute(params: ViewParams): Promise<Result<PressRelease, ApiFailure>>;
436
+ interface UsePressReleases {
437
+ fetchPressReleaseList: (params: PressReleaseListParams) => Promise<Result<ListResult<PressRelease>, ApiFailure>>;
438
+ fetchPressReleaseDetail: (params: ViewParams) => Promise<Result<PressRelease, ApiFailure>>;
718
439
  }
440
+ declare function usePressReleases(client?: StadataClient): UsePressReleases;
719
441
 
720
442
  declare class StaticTable extends BaseEntity {
721
443
  readonly id: string;
@@ -729,108 +451,148 @@ declare class StaticTable extends BaseEntity {
729
451
  static fromJson(json: Record<string, unknown>): StaticTable;
730
452
  }
731
453
 
732
- interface StaticTableRepository {
733
- getAll(params: StaticTableListParams): Promise<Result<ListResult<StaticTable>, ApiFailure>>;
734
- getById(params: ViewParams): Promise<Result<StaticTable, ApiFailure>>;
735
- }
736
-
737
- declare class GetAllStaticTables {
738
- private readonly repository;
739
- constructor(repository: StaticTableRepository);
740
- execute(params: StaticTableListParams): Promise<Result<ListResult<StaticTable>, ApiFailure>>;
454
+ interface UseStaticTables {
455
+ fetchStaticTableList: (params: StaticTableListParams) => Promise<Result<ListResult<StaticTable>, ApiFailure>>;
456
+ fetchStaticTableDetail: (params: ViewParams) => Promise<Result<StaticTable, ApiFailure>>;
741
457
  }
458
+ declare function useStaticTables(client?: StadataClient): UseStaticTables;
742
459
 
743
- declare class GetStaticTableById {
744
- private readonly repository;
745
- constructor(repository: StaticTableRepository);
746
- execute(params: ViewParams): Promise<Result<StaticTable, ApiFailure>>;
460
+ declare class VariableInfo extends BaseEntity {
461
+ readonly value: number;
462
+ readonly label: string;
463
+ readonly unit: string;
464
+ readonly subject: string;
465
+ readonly definition: string;
466
+ readonly notes: string;
467
+ readonly decimal?: number | undefined;
468
+ constructor(value: number, label: string, unit: string, subject: string, definition: string, notes: string, decimal?: number | undefined);
469
+ toJson(): Record<string, unknown>;
470
+ static fromJson(json: Record<string, unknown>): VariableInfo;
747
471
  }
748
-
749
- declare class Subject extends BaseEntity {
750
- readonly id: number;
751
- readonly name: string;
752
- readonly categoryId: number;
753
- readonly category: string;
754
- constructor(id: number, name: string, categoryId: number, category: string);
472
+ declare class VerticalVariableInfo extends BaseEntity {
473
+ readonly value: number | string;
474
+ readonly label: string;
475
+ constructor(value: number | string, label: string);
755
476
  toJson(): Record<string, unknown>;
756
- static fromJson(json: Record<string, unknown>): Subject;
477
+ static fromJson(json: Record<string, unknown>): VerticalVariableInfo;
757
478
  }
758
-
759
- interface SubjectRepository {
760
- getAll(params?: SubjectListParams): Promise<Result<ListResult<Subject>, ApiFailure>>;
761
- getById(params: ViewParams): Promise<Result<Subject, ApiFailure>>;
479
+ declare class PeriodInfo extends VerticalVariableInfo {
480
+ static fromJson(json: Record<string, unknown>): PeriodInfo;
762
481
  }
763
-
764
- declare class GetAllSubjects implements UseCase<SubjectListParams | undefined, ListResult<Subject>> {
765
- private readonly repository;
766
- constructor(repository: SubjectRepository);
767
- execute(params?: SubjectListParams): Promise<Result<ListResult<Subject>, ApiFailure>>;
482
+ declare class SubjectInfo extends BaseEntity {
483
+ readonly value: number;
484
+ readonly label: string;
485
+ constructor(value: number, label: string);
486
+ toJson(): Record<string, unknown>;
487
+ static fromJson(json: Record<string, unknown>): SubjectInfo;
768
488
  }
769
-
770
- declare class GetSubjectById implements UseCase<ViewParams, Subject> {
771
- private readonly repository;
772
- constructor(repository: SubjectRepository);
773
- execute(params: ViewParams): Promise<Result<Subject, ApiFailure>>;
489
+ declare class RelatedTable extends BaseEntity {
490
+ readonly id: string;
491
+ readonly title: string;
492
+ readonly tableSource: number;
493
+ readonly lastUpdate: string | null;
494
+ readonly link: string;
495
+ constructor(id: string, title: string, tableSource: number, lastUpdate: string | null, link: string);
496
+ toJson(): Record<string, unknown>;
497
+ static fromJson(json: Record<string, unknown>): RelatedTable;
774
498
  }
775
499
 
776
- declare class SubjectCategory extends BaseEntity {
777
- readonly id: number;
778
- readonly name: string;
779
- constructor(id: number, name: string);
500
+ declare class DynamicTable extends BaseEntity {
501
+ readonly subjects: SubjectInfo[];
502
+ readonly variables: VariableInfo[];
503
+ readonly verticalVariables: VerticalVariableInfo[];
504
+ readonly verticalVariableLabel: string;
505
+ readonly periods: PeriodInfo[];
506
+ readonly derivedVariables: VerticalVariableInfo[];
507
+ readonly derivedPeriods: VerticalVariableInfo[];
508
+ readonly dataContent: Record<string, unknown>;
509
+ readonly related: RelatedTable[];
510
+ readonly lastUpdate?: string | null | undefined;
511
+ constructor(subjects: SubjectInfo[], variables: VariableInfo[], verticalVariables: VerticalVariableInfo[], verticalVariableLabel: string, periods: PeriodInfo[], derivedVariables: VerticalVariableInfo[], derivedPeriods: VerticalVariableInfo[], dataContent: Record<string, unknown>, related: RelatedTable[], lastUpdate?: string | null | undefined);
780
512
  toJson(): Record<string, unknown>;
781
- static fromJson(json: Record<string, unknown>): SubjectCategory;
513
+ static fromJson(json: Record<string, unknown>): DynamicTable;
514
+ getDataValue(vervarValue: number | string, varValue: number | string, turvarValue: number | string, tahunValue: number | string, turtahunValue: number | string): unknown;
515
+ toStructuredData(): {
516
+ subject_id: number;
517
+ subject_label: string;
518
+ variable_id: number;
519
+ variable_label: string;
520
+ variable_unit: string;
521
+ vertical_variable_label: string;
522
+ last_update: string | null | undefined;
523
+ data: Array<{
524
+ id: number | string;
525
+ label: string;
526
+ data: Array<{
527
+ id: number | string;
528
+ label: string;
529
+ data: Array<{
530
+ id: number | string;
531
+ label: string;
532
+ value?: unknown;
533
+ data?: Array<{
534
+ id: number | string;
535
+ label: string;
536
+ value: unknown;
537
+ }>;
538
+ }>;
539
+ }>;
540
+ }>;
541
+ };
782
542
  }
783
543
 
784
- interface SubjectCategoryRepository {
785
- getAll(params?: SubjectCategoryListParams): Promise<Result<ListResult<SubjectCategory>, ApiFailure>>;
786
- getById(params: ViewParams): Promise<Result<SubjectCategory, ApiFailure>>;
544
+ interface UseDynamicTables {
545
+ fetchDynamicTableList: (params: DynamicTableParams) => Promise<Result<DynamicTable, ApiFailure>>;
787
546
  }
547
+ declare function useDynamicTables(client?: StadataClient): UseDynamicTables;
788
548
 
789
- declare class GetAllSubjectCategories implements UseCase<SubjectCategoryListParams | undefined, ListResult<SubjectCategory>> {
790
- private readonly repository;
791
- constructor(repository: SubjectCategoryRepository);
792
- execute(params?: SubjectCategoryListParams): Promise<Result<ListResult<SubjectCategory>, ApiFailure>>;
549
+ declare class Infographic extends BaseEntity {
550
+ readonly id: string;
551
+ readonly title: string;
552
+ readonly image: string;
553
+ readonly category: number;
554
+ readonly downloadUrl: string;
555
+ readonly description: string | null;
556
+ constructor(id: string, title: string, image: string, category: number, downloadUrl: string, description: string | null);
557
+ toJson(): Record<string, unknown>;
558
+ static fromJson(json: Record<string, unknown>): Infographic;
793
559
  }
794
560
 
795
- declare class GetSubjectCategoryById implements UseCase<ViewParams, SubjectCategory> {
796
- private readonly repository;
797
- constructor(repository: SubjectCategoryRepository);
798
- execute(params: ViewParams): Promise<Result<SubjectCategory, ApiFailure>>;
561
+ interface UseInfographics {
562
+ fetchInfographicList: (params: InfographicListParams) => Promise<Result<ListResult<Infographic>, ApiFailure>>;
799
563
  }
564
+ declare function useInfographics(client?: StadataClient): UseInfographics;
800
565
 
801
- declare class StrategicIndicator extends BaseEntity {
802
- readonly variableId: number;
803
- readonly indicatorId: number;
804
- readonly subjectCsa: number;
566
+ declare class News extends BaseEntity {
567
+ readonly id: string;
805
568
  readonly title: string;
806
- readonly name: string;
807
- readonly dataSource: string;
808
- readonly value: number;
809
- readonly unit: string;
810
- readonly category: number;
811
- readonly hashId: string;
812
- readonly period: string;
813
- constructor(variableId: number, indicatorId: number, subjectCsa: number, title: string, name: string, dataSource: string, value: number, unit: string, category: number, hashId: string, period: string);
569
+ readonly content: string;
570
+ readonly releaseDate: string;
571
+ readonly categoryId: number;
572
+ readonly picture: string | null;
573
+ constructor(id: string, title: string, content: string, releaseDate: string, categoryId: number, picture: string | null);
814
574
  toJson(): Record<string, unknown>;
815
- static fromJson(json: Record<string, unknown>): StrategicIndicator;
575
+ static fromJson(json: Record<string, unknown>): News;
816
576
  }
817
577
 
818
- interface StrategicIndicatorRepository {
819
- getAll(params?: StrategicIndicatorListParams): Promise<Result<ListResult<StrategicIndicator>, ApiFailure>>;
820
- getById(params: ViewParams): Promise<Result<StrategicIndicator, ApiFailure>>;
578
+ interface UseNews {
579
+ fetchNewList: (params: NewsListParams) => Promise<Result<ListResult<News>, ApiFailure>>;
580
+ fetchNewDetail: (params: ViewParams) => Promise<Result<News, ApiFailure>>;
821
581
  }
582
+ declare function useNews(client?: StadataClient): UseNews;
822
583
 
823
- declare class GetAllStrategicIndicators implements UseCase<StrategicIndicatorListParams | undefined, ListResult<StrategicIndicator>> {
824
- private readonly repository;
825
- constructor(repository: StrategicIndicatorRepository);
826
- execute(params?: StrategicIndicatorListParams): Promise<Result<ListResult<StrategicIndicator>, ApiFailure>>;
584
+ declare class NewsCategory extends BaseEntity {
585
+ readonly id: string;
586
+ readonly name: string;
587
+ constructor(id: string, name: string);
588
+ toJson(): Record<string, unknown>;
589
+ static fromJson(json: Record<string, unknown>): NewsCategory;
827
590
  }
828
591
 
829
- declare class GetStrategicIndicatorById implements UseCase<ViewParams, StrategicIndicator> {
830
- private readonly repository;
831
- constructor(repository: StrategicIndicatorRepository);
832
- execute(params: ViewParams): Promise<Result<StrategicIndicator, ApiFailure>>;
592
+ interface UseNewsCategories {
593
+ fetchNewsCategoryList: (params: NewsCategoryListParams) => Promise<Result<ListResult<NewsCategory>, ApiFailure>>;
833
594
  }
595
+ declare function useNewsCategories(client?: StadataClient): UseNewsCategories;
834
596
 
835
597
  declare class Variable extends BaseEntity {
836
598
  readonly id: number;
@@ -851,22 +613,11 @@ declare class Variable extends BaseEntity {
851
613
  static fromJson(json: Record<string, unknown>): Variable;
852
614
  }
853
615
 
854
- interface VariableRepository {
855
- getAll(params?: VariableListParams): Promise<Result<ListResult<Variable>, ApiFailure>>;
856
- getById(params: ViewParams): Promise<Result<Variable, ApiFailure>>;
857
- }
858
-
859
- declare class GetAllVariables implements UseCase<VariableListParams | undefined, ListResult<Variable>> {
860
- private readonly repository;
861
- constructor(repository: VariableRepository);
862
- execute(params?: VariableListParams): Promise<Result<ListResult<Variable>, ApiFailure>>;
863
- }
864
-
865
- declare class GetVariableById implements UseCase<ViewParams, Variable> {
866
- private readonly repository;
867
- constructor(repository: VariableRepository);
868
- execute(params: ViewParams): Promise<Result<Variable, ApiFailure>>;
616
+ interface UseVariables {
617
+ fetchVariableList: (params: VariableListParams) => Promise<Result<ListResult<Variable>, ApiFailure>>;
618
+ fetchVariableDetail: (params: ViewParams) => Promise<Result<Variable, ApiFailure>>;
869
619
  }
620
+ declare function useVariables(client?: StadataClient): UseVariables;
870
621
 
871
622
  declare class VerticalVariable extends BaseEntity {
872
623
  readonly id: number;
@@ -879,47 +630,68 @@ declare class VerticalVariable extends BaseEntity {
879
630
  static fromJson(json: Record<string, unknown>): VerticalVariable;
880
631
  }
881
632
 
882
- interface VerticalVariableRepository {
883
- getAll(params: VerticalVariableListParams): Promise<Result<ListResult<VerticalVariable>, ApiFailure>>;
884
- getById(params: ViewParams): Promise<Result<VerticalVariable, ApiFailure>>;
633
+ interface UseVerticalVariables {
634
+ fetchVerticalVariableList: (params: VerticalVariableListParams) => Promise<Result<ListResult<VerticalVariable>, ApiFailure>>;
885
635
  }
636
+ declare function useVerticalVariables(client?: StadataClient): UseVerticalVariables;
886
637
 
887
- declare class GetAllVerticalVariables implements UseCase<VerticalVariableListParams, ListResult<VerticalVariable>> {
888
- private readonly repository;
889
- constructor(repository: VerticalVariableRepository);
890
- execute(params: VerticalVariableListParams): Promise<Result<ListResult<VerticalVariable>, ApiFailure>>;
638
+ declare class DerivedVariable extends BaseEntity {
639
+ readonly id: number;
640
+ readonly name: string;
641
+ readonly groupId: number;
642
+ readonly groupName: string;
643
+ constructor(id: number, name: string, groupId: number, groupName: string);
644
+ toJson(): Record<string, unknown>;
645
+ static fromJson(json: Record<string, unknown>): DerivedVariable;
891
646
  }
892
647
 
893
- declare class GetVerticalVariableById implements UseCase<ViewParams, VerticalVariable> {
894
- private readonly repository;
895
- constructor(repository: VerticalVariableRepository);
896
- execute(params: ViewParams): Promise<Result<VerticalVariable, ApiFailure>>;
648
+ interface UseDerivedVariables {
649
+ fetchDerivedVariableList: (params: DerivedVariableListParams) => Promise<Result<ListResult<DerivedVariable>, ApiFailure>>;
897
650
  }
651
+ declare function useDerivedVariables(client?: StadataClient): UseDerivedVariables;
898
652
 
899
- declare class Unit extends BaseEntity {
653
+ declare class Subject extends BaseEntity {
654
+ readonly id: number;
655
+ readonly name: string;
656
+ readonly categoryId: number;
657
+ readonly category: string;
658
+ constructor(id: number, name: string, categoryId: number, category: string);
659
+ toJson(): Record<string, unknown>;
660
+ static fromJson(json: Record<string, unknown>): Subject;
661
+ }
662
+
663
+ interface UseSubjects {
664
+ fetchSubjectList: (params: SubjectListParams) => Promise<Result<ListResult<Subject>, ApiFailure>>;
665
+ fetchSubjectDetail: (params: ViewParams) => Promise<Result<Subject, ApiFailure>>;
666
+ }
667
+ declare function useSubjects(client?: StadataClient): UseSubjects;
668
+
669
+ declare class SubjectCategory extends BaseEntity {
900
670
  readonly id: number;
901
671
  readonly name: string;
902
672
  constructor(id: number, name: string);
903
673
  toJson(): Record<string, unknown>;
904
- static fromJson(json: Record<string, unknown>): Unit;
674
+ static fromJson(json: Record<string, unknown>): SubjectCategory;
905
675
  }
906
676
 
907
- interface UnitRepository {
908
- getAll(params?: UnitListParams): Promise<Result<ListResult<Unit>, ApiFailure>>;
909
- getById(params: ViewParams): Promise<Result<Unit, ApiFailure>>;
677
+ interface UseSubjectCategories {
678
+ fetchSubjectCategoryList: (params: SubjectCategoryListParams) => Promise<Result<ListResult<SubjectCategory>, ApiFailure>>;
910
679
  }
680
+ declare function useSubjectCategories(client?: StadataClient): UseSubjectCategories;
911
681
 
912
- declare class GetAllUnits implements UseCase<UnitListParams | undefined, ListResult<Unit>> {
913
- private readonly repository;
914
- constructor(repository: UnitRepository);
915
- execute(params?: UnitListParams): Promise<Result<ListResult<Unit>, ApiFailure>>;
682
+ declare class Unit extends BaseEntity {
683
+ readonly id: number;
684
+ readonly name: string;
685
+ constructor(id: number, name: string);
686
+ toJson(): Record<string, unknown>;
687
+ static fromJson(json: Record<string, unknown>): Unit;
916
688
  }
917
689
 
918
- declare class GetUnitById implements UseCase<ViewParams, Unit> {
919
- private readonly repository;
920
- constructor(repository: UnitRepository);
921
- execute(params: ViewParams): Promise<Result<Unit, ApiFailure>>;
690
+ interface UseUnits {
691
+ fetchUnitList: (params: UnitListParams) => Promise<Result<ListResult<Unit>, ApiFailure>>;
692
+ fetchUnitDetail: (params: ViewParams) => Promise<Result<Unit, ApiFailure>>;
922
693
  }
694
+ declare function useUnits(client?: StadataClient): UseUnits;
923
695
 
924
696
  declare class Period extends BaseEntity {
925
697
  readonly id: number;
@@ -929,22 +701,10 @@ declare class Period extends BaseEntity {
929
701
  static fromJson(json: Record<string, unknown>): Period;
930
702
  }
931
703
 
932
- interface PeriodRepository {
933
- getAll(params: PeriodListParams): Promise<Result<ListResult<Period>, ApiFailure>>;
934
- getById(params: ViewParams): Promise<Result<Period, ApiFailure>>;
935
- }
936
-
937
- declare class GetAllPeriods implements UseCase<PeriodListParams, ListResult<Period>> {
938
- private readonly repository;
939
- constructor(repository: PeriodRepository);
940
- execute(params: PeriodListParams): Promise<Result<ListResult<Period>, ApiFailure>>;
941
- }
942
-
943
- declare class GetPeriodById implements UseCase<ViewParams, Period> {
944
- private readonly repository;
945
- constructor(repository: PeriodRepository);
946
- execute(params: ViewParams): Promise<Result<Period, ApiFailure>>;
704
+ interface UsePeriods {
705
+ fetchPeriodList: (params: PeriodListParams) => Promise<Result<ListResult<Period>, ApiFailure>>;
947
706
  }
707
+ declare function usePeriods(client?: StadataClient): UsePeriods;
948
708
 
949
709
  declare class DerivedPeriod extends BaseEntity {
950
710
  readonly id: number;
@@ -956,49 +716,33 @@ declare class DerivedPeriod extends BaseEntity {
956
716
  static fromJson(json: Record<string, unknown>): DerivedPeriod;
957
717
  }
958
718
 
959
- interface DerivedPeriodRepository {
960
- getAll(params: DerivedPeriodListParams): Promise<Result<ListResult<DerivedPeriod>, ApiFailure>>;
961
- getById(params: ViewParams): Promise<Result<DerivedPeriod, ApiFailure>>;
962
- }
963
-
964
- declare class GetAllDerivedPeriods {
965
- private readonly repository;
966
- constructor(repository: DerivedPeriodRepository);
967
- execute(params: DerivedPeriodListParams): Promise<Result<ListResult<DerivedPeriod>, ApiFailure>>;
719
+ interface UseDerivedPeriods {
720
+ fetchDerivedPeriodList: (params: DerivedPeriodListParams) => Promise<Result<ListResult<DerivedPeriod>, ApiFailure>>;
968
721
  }
722
+ declare function useDerivedPeriods(client?: StadataClient): UseDerivedPeriods;
969
723
 
970
- declare class GetDerivedPeriodById {
971
- private readonly repository;
972
- constructor(repository: DerivedPeriodRepository);
973
- execute(params: ViewParams): Promise<Result<DerivedPeriod, ApiFailure>>;
974
- }
975
-
976
- declare class DerivedVariable extends BaseEntity {
977
- readonly id: number;
724
+ declare class StrategicIndicator extends BaseEntity {
725
+ readonly variableId: number;
726
+ readonly indicatorId: number;
727
+ readonly subjectCsa: number;
728
+ readonly title: string;
978
729
  readonly name: string;
979
- readonly groupId: number;
980
- readonly groupName: string;
981
- constructor(id: number, name: string, groupId: number, groupName: string);
730
+ readonly dataSource: string;
731
+ readonly value: number;
732
+ readonly unit: string;
733
+ readonly category: number;
734
+ readonly hashId: string;
735
+ readonly period: string;
736
+ constructor(variableId: number, indicatorId: number, subjectCsa: number, title: string, name: string, dataSource: string, value: number, unit: string, category: number, hashId: string, period: string);
982
737
  toJson(): Record<string, unknown>;
983
- static fromJson(json: Record<string, unknown>): DerivedVariable;
984
- }
985
-
986
- interface DerivedVariableRepository {
987
- getAll(params: DerivedVariableListParams): Promise<Result<ListResult<DerivedVariable>, ApiFailure>>;
988
- getById(params: ViewParams): Promise<Result<DerivedVariable, ApiFailure>>;
989
- }
990
-
991
- declare class GetAllDerivedVariables {
992
- private readonly repository;
993
- constructor(repository: DerivedVariableRepository);
994
- execute(params: DerivedVariableListParams): Promise<Result<ListResult<DerivedVariable>, ApiFailure>>;
738
+ static fromJson(json: Record<string, unknown>): StrategicIndicator;
995
739
  }
996
740
 
997
- declare class GetDerivedVariableById {
998
- private readonly repository;
999
- constructor(repository: DerivedVariableRepository);
1000
- execute(params: ViewParams): Promise<Result<DerivedVariable, ApiFailure>>;
741
+ interface UseStrategicIndicators {
742
+ fetchStrategicIndicatorList: (params: StrategicIndicatorListParams) => Promise<Result<ListResult<StrategicIndicator>, ApiFailure>>;
743
+ fetchStrategicIndicatorDetail: (params: ViewParams) => Promise<Result<StrategicIndicator, ApiFailure>>;
1001
744
  }
745
+ declare function useStrategicIndicators(client?: StadataClient): UseStrategicIndicators;
1002
746
 
1003
747
  declare class StatisticClassification extends BaseEntity {
1004
748
  readonly id: string;
@@ -1008,22 +752,11 @@ declare class StatisticClassification extends BaseEntity {
1008
752
  static fromJson(json: Record<string, unknown>): StatisticClassification;
1009
753
  }
1010
754
 
1011
- interface StatisticClassificationRepository {
1012
- getAll(params?: StatisticClassificationListParams): Promise<Result<ListResult<StatisticClassification>, ApiFailure>>;
1013
- getById(params: ViewParams): Promise<Result<StatisticClassification, ApiFailure>>;
1014
- }
1015
-
1016
- declare class GetAllStatisticClassifications {
1017
- private readonly repository;
1018
- constructor(repository: StatisticClassificationRepository);
1019
- execute(params?: StatisticClassificationListParams): Promise<Result<ListResult<StatisticClassification>, ApiFailure>>;
1020
- }
1021
-
1022
- declare class GetStatisticClassificationById {
1023
- private readonly repository;
1024
- constructor(repository: StatisticClassificationRepository);
1025
- execute(params: ViewParams): Promise<Result<StatisticClassification, ApiFailure>>;
755
+ interface UseStatisticClassifications {
756
+ fetchStatisticClassificationList: (params: StatisticClassificationListParams) => Promise<Result<ListResult<StatisticClassification>, ApiFailure>>;
757
+ fetchStatisticClassificationDetail: (params: ViewParams) => Promise<Result<StatisticClassification, ApiFailure>>;
1026
758
  }
759
+ declare function useStatisticClassifications(client?: StadataClient): UseStatisticClassifications;
1027
760
 
1028
761
  declare class CensusCategory extends BaseEntity {
1029
762
  readonly id: string;
@@ -1098,116 +831,61 @@ declare class CensusData extends BaseEntity {
1098
831
  static fromJson(json: Record<string, unknown>): CensusData;
1099
832
  }
1100
833
 
1101
- interface CensusRepository {
1102
- getAll(params?: CensusListParams): Promise<Result<ListResult<CensusEvent | CensusTopic | CensusArea | CensusDataset | CensusData>, ApiFailure>>;
1103
- getById(params: ViewParams): Promise<Result<CensusEvent, ApiFailure>>;
1104
- }
1105
-
1106
- type CensusEntity = CensusEvent | CensusTopic | CensusArea | CensusDataset | CensusData;
1107
- declare class GetAllCensuses implements UseCase<CensusListParams | undefined, ListResult<CensusEntity>> {
1108
- private repository;
1109
- constructor(repository: CensusRepository);
1110
- execute(params?: CensusListParams): Promise<Result<ListResult<CensusEntity>, ApiFailure>>;
1111
- }
1112
-
1113
- declare class GetCensusById implements UseCase<ViewParams, CensusEvent> {
1114
- private repository;
1115
- constructor(repository: CensusRepository);
1116
- execute(params: ViewParams): Promise<Result<CensusEvent, ApiFailure>>;
834
+ interface UseCensus {
835
+ fetchCensusList: (params: CensusListParams) => Promise<Result<ListResult<CensusEvent | CensusTopic | CensusArea | CensusDataset | CensusData>, ApiFailure>>;
1117
836
  }
837
+ declare function useCensus(client?: StadataClient): UseCensus;
1118
838
 
1119
- declare class VariableInfo extends BaseEntity {
1120
- readonly value: number;
1121
- readonly label: string;
1122
- readonly unit: string;
1123
- readonly subject: string;
1124
- readonly definition: string;
1125
- readonly notes: string;
1126
- readonly decimal?: number | undefined;
1127
- constructor(value: number, label: string, unit: string, subject: string, definition: string, notes: string, decimal?: number | undefined);
1128
- toJson(): Record<string, unknown>;
1129
- static fromJson(json: Record<string, unknown>): VariableInfo;
1130
- }
1131
- declare class VerticalVariableInfo extends BaseEntity {
1132
- readonly value: number | string;
1133
- readonly label: string;
1134
- constructor(value: number | string, label: string);
1135
- toJson(): Record<string, unknown>;
1136
- static fromJson(json: Record<string, unknown>): VerticalVariableInfo;
1137
- }
1138
- declare class PeriodInfo extends VerticalVariableInfo {
1139
- static fromJson(json: Record<string, unknown>): PeriodInfo;
1140
- }
1141
- declare class SubjectInfo extends BaseEntity {
1142
- readonly value: number;
1143
- readonly label: string;
1144
- constructor(value: number, label: string);
1145
- toJson(): Record<string, unknown>;
1146
- static fromJson(json: Record<string, unknown>): SubjectInfo;
1147
- }
1148
- declare class RelatedTable extends BaseEntity {
1149
- readonly id: string;
1150
- readonly title: string;
1151
- readonly tableSource: number;
1152
- readonly lastUpdate: string | null;
1153
- readonly link: string;
1154
- constructor(id: string, title: string, tableSource: number, lastUpdate: string | null, link: string);
1155
- toJson(): Record<string, unknown>;
1156
- static fromJson(json: Record<string, unknown>): RelatedTable;
839
+ interface UseTrade {
840
+ fetchTradeData: (params: TradeParams) => Promise<Result<ResponseData<Record<string, unknown>>, ApiFailure>>;
1157
841
  }
842
+ declare function useTrade(client?: StadataClient): UseTrade;
1158
843
 
1159
- declare class DynamicTable extends BaseEntity {
1160
- readonly subjects: SubjectInfo[];
1161
- readonly variables: VariableInfo[];
1162
- readonly verticalVariables: VerticalVariableInfo[];
1163
- readonly verticalVariableLabel: string;
1164
- readonly periods: PeriodInfo[];
1165
- readonly derivedVariables: VerticalVariableInfo[];
1166
- readonly derivedPeriods: VerticalVariableInfo[];
1167
- readonly dataContent: Record<string, unknown>;
1168
- readonly related: RelatedTable[];
1169
- readonly lastUpdate?: string | null | undefined;
1170
- constructor(subjects: SubjectInfo[], variables: VariableInfo[], verticalVariables: VerticalVariableInfo[], verticalVariableLabel: string, periods: PeriodInfo[], derivedVariables: VerticalVariableInfo[], derivedPeriods: VerticalVariableInfo[], dataContent: Record<string, unknown>, related: RelatedTable[], lastUpdate?: string | null | undefined);
1171
- toJson(): Record<string, unknown>;
1172
- static fromJson(json: Record<string, unknown>): DynamicTable;
1173
- getDataValue(vervarValue: number | string, varValue: number | string, turvarValue: number | string, tahunValue: number | string, turtahunValue: number | string): unknown;
1174
- toStructuredData(): {
1175
- subject_id: number;
1176
- subject_label: string;
1177
- variable_id: number;
1178
- variable_label: string;
1179
- variable_unit: string;
1180
- vertical_variable_label: string;
1181
- last_update: string | null | undefined;
1182
- data: Array<{
1183
- id: number | string;
1184
- label: string;
1185
- data: Array<{
1186
- id: number | string;
1187
- label: string;
1188
- data: Array<{
1189
- id: number | string;
1190
- label: string;
1191
- value?: unknown;
1192
- data?: Array<{
1193
- id: number | string;
1194
- label: string;
1195
- value: unknown;
1196
- }>;
1197
- }>;
1198
- }>;
1199
- }>;
1200
- };
1201
- }
1202
-
1203
- interface DynamicTableRepository {
1204
- getAll(params: DynamicTableParams): Promise<Result<DynamicTable, ApiFailure>>;
844
+ interface StadataClientConfig {
845
+ apiKey: string;
846
+ baseURL?: string;
847
+ timeout?: number;
848
+ interceptors?: NetworkInterceptor[];
849
+ debug?: boolean;
850
+ logLevel?: LogLevel;
1205
851
  }
1206
-
1207
- declare class GetAllDynamicTables implements UseCase<DynamicTableParams, DynamicTable> {
1208
- private repository;
1209
- constructor(repository: DynamicTableRepository);
1210
- execute(params: DynamicTableParams): Promise<Result<DynamicTable, ApiFailure>>;
852
+ interface StadataClient {
853
+ readonly networkClient: NetworkClient;
854
+ readonly config: StadataClientConfig;
855
+ }
856
+ interface StadataClientInstance extends StadataClient {
857
+ useDomains: () => ReturnType<typeof useDomains>;
858
+ usePublications: () => ReturnType<typeof usePublications>;
859
+ usePressReleases: () => ReturnType<typeof usePressReleases>;
860
+ useStaticTables: () => ReturnType<typeof useStaticTables>;
861
+ useDynamicTables: () => ReturnType<typeof useDynamicTables>;
862
+ useInfographics: () => ReturnType<typeof useInfographics>;
863
+ useNews: () => ReturnType<typeof useNews>;
864
+ useNewsCategories: () => ReturnType<typeof useNewsCategories>;
865
+ useVariables: () => ReturnType<typeof useVariables>;
866
+ useVerticalVariables: () => ReturnType<typeof useVerticalVariables>;
867
+ useDerivedVariables: () => ReturnType<typeof useDerivedVariables>;
868
+ useSubjects: () => ReturnType<typeof useSubjects>;
869
+ useSubjectCategories: () => ReturnType<typeof useSubjectCategories>;
870
+ useUnits: () => ReturnType<typeof useUnits>;
871
+ usePeriods: () => ReturnType<typeof usePeriods>;
872
+ useDerivedPeriods: () => ReturnType<typeof useDerivedPeriods>;
873
+ useStrategicIndicators: () => ReturnType<typeof useStrategicIndicators>;
874
+ useStatisticClassifications: () => ReturnType<typeof useStatisticClassifications>;
875
+ useCensus: () => ReturnType<typeof useCensus>;
876
+ useTrade: () => ReturnType<typeof useTrade>;
877
+ }
878
+ declare function createStadataClient(config: StadataClientConfig): StadataClientInstance;
879
+
880
+ declare function initStadata(config: StadataClientConfig): StadataClientInstance;
881
+ declare function getGlobalClient(): StadataClientInstance;
882
+ declare function resetGlobalClient(): void;
883
+
884
+ declare class DynamicTableHtmlGenerator {
885
+ static generate(table: DynamicTable): string;
886
+ private static generateHeader;
887
+ private static generateBody;
888
+ private static formatValue;
1211
889
  }
1212
890
 
1213
891
  interface StadataList {
@@ -1312,14 +990,4 @@ declare class Trade extends BaseEntity {
1312
990
  static fromJson(json: Record<string, unknown>): Trade;
1313
991
  }
1314
992
 
1315
- interface TradeRepository {
1316
- get(params: TradeParams): Promise<Result<ResponseData<Record<string, unknown>>, ApiFailure>>;
1317
- }
1318
-
1319
- declare class GetTrade implements UseCase<TradeParams, ResponseData<Record<string, unknown>>> {
1320
- private repository;
1321
- constructor(repository: TradeRepository);
1322
- execute(params: TradeParams): Promise<Result<ResponseData<Record<string, unknown>>, ApiFailure>>;
1323
- }
1324
-
1325
- export { ApiConstant, ApiEndpoint, ApiException, ApiFailure, ApiResponse, AuthInterceptor, BaseEntity, type BaseListParams, CancelToken, CancelledException, CancelledFailure, CensusArea, CensusCategory, CensusData, CensusDataset, CensusEvent, type CensusListParams, type CensusRepository, CensusTopic, ClassificationType, ConsoleLogPrinter, DataAvailability, DataLanguage, DateHelper, DerivedPeriod, type DerivedPeriodListParams, type DerivedPeriodRepository, DerivedVariable, type DerivedVariableListParams, type DerivedVariableRepository, Domain, type DomainListParams, type DomainRepository, DomainType, 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, GetInfographicById, GetNewsById, GetNewsCategoryById, GetPeriodById, GetPressReleaseById, GetPublicationById, GetStaticTableById, GetStatisticClassificationById, GetStrategicIndicatorById, GetSubjectById, GetSubjectCategoryById, GetTrade, GetUnitById, GetVariableById, GetVerticalVariableById, HSCodeType, Infographic, type InfographicListParams, type InfographicRepository, Injector, type JSON, KBKILevel, KBLILevel, 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 };
993
+ export { ApiConstant, ApiEndpoint, ApiFailure, type BaseDomainListParams, type BaseListParams, CancelToken, CancelledFailure, CensusArea, CensusCategory, CensusData, CensusDataset, CensusEvent, type CensusListParams, CensusTopic, ClassificationType, DataAvailability, DataLanguage, DerivedPeriod, type DerivedPeriodListParams, DerivedVariable, type DerivedVariableListParams, Domain, type DomainListParams, DomainType, DynamicTable, DynamicTableHtmlGenerator, type DynamicTableParams, ForbiddenFailure, HSCodeType, Infographic, type InfographicListParams, type JSON, KBKILevel, KBLILevel, ListResult, LogLevel, NetworkClient, type NetworkClientConfig, NetworkFailure, type NetworkInterceptor, News, NewsCategory, type NewsCategoryListParams, type NewsListParams, NotFoundFailure, Pagination, ParseFailure, Period, type PeriodListParams, PressRelease, type PressReleaseListParams, Publication, type PublicationListParams, RelatedPublication, type RequestData, type RequestOptions, type ResponseData, ServerFailure, type StadataClient, type StadataClientConfig, type StadataClientInstance, StadataJS, type StadataJSConfig, StaticTable, type StaticTableListParams, StatisticClassification, type StatisticClassificationListParams, StrategicIndicator, type StrategicIndicatorListParams, Subject, SubjectCategory, type SubjectCategoryListParams, type SubjectListParams, TimeoutFailure, Trade, type TradeParams, TradePeriod, TradeSource, UnauthorizedFailure, Unit, type UnitListParams, type UseCensus, type UseDerivedPeriods, type UseDerivedVariables, type UseDomains, type UseDynamicTables, type UseInfographics, type UseNews, type UseNewsCategories, type UsePeriods, type UsePressReleases, type UsePublications, type UseStaticTables, type UseStatisticClassifications, type UseStrategicIndicators, type UseSubjectCategories, type UseSubjects, type UseTrade, type UseUnits, type UseVariables, type UseVerticalVariables, ValidationFailure, Variable, type VariableListParams, VerticalVariable, type VerticalVariableListParams, type ViewParams, createStadataClient, getGlobalClient, initStadata, resetGlobalClient, useCensus, useDerivedPeriods, useDerivedVariables, useDomains, useDynamicTables, useInfographics, useNews, useNewsCategories, usePeriods, usePressReleases, usePublications, useStaticTables, useStatisticClassifications, useStrategicIndicators, useSubjectCategories, useSubjects, useTrade, useUnits, useVariables, useVerticalVariables };