@flagpole/api-types 1.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/README.md +54 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/lib/flagpole-api-types.d.ts +1579 -0
- package/lib/flagpole-api-types.js +827 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# @flagpole/api-types
|
|
2
|
+
|
|
3
|
+
TypeScript types for the FlagPole API.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @flagpole/api-types
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import {
|
|
15
|
+
CreateFeatureFlagDto,
|
|
16
|
+
FeatureFlag,
|
|
17
|
+
CreateOrganizationDto,
|
|
18
|
+
Organization,
|
|
19
|
+
Api
|
|
20
|
+
} from '@flagpole/api-types';
|
|
21
|
+
|
|
22
|
+
// Use the types in your application
|
|
23
|
+
const createFlag: CreateFeatureFlagDto = {
|
|
24
|
+
name: 'my-feature',
|
|
25
|
+
description: 'My new feature flag',
|
|
26
|
+
isEnabled: false,
|
|
27
|
+
environments: ['development']
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// API Client usage
|
|
31
|
+
const api = new Api({
|
|
32
|
+
baseURL: 'https://api.useflagpole.dev',
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// Set authorization header
|
|
36
|
+
api.instance.defaults.headers.common['Authorization'] = `Bearer ${token}`;
|
|
37
|
+
|
|
38
|
+
const flags = await api.featureFlags.findAll();
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Version
|
|
42
|
+
|
|
43
|
+
This package is automatically generated from the FlagPole API OpenAPI specification.
|
|
44
|
+
The version corresponds to the API version it was generated from.
|
|
45
|
+
|
|
46
|
+
## Generated Files
|
|
47
|
+
|
|
48
|
+
- `flagpole-api-types.ts` - Main types and API client
|
|
49
|
+
- `index.d.ts` - TypeScript declarations
|
|
50
|
+
- `index.js` - CommonJS exports
|
|
51
|
+
|
|
52
|
+
## Support
|
|
53
|
+
|
|
54
|
+
For issues with the API types, please refer to the main FlagPole API repository.
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib/flagpole-api-types';
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib/flagpole-api-types';
|