@flagpole/api-types 1.0.10 → 1.0.11
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 +2 -54
- package/lib/flagpole-api-types.d.ts +87 -4
- package/lib/flagpole-api-types.js +1 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,54 +1,2 @@
|
|
|
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.
|
|
1
|
+
# @flagpole/api-types v1.0.11
|
|
2
|
+
TypeScript types for FlagPole API generated from OpenAPI specification.
|
|
@@ -35,6 +35,52 @@ export interface CheckoutSessionResponseDto {
|
|
|
35
35
|
/** @example "https://checkout.stripe.com/pay/cs_test_1234567890" */
|
|
36
36
|
url: object | null;
|
|
37
37
|
}
|
|
38
|
+
export interface ConditionRuleDto {
|
|
39
|
+
/** Whether this is an allow list (true) or block list (false) */
|
|
40
|
+
allowList?: boolean;
|
|
41
|
+
/** The attribute to check (custom condition) */
|
|
42
|
+
attribute?: string;
|
|
43
|
+
/** Array of browser names */
|
|
44
|
+
browsers?: string[];
|
|
45
|
+
/** Array of country codes */
|
|
46
|
+
countries?: string[];
|
|
47
|
+
/** Days of week (0-6, Sunday=0) */
|
|
48
|
+
daysOfWeek?: number[];
|
|
49
|
+
/** Array of email addresses (user condition) */
|
|
50
|
+
email?: string[];
|
|
51
|
+
/** Array of email domains (user condition) */
|
|
52
|
+
emailDomain?: string[];
|
|
53
|
+
/**
|
|
54
|
+
* End date for time-based condition
|
|
55
|
+
* @format date-time
|
|
56
|
+
*/
|
|
57
|
+
endDate?: string;
|
|
58
|
+
/** Hours of day (0-23) */
|
|
59
|
+
hours?: number[];
|
|
60
|
+
/** Whether to target mobile devices */
|
|
61
|
+
mobile?: boolean;
|
|
62
|
+
/** The operator to use for comparison (custom condition) */
|
|
63
|
+
operator?: "equals" | "contains" | "startsWith" | "endsWith" | "regex";
|
|
64
|
+
/** Array of operating systems */
|
|
65
|
+
os?: string[];
|
|
66
|
+
/** Array of region codes */
|
|
67
|
+
regions?: string[];
|
|
68
|
+
/**
|
|
69
|
+
* Start date for time-based condition
|
|
70
|
+
* @format date-time
|
|
71
|
+
*/
|
|
72
|
+
startDate?: string;
|
|
73
|
+
/** Time zone for the condition */
|
|
74
|
+
timeZone?: string;
|
|
75
|
+
/** Array of user IDs (user condition) */
|
|
76
|
+
userId?: string[];
|
|
77
|
+
/** Array of user types (user condition) */
|
|
78
|
+
userType?: string[];
|
|
79
|
+
/** Array of values to match against (custom condition) */
|
|
80
|
+
values?: string[];
|
|
81
|
+
/** Array of version strings */
|
|
82
|
+
versions?: string[];
|
|
83
|
+
}
|
|
38
84
|
export type CreateApiKeyDto = object;
|
|
39
85
|
export interface CreateCheckoutSessionByPlanDto {
|
|
40
86
|
/**
|
|
@@ -65,7 +111,26 @@ export interface CreateCheckoutSessionByPlanDto {
|
|
|
65
111
|
trialPeriodDays?: number;
|
|
66
112
|
}
|
|
67
113
|
export type CreateCheckoutSessionDto = object;
|
|
68
|
-
export
|
|
114
|
+
export interface CreateFeatureFlagDto {
|
|
115
|
+
/** Conditions for when the flag should be active */
|
|
116
|
+
conditions?: FeatureFlagConditionsDto;
|
|
117
|
+
/**
|
|
118
|
+
* Description of the feature flag
|
|
119
|
+
* @example "Enables dark mode UI"
|
|
120
|
+
*/
|
|
121
|
+
description: string;
|
|
122
|
+
environments?: Environment[];
|
|
123
|
+
/**
|
|
124
|
+
* Whether the flag is initially enabled
|
|
125
|
+
* @default false
|
|
126
|
+
*/
|
|
127
|
+
isEnabled?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Unique name of the feature flag
|
|
130
|
+
* @example "dark-mode"
|
|
131
|
+
*/
|
|
132
|
+
name: string;
|
|
133
|
+
}
|
|
69
134
|
export interface CreateOrganizationDto {
|
|
70
135
|
/**
|
|
71
136
|
* The name of the organization
|
|
@@ -118,7 +183,26 @@ export interface DemoRequestDto {
|
|
|
118
183
|
*/
|
|
119
184
|
notes?: string;
|
|
120
185
|
}
|
|
186
|
+
/** Environments where this flag is active */
|
|
187
|
+
export type Environment = "development" | "staging" | "production";
|
|
121
188
|
export type FeatureFlag = object;
|
|
189
|
+
export interface FeatureFlagConditionDto {
|
|
190
|
+
/** Rules for the condition */
|
|
191
|
+
rules?: ConditionRuleDto;
|
|
192
|
+
type: "percentage" | "user" | "time" | "geo" | "device" | "custom";
|
|
193
|
+
/**
|
|
194
|
+
* Percentage value (0-100) for percentage condition
|
|
195
|
+
* @min 0
|
|
196
|
+
* @max 100
|
|
197
|
+
*/
|
|
198
|
+
value?: number;
|
|
199
|
+
}
|
|
200
|
+
export interface FeatureFlagConditionsDto {
|
|
201
|
+
/** Array of conditions */
|
|
202
|
+
conditions: FeatureFlagConditionDto[];
|
|
203
|
+
/** Logical operator to combine conditions */
|
|
204
|
+
operator: "AND" | "OR";
|
|
205
|
+
}
|
|
122
206
|
export type FeatureFlagControllerCreateData = FeatureFlag;
|
|
123
207
|
export type FeatureFlagControllerDeleteData = any;
|
|
124
208
|
export type FeatureFlagControllerFindAllData = FeatureFlag[];
|
|
@@ -669,9 +753,9 @@ export declare namespace Api {
|
|
|
669
753
|
type RequestQuery = {};
|
|
670
754
|
type RequestBody = CreateFeatureFlagDto;
|
|
671
755
|
type RequestHeaders = {
|
|
756
|
+
"x-organization-id": string;
|
|
672
757
|
/** ID of the current project */
|
|
673
758
|
"x-project-id": string;
|
|
674
|
-
"x-organization-id": string;
|
|
675
759
|
};
|
|
676
760
|
type ResponseBody = FeatureFlagControllerCreateData;
|
|
677
761
|
}
|
|
@@ -1097,9 +1181,8 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
1097
1181
|
/**
|
|
1098
1182
|
* @title FlagPole API
|
|
1099
1183
|
* @version 1.0.0
|
|
1100
|
-
* @license Proprietary (https://useflagpole.dev/terms)
|
|
1101
1184
|
* @baseUrl http://localhost:5000
|
|
1102
|
-
* @contact
|
|
1185
|
+
* @contact
|
|
1103
1186
|
*
|
|
1104
1187
|
* API for managing feature flags and organizations
|
|
1105
1188
|
*/
|
|
@@ -95,9 +95,8 @@ exports.HttpClient = HttpClient;
|
|
|
95
95
|
/**
|
|
96
96
|
* @title FlagPole API
|
|
97
97
|
* @version 1.0.0
|
|
98
|
-
* @license Proprietary (https://useflagpole.dev/terms)
|
|
99
98
|
* @baseUrl http://localhost:5000
|
|
100
|
-
* @contact
|
|
99
|
+
* @contact
|
|
101
100
|
*
|
|
102
101
|
* API for managing feature flags and organizations
|
|
103
102
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flagpole/api-types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "TypeScript types for FlagPole API",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -41,4 +41,4 @@
|
|
|
41
41
|
"typescript": "^5.7.2",
|
|
42
42
|
"@types/node": "^22.9.4"
|
|
43
43
|
}
|
|
44
|
-
}
|
|
44
|
+
}
|