@shipeasy/openapi 2.5.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -94,14 +94,6 @@ ListI18nKeysResponse:
94
94
  anyOf:
95
95
  - type: string
96
96
  - type: "null"
97
- chunkId:
98
- description: Owning chunk (authoring grouping) id.
99
- type: string
100
- chunkName:
101
- description: Name of the owning chunk (authoring grouping), or `null` when it cannot be resolved.
102
- anyOf:
103
- - type: string
104
- - type: "null"
105
97
  updatedAt:
106
98
  description: ISO-8601 timestamp of the last edit.
107
99
  type: string
@@ -116,8 +108,6 @@ ListI18nKeysResponse:
116
108
  - variables
117
109
  - profileId
118
110
  - profileName
119
- - chunkId
120
- - chunkName
121
111
  - updatedAt
122
112
  - updatedBy
123
113
  additionalProperties: false
@@ -138,12 +128,6 @@ PushI18nKeysRequest:
138
128
  type: string
139
129
  format: uuid
140
130
  description: Target profile id to add keys to.
141
- chunk:
142
- description: Logical grouping the new keys are filed under. Defaults to `default`.
143
- type: string
144
- minLength: 1
145
- maxLength: 64
146
- default: default
147
131
  keys:
148
132
  type: array
149
133
  minItems: 1
@@ -174,12 +158,16 @@ PushI18nKeysRequest:
174
158
  - key
175
159
  - value
176
160
  additionalProperties: false
177
- description: Keys to add. Insert-only — existing keys are reported back as `skipped`.
161
+ description: Keys to add. Insert-only by default — existing keys are reported back as `skipped` (set `force` to overwrite them instead).
162
+ force:
163
+ type: boolean
164
+ default: false
165
+ description: Overwrite keys that already exist with the submitted value instead of skipping them. Overwritten keys come back as `updated`. Off by default so a routine push can never clobber live translations.
178
166
  required:
179
167
  - profile_id
180
168
  - keys
181
169
  additionalProperties: false
182
- description: "Body for `POST /api/admin/i18n/keys`. Insert-only: keys that already exist are never overwritten — use `PUT /keys/{id}` to change a value."
170
+ description: "Body for `POST /api/admin/i18n/keys`. Insert-only by default: keys that already exist are never overwritten — pass `force: true` to overwrite them in bulk, or use `PUT /keys/{id}` to change one value."
183
171
  PushI18nKeysResponse:
184
172
  type: object
185
173
  properties:
@@ -192,23 +180,30 @@ PushI18nKeysResponse:
192
180
  type: array
193
181
  items:
194
182
  type: string
195
- description: Key names that already existed and were left untouched.
183
+ description: Key names that already existed and were left untouched. Always empty when `force` was set — those key names come back under `updated` instead.
184
+ updated:
185
+ type: array
186
+ items:
187
+ type: string
188
+ description: Key names that already existed and were overwritten with the submitted value. Only ever non-empty when the push set `force`.
196
189
  pushed_count:
197
190
  type: number
198
191
  description: Number of keys inserted (== `added.length`).
199
192
  skipped_count:
200
193
  type: number
201
194
  description: Number of keys skipped (== `skipped.length`).
202
- chunk:
203
- description: The chunk the keys were filed under.
204
- type: string
195
+ updated_count:
196
+ type: number
197
+ description: Number of existing keys overwritten (== `updated.length`).
205
198
  required:
206
199
  - added
207
200
  - skipped
201
+ - updated
208
202
  - pushed_count
209
203
  - skipped_count
204
+ - updated_count
210
205
  additionalProperties: false
211
- description: Result of an insert-only key push.
206
+ description: Result of a key push — what was inserted, what was left alone, and (with `force`) what was overwritten.
212
207
  UpdateI18nKeyRequest:
213
208
  type: object
214
209
  properties:
@@ -249,12 +244,6 @@ UpsertI18nKeysRequest:
249
244
  type: string
250
245
  format: uuid
251
246
  description: Target profile id to upsert keys into.
252
- chunk:
253
- description: Logical grouping the keys are filed under. Defaults to `default`.
254
- type: string
255
- minLength: 1
256
- maxLength: 64
257
- default: default
258
247
  keys:
259
248
  type: array
260
249
  minItems: 1
@@ -297,12 +286,8 @@ UpsertI18nKeysResponse:
297
286
  upserted:
298
287
  type: number
299
288
  description: Number of keys written (inserted or overwritten).
300
- chunk:
301
- type: string
302
- description: The chunk the keys were filed under.
303
289
  required:
304
290
  - upserted
305
- - chunk
306
291
  additionalProperties: false
307
292
  description: Result of a bulk key upsert. The affected profile's KV snapshot is rebuilt (and the CDN purged) before this returns.
308
293
  ListI18nDraftsResponse:
@@ -465,12 +450,9 @@ UpsertI18nDraftKeyResponse:
465
450
  $ref: "./common.yaml#/OkResponse"
466
451
  PublishI18nProfileRequest:
467
452
  type: object
468
- properties:
469
- chunk:
470
- description: Optional chunk label to stamp on the audit log. Publishing is profile-wide regardless — the whole profile is snapshotted into one KV blob.
471
- type: string
453
+ properties: {}
472
454
  additionalProperties: false
473
- description: Body for `POST /api/admin/i18n/profiles/{profileId}/publish`. The `chunk` is an audit label only.
455
+ description: Body for `POST /api/admin/i18n/profiles/{profileId}/publish`. Publishing is profile-wide — the whole profile is snapshotted into one KV blob — so the body takes no options.
474
456
  PublishI18nProfileResponse:
