@dinoconfig/js-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/LICENSE +21 -0
- package/README.md +743 -0
- package/index.d.ts +88 -0
- package/index.js +883 -0
- package/lib/cache/cache-manager.d.ts +86 -0
- package/lib/cache/cache.types.d.ts +105 -0
- package/lib/cache/index.d.ts +8 -0
- package/lib/cache/memory-cache.d.ts +86 -0
- package/lib/cache/storage-cache.d.ts +58 -0
- package/lib/config-api.d.ts +111 -0
- package/lib/dinoconfig-js-sdk.d.ts +140 -0
- package/lib/discovery-api.d.ts +174 -0
- package/lib/http-client.d.ts +245 -0
- package/lib/types.d.ts +364 -0
- package/package.json +77 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DinoConfig JavaScript SDK
|
|
3
|
+
*
|
|
4
|
+
* Official SDK for interacting with the DinoConfig API.
|
|
5
|
+
* Provides a simple, type-safe way to retrieve configuration values.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @module @dinoconfig/dinoconfig-js-sdk
|
|
9
|
+
* @version 1.0.0
|
|
10
|
+
* @license MIT
|
|
11
|
+
*
|
|
12
|
+
* @example Quick Start
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import { dinoconfigApi } from '@dinoconfig/dinoconfig-js-sdk';
|
|
15
|
+
*
|
|
16
|
+
* // Initialize the SDK
|
|
17
|
+
* const dinoconfig = await dinoconfigApi({
|
|
18
|
+
* apiKey: 'dino_your-api-key-here',
|
|
19
|
+
* baseUrl: 'https://api.dinoconfig.com'
|
|
20
|
+
* });
|
|
21
|
+
*
|
|
22
|
+
* // Get entire config
|
|
23
|
+
* const config = await dinoconfig.configs.get('MyBrand.AppSettings');
|
|
24
|
+
* console.log('All values:', config.data.values);
|
|
25
|
+
*
|
|
26
|
+
* // Get single value (shorthand)
|
|
27
|
+
* const theme = await dinoconfig.configs.getValue('MyBrand.AppSettings.theme');
|
|
28
|
+
* console.log('Theme:', theme.data);
|
|
29
|
+
*
|
|
30
|
+
* // Get single value (full params)
|
|
31
|
+
* const response = await dinoconfig.configs.getValue('MyBrand', 'AppSettings', 'theme');
|
|
32
|
+
* console.log('Theme:', response.data);
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @example Discovery API
|
|
36
|
+
* ```typescript
|
|
37
|
+
* // List all brands
|
|
38
|
+
* const brands = await dinoconfig.discovery.listBrands();
|
|
39
|
+
*
|
|
40
|
+
* // List configs for a brand
|
|
41
|
+
* const configs = await dinoconfig.discovery.listConfigs('MyBrand');
|
|
42
|
+
*
|
|
43
|
+
* // Get config schema
|
|
44
|
+
* const schema = await dinoconfig.discovery.getSchema('MyBrand', 'FeatureFlags');
|
|
45
|
+
*
|
|
46
|
+
* // Full introspection
|
|
47
|
+
* const all = await dinoconfig.discovery.introspect();
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @see {@link https://docs.dinoconfig.com | Documentation}
|
|
51
|
+
* @see {@link https://github.com/dinoconfig/dinoconfig-js-sdk | GitHub}
|
|
52
|
+
*/
|
|
53
|
+
/** Factory function to create SDK instance */
|
|
54
|
+
export { dinoconfigApi } from './lib/dinoconfig-js-sdk';
|
|
55
|
+
/** SDK instance type */
|
|
56
|
+
export type { DinoConfigInstance, CacheAPI } from './lib/dinoconfig-js-sdk';
|
|
57
|
+
/** SDK configuration options */
|
|
58
|
+
export type { DinoConfigSDKConfig, ApiResponse, RequestOptions } from './lib/types';
|
|
59
|
+
/** Configuration API class */
|
|
60
|
+
export { ConfigAPI } from './lib/config-api';
|
|
61
|
+
/** Full configuration data returned by configs.get() */
|
|
62
|
+
export type { ConfigData } from './lib/config-api';
|
|
63
|
+
/** Discovery API class */
|
|
64
|
+
export { DiscoveryAPI } from './lib/discovery-api';
|
|
65
|
+
/** Discovery API types */
|
|
66
|
+
export type {
|
|
67
|
+
/** Brand information from listBrands() */
|
|
68
|
+
BrandInfo,
|
|
69
|
+
/** Config information from listConfigs() */
|
|
70
|
+
ConfigInfo,
|
|
71
|
+
/** Config schema from getSchema() */
|
|
72
|
+
ConfigSchema,
|
|
73
|
+
/** Field schema definition */
|
|
74
|
+
FieldSchema,
|
|
75
|
+
/** Supported field types */
|
|
76
|
+
FieldType,
|
|
77
|
+
/** Field validation rules */
|
|
78
|
+
FieldValidation,
|
|
79
|
+
/** Full introspection result */
|
|
80
|
+
IntrospectionResult,
|
|
81
|
+
/** Brand with detailed config info (for introspection) */
|
|
82
|
+
BrandInfoDetail,
|
|
83
|
+
/** Config with key details (for introspection) */
|
|
84
|
+
ConfigInfoDetail,
|
|
85
|
+
/** Key information with name, type, and value */
|
|
86
|
+
KeyInfo, } from './lib/discovery-api';
|
|
87
|
+
/** Cache API types */
|
|
88
|
+
export type { CacheConfig, CacheEntry, CacheOptions, CacheStats } from './lib/cache';
|