@productcraft/flags 0.3.0 → 0.5.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/README.md +35 -0
- package/api.md +110 -18
- package/dist/browser/{chunk-4LRAE3F3.js → chunk-OOX7EUCT.js} +114 -22
- package/dist/browser/chunk-OOX7EUCT.js.map +1 -0
- package/dist/browser/{chunk-72WU42RU.js → chunk-WUZAG2E3.js} +11 -4
- package/dist/browser/chunk-WUZAG2E3.js.map +1 -0
- package/dist/browser/{chunk-FXZVXQ75.cjs → chunk-XZK57G7L.cjs} +114 -22
- package/dist/browser/chunk-XZK57G7L.cjs.map +1 -0
- package/dist/browser/{chunk-4XCQBTYE.cjs → chunk-YM5K4NHA.cjs} +11 -4
- package/dist/browser/chunk-YM5K4NHA.cjs.map +1 -0
- package/dist/browser/index.cjs +8 -8
- package/dist/browser/index.js +2 -2
- package/dist/browser/management.cjs +2 -2
- package/dist/browser/management.js +1 -1
- package/dist/browser/testing.cjs +3 -3
- package/dist/browser/testing.cjs.map +1 -1
- package/dist/browser/testing.js +1 -1
- package/dist/browser/testing.js.map +1 -1
- package/dist/{chunk-TSRLPHJ5.js → chunk-CGVDMKEE.js} +12 -5
- package/dist/chunk-CGVDMKEE.js.map +1 -0
- package/dist/{chunk-QTDMUNLG.cjs → chunk-L3AOANTB.cjs} +12 -5
- package/dist/chunk-L3AOANTB.cjs.map +1 -0
- package/dist/{chunk-WI4EZXOV.cjs → chunk-RJIVAOBG.cjs} +114 -22
- package/dist/chunk-RJIVAOBG.cjs.map +1 -0
- package/dist/{chunk-2YRDLKNB.js → chunk-XNJ5OX4X.js} +114 -22
- package/dist/chunk-XNJ5OX4X.js.map +1 -0
- package/dist/{client-K2zALPGD.d.cts → client-BBiIKiGW.d.cts} +18 -14
- package/dist/{client-K2zALPGD.d.ts → client-BBiIKiGW.d.ts} +18 -14
- package/dist/{client-bVEJfS6_.d.cts → client-BWi7PASW.d.cts} +1091 -45
- package/dist/{client-bVEJfS6_.d.ts → client-BWi7PASW.d.ts} +1091 -45
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/management.cjs +2 -2
- package/dist/management.d.cts +1 -1
- package/dist/management.d.ts +1 -1
- package/dist/management.js +1 -1
- package/dist/testing.cjs +3 -3
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +3 -3
- package/dist/testing.d.ts +3 -3
- package/dist/testing.js +1 -1
- package/dist/testing.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +2 -2
- package/dist/browser/chunk-4LRAE3F3.js.map +0 -1
- package/dist/browser/chunk-4XCQBTYE.cjs.map +0 -1
- package/dist/browser/chunk-72WU42RU.js.map +0 -1
- package/dist/browser/chunk-FXZVXQ75.cjs.map +0 -1
- package/dist/chunk-2YRDLKNB.js.map +0 -1
- package/dist/chunk-QTDMUNLG.cjs.map +0 -1
- package/dist/chunk-TSRLPHJ5.js.map +0 -1
- package/dist/chunk-WI4EZXOV.cjs.map +0 -1
|
@@ -25,9 +25,11 @@ var ChangesResource = class extends APIResource {
|
|
|
25
25
|
*
|
|
26
26
|
* @param changeId - Id of the change.
|
|
27
27
|
* @param options - Per-request options.
|
|
28
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
28
29
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
29
30
|
* @throws {NotFoundError} 404 NOT_FOUND, CHANGE_NOT_FOUND: `CHANGE_NOT_FOUND`: no such change in this workspace (or it was pruned).
|
|
30
31
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
32
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
31
33
|
* @see GET /v1/workspaces/{workspace_id}/changes/{change_id}
|
|
32
34
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-changes-change-id
|
|
33
35
|
* @example
|
|
@@ -47,11 +49,13 @@ var ChangesResource = class extends APIResource {
|
|
|
47
49
|
* @param params - `Flags.ChangeRevertParams`.
|
|
48
50
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
49
51
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: `version` is missing (value and segment restores) or invalid.
|
|
52
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
50
53
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`). A restore needs the actions of the original edit too.
|
|
51
54
|
* @throws {NotFoundError} 404 NOT_FOUND, CHANGE_NOT_FOUND, SETTING_NOT_FOUND, SEGMENT_NOT_FOUND, ENVIRONMENT_NOT_FOUND: `CHANGE_NOT_FOUND`; `SETTING_NOT_FOUND`, `SEGMENT_NOT_FOUND` or `ENVIRONMENT_NOT_FOUND` when the entity was deleted since.
|
|
52
55
|
* @throws {ConflictError} 409 CONFLICT, VERSION_CONFLICT, KEY_ALREADY_EXISTS, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `VERSION_CONFLICT`: the entity changed since you read it (`details.current_version`), or the setting no longer matches this change. `KEY_ALREADY_EXISTS`: the restored key is taken. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).
|
|
53
56
|
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, REVERT_NOT_SUPPORTED, NOTHING_TO_RESTORE, INVALID_VALUE, INVALID_TARGETING, SEGMENT_NOT_FOUND, PREREQUISITE_NOT_FOUND, PREREQUISITE_TYPE_MISMATCH, CIRCULAR_PREREQUISITE, CONFIDENTIAL_LIST_NOT_EDITABLE, LIMIT_EXCEEDED, NOTE_REQUIRED, CONFIG_TOO_LARGE, OWNER_NOT_A_MEMBER: `REVERT_NOT_SUPPORTED`: this kind of change cannot be restored. `NOTHING_TO_RESTORE`: it already matches the version before this change. The restored or copied targeting is refused by the normal write checks: `INVALID_VALUE`, `INVALID_TARGETING`, `SEGMENT_NOT_FOUND` (a segment it used was deleted), `PREREQUISITE_NOT_FOUND`, `PREREQUISITE_TYPE_MISMATCH`, `CIRCULAR_PREREQUISITE`, `CONFIDENTIAL_LIST_NOT_EDITABLE`, `LIMIT_EXCEEDED`, `NOTE_REQUIRED` (the environment requires a `note`), `CONFIG_TOO_LARGE`, or `OWNER_NOT_A_MEMBER` (a restored owner left the workspace).
|
|
54
57
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
58
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
55
59
|
* @see POST /v1/workspaces/{workspace_id}/changes/{change_id}/revert
|
|
56
60
|
* @see https://productcraft.co/docs/flags/api-reference#post-v1-workspaces-workspace-id-changes-change-id-revert
|
|
57
61
|
* @example
|
|
@@ -74,9 +78,11 @@ var ConfigsEnvironmentsRevisionsResource = class extends APIResource {
|
|
|
74
78
|
* @param params - `Flags.ConfigEnvironmentRevisionListParams`.
|
|
75
79
|
* @param options - Per-request options.
|
|
76
80
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a bad cursor or `limit`.
|
|
81
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
77
82
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
78
83
|
* @throws {NotFoundError} 404 NOT_FOUND, CONFIG_NOT_FOUND, ENVIRONMENT_NOT_FOUND: `CONFIG_NOT_FOUND` or `ENVIRONMENT_NOT_FOUND`: no such config in this workspace, or the environment is not one of its project.
|
|
79
84
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
85
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
80
86
|
* @see GET /v1/workspaces/{workspace_id}/configs/{config_id}/environments/{environment_id}/revisions
|
|
81
87
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-configs-config-id-environments-environment-id-revisions
|
|
82
88
|
* @example
|
|
@@ -100,9 +106,11 @@ var ConfigsEnvironmentsRevisionsResource = class extends APIResource {
|
|
|
100
106
|
* @param revision - The revision number.
|
|
101
107
|
* @param options - Per-request options.
|
|
102
108
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: `revision` is not a positive integer.
|
|
109
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
103
110
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
104
111
|
* @throws {NotFoundError} 404 NOT_FOUND, CONFIG_NOT_FOUND, ENVIRONMENT_NOT_FOUND, REVISION_NOT_FOUND: `CONFIG_NOT_FOUND` or `ENVIRONMENT_NOT_FOUND`: no such config in this workspace, or the environment is not one of its project. `REVISION_NOT_FOUND`: no such revision (never published, or pruned).
|
|
105
112
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
113
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
106
114
|
* @see GET /v1/workspaces/{workspace_id}/configs/{config_id}/environments/{environment_id}/revisions/{revision}
|
|
107
115
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-configs-config-id-environments-environment-id-revisions-revision
|
|
108
116
|
* @example
|
|
@@ -123,9 +131,11 @@ var ConfigsEnvironmentsSdkKeysResource = class extends APIResource {
|
|
|
123
131
|
* @param configId - Id of the config.
|
|
124
132
|
* @param environmentId - Id of an environment of the same project.
|
|
125
133
|
* @param options - Per-request options.
|
|
134
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
126
135
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
127
136
|
* @throws {NotFoundError} 404 NOT_FOUND, CONFIG_NOT_FOUND, ENVIRONMENT_NOT_FOUND, SDK_KEY_NOT_FOUND: `CONFIG_NOT_FOUND` or `ENVIRONMENT_NOT_FOUND`: no such config in this workspace, or the environment is not one of its project. `SDK_KEY_NOT_FOUND`: there is no secondary key.
|
|
128
137
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
138
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
129
139
|
* @see DELETE /v1/workspaces/{workspace_id}/configs/{config_id}/environments/{environment_id}/sdk-keys/secondary
|
|
130
140
|
* @see https://productcraft.co/docs/flags/api-reference#delete-v1-workspaces-workspace-id-configs-config-id-environments-environment-id-sdk-keys-secondary
|
|
131
141
|
* @example
|
|
@@ -144,9 +154,11 @@ var ConfigsEnvironmentsSdkKeysResource = class extends APIResource {
|
|
|
144
154
|
* @param configId - Id of the config.
|
|
145
155
|
* @param environmentId - Id of an environment of the same project.
|
|
146
156
|
* @param options - Per-request options.
|
|
157
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
147
158
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
148
159
|
* @throws {NotFoundError} 404 NOT_FOUND, CONFIG_NOT_FOUND, ENVIRONMENT_NOT_FOUND: `CONFIG_NOT_FOUND` or `ENVIRONMENT_NOT_FOUND`: no such config in this workspace, or the environment is not one of its project.
|
|
149
160
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
161
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
150
162
|
* @see GET /v1/workspaces/{workspace_id}/configs/{config_id}/environments/{environment_id}/sdk-keys
|
|
151
163
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-configs-config-id-environments-environment-id-sdk-keys
|
|
152
164
|
* @example
|
|
@@ -165,9 +177,11 @@ var ConfigsEnvironmentsSdkKeysResource = class extends APIResource {
|
|
|
165
177
|
* @param configId - Id of the config.
|
|
166
178
|
* @param environmentId - Id of an environment of the same project.
|
|
167
179
|
* @param options - Per-request options.
|
|
180
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
168
181
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
169
182
|
* @throws {NotFoundError} 404 NOT_FOUND, CONFIG_NOT_FOUND, ENVIRONMENT_NOT_FOUND: `CONFIG_NOT_FOUND` or `ENVIRONMENT_NOT_FOUND`: no such config in this workspace, or the environment is not one of its project.
|
|
170
183
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
184
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
171
185
|
* @see POST /v1/workspaces/{workspace_id}/configs/{config_id}/environments/{environment_id}/sdk-keys/reveal
|
|
172
186
|
* @see https://productcraft.co/docs/flags/api-reference#post-v1-workspaces-workspace-id-configs-config-id-environments-environment-id-sdk-keys-reveal
|
|
173
187
|
* @example
|
|
@@ -188,10 +202,12 @@ var ConfigsEnvironmentsSdkKeysResource = class extends APIResource {
|
|
|
188
202
|
* @param params - `Flags.ConfigEnvironmentSdkKeyRotateParams`.
|
|
189
203
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
190
204
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: `grace_hours` is not an integer from 0 to 168, or `note` is too long.
|
|
205
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
191
206
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
192
207
|
* @throws {NotFoundError} 404 NOT_FOUND, CONFIG_NOT_FOUND, ENVIRONMENT_NOT_FOUND: `CONFIG_NOT_FOUND` or `ENVIRONMENT_NOT_FOUND`: no such config in this workspace, or the environment is not one of its project.
|
|
193
208
|
* @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).
|
|
194
209
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
210
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
195
211
|
* @see POST /v1/workspaces/{workspace_id}/configs/{config_id}/environments/{environment_id}/sdk-keys/rotate
|
|
196
212
|
* @see https://productcraft.co/docs/flags/api-reference#post-v1-workspaces-workspace-id-configs-config-id-environments-environment-id-sdk-keys-rotate
|
|
197
213
|
* @example
|
|
@@ -214,9 +230,11 @@ var ConfigsEnvironmentsValuesResource = class extends APIResource {
|
|
|
214
230
|
* @param params - `Flags.ConfigEnvironmentValueListParams`.
|
|
215
231
|
* @param options - Per-request options.
|
|
216
232
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a bad cursor, `limit` or `include`.
|
|
233
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
217
234
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
218
235
|
* @throws {NotFoundError} 404 NOT_FOUND, CONFIG_NOT_FOUND, ENVIRONMENT_NOT_FOUND: `CONFIG_NOT_FOUND` or `ENVIRONMENT_NOT_FOUND` (not an environment of the config's project).
|
|
219
236
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
237
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
220
238
|
* @see GET /v1/workspaces/{workspace_id}/configs/{config_id}/environments/{environment_id}/values
|
|
221
239
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-configs-config-id-environments-environment-id-values
|
|
222
240
|
* @example
|
|
@@ -254,11 +272,13 @@ var ConfigsEnvironmentsResource = class extends APIResource {
|
|
|
254
272
|
* @param params - `Flags.ConfigEnvironmentCopyParams`.
|
|
255
273
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
256
274
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: neither or both of `setting_ids` / `all_differing`, the source is the target, or a bad `versions` entry.
|
|
275
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
257
276
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`). Copies need `flags.value.update` on the environment and every setting, and `flags.protected.update` into a protected environment.
|
|
258
277
|
* @throws {NotFoundError} 404 NOT_FOUND, CONFIG_NOT_FOUND, ENVIRONMENT_NOT_FOUND, SETTING_NOT_FOUND: `CONFIG_NOT_FOUND`, `ENVIRONMENT_NOT_FOUND` (target or source is not of this project) or `SETTING_NOT_FOUND`.
|
|
259
278
|
* @throws {ConflictError} 409 CONFLICT, VERSION_CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `VERSION_CONFLICT`: a setting changed in the target since you read it, or has no entry in `versions` (`details.conflicts[]`: `setting_id`, `key`, `current_version`, `sent_version`); nothing was copied. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).
|
|
260
279
|
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, INVALID_VALUE, INVALID_TARGETING, SEGMENT_NOT_FOUND, PREREQUISITE_NOT_FOUND, PREREQUISITE_TYPE_MISMATCH, CIRCULAR_PREREQUISITE, CONFIDENTIAL_LIST_NOT_EDITABLE, LIMIT_EXCEEDED, NOTE_REQUIRED, CONFIG_TOO_LARGE, OWNER_NOT_A_MEMBER: The restored or copied targeting is refused by the normal write checks: `INVALID_VALUE`, `INVALID_TARGETING`, `SEGMENT_NOT_FOUND` (a segment it used was deleted), `PREREQUISITE_NOT_FOUND`, `PREREQUISITE_TYPE_MISMATCH`, `CIRCULAR_PREREQUISITE`, `CONFIDENTIAL_LIST_NOT_EDITABLE`, `LIMIT_EXCEEDED`, `NOTE_REQUIRED` (the environment requires a `note`), `CONFIG_TOO_LARGE`, or `OWNER_NOT_A_MEMBER` (a restored owner left the workspace).
|
|
261
280
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
281
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
262
282
|
* @see POST /v1/workspaces/{workspace_id}/configs/{config_id}/environments/{environment_id}/copy
|
|
263
283
|
* @see https://productcraft.co/docs/flags/api-reference#post-v1-workspaces-workspace-id-configs-config-id-environments-environment-id-copy
|
|
264
284
|
* @example
|
|
@@ -282,10 +302,12 @@ var ConfigsEnvironmentsResource = class extends APIResource {
|
|
|
282
302
|
* @param params - `Flags.ConfigEnvironmentEvaluateParams`.
|
|
283
303
|
* @param options - Per-request options.
|
|
284
304
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: `user` is not an object or null, it has more than 200 attributes, more than 200 `keys`, or a bad `revision`.
|
|
305
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
285
306
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
286
307
|
* @throws {NotFoundError} 404 NOT_FOUND, CONFIG_NOT_FOUND, ENVIRONMENT_NOT_FOUND, REVISION_NOT_FOUND: `CONFIG_NOT_FOUND` or `ENVIRONMENT_NOT_FOUND`: no such config in this workspace, or the environment is not one of its project. `REVISION_NOT_FOUND`: the requested revision was pruned or never published.
|
|
287
308
|
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, EVALUATION_BUDGET_EXCEEDED, INVALID_TARGETING: `EVALUATION_BUDGET_EXCEEDED`: the evaluation ran over 250 ms; ask for fewer keys. `INVALID_TARGETING`: the stored revision is not a config the engine accepts.
|
|
288
309
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
310
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
289
311
|
* @see POST /v1/workspaces/{workspace_id}/configs/{config_id}/environments/{environment_id}/evaluate
|
|
290
312
|
* @see https://productcraft.co/docs/flags/api-reference#post-v1-workspaces-workspace-id-configs-config-id-environments-environment-id-evaluate
|
|
291
313
|
* @example
|
|
@@ -307,12 +329,13 @@ var ConfigsSettingsResource = class extends APIResource {
|
|
|
307
329
|
* @param params - `Flags.ConfigSettingsCreateParams`.
|
|
308
330
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
309
331
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a field is missing or invalid.
|
|
332
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
310
333
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
311
334
|
* @throws {NotFoundError} 404 NOT_FOUND, CONFIG_NOT_FOUND: `CONFIG_NOT_FOUND`: no such config in this workspace.
|
|
312
335
|
* @throws {ConflictError} 409 CONFLICT, KEY_ALREADY_EXISTS, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `KEY_ALREADY_EXISTS`: the config already has a setting with this key. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).
|
|
313
336
|
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, INVALID_VALUE, LIMIT_EXCEEDED, OWNER_NOT_A_MEMBER, NOTE_REQUIRED, CONFIG_TOO_LARGE: `INVALID_VALUE`: `initial_value` does not match the type; `LIMIT_EXCEEDED`: the config has the maximum number of settings; `OWNER_NOT_A_MEMBER`: `owner_id` is not a workspace member; `NOTE_REQUIRED`. Publishing: `CONFIG_TOO_LARGE` (the rendered config would exceed 1 MiB; `details.size_bytes`, `max_bytes`) or `LIMIT_EXCEEDED` with `details.limit: comparison_values_per_config` (over 20,000 comparison values in the config); the write is not applied.
|
|
314
337
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
315
|
-
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE: `SERVICE_UNAVAILABLE`: the member lookup for `owner_id` is unavailable; retry.
|
|
338
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: `SERVICE_UNAVAILABLE`: the member lookup for `owner_id` is unavailable; retry. Or `MANAGEMENT_UNAVAILABLE`: the whole management API is temporarily unavailable, for example while its database is unreachable; wait `Retry-After` seconds and retry.
|
|
316
339
|
* @see POST /v1/workspaces/{workspace_id}/configs/{config_id}/settings
|
|
317
340
|
* @see https://productcraft.co/docs/flags/api-reference#post-v1-workspaces-workspace-id-configs-config-id-settings
|
|
318
341
|
* @example
|
|
@@ -332,9 +355,11 @@ var ConfigsSettingsResource = class extends APIResource {
|
|
|
332
355
|
* @param params - `Flags.ConfigSettingsListParams`.
|
|
333
356
|
* @param options - Per-request options.
|
|
334
357
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a bad filter, cursor or `limit`.
|
|
358
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
335
359
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
336
360
|
* @throws {NotFoundError} 404 NOT_FOUND, CONFIG_NOT_FOUND: `CONFIG_NOT_FOUND`: no such config in this workspace.
|
|
337
361
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
362
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
338
363
|
* @see GET /v1/workspaces/{workspace_id}/configs/{config_id}/settings
|
|
339
364
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-configs-config-id-settings
|
|
340
365
|
* @example
|
|
@@ -367,9 +392,11 @@ var ConfigsResource = class extends APIResource {
|
|
|
367
392
|
* @param params - `Flags.ConfigCompareParams`.
|
|
368
393
|
* @param options - Per-request options.
|
|
369
394
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: `environment_ids` is not 2-5 environment ids.
|
|
395
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
370
396
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
371
397
|
* @throws {NotFoundError} 404 NOT_FOUND, CONFIG_NOT_FOUND, ENVIRONMENT_NOT_FOUND: `CONFIG_NOT_FOUND` or `ENVIRONMENT_NOT_FOUND`.
|
|
372
398
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
399
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
373
400
|
* @see GET /v1/workspaces/{workspace_id}/configs/{config_id}/compare
|
|
374
401
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-configs-config-id-compare
|
|
375
402
|
* @example
|
|
@@ -392,9 +419,11 @@ var ConfigsResource = class extends APIResource {
|
|
|
392
419
|
* @param configId - Id of the config.
|
|
393
420
|
* @param params - `Flags.ConfigDeleteParams`.
|
|
394
421
|
* @param options - Per-request options.
|
|
422
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
395
423
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
396
424
|
* @throws {NotFoundError} 404 NOT_FOUND, CONFIG_NOT_FOUND: `CONFIG_NOT_FOUND`: no such config in this workspace.
|
|
397
425
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
426
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
398
427
|
* @see DELETE /v1/workspaces/{workspace_id}/configs/{config_id}
|
|
399
428
|
* @see https://productcraft.co/docs/flags/api-reference#delete-v1-workspaces-workspace-id-configs-config-id
|
|
400
429
|
* @example
|
|
@@ -410,9 +439,11 @@ var ConfigsResource = class extends APIResource {
|
|
|
410
439
|
*
|
|
411
440
|
* @param configId - Id of the config.
|
|
412
441
|
* @param options - Per-request options.
|
|
442
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
413
443
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
414
444
|
* @throws {NotFoundError} 404 NOT_FOUND, CONFIG_NOT_FOUND: `CONFIG_NOT_FOUND`: no such config in this workspace.
|
|
415
445
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
446
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
416
447
|
* @see GET /v1/workspaces/{workspace_id}/configs/{config_id}
|
|
417
448
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-configs-config-id
|
|
418
449
|
* @example
|
|
@@ -432,10 +463,12 @@ var ConfigsResource = class extends APIResource {
|
|
|
432
463
|
* @param params - `Flags.ConfigUpdateParams`.
|
|
433
464
|
* @param options - Per-request options.
|
|
434
465
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a field is invalid.
|
|
466
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
435
467
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
436
468
|
* @throws {NotFoundError} 404 NOT_FOUND, CONFIG_NOT_FOUND: `CONFIG_NOT_FOUND`: no such config in this workspace.
|
|
437
469
|
* @throws {ConflictError} 409 CONFLICT, KEY_ALREADY_EXISTS: `KEY_ALREADY_EXISTS`: the project already has a config with this key.
|
|
438
470
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
471
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
439
472
|
* @see PATCH /v1/workspaces/{workspace_id}/configs/{config_id}
|
|
440
473
|
* @see https://productcraft.co/docs/flags/api-reference#patch-v1-workspaces-workspace-id-configs-config-id
|
|
441
474
|
* @example
|
|
@@ -456,12 +489,14 @@ var ImportsResource = class extends APIResource {
|
|
|
456
489
|
* @param params - `Flags.ImportCreateParams`.
|
|
457
490
|
* @param options - Per-request options.
|
|
458
491
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a field is missing or invalid (`source` must be `configcat`, `configcat_product_id` a uuid).
|
|
492
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
459
493
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
460
494
|
* @throws {NotFoundError} 404 NOT_FOUND, IMPORT_SOURCE_NOT_FOUND: `IMPORT_SOURCE_NOT_FOUND`: the ConfigCat product does not exist, or the credentials cannot see it.
|
|
461
495
|
* @throws {ConflictError} 409 CONFLICT, KEY_ALREADY_EXISTS: `KEY_ALREADY_EXISTS`: a project with the target name already exists (pass `target_project_name`).
|
|
462
496
|
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, IMPORT_CREDENTIALS_INVALID, IMPORT_UNSUPPORTED, IMPORT_EXCEEDS_LIMITS: `IMPORT_CREDENTIALS_INVALID`: ConfigCat rejected the credentials. `IMPORT_UNSUPPORTED`: a real run while the report lists unsupported items (`details.items`); send `skip_unsupported: true` to import without them. `IMPORT_EXCEEDS_LIMITS`: the product is larger than the Flags limits, or reading it ran over the 120 s budget (`details`: `limit`, `max`, `current`). Nothing was imported.
|
|
463
497
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
464
498
|
* @throws {InternalServerError} 502 BAD_GATEWAY, IMPORT_SOURCE_UNAVAILABLE: `IMPORT_SOURCE_UNAVAILABLE`: ConfigCat answered 5xx, timed out or could not be reached.
|
|
499
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
465
500
|
* @see POST /v1/workspaces/{workspace_id}/imports
|
|
466
501
|
* @see https://productcraft.co/docs/flags/api-reference#post-v1-workspaces-workspace-id-imports
|
|
467
502
|
* @example
|
|
@@ -485,8 +520,10 @@ var LimitsResource = class extends APIResource {
|
|
|
485
520
|
* The preview limits that apply to this workspace and how much of the counted ones it uses.
|
|
486
521
|
*
|
|
487
522
|
* @param options - Per-request options.
|
|
523
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
488
524
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
489
525
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
526
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
490
527
|
* @see GET /v1/workspaces/{workspace_id}/limits
|
|
491
528
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-limits
|
|
492
529
|
* @example
|
|
@@ -508,9 +545,11 @@ var ProjectsChangesResource = class extends APIResource {
|
|
|
508
545
|
* @param params - `Flags.ProjectChangeExportParams`.
|
|
509
546
|
* @param options - Per-request options.
|
|
510
547
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a bad filter or `format`, or `since` is not before `until`.
|
|
548
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
511
549
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
512
550
|
* @throws {NotFoundError} 404 NOT_FOUND, PROJECT_NOT_FOUND: `PROJECT_NOT_FOUND`: no such project in this workspace.
|
|
513
551
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
552
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
514
553
|
* @see GET /v1/workspaces/{workspace_id}/projects/{project_id}/changes/export
|
|
515
554
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-projects-project-id-changes-export
|
|
516
555
|
* @example
|
|
@@ -531,9 +570,11 @@ var ProjectsChangesResource = class extends APIResource {
|
|
|
531
570
|
* @param params - `Flags.ProjectChangeListParams`.
|
|
532
571
|
* @param options - Per-request options.
|
|
533
572
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a bad filter, cursor or `limit`, or `since` is not before `until`.
|
|
573
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
534
574
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
535
575
|
* @throws {NotFoundError} 404 NOT_FOUND, PROJECT_NOT_FOUND: `PROJECT_NOT_FOUND`: no such project in this workspace.
|
|
536
576
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
577
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
537
578
|
* @see GET /v1/workspaces/{workspace_id}/projects/{project_id}/changes
|
|
538
579
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-projects-project-id-changes
|
|
539
580
|
* @example
|
|
@@ -558,11 +599,13 @@ var ProjectsConfigsResource = class extends APIResource {
|
|
|
558
599
|
* @param params - `Flags.ProjectConfigCreateParams`.
|
|
559
600
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
560
601
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a field is missing or invalid.
|
|
602
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
561
603
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
562
604
|
* @throws {NotFoundError} 404 NOT_FOUND, PROJECT_NOT_FOUND: `PROJECT_NOT_FOUND`: no such project in this workspace.
|
|
563
605
|
* @throws {ConflictError} 409 CONFLICT, KEY_ALREADY_EXISTS, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `KEY_ALREADY_EXISTS`: the project already has a config with this key. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).
|
|
564
606
|
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, LIMIT_EXCEEDED: `LIMIT_EXCEEDED`: the project already has the maximum number of configs (`details`: `limit`, `max`, `current`).
|
|
565
607
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
608
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
566
609
|
* @see POST /v1/workspaces/{workspace_id}/projects/{project_id}/configs
|
|
567
610
|
* @see https://productcraft.co/docs/flags/api-reference#post-v1-workspaces-workspace-id-projects-project-id-configs
|
|
568
611
|
* @example
|
|
@@ -582,9 +625,11 @@ var ProjectsConfigsResource = class extends APIResource {
|
|
|
582
625
|
* @param params - `Flags.ProjectConfigListParams`.
|
|
583
626
|
* @param options - Per-request options.
|
|
584
627
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a bad cursor or a `limit` outside 1-100.
|
|
628
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
585
629
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
586
630
|
* @throws {NotFoundError} 404 NOT_FOUND, PROJECT_NOT_FOUND: `PROJECT_NOT_FOUND`: no such project in this workspace.
|
|
587
631
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
632
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
588
633
|
* @see GET /v1/workspaces/{workspace_id}/projects/{project_id}/configs
|
|
589
634
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-projects-project-id-configs
|
|
590
635
|
* @example
|
|
@@ -609,11 +654,13 @@ var ProjectsEnvironmentsResource = class extends APIResource {
|
|
|
609
654
|
* @param params - `Flags.ProjectEnvironmentCreateParams`.
|
|
610
655
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
611
656
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a field is missing or invalid.
|
|
657
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
612
658
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
613
659
|
* @throws {NotFoundError} 404 NOT_FOUND, PROJECT_NOT_FOUND: `PROJECT_NOT_FOUND`: no such project in this workspace.
|
|
614
660
|
* @throws {ConflictError} 409 CONFLICT, KEY_ALREADY_EXISTS, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `KEY_ALREADY_EXISTS`: the project already has an environment with this key. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).
|
|
615
661
|
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, LIMIT_EXCEEDED: `LIMIT_EXCEEDED`: the project already has the maximum number of environments (`details`: `limit`, `max`, `current`).
|
|
616
662
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
663
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
617
664
|
* @see POST /v1/workspaces/{workspace_id}/projects/{project_id}/environments
|
|
618
665
|
* @see https://productcraft.co/docs/flags/api-reference#post-v1-workspaces-workspace-id-projects-project-id-environments
|
|
619
666
|
* @example
|
|
@@ -633,10 +680,12 @@ var ProjectsEnvironmentsResource = class extends APIResource {
|
|
|
633
680
|
* @param environmentId - Id of the environment.
|
|
634
681
|
* @param params - `Flags.ProjectEnvironmentDeleteParams`.
|
|
635
682
|
* @param options - Per-request options.
|
|
683
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
636
684
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
637
685
|
* @throws {NotFoundError} 404 NOT_FOUND, ENVIRONMENT_NOT_FOUND: `ENVIRONMENT_NOT_FOUND`: no such environment in this project.
|
|
638
686
|
* @throws {ConflictError} 409 CONFLICT, LAST_ENVIRONMENT: `LAST_ENVIRONMENT`: this is the project's only environment.
|
|
639
687
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
688
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
640
689
|
* @see DELETE /v1/workspaces/{workspace_id}/projects/{project_id}/environments/{environment_id}
|
|
641
690
|
* @see https://productcraft.co/docs/flags/api-reference#delete-v1-workspaces-workspace-id-projects-project-id-environments-environment-id
|
|
642
691
|
* @example
|
|
@@ -654,9 +703,11 @@ var ProjectsEnvironmentsResource = class extends APIResource {
|
|
|
654
703
|
*
|
|
655
704
|
* @param projectId - Id of the project.
|
|
656
705
|
* @param options - Per-request options.
|
|
706
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
657
707
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
658
708
|
* @throws {NotFoundError} 404 NOT_FOUND, PROJECT_NOT_FOUND: `PROJECT_NOT_FOUND`: no such project in this workspace.
|
|
659
709
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
710
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
660
711
|
* @see GET /v1/workspaces/{workspace_id}/projects/{project_id}/environments
|
|
661
712
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-projects-project-id-environments
|
|
662
713
|
* @example
|
|
@@ -673,9 +724,11 @@ var ProjectsEnvironmentsResource = class extends APIResource {
|
|
|
673
724
|
* @param projectId - Id of the project.
|
|
674
725
|
* @param environmentId - Id of the environment.
|
|
675
726
|
* @param options - Per-request options.
|
|
727
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
676
728
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
677
729
|
* @throws {NotFoundError} 404 NOT_FOUND, ENVIRONMENT_NOT_FOUND: `ENVIRONMENT_NOT_FOUND`: no such environment in this project.
|
|
678
730
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
731
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
679
732
|
* @see GET /v1/workspaces/{workspace_id}/projects/{project_id}/environments/{environment_id}
|
|
680
733
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-projects-project-id-environments-environment-id
|
|
681
734
|
* @example
|
|
@@ -696,9 +749,11 @@ var ProjectsEnvironmentsResource = class extends APIResource {
|
|
|
696
749
|
* @param params - `Flags.ProjectEnvironmentUpdateParams`.
|
|
697
750
|
* @param options - Per-request options.
|
|
698
751
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a field is invalid.
|
|
752
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
699
753
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
700
754
|
* @throws {NotFoundError} 404 NOT_FOUND, ENVIRONMENT_NOT_FOUND: `ENVIRONMENT_NOT_FOUND`: no such environment in this project.
|
|
701
755
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
756
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
702
757
|
* @see PATCH /v1/workspaces/{workspace_id}/projects/{project_id}/environments/{environment_id}
|
|
703
758
|
* @see https://productcraft.co/docs/flags/api-reference#patch-v1-workspaces-workspace-id-projects-project-id-environments-environment-id
|
|
704
759
|
* @example
|
|
@@ -720,11 +775,13 @@ var ProjectsSegmentsResource = class extends APIResource {
|
|
|
720
775
|
* @param params - `Flags.ProjectSegmentCreateParams`.
|
|
721
776
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
722
777
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a field is missing or invalid.
|
|
778
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
723
779
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
724
780
|
* @throws {NotFoundError} 404 NOT_FOUND, PROJECT_NOT_FOUND: `PROJECT_NOT_FOUND`: no such project in this workspace.
|
|
725
781
|
* @throws {ConflictError} 409 CONFLICT, KEY_ALREADY_EXISTS, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `KEY_ALREADY_EXISTS`: the project already has a segment with this key. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).
|
|
726
782
|
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, INVALID_TARGETING, LIMIT_EXCEEDED, CONFIDENTIAL_LIST_NOT_EDITABLE, NOTE_REQUIRED: The conditions are invalid; `details.errors` lists every problem (`param`, `code`, `message`) and `code` is the first one: `INVALID_TARGETING` (shape, comparator or value), `LIMIT_EXCEEDED` (conditions, values or segments per project), `CONFIDENTIAL_LIST_NOT_EDITABLE` (`values_add` / `values_remove` on a list sent pre-hashed), or `NOTE_REQUIRED` (the segment is used in an environment that requires a `note`).
|
|
727
783
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
784
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
728
785
|
* @see POST /v1/workspaces/{workspace_id}/projects/{project_id}/segments
|
|
729
786
|
* @see https://productcraft.co/docs/flags/api-reference#post-v1-workspaces-workspace-id-projects-project-id-segments
|
|
730
787
|
* @example
|
|
@@ -751,9 +808,11 @@ var ProjectsSegmentsResource = class extends APIResource {
|
|
|
751
808
|
* @param params - `Flags.ProjectSegmentListParams`.
|
|
752
809
|
* @param options - Per-request options.
|
|
753
810
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a bad cursor or `limit`.
|
|
811
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
754
812
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
755
813
|
* @throws {NotFoundError} 404 NOT_FOUND, PROJECT_NOT_FOUND: `PROJECT_NOT_FOUND`: no such project in this workspace.
|
|
756
814
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
815
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
757
816
|
* @see GET /v1/workspaces/{workspace_id}/projects/{project_id}/segments
|
|
758
817
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-projects-project-id-segments
|
|
759
818
|
* @example
|
|
@@ -793,10 +852,12 @@ var ProjectsResource = class extends APIResource {
|
|
|
793
852
|
* @param params - `Flags.ProjectCreateParams`.
|
|
794
853
|
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
795
854
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a field is missing or invalid.
|
|
855
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
796
856
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
797
857
|
* @throws {ConflictError} 409 CONFLICT, KEY_ALREADY_EXISTS, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `KEY_ALREADY_EXISTS`: another project has this name, or a key repeats in `environments` / `configs`. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).
|
|
798
858
|
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, LIMIT_EXCEEDED: `LIMIT_EXCEEDED`: the workspace already has the maximum number of projects (`details`: `limit`, `max`, `current`).
|
|
799
859
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
860
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
800
861
|
* @see POST /v1/workspaces/{workspace_id}/projects
|
|
801
862
|
* @see https://productcraft.co/docs/flags/api-reference#post-v1-workspaces-workspace-id-projects
|
|
802
863
|
* @example
|
|
@@ -815,10 +876,12 @@ var ProjectsResource = class extends APIResource {
|
|
|
815
876
|
* @param projectId - Id of the project.
|
|
816
877
|
* @param params - `Flags.ProjectDeleteParams`.
|
|
817
878
|
* @param options - Per-request options.
|
|
879
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
818
880
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
819
881
|
* @throws {NotFoundError} 404 NOT_FOUND, PROJECT_NOT_FOUND: `PROJECT_NOT_FOUND`: no such project in this workspace.
|
|
820
882
|
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, CONFIRMATION_REQUIRED: `CONFIRMATION_REQUIRED`: `confirm` is missing or is not the exact project name.
|
|
821
883
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
884
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
822
885
|
* @see DELETE /v1/workspaces/{workspace_id}/projects/{project_id}
|
|
823
886
|
* @see https://productcraft.co/docs/flags/api-reference#delete-v1-workspaces-workspace-id-projects-project-id
|
|
824
887
|
* @example
|
|
@@ -837,8 +900,10 @@ var ProjectsResource = class extends APIResource {
|
|
|
837
900
|
* @param params - `Flags.ProjectListParams`.
|
|
838
901
|
* @param options - Per-request options.
|
|
839
902
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a bad cursor or a `limit` outside 1-100.
|
|
903
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
840
904
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
841
905
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
906
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
842
907
|
* @see GET /v1/workspaces/{workspace_id}/projects
|
|
843
908
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-projects
|
|
844
909
|
* @example
|
|
@@ -859,9 +924,11 @@ var ProjectsResource = class extends APIResource {
|
|
|
859
924
|
*
|
|
860
925
|
* @param projectId - Id of the project.
|
|
861
926
|
* @param options - Per-request options.
|
|
927
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
862
928
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
863
929
|
* @throws {NotFoundError} 404 NOT_FOUND, PROJECT_NOT_FOUND: `PROJECT_NOT_FOUND`: no such project in this workspace.
|
|
864
930
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
931
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
865
932
|
* @see GET /v1/workspaces/{workspace_id}/projects/{project_id}
|
|
866
933
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-projects-project-id
|
|
867
934
|
* @example
|
|
@@ -881,10 +948,12 @@ var ProjectsResource = class extends APIResource {
|
|
|
881
948
|
* @param params - `Flags.ProjectUpdateParams`.
|
|
882
949
|
* @param options - Per-request options.
|
|
883
950
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a field is invalid.
|
|
951
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
884
952
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
885
953
|
* @throws {NotFoundError} 404 NOT_FOUND, PROJECT_NOT_FOUND: `PROJECT_NOT_FOUND`: no such project in this workspace.
|
|
886
954
|
* @throws {ConflictError} 409 CONFLICT, KEY_ALREADY_EXISTS: `KEY_ALREADY_EXISTS`: another project has this name.
|
|
887
955
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
956
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
888
957
|
* @see PATCH /v1/workspaces/{workspace_id}/projects/{project_id}
|
|
889
958
|
* @see https://productcraft.co/docs/flags/api-reference#patch-v1-workspaces-workspace-id-projects-project-id
|
|
890
959
|
* @example
|
|
@@ -905,10 +974,12 @@ var SegmentsResource = class extends APIResource {
|
|
|
905
974
|
* @param segmentId - Id of the segment.
|
|
906
975
|
* @param params - `Flags.SegmentDeleteParams`.
|
|
907
976
|
* @param options - Per-request options.
|
|
977
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
908
978
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
909
979
|
* @throws {NotFoundError} 404 NOT_FOUND, SEGMENT_NOT_FOUND: `SEGMENT_NOT_FOUND`: no such segment in this workspace.
|
|
910
980
|
* @throws {ConflictError} 409 CONFLICT, SEGMENT_IN_USE: `SEGMENT_IN_USE`: a rule uses it (`details.used_by` lists where).
|
|
911
981
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
982
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
912
983
|
* @see DELETE /v1/workspaces/{workspace_id}/segments/{segment_id}
|
|
913
984
|
* @see https://productcraft.co/docs/flags/api-reference#delete-v1-workspaces-workspace-id-segments-segment-id
|
|
914
985
|
* @example
|
|
@@ -926,9 +997,11 @@ var SegmentsResource = class extends APIResource {
|
|
|
926
997
|
*
|
|
927
998
|
* @param segmentId - Id of the segment.
|
|
928
999
|
* @param options - Per-request options.
|
|
1000
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
929
1001
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
930
1002
|
* @throws {NotFoundError} 404 NOT_FOUND, SEGMENT_NOT_FOUND: `SEGMENT_NOT_FOUND`: no such segment in this workspace.
|
|
931
1003
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1004
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
932
1005
|
* @see GET /v1/workspaces/{workspace_id}/segments/{segment_id}
|
|
933
1006
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-segments-segment-id
|
|
934
1007
|
* @example
|
|
@@ -946,10 +1019,12 @@ var SegmentsResource = class extends APIResource {
|
|
|
946
1019
|
*
|
|
947
1020
|
* @param segmentId - Id of the segment.
|
|
948
1021
|
* @param options - Per-request options.
|
|
1022
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
949
1023
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
950
1024
|
* @throws {NotFoundError} 404 NOT_FOUND, SEGMENT_NOT_FOUND: `SEGMENT_NOT_FOUND`: no such segment in this workspace.
|
|
951
1025
|
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, CONFIDENTIAL_LIST_NOT_EDITABLE: `CONFIDENTIAL_LIST_NOT_EDITABLE`: every confidential list was sent pre-hashed, so there is no cleartext.
|
|
952
1026
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1027
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
953
1028
|
* @see GET /v1/workspaces/{workspace_id}/segments/{segment_id}/confidential
|
|
954
1029
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-segments-segment-id-confidential
|
|
955
1030
|
* @example
|
|
@@ -963,33 +1038,24 @@ var SegmentsResource = class extends APIResource {
|
|
|
963
1038
|
/**
|
|
964
1039
|
* Update a segment
|
|
965
1040
|
*
|
|
966
|
-
* Key, name, description or conditions; only the fields you send change. Edit a confidential list with `list_id` plus `values_add` / `values_remove`. A segment used in a protected environment also needs `flags.protected.update` there.
|
|
1041
|
+
* Key, name, description or conditions; only the fields you send change. To add or remove values in one list condition without re-sending the others, send `condition_edits` (with the `version` you read). Edit a confidential list with `list_id` plus `values_add` / `values_remove`, or with `condition_edits`. A segment used in a protected environment also needs `flags.protected.update` there.
|
|
967
1042
|
*
|
|
968
1043
|
* @param segmentId - Id of the segment.
|
|
969
1044
|
* @param params - `Flags.SegmentUpdateParams`.
|
|
970
1045
|
* @param options - Per-request options.
|
|
971
|
-
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a field is invalid.
|
|
1046
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a field is invalid, an edit has no values, or both `conditions` and `condition_edits` were sent.
|
|
1047
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
972
1048
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`). A segment used in a protected environment also needs `flags.protected.update` on it.
|
|
973
1049
|
* @throws {NotFoundError} 404 NOT_FOUND, SEGMENT_NOT_FOUND: `SEGMENT_NOT_FOUND`: no such segment in this workspace.
|
|
974
1050
|
* @throws {ConflictError} 409 CONFLICT, KEY_ALREADY_EXISTS, VERSION_CONFLICT: `KEY_ALREADY_EXISTS`: the project already has a segment with this key; `VERSION_CONFLICT`: `version` is stale (`details.current_version`).
|
|
975
1051
|
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, INVALID_TARGETING, LIMIT_EXCEEDED, CONFIDENTIAL_LIST_NOT_EDITABLE, NOTE_REQUIRED, CONFIG_TOO_LARGE: The conditions are invalid; `details.errors` lists every problem (`param`, `code`, `message`) and `code` is the first one: `INVALID_TARGETING` (shape, comparator or value), `LIMIT_EXCEEDED` (conditions, values or segments per project), `CONFIDENTIAL_LIST_NOT_EDITABLE` (`values_add` / `values_remove` on a list sent pre-hashed), or `NOTE_REQUIRED` (the segment is used in an environment that requires a `note`). Publishing (every config that uses the segment): `CONFIG_TOO_LARGE` (a rendered config would exceed 1 MiB) or `LIMIT_EXCEEDED` with `details.limit: comparison_values_per_config`; the edit is not applied.
|
|
976
1052
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1053
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
977
1054
|
* @see PATCH /v1/workspaces/{workspace_id}/segments/{segment_id}
|
|
978
1055
|
* @see https://productcraft.co/docs/flags/api-reference#patch-v1-workspaces-workspace-id-segments-segment-id
|
|
979
1056
|
* @example
|
|
980
1057
|
* ```ts
|
|
981
|
-
* const segmentDetail = await flags.segments.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", {
|
|
982
|
-
* conditions: [
|
|
983
|
-
* {
|
|
984
|
-
* user: {
|
|
985
|
-
* attribute: "email",
|
|
986
|
-
* comparator: "ends_with_any_hashed",
|
|
987
|
-
* list_id: "3f0c6a3e-0f5e-4b8e-9d1a-2c7b9f1e8a10",
|
|
988
|
-
* values_add: ["@beta.test"],
|
|
989
|
-
* },
|
|
990
|
-
* },
|
|
991
|
-
* ],
|
|
992
|
-
* });
|
|
1058
|
+
* const segmentDetail = await flags.segments.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { condition_edits: [{ condition_index: 0, values_add: ["qa-bot@example.com"] }] });
|
|
993
1059
|
* ```
|
|
994
1060
|
*/
|
|
995
1061
|
update(segmentId, params, options) {
|
|
@@ -1007,11 +1073,13 @@ var SettingsValuesResource = class extends APIResource {
|
|
|
1007
1073
|
* @param params - `Flags.SettingsValueReplaceParams`.
|
|
1008
1074
|
* @param options - Per-request options.
|
|
1009
1075
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: `version` or `note` is missing or invalid.
|
|
1076
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
1010
1077
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`). Value writes need `flags.value.update` on the environment and the setting, plus `flags.protected.update` in a protected environment.
|
|
1011
1078
|
* @throws {NotFoundError} 404 NOT_FOUND, SETTING_NOT_FOUND, ENVIRONMENT_NOT_FOUND: `SETTING_NOT_FOUND` or `ENVIRONMENT_NOT_FOUND`.
|
|
1012
1079
|
* @throws {ConflictError} 409 CONFLICT, VERSION_CONFLICT: `VERSION_CONFLICT`: the value changed since you read it (`details.current_version`, `updated_at`, `updated_by`).
|
|
1013
1080
|
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, INVALID_VALUE, INVALID_TARGETING, SEGMENT_NOT_FOUND, CONFIDENTIAL_LIST_NOT_EDITABLE, PERCENTAGES_MUST_SUM_TO_100, PREREQUISITE_NOT_FOUND, PREREQUISITE_TYPE_MISMATCH, CIRCULAR_PREREQUISITE, LIMIT_EXCEEDED, NOTE_REQUIRED, CONFIG_TOO_LARGE: The value or targeting is invalid; `details.errors` lists every problem (`param`, `code`, `message`) and `code` is the first one: `INVALID_VALUE` (type mismatch, over 100 KB, json that does not parse), `INVALID_TARGETING` (shape, comparator or comparison value), `SEGMENT_NOT_FOUND` (a segment condition names no segment of this project), `CONFIDENTIAL_LIST_NOT_EDITABLE` (`values_add` / `values_remove` on a list sent pre-hashed), `PERCENTAGES_MUST_SUM_TO_100`, `PREREQUISITE_NOT_FOUND`, `PREREQUISITE_TYPE_MISMATCH`, `CIRCULAR_PREREQUISITE` (`details.cycle` lists the keys), `LIMIT_EXCEEDED` (rules, conditions, values or prerequisite depth), or `NOTE_REQUIRED` (the environment requires a `note`). Publishing: `CONFIG_TOO_LARGE` (the rendered config would exceed 1 MiB; `details.size_bytes`, `max_bytes`) or `LIMIT_EXCEEDED` with `details.limit: comparison_values_per_config` (over 20,000 comparison values in the config); the write is not applied.
|
|
1014
1081
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1082
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
1015
1083
|
* @see PUT /v1/workspaces/{workspace_id}/settings/{setting_id}/values/{environment_id}
|
|
1016
1084
|
* @see https://productcraft.co/docs/flags/api-reference#put-v1-workspaces-workspace-id-settings-setting-id-values-environment-id
|
|
1017
1085
|
* @example
|
|
@@ -1030,9 +1098,11 @@ var SettingsValuesResource = class extends APIResource {
|
|
|
1030
1098
|
* @param settingId - Id of the setting.
|
|
1031
1099
|
* @param environmentId - Id of an environment of the same project.
|
|
1032
1100
|
* @param options - Per-request options.
|
|
1101
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
1033
1102
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
1034
1103
|
* @throws {NotFoundError} 404 NOT_FOUND, SETTING_NOT_FOUND, ENVIRONMENT_NOT_FOUND: `SETTING_NOT_FOUND` or `ENVIRONMENT_NOT_FOUND`.
|
|
1035
1104
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1105
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
1036
1106
|
* @see GET /v1/workspaces/{workspace_id}/settings/{setting_id}/values/{environment_id}
|
|
1037
1107
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-settings-setting-id-values-environment-id
|
|
1038
1108
|
* @example
|
|
@@ -1051,10 +1121,12 @@ var SettingsValuesResource = class extends APIResource {
|
|
|
1051
1121
|
* @param settingId - Id of the setting.
|
|
1052
1122
|
* @param environmentId - Id of an environment of the same project.
|
|
1053
1123
|
* @param options - Per-request options.
|
|
1124
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
1054
1125
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
1055
1126
|
* @throws {NotFoundError} 404 NOT_FOUND, SETTING_NOT_FOUND, ENVIRONMENT_NOT_FOUND: `SETTING_NOT_FOUND` or `ENVIRONMENT_NOT_FOUND`.
|
|
1056
1127
|
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, CONFIDENTIAL_LIST_NOT_EDITABLE: `CONFIDENTIAL_LIST_NOT_EDITABLE`: every confidential list was sent pre-hashed, so there is no cleartext.
|
|
1057
1128
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1129
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
1058
1130
|
* @see GET /v1/workspaces/{workspace_id}/settings/{setting_id}/values/{environment_id}/confidential
|
|
1059
1131
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-settings-setting-id-values-environment-id-confidential
|
|
1060
1132
|
* @example
|
|
@@ -1068,18 +1140,20 @@ var SettingsValuesResource = class extends APIResource {
|
|
|
1068
1140
|
/**
|
|
1069
1141
|
* Update a value
|
|
1070
1142
|
*
|
|
1071
|
-
* The quick edits: `value` (the toggle), `percentage_attribute`, and `clear_rules: true` to drop every rule and split so `value` is served to everyone (the kill switch). Send the `version` you read.
|
|
1143
|
+
* The quick edits: `value` (the toggle), `percentage_attribute`, `rule_edits` to add or remove values in a list condition of an existing rule (a tester, a QA account) without re-sending the other rules, and `clear_rules: true` to drop every rule and split so `value` is served to everyone (the kill switch). Send the `version` you read. A protected environment needs `flags.protected.update`; one change and one revision per request, none when nothing changed.
|
|
1072
1144
|
*
|
|
1073
1145
|
* @param settingId - Id of the setting.
|
|
1074
1146
|
* @param environmentId - Id of an environment of the same project.
|
|
1075
1147
|
* @param params - `Flags.SettingsValueUpdateParams`.
|
|
1076
1148
|
* @param options - Per-request options.
|
|
1077
|
-
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: nothing to change,
|
|
1149
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: nothing to change, `version` is missing, an edit has no values, or `rule_edits` sent with `clear_rules`.
|
|
1150
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
1078
1151
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`). Value writes need `flags.value.update` on the environment and the setting, plus `flags.protected.update` in a protected environment.
|
|
1079
1152
|
* @throws {NotFoundError} 404 NOT_FOUND, SETTING_NOT_FOUND, ENVIRONMENT_NOT_FOUND: `SETTING_NOT_FOUND` or `ENVIRONMENT_NOT_FOUND`.
|
|
1080
1153
|
* @throws {ConflictError} 409 CONFLICT, VERSION_CONFLICT: `VERSION_CONFLICT`: the value changed since you read it (`details.current_version`, `updated_at`, `updated_by`).
|
|
1081
1154
|
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, INVALID_VALUE, INVALID_TARGETING, NOTE_REQUIRED, CONFIG_TOO_LARGE, LIMIT_EXCEEDED: `INVALID_VALUE`, `INVALID_TARGETING` or `NOTE_REQUIRED`; `details.errors` lists each problem. Publishing: `CONFIG_TOO_LARGE` (the rendered config would exceed 1 MiB; `details.size_bytes`, `max_bytes`) or `LIMIT_EXCEEDED` with `details.limit: comparison_values_per_config` (over 20,000 comparison values in the config); the write is not applied.
|
|
1082
1155
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1156
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
1083
1157
|
* @see PATCH /v1/workspaces/{workspace_id}/settings/{setting_id}/values/{environment_id}
|
|
1084
1158
|
* @see https://productcraft.co/docs/flags/api-reference#patch-v1-workspaces-workspace-id-settings-setting-id-values-environment-id
|
|
1085
1159
|
* @example
|
|
@@ -1104,10 +1178,12 @@ var SettingsResource = class extends APIResource {
|
|
|
1104
1178
|
* @param settingId - Id of the setting.
|
|
1105
1179
|
* @param params - `Flags.SettingsDeleteParams`.
|
|
1106
1180
|
* @param options - Per-request options.
|
|
1181
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
1107
1182
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
1108
1183
|
* @throws {NotFoundError} 404 NOT_FOUND, SETTING_NOT_FOUND: `SETTING_NOT_FOUND`: no such setting in this workspace.
|
|
1109
1184
|
* @throws {ConflictError} 409 CONFLICT, SETTING_IN_USE: `SETTING_IN_USE`: another setting uses it as a prerequisite (`details.used_by`).
|
|
1110
1185
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1186
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
1111
1187
|
* @see DELETE /v1/workspaces/{workspace_id}/settings/{setting_id}
|
|
1112
1188
|
* @see https://productcraft.co/docs/flags/api-reference#delete-v1-workspaces-workspace-id-settings-setting-id
|
|
1113
1189
|
* @example
|
|
@@ -1125,9 +1201,11 @@ var SettingsResource = class extends APIResource {
|
|
|
1125
1201
|
*
|
|
1126
1202
|
* @param settingId - Id of the setting.
|
|
1127
1203
|
* @param options - Per-request options.
|
|
1204
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
1128
1205
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
1129
1206
|
* @throws {NotFoundError} 404 NOT_FOUND, SETTING_NOT_FOUND: `SETTING_NOT_FOUND`: no such setting in this workspace.
|
|
1130
1207
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1208
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
1131
1209
|
* @see GET /v1/workspaces/{workspace_id}/settings/{setting_id}
|
|
1132
1210
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-settings-setting-id
|
|
1133
1211
|
* @example
|
|
@@ -1147,12 +1225,13 @@ var SettingsResource = class extends APIResource {
|
|
|
1147
1225
|
* @param params - `Flags.SettingsUpdateParams`.
|
|
1148
1226
|
* @param options - Per-request options.
|
|
1149
1227
|
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a field is invalid.
|
|
1228
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
1150
1229
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
1151
1230
|
* @throws {NotFoundError} 404 NOT_FOUND, SETTING_NOT_FOUND: `SETTING_NOT_FOUND`: no such setting in this workspace.
|
|
1152
1231
|
* @throws {ConflictError} 409 CONFLICT, KEY_ALREADY_EXISTS: `KEY_ALREADY_EXISTS`: the config already has a setting with this key.
|
|
1153
1232
|
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, SETTING_TYPE_IMMUTABLE, OWNER_NOT_A_MEMBER, CONFIG_TOO_LARGE, LIMIT_EXCEEDED: `SETTING_TYPE_IMMUTABLE`: `type` differs from the current one; `OWNER_NOT_A_MEMBER`: `owner_id` is not a workspace member. Publishing: `CONFIG_TOO_LARGE` (the rendered config would exceed 1 MiB; `details.size_bytes`, `max_bytes`) or `LIMIT_EXCEEDED` with `details.limit: comparison_values_per_config` (over 20,000 comparison values in the config); the write is not applied.
|
|
1154
1233
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1155
|
-
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE: `SERVICE_UNAVAILABLE`: the member lookup for `owner_id` is unavailable; retry.
|
|
1234
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: `SERVICE_UNAVAILABLE`: the member lookup for `owner_id` is unavailable; retry. Or `MANAGEMENT_UNAVAILABLE`: the whole management API is temporarily unavailable, for example while its database is unreachable; wait `Retry-After` seconds and retry.
|
|
1156
1235
|
* @see PATCH /v1/workspaces/{workspace_id}/settings/{setting_id}
|
|
1157
1236
|
* @see https://productcraft.co/docs/flags/api-reference#patch-v1-workspaces-workspace-id-settings-setting-id
|
|
1158
1237
|
* @example
|
|
@@ -1171,8 +1250,10 @@ var StatsResource = class extends APIResource {
|
|
|
1171
1250
|
* Counts for the workspace: projects, configs, flags and settings, segments, changes in the last 7 days and when the latest change was made, plus each project’s history usage against the retention caps (50,000 rows or 200 MiB per project; `warning` from 80%). Counts only: no keys, values or rules.
|
|
1172
1251
|
*
|
|
1173
1252
|
* @param options - Per-request options.
|
|
1253
|
+
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token (`UNAUTHORIZED`). Send a workspace API key or a platform session token as `Authorization: Bearer <token>`.
|
|
1174
1254
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action this route needs (`message` names it), or the workspace has not enabled Flags (`SERVICE_NOT_ENABLED`).
|
|
1175
1255
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1256
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
1176
1257
|
* @see GET /v1/workspaces/{workspace_id}/stats
|
|
1177
1258
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-stats
|
|
1178
1259
|
* @example
|
|
@@ -1198,6 +1279,7 @@ var WebhooksEndpointsResource = class extends APIResource {
|
|
|
1198
1279
|
* @throws {ConflictError} 409 CONFLICT, WEBHOOK_ENDPOINT_LIMIT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Already 10 endpoints (`WEBHOOK_ENDPOINT_LIMIT`), or Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).
|
|
1199
1280
|
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY: The URL points at a private, loopback or internal address.
|
|
1200
1281
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1282
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
1201
1283
|
* @see POST /v1/workspaces/{workspace_id}/webhooks/endpoints
|
|
1202
1284
|
* @see https://productcraft.co/docs/flags/api-reference#post-v1-workspaces-workspace-id-webhooks-endpoints
|
|
1203
1285
|
* @example
|
|
@@ -1220,6 +1302,7 @@ var WebhooksEndpointsResource = class extends APIResource {
|
|
|
1220
1302
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: Caller lacks `flags.webhook.read` (reads) or `flags.webhook.manage` (changes, Send test, replay), or Flags is not enabled for the workspace (`SERVICE_NOT_ENABLED`).
|
|
1221
1303
|
* @throws {NotFoundError} 404 NOT_FOUND, WEBHOOK_ENDPOINT_NOT_FOUND: No such endpoint here (`WEBHOOK_ENDPOINT_NOT_FOUND`).
|
|
1222
1304
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1305
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
1223
1306
|
* @see DELETE /v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}
|
|
1224
1307
|
* @see https://productcraft.co/docs/flags/api-reference#delete-v1-workspaces-workspace-id-webhooks-endpoints-endpoint-id
|
|
1225
1308
|
* @example
|
|
@@ -1240,6 +1323,7 @@ var WebhooksEndpointsResource = class extends APIResource {
|
|
|
1240
1323
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
1241
1324
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: Caller lacks `flags.webhook.read` (reads) or `flags.webhook.manage` (changes, Send test, replay), or Flags is not enabled for the workspace (`SERVICE_NOT_ENABLED`).
|
|
1242
1325
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1326
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
1243
1327
|
* @see GET /v1/workspaces/{workspace_id}/webhooks/endpoints
|
|
1244
1328
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-webhooks-endpoints
|
|
1245
1329
|
* @example
|
|
@@ -1264,6 +1348,7 @@ var WebhooksEndpointsResource = class extends APIResource {
|
|
|
1264
1348
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: Caller lacks `flags.webhook.read` (reads) or `flags.webhook.manage` (changes, Send test, replay), or Flags is not enabled for the workspace (`SERVICE_NOT_ENABLED`).
|
|
1265
1349
|
* @throws {NotFoundError} 404 NOT_FOUND, WEBHOOK_ENDPOINT_NOT_FOUND: No such endpoint here (`WEBHOOK_ENDPOINT_NOT_FOUND`).
|
|
1266
1350
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1351
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
1267
1352
|
* @see GET /v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}
|
|
1268
1353
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-webhooks-endpoints-endpoint-id
|
|
1269
1354
|
* @example
|
|
@@ -1288,6 +1373,7 @@ var WebhooksEndpointsResource = class extends APIResource {
|
|
|
1288
1373
|
* @throws {NotFoundError} 404 NOT_FOUND, WEBHOOK_ENDPOINT_NOT_FOUND: No such endpoint here (`WEBHOOK_ENDPOINT_NOT_FOUND`).
|
|
1289
1374
|
* @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).
|
|
1290
1375
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1376
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
1291
1377
|
* @see POST /v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}/rotate-secret
|
|
1292
1378
|
* @see https://productcraft.co/docs/flags/api-reference#post-v1-workspaces-workspace-id-webhooks-endpoints-endpoint-id-rotate-secret
|
|
1293
1379
|
* @example
|
|
@@ -1312,6 +1398,7 @@ var WebhooksEndpointsResource = class extends APIResource {
|
|
|
1312
1398
|
* @throws {NotFoundError} 404 NOT_FOUND, WEBHOOK_ENDPOINT_NOT_FOUND: No such endpoint here (`WEBHOOK_ENDPOINT_NOT_FOUND`).
|
|
1313
1399
|
* @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).
|
|
1314
1400
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1401
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
1315
1402
|
* @see POST /v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}/test
|
|
1316
1403
|
* @see https://productcraft.co/docs/flags/api-reference#post-v1-workspaces-workspace-id-webhooks-endpoints-endpoint-id-test
|
|
1317
1404
|
* @example
|
|
@@ -1337,6 +1424,7 @@ var WebhooksEndpointsResource = class extends APIResource {
|
|
|
1337
1424
|
* @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).
|
|
1338
1425
|
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY: The new URL points at a private, loopback or internal address.
|
|
1339
1426
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1427
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
1340
1428
|
* @see PATCH /v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}
|
|
1341
1429
|
* @see https://productcraft.co/docs/flags/api-reference#patch-v1-workspaces-workspace-id-webhooks-endpoints-endpoint-id
|
|
1342
1430
|
* @example
|
|
@@ -1358,6 +1446,7 @@ var WebhooksEventTypesResource = class extends APIResource {
|
|
|
1358
1446
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
1359
1447
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: Caller lacks `flags.webhook.read` (reads) or `flags.webhook.manage` (changes, Send test, replay), or Flags is not enabled for the workspace (`SERVICE_NOT_ENABLED`).
|
|
1360
1448
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1449
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
1361
1450
|
* @see GET /v1/workspaces/{workspace_id}/webhooks/event-types
|
|
1362
1451
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-webhooks-event-types
|
|
1363
1452
|
* @example
|
|
@@ -1381,6 +1470,7 @@ var WebhooksEventsResource = class extends APIResource {
|
|
|
1381
1470
|
* @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
|
|
1382
1471
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: Caller lacks `flags.webhook.read` (reads) or `flags.webhook.manage` (changes, Send test, replay), or Flags is not enabled for the workspace (`SERVICE_NOT_ENABLED`).
|
|
1383
1472
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1473
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
1384
1474
|
* @see GET /v1/workspaces/{workspace_id}/webhooks/events
|
|
1385
1475
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-webhooks-events
|
|
1386
1476
|
* @example
|
|
@@ -1408,6 +1498,7 @@ var WebhooksEventsResource = class extends APIResource {
|
|
|
1408
1498
|
* @throws {NotFoundError} 404 NOT_FOUND, WEBHOOK_EVENT_NOT_FOUND, WEBHOOK_ENDPOINT_NOT_FOUND: No such event here (`WEBHOOK_EVENT_NOT_FOUND`); events are kept for 30 days. Or No such endpoint here (`WEBHOOK_ENDPOINT_NOT_FOUND`).
|
|
1409
1499
|
* @throws {ConflictError} 409 CONFLICT, WEBHOOK_ENDPOINT_NOT_SUBSCRIBED, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `endpoint_id` is switched off or does not receive this event type (`WEBHOOK_ENDPOINT_NOT_SUBSCRIBED`), or Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).
|
|
1410
1500
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1501
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
1411
1502
|
* @see POST /v1/workspaces/{workspace_id}/webhooks/events/{event_id}/replay
|
|
1412
1503
|
* @see https://productcraft.co/docs/flags/api-reference#post-v1-workspaces-workspace-id-webhooks-events-event-id-replay
|
|
1413
1504
|
* @example
|
|
@@ -1430,6 +1521,7 @@ var WebhooksEventsResource = class extends APIResource {
|
|
|
1430
1521
|
* @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: Caller lacks `flags.webhook.read` (reads) or `flags.webhook.manage` (changes, Send test, replay), or Flags is not enabled for the workspace (`SERVICE_NOT_ENABLED`).
|
|
1431
1522
|
* @throws {NotFoundError} 404 NOT_FOUND, WEBHOOK_EVENT_NOT_FOUND: No such event here (`WEBHOOK_EVENT_NOT_FOUND`); events are kept for 30 days.
|
|
1432
1523
|
* @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
|
|
1524
|
+
* @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, MANAGEMENT_UNAVAILABLE: The management API is temporarily unavailable (`MANAGEMENT_UNAVAILABLE`), for example while its database is unreachable. Wait `Retry-After` seconds and retry; SDK config delivery keeps serving.
|
|
1433
1525
|
* @see GET /v1/workspaces/{workspace_id}/webhooks/events/{event_id}
|
|
1434
1526
|
* @see https://productcraft.co/docs/flags/api-reference#get-v1-workspaces-workspace-id-webhooks-events-event-id
|
|
1435
1527
|
* @example
|
|
@@ -1520,7 +1612,7 @@ var FlagsChangeActorType = { values: ["user", "api_key", "system"] };
|
|
|
1520
1612
|
var FlagsEnvironmentPreset = { values: ["dev_prod", "dev_staging_prod"] };
|
|
1521
1613
|
var FlagsEvaluationErrorCode = { values: ["FLAG_NOT_FOUND", "TYPE_MISMATCH", "PREREQUISITE_CYCLE", "PREREQUISITE_NOT_FOUND", "PREREQUISITE_DEPTH", "GENERAL"] };
|
|
1522
1614
|
var FlagsEvaluationReason = { values: ["STATIC", "TARGETING_MATCH", "SPLIT", "DEFAULT", "ERROR"] };
|
|
1523
|
-
var FlagsEvaluationWarningCode = { values: ["missing_user", "missing_attribute", "invalid_attribute", "unknown_comparator", "missing_percentage_attribute"] };
|
|
1615
|
+
var FlagsEvaluationWarningCode = { values: ["missing_user", "missing_attribute", "invalid_attribute", "unknown_comparator", "missing_percentage_attribute", "iso_date_converted"] };
|
|
1524
1616
|
var FlagsHistoryExportFormat = { values: ["csv", "json"] };
|
|
1525
1617
|
var FlagsImportMappedType = { values: ["environment", "config", "segment", "setting"] };
|
|
1526
1618
|
var FlagsImportSource = { values: ["configcat"] };
|
|
@@ -1541,7 +1633,7 @@ var WebhookEventStatus = { values: ["pending", "delivered", "failed", "not_sent"
|
|
|
1541
1633
|
var WebhookEventType = { values: ["config.published", "sdk_key.rotated"] };
|
|
1542
1634
|
|
|
1543
1635
|
// src/_generated/client.ts
|
|
1544
|
-
var VERSION = "0.
|
|
1636
|
+
var VERSION = "0.5.0" ;
|
|
1545
1637
|
var Flags = class extends FlagsResources {
|
|
1546
1638
|
constructor(options = {}) {
|
|
1547
1639
|
super(new APIClient(options, PC_BASE_URL.flags, { name: "flags", version: VERSION }));
|
|
@@ -1580,5 +1672,5 @@ var Flags = class extends FlagsResources {
|
|
|
1580
1672
|
})(Flags || (Flags = {}));
|
|
1581
1673
|
|
|
1582
1674
|
export { Flags };
|
|
1583
|
-
//# sourceMappingURL=chunk-
|
|
1584
|
-
//# sourceMappingURL=chunk-
|
|
1675
|
+
//# sourceMappingURL=chunk-OOX7EUCT.js.map
|
|
1676
|
+
//# sourceMappingURL=chunk-OOX7EUCT.js.map
|