@flagpole/api-types 1.0.10 → 1.0.13
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 +93 -7
- package/lib/flagpole-api-types.js +1 -2
- package/package.json +1 -1
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.12
|
|
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[];
|
|
@@ -245,7 +329,6 @@ export interface StripeProductsResponseDto {
|
|
|
245
329
|
products: ProductWithFeaturesDto[];
|
|
246
330
|
}
|
|
247
331
|
export type SubmitFeedbackDto = object;
|
|
248
|
-
export type UpdateProfileDto = object;
|
|
249
332
|
export interface UpdateProjectDto {
|
|
250
333
|
/**
|
|
251
334
|
* Optional project description
|
|
@@ -258,6 +341,10 @@ export interface UpdateProjectDto {
|
|
|
258
341
|
*/
|
|
259
342
|
name: string;
|
|
260
343
|
}
|
|
344
|
+
export interface UpdateUserProfileDto {
|
|
345
|
+
firstName?: string;
|
|
346
|
+
lastName?: string;
|
|
347
|
+
}
|
|
261
348
|
export type UpdateUserProjectsDto = object;
|
|
262
349
|
export type UpdateUserRoleDto = object;
|
|
263
350
|
export type UsersControllerDeleteUserData = any;
|
|
@@ -499,7 +586,7 @@ export declare namespace Api {
|
|
|
499
586
|
namespace UsersControllerUpdateProfile {
|
|
500
587
|
type RequestParams = {};
|
|
501
588
|
type RequestQuery = {};
|
|
502
|
-
type RequestBody =
|
|
589
|
+
type RequestBody = UpdateUserProfileDto;
|
|
503
590
|
type RequestHeaders = {};
|
|
504
591
|
type ResponseBody = UsersControllerUpdateProfileData;
|
|
505
592
|
}
|
|
@@ -669,9 +756,9 @@ export declare namespace Api {
|
|
|
669
756
|
type RequestQuery = {};
|
|
670
757
|
type RequestBody = CreateFeatureFlagDto;
|
|
671
758
|
type RequestHeaders = {
|
|
759
|
+
"x-organization-id": string;
|
|
672
760
|
/** ID of the current project */
|
|
673
761
|
"x-project-id": string;
|
|
674
|
-
"x-organization-id": string;
|
|
675
762
|
};
|
|
676
763
|
type ResponseBody = FeatureFlagControllerCreateData;
|
|
677
764
|
}
|
|
@@ -1097,9 +1184,8 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
1097
1184
|
/**
|
|
1098
1185
|
* @title FlagPole API
|
|
1099
1186
|
* @version 1.0.0
|
|
1100
|
-
* @license Proprietary (https://useflagpole.dev/terms)
|
|
1101
1187
|
* @baseUrl http://localhost:5000
|
|
1102
|
-
* @contact
|
|
1188
|
+
* @contact
|
|
1103
1189
|
*
|
|
1104
1190
|
* API for managing feature flags and organizations
|
|
1105
1191
|
*/
|
|
@@ -1252,7 +1338,7 @@ export declare class Api<SecurityDataType extends unknown> {
|
|
|
1252
1338
|
* @request PATCH:/api/users/profile
|
|
1253
1339
|
* @response `200` `UsersControllerUpdateProfileData`
|
|
1254
1340
|
*/
|
|
1255
|
-
usersControllerUpdateProfile: (data:
|
|
1341
|
+
usersControllerUpdateProfile: (data: UpdateUserProfileDto, params?: RequestParams) => Promise<AxiosResponse<any, any>>;
|
|
1256
1342
|
/**
|
|
1257
1343
|
* No description
|
|
1258
1344
|
*
|
|
@@ -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
|
*/
|