475
457
  type: object
476
458
  properties:
@@ -481,11 +463,6 @@ PublishI18nProfileResponse:
481
463
  profile_id:
482
464
  type: string
483
465
  description: Profile that was published.
484
- chunk:
485
- anyOf:
486
- - type: string
487
- - type: "null"
488
- description: Audit chunk label, or `null` when none was given.
489
466
  published_at:
490
467
  type: string
491
468
  description: ISO-8601 timestamp of the publish.
@@ -514,7 +491,6 @@ PublishI18nProfileResponse:
514
491
  required:
515
492
  - ok
516
493
  - profile_id
517
- - chunk
518
494
  - published_at
519
495
  - version
520
496
  - key_count
package/spec/openapi.yaml CHANGED
@@ -228,14 +228,14 @@ tags:
228
228
  - name: i18n
229
229
  description: |-
230
230
  String Manager (i18n): the worker-safe REST surface — locale profiles, the
231
- insert-only key push, single-key overwrite, chunk publish, and the read-only
231
+ insert-only key push, single-key overwrite, profile publish, and the read-only
232
232
  key/draft listings.
233
233
 
234
234
  The fs/AST parts (scan, validate, install-loader, codemod) are NOT part of
235
235
  this API — they stay in the fs-having CLI/MCP.
236
236
  - name: Profiles
237
237
  parent: i18n
238
- description: Locale profiles (e.g. `en:prod`) — create, list, and publish a profile's chunks to the CDN.
238
+ description: Locale profiles (e.g. `en:prod`) — create, list, and publish a profile to the CDN.
239
239
  - name: Keys
240
240
  parent: i18n
241
241
  description: Translation keys — the insert-only push, single-key overwrite, and key listing.
@@ -5,7 +5,7 @@
5
5
  description: |-
6
6
  Returns every locale profile in the project (e.g. `en:prod`, `fr:prod`).
7
7
 
8
- **Use case:** Discover which locale profiles exist before pushing keys or publishing a chunk.
8
+ **Use case:** Discover which locale profiles exist before pushing keys or publishing.
9
9
  tags:
10
10
  - Profiles
11
11
  parameters:
@@ -173,11 +173,13 @@
173
173
  name: list
174
174
  post:
175
175
  operationId: pushI18nKeys
176
- summary: Push new i18n keys (insert-only)
176
+ summary: Push i18n keys (insert-only, or `force` to overwrite)
177
177
  description: |-
178
- Add NEW keys to a profile. Insert-only — existing keys are left untouched (overwrite one with `updateI18nKey`).
178
+ Add NEW keys to a profile. Insert-only by default — existing keys are left untouched and reported back as `skipped`.
179
179
 
180
- **Use case:** Seed newly-extracted keys without clobbering translations already in the profile.
180
+ Pass `force: true` to overwrite the existing ones in bulk with the submitted values: they come back as `updated` instead of `skipped`. Without `force` the only overwrite paths are `updateI18nKey` (one key) and the devtools-only `upsertI18nKeys`.
181
+
182
+ **Use case:** Seed newly-extracted keys without clobbering translations already in the profile — or re-push a whole source-language file with `force` after the copy changed.
181
183
  tags:
182
184
  - Keys
183
185
  parameters:
@@ -195,7 +197,7 @@
195
197
  value: Buy now
196
198
  responses:
197
199
  "201":
198
- description: Push new i18n keys (insert-only)
200
+ description: Push i18n keys (insert-only, or `force` to overwrite)
199
201
  content:
200
202
  application/json:
201
203
  schema:
@@ -204,8 +206,10 @@
204
206
  added:
205
207
  - checkout.cta
206
208
  skipped: []
209
+ updated: []
207
210
  pushed_count: 1
208
211
  skipped_count: 0
212
+ updated_count: 0
209
213
  "400":
210
214
  $ref: ../components/responses.yaml#/BadRequest
211
215
  "401":
@@ -259,7 +263,6 @@
259
263
  $ref: ../components/schemas/i18n.yaml#/UpsertI18nKeysResponse
260
264
  example:
261
265
  upserted: 1
262
- chunk: default
263
266
  "400":
264
267
  $ref: ../components/responses.yaml#/BadRequest
265
268
  "401":
@@ -726,7 +729,7 @@
726
729
  operationId: publishI18nProfile
727
730
  summary: Publish a profile live
728
731
  description: |-
729
- Publish a profile to the CDN — rebuild its KV snapshot + purge the edge. Publishing is PROFILE-WIDE: the whole profile is snapshotted into one KV blob, so the optional `chunk` in the body is an audit label only (it does not scope what ships).
732
+ Publish a profile to the CDN — rebuild its KV snapshot + purge the edge. Publishing is PROFILE-WIDE: the whole profile is snapshotted into one KV blob, so the body takes no options.
730
733
 
731
734
  **Use case:** Ship the latest translations live after pushing/updating keys.
732
735
  tags:
@@ -740,16 +743,15 @@
740
743
  schema:
741
744
  $ref: ../components/schemas/common.yaml#/ResourceId
742
745
  requestBody:
743
- required: true
746
+ required: false
744
747
  content:
745
748
  application/json:
746
749
  schema:
747
750
  $ref: ../components/schemas/i18n.yaml#/PublishI18nProfileRequest
748
- example:
749
- chunk: default
751
+ example: {}
750
752
  responses:
751
753
  "200":
752
- description: Publish a profile chunk
754
+ description: Publish a profile
753
755
  content:
754
756
  application/json:
755
757
  schema: