@paragraphcms/client 1.6.0 → 2.1.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/dist/client.js CHANGED
@@ -1,10 +1,15 @@
1
1
  import { ParagraphApiError, ParagraphClientError, } from "./errors.js";
2
2
  import { RequestRateLimiter } from "./rate-limiter.js";
3
- const DEFAULT_BASE_URL = "https://api.paragraphcms.com/v1";
3
+ const API_BASE_URL = "https://api.paragraphcms.com/v1";
4
4
  const DEFAULT_REQUESTS_PER_SECOND = 5;
5
5
  const DEFAULT_RATE_LIMIT_RETRIES = 2;
6
6
  const DEFAULT_RATE_LIMIT_RETRY_DELAY_MS = 1000;
7
7
  const LOOKUP_PAGE_SIZE = 100;
8
+ const PRESERVED_TRANSFORM_KEYS = new Set([
9
+ "content",
10
+ "editorNode",
11
+ "fields",
12
+ ]);
8
13
  function resolveFetchImplementation(customFetch) {
9
14
  const fetchImpl = customFetch ?? globalThis.fetch;
10
15
  if (typeof fetchImpl !== "function") {
@@ -15,26 +20,48 @@ function resolveFetchImplementation(customFetch) {
15
20
  }
16
21
  return fetchImpl;
17
22
  }
18
- function normalizeBaseUrl(baseUrl) {
19
- const trimmed = baseUrl.trim().replace(/\/+$/, "");
20
- if (!trimmed) {
21
- throw new ParagraphClientError("`baseUrl` cannot be empty.");
22
- }
23
- const url = new URL(trimmed);
24
- const normalizedPath = url.pathname.replace(/\/+$/, "");
25
- if (normalizedPath === "" || normalizedPath === "/") {
26
- url.pathname = "/v1";
23
+ function isPlainObject(value) {
24
+ if (typeof value !== "object" || value === null) {
25
+ return false;
27
26
  }
28
- else {
29
- url.pathname = normalizedPath;
27
+ const prototype = Object.getPrototypeOf(value);
28
+ return prototype === Object.prototype || prototype === null;
29
+ }
30
+ function toCamelCaseKey(key) {
31
+ return key.replace(/_([a-z])/g, (_match, letter) => letter.toUpperCase());
32
+ }
33
+ function transformKeysDeep(value, transformKey) {
34
+ if (Array.isArray(value)) {
35
+ return value.map((item) => transformKeysDeep(item, transformKey));
36
+ }
37
+ if (!isPlainObject(value)) {
38
+ return value;
39
+ }
40
+ const transformed = {};
41
+ for (const [key, nestedValue] of Object.entries(value)) {
42
+ const transformedKey = transformKey(key);
43
+ if (PRESERVED_TRANSFORM_KEYS.has(transformedKey)) {
44
+ transformed[transformedKey] = nestedValue;
45
+ continue;
46
+ }
47
+ transformed[transformedKey] = transformKeysDeep(nestedValue, transformKey);
30
48
  }
31
- return url.toString().replace(/\/+$/, "");
49
+ return transformed;
50
+ }
51
+ function toApiPayload(value) {
52
+ return value;
53
+ }
54
+ function toSdkPayload(value) {
55
+ return transformKeysDeep(value, toCamelCaseKey);
32
56
  }
33
- function buildUrl(baseUrl, path, query) {
57
+ function buildUrl(path, query) {
34
58
  const normalizedPath = path ? `/${path.replace(/^\/+/, "")}` : "";
35
- const url = new URL(`${baseUrl}${normalizedPath}`);
36
- if (query) {
37
- for (const [key, rawValue] of Object.entries(query)) {
59
+ const url = new URL(`${API_BASE_URL}${normalizedPath}`);
60
+ const apiQuery = query
61
+ ? toApiPayload(query)
62
+ : undefined;
63
+ if (apiQuery) {
64
+ for (const [key, rawValue] of Object.entries(apiQuery)) {
38
65
  if (rawValue === undefined || rawValue === null) {
39
66
  continue;
40
67
  }
@@ -215,11 +242,11 @@ function toBlobPart(file) {
215
242
  }
216
243
  function buildUploadFilePart(input) {
217
244
  const source = toBlobPart(input.file);
218
- const fileName = input.file_name ??
245
+ const fileName = input.fileName ??
219
246
  (typeof File !== "undefined" && input.file instanceof File
220
247
  ? input.file.name
221
248
  : "upload.bin");
222
- const contentType = input.content_type ??
249
+ const contentType = input.contentType ??
223
250
  ("type" in source.value &&
224
251
  typeof source.value.type === "string" &&
225
252
  source.value.type.length > 0
@@ -265,7 +292,7 @@ function createUploadFormData(input) {
265
292
  else {
266
293
  formData.append("file", filePart.value);
267
294
  }
268
- formData.append("page_id", input.page_id);
295
+ formData.append("pageId", input.pageId);
269
296
  if (input.alt !== undefined && input.alt !== null) {
270
297
  formData.append("alt", input.alt);
271
298
  }
@@ -273,7 +300,6 @@ function createUploadFormData(input) {
273
300
  }
274
301
  export class Client {
275
302
  apiKey;
276
- baseUrl;
277
303
  fetchImpl;
278
304
  defaultHeaders;
279
305
  timeoutMs;
@@ -312,6 +338,7 @@ export class Client {
312
338
  }),
313
339
  };
314
340
  page = {
341
+ list: (query, options) => this.pages.list(query, options),
315
342
  get: (pageId, query, options) => this.pages.get(pageId, query, options),
316
343
  getBySlug: (slug, options) => this.pages.getBySlug(slug, options),
317
344
  };
@@ -361,7 +388,7 @@ export class Client {
361
388
  options,
362
389
  }),
363
390
  get: (memberId, options) => this.findListItem("/members", (member) => member.id === memberId, options, {
364
- code: "member_not_found",
391
+ code: "memberNotFound",
365
392
  message: "Member not found.",
366
393
  details: { memberId },
367
394
  }),
@@ -372,7 +399,7 @@ export class Client {
372
399
  options,
373
400
  }),
374
401
  get: (authorId, options) => this.findListItem("/authors", (author) => author.id === authorId, options, {
375
- code: "author_not_found",
402
+ code: "authorNotFound",
376
403
  message: "Author not found.",
377
404
  details: { authorId },
378
405
  }),
@@ -383,7 +410,7 @@ export class Client {
383
410
  options,
384
411
  }),
385
412
  get: (reviewerId, options) => this.findListItem("/reviewers", (reviewer) => reviewer.id === reviewerId, options, {
386
- code: "reviewer_not_found",
413
+ code: "reviewerNotFound",
387
414
  message: "Reviewer not found.",
388
415
  details: { reviewerId },
389
416
  }),
@@ -461,7 +488,7 @@ export class Client {
461
488
  options,
462
489
  }),
463
490
  get: (code, options) => this.findArrayItem("/locales", (locale) => locale.code === code, options, {
464
- code: "locale_not_found",
491
+ code: "localeNotFound",
465
492
  message: "Locale not found.",
466
493
  details: { code },
467
494
  }),
@@ -488,11 +515,15 @@ export class Client {
488
515
  }),
489
516
  };
490
517
  constructor(options) {
491
- if (!options.apiKey.trim()) {
518
+ if ("baseUrl" in options ||
519
+ "apiUrl" in options) {
520
+ throw new ParagraphClientError("`baseUrl` and `apiUrl` are not supported. The client always uses the official Paragraph CMS API endpoint.");
521
+ }
522
+ if (typeof options.apiKey !== "string" ||
523
+ !options.apiKey.trim()) {
492
524
  throw new ParagraphClientError("`apiKey` is required.");
493
525
  }
494
526
  this.apiKey = options.apiKey.trim();
495
- this.baseUrl = normalizeBaseUrl(options.baseUrl ?? DEFAULT_BASE_URL);
496
527
  this.fetchImpl = resolveFetchImplementation(options.fetch);
497
528
  this.defaultHeaders = new Headers(options.headers);
498
529
  this.timeoutMs = options.timeoutMs;
@@ -510,13 +541,13 @@ export class Client {
510
541
  });
511
542
  if (pageListQuery.limit !== undefined ||
512
543
  pageListQuery.page !== undefined ||
513
- !response.meta.has_next_page) {
544
+ !response.meta.hasNextPage) {
514
545
  return response;
515
546
  }
516
547
  const items = [...response.data];
517
548
  let nextPage = response.meta.page + 1;
518
549
  let lastMeta = response.meta;
519
- while (lastMeta.has_next_page) {
550
+ while (lastMeta.hasNextPage) {
520
551
  const nextResponse = await this.requestList("GET", "/pages", {
521
552
  query: {
522
553
  ...pageListQuery,
@@ -534,25 +565,19 @@ export class Client {
534
565
  meta: {
535
566
  page: 1,
536
567
  limit: items.length,
537
- total_items: items.length,
538
- total_pages: items.length > 0 ? 1 : 0,
539
- has_next_page: false,
540
- has_prev_page: false,
568
+ totalItems: items.length,
569
+ totalPages: items.length > 0 ? 1 : 0,
570
+ hasNextPage: false,
571
+ hasPrevPage: false,
541
572
  },
542
573
  };
543
574
  }
544
575
  createPageListQuery(query) {
545
- const collection = query?.collection_id ?? query?.collection;
546
- if (query?.collection !== undefined &&
547
- query?.collection_id !== undefined &&
548
- query.collection !== query.collection_id) {
549
- throw new ParagraphClientError("`collection` and `collection_id` must match when both are provided.");
550
- }
576
+ const { requiredSlug, ...restQuery } = query ?? {};
551
577
  return {
552
- ...(query ?? {}),
553
- collection: undefined,
554
- collection_id: collection,
555
- include_content: query?.include_content ?? false,
578
+ ...restQuery,
579
+ includeContent: restQuery.includeContent ?? false,
580
+ ...(requiredSlug === true ? { requiredSlug: true } : {}),
556
581
  };
557
582
  }
558
583
  requestData(method, path, config) {
@@ -564,7 +589,7 @@ export class Client {
564
589
  async getPageBySlug(slug, options) {
565
590
  const query = this.createPageListQuery({ slug });
566
591
  const page = await this.findListItem("/pages", (item) => item.slug === slug, options, {
567
- code: "page_not_found",
592
+ code: "pageNotFound",
568
593
  message: "Page not found.",
569
594
  details: { slug },
570
595
  }, query);
@@ -585,7 +610,7 @@ export class Client {
585
610
  if (match) {
586
611
  return match;
587
612
  }
588
- if (!response.meta.has_next_page) {
613
+ if (!response.meta.hasNextPage) {
589
614
  break;
590
615
  }
591
616
  page += 1;
@@ -621,11 +646,11 @@ export class Client {
621
646
  code: config.code,
622
647
  message: config.message,
623
648
  details: config.details,
624
- request: createRequestDescriptor(method, buildUrl(this.baseUrl, path, config.query)),
649
+ request: createRequestDescriptor(method, buildUrl(path, config.query)),
625
650
  });
626
651
  }
627
652
  requestJson(method, path, config) {
628
- const url = buildUrl(this.baseUrl, path, config?.query);
653
+ const url = buildUrl(path, config?.query);
629
654
  const request = createRequestDescriptor(method, url);
630
655
  const headers = new Headers(this.defaultHeaders);
631
656
  const timeoutMs = config?.options?.timeoutMs ?? this.timeoutMs;
@@ -644,7 +669,7 @@ export class Client {
644
669
  if (!headers.has("content-type")) {
645
670
  headers.set("content-type", "application/json");
646
671
  }
647
- body = JSON.stringify(config.body);
672
+ body = JSON.stringify(toApiPayload(config.body));
648
673
  }
649
674
  const optionHeaders = new Headers(config?.options?.headers);
650
675
  for (const [key, value] of optionHeaders.entries()) {
@@ -667,24 +692,24 @@ export class Client {
667
692
  }));
668
693
  const payload = await parseResponse(response);
669
694
  if (response.ok) {
670
- return payload;
695
+ return toSdkPayload(payload);
671
696
  }
672
697
  const responseHeaders = new Headers(response.headers);
673
698
  const apiError = isApiErrorPayload(payload)
674
699
  ? new ParagraphApiError({
700
+ body: toSdkPayload(payload),
675
701
  status: response.status,
676
702
  code: payload.error.code,
677
703
  message: payload.error.message,
678
- details: payload.error.details,
704
+ details: toSdkPayload(payload.error.details),
679
705
  headers: responseHeaders,
680
706
  request,
681
- body: payload,
682
707
  })
683
708
  : new ParagraphApiError({
684
709
  status: response.status,
685
710
  code: response.status === 401
686
711
  ? "unauthorized"
687
- : "request_failed",
712
+ : "requestFailed",
688
713
  message: typeof payload === "string" && payload.length > 0
689
714
  ? payload
690
715
  : response.statusText || "Request failed.",
package/dist/types.d.ts CHANGED
@@ -10,10 +10,10 @@ export type Uploadable = File | Blob | ArrayBuffer | ArrayBufferView;
10
10
  export interface PaginationMeta {
11
11
  page: number;
12
12
  limit: number;
13
- total_items: number;
14
- total_pages: number;
15
- has_next_page: boolean;
16
- has_prev_page: boolean;
13
+ totalItems: number;
14
+ totalPages: number;
15
+ hasNextPage: boolean;
16
+ hasPrevPage: boolean;
17
17
  }
18
18
  export interface ListResponse<T> {
19
19
  data: T[];
@@ -21,11 +21,11 @@ export interface ListResponse<T> {
21
21
  }
22
22
  export interface ApiInfo {
23
23
  version: string;
24
- openapi_url: string;
24
+ openapiUrl: string;
25
25
  authentication: {
26
- type: "api_key";
27
- supported_headers: ["x-api-key", "authorization"];
28
- authorization_format: "Bearer <api-key>";
26
+ type: "apiKey";
27
+ supportedHeaders: ["x-api-key", "authorization"];
28
+ authorizationFormat: "Bearer <api-key>";
29
29
  };
30
30
  resources: string[];
31
31
  }
@@ -49,7 +49,6 @@ export interface RequestOptions {
49
49
  }
50
50
  export interface ClientOptions {
51
51
  apiKey: string;
52
- baseUrl?: string;
53
52
  fetch?: typeof globalThis.fetch;
54
53
  headers?: HeadersInit;
55
54
  timeoutMs?: number;
@@ -64,12 +63,12 @@ export interface ListQuery {
64
63
  }
65
64
  export interface Member {
66
65
  id: string;
67
- user_id: string;
66
+ userId: string;
68
67
  role: string;
69
68
  name: string | null;
70
69
  email: string | null;
71
- image_url: string | null;
72
- created_at: string | null;
70
+ imageUrl: string | null;
71
+ createdAt: string | null;
73
72
  }
74
73
  export interface Status {
75
74
  id: string;
@@ -78,8 +77,8 @@ export interface Status {
78
77
  type: StatusType;
79
78
  description: string | null;
80
79
  order: number;
81
- created_at: string | null;
82
- updated_at: string | null;
80
+ createdAt: string | null;
81
+ updatedAt: string | null;
83
82
  }
84
83
  export interface Label {
85
84
  id: string;
@@ -87,8 +86,8 @@ export interface Label {
87
86
  color: string;
88
87
  description: string | null;
89
88
  order: number;
90
- created_at: string | null;
91
- last_applied_at: string | null;
89
+ createdAt: string | null;
90
+ lastAppliedAt: string | null;
92
91
  }
93
92
  export interface DataModelField {
94
93
  id: string;
@@ -104,57 +103,57 @@ export interface DataModelSummary {
104
103
  }
105
104
  export interface DataModel extends DataModelSummary {
106
105
  fields: DataModelField[];
107
- created_at: string | null;
108
- updated_at: string | null;
106
+ createdAt: string | null;
107
+ updatedAt: string | null;
109
108
  }
110
109
  export interface CollectionSummary {
111
110
  id: string;
112
111
  name: string;
113
112
  description: string | null;
114
- default_data_model_id: string | null;
115
- team_ids: string[];
116
- page_count: number;
117
- last_modified_at: string | null;
113
+ defaultDataModelId: string | null;
114
+ teamIds: string[];
115
+ pageCount: number;
116
+ lastModifiedAt: string | null;
118
117
  }
119
118
  export interface Collection extends CollectionSummary {
120
- default_data_model: DataModel | null;
119
+ defaultDataModel: DataModel | null;
121
120
  }
122
121
  export interface PageTranslation {
123
122
  id: string;
124
123
  title: string;
125
124
  language: string;
126
- deleted_at: string | null;
127
- created_at: string | null;
128
- updated_at: string | null;
129
- is_current: boolean;
125
+ deletedAt: string | null;
126
+ createdAt: string | null;
127
+ updatedAt: string | null;
128
+ isCurrent: boolean;
130
129
  }
131
130
  export interface PageSummary {
132
131
  id: string;
133
132
  title: string;
134
133
  slug: string | null;
135
134
  language: string;
136
- content_format?: PageContentFormat;
137
- hero_url: string | null;
138
- collection_id: string | null;
135
+ contentFormat?: PageContentFormat;
136
+ heroUrl: string | null;
137
+ collectionId: string | null;
139
138
  collection: Collection | null;
140
- translation_group_id: string;
141
- data_model_id: string | null;
142
- data_model: DataModel | null;
143
- status_id: string | null;
139
+ translationGroupId: string;
140
+ dataModelId: string | null;
141
+ dataModel: DataModel | null;
142
+ statusId: string | null;
144
143
  status: Status | null;
145
- author_id: string | null;
144
+ authorId: string | null;
146
145
  author: Member | null;
147
- reviewer_id: string | null;
146
+ reviewerId: string | null;
148
147
  reviewer: Member | null;
149
148
  labels: Label[];
150
149
  fields: Record<string, unknown>;
151
150
  content?: PageContent;
152
- meta_name: string | null;
153
- meta_description: string | null;
154
- published_at: string | null;
155
- deleted_at: string | null;
156
- created_at: string | null;
157
- updated_at: string | null;
151
+ metaName: string | null;
152
+ metaDescription: string | null;
153
+ publishedAt: string | null;
154
+ deletedAt: string | null;
155
+ createdAt: string | null;
156
+ updatedAt: string | null;
158
157
  }
159
158
  export interface Page extends PageSummary {
160
159
  content: PageContent;
@@ -162,30 +161,30 @@ export interface Page extends PageSummary {
162
161
  }
163
162
  export interface Media {
164
163
  id: string;
165
- page_id: string | null;
166
- file_name: string;
164
+ pageId: string | null;
165
+ fileName: string;
167
166
  alt: string | null;
168
- mime_type: string;
167
+ mimeType: string;
169
168
  size: number;
170
169
  width: number | null;
171
170
  height: number | null;
172
171
  url: string;
173
- created_at: string | null;
174
- updated_at: string | null;
172
+ createdAt: string | null;
173
+ updatedAt: string | null;
175
174
  }
176
175
  export interface MediaReferencePage {
177
176
  id: string;
178
177
  title: string;
179
178
  slug: string | null;
180
179
  language: string | null;
181
- translation_group_id: string | null;
182
- updated_at: string | null;
183
- is_unassigned: boolean;
180
+ translationGroupId: string | null;
181
+ updatedAt: string | null;
182
+ isUnassigned: boolean;
184
183
  }
185
184
  export interface MediaDetail extends Media {
186
- reference_page_count: number;
187
- last_modified_at: string | null;
188
- reference_pages: MediaReferencePage[];
185
+ referencePageCount: number;
186
+ lastModifiedAt: string | null;
187
+ referencePages: MediaReferencePage[];
189
188
  }
190
189
  export interface Locale {
191
190
  id: string;
@@ -206,7 +205,7 @@ export interface CollectionMutationResult {
206
205
  export interface MediaUploadResult {
207
206
  message: string;
208
207
  media: Media;
209
- editor_node: EditorNode;
208
+ editorNode: EditorNode;
210
209
  }
211
210
  export interface MediaMutationResult {
212
211
  message: string;
@@ -215,7 +214,7 @@ export interface MediaMutationResult {
215
214
  export interface MediaDeleteResult {
216
215
  id: string;
217
216
  deleted: boolean;
218
- deleted_count: number;
217
+ deletedCount: number;
219
218
  message: string;
220
219
  }
221
220
  export interface StatusMutationResult {
@@ -228,7 +227,7 @@ export interface LabelMutationResult {
228
227
  }
229
228
  export interface DataModelMutationResult {
230
229
  message: string;
231
- data_model: DataModel;
230
+ dataModel: DataModel;
232
231
  }
233
232
  export interface LocaleMutationResult {
234
233
  message: string;
@@ -240,11 +239,11 @@ export interface LocaleMutationResult {
240
239
  }
241
240
  export interface AiMetaNameResult {
242
241
  message: string;
243
- meta_name: string;
242
+ metaName: string;
244
243
  }
245
244
  export interface AiMetaDescriptionResult {
246
245
  message: string;
247
- meta_description: string;
246
+ metaDescription: string;
248
247
  }
249
248
  export interface AiContentResult {
250
249
  message: string;
@@ -269,7 +268,7 @@ export interface PageRestoreResult {
269
268
  }
270
269
  export interface PermanentDeleteResult {
271
270
  id: string;
272
- permanently_deleted: boolean;
271
+ permanentlyDeleted: boolean;
273
272
  message: string;
274
273
  }
275
274
  export interface ReorderResult {
@@ -277,46 +276,46 @@ export interface ReorderResult {
277
276
  message: string;
278
277
  }
279
278
  export interface PageListQuery extends ListQuery {
280
- include_content?: boolean;
281
- collection?: string;
279
+ includeContent?: boolean;
280
+ collectionId?: string;
282
281
  deleted?: DeletedFilter;
283
- collection_id?: string;
284
- without_collection?: boolean;
285
- data_model_id?: string;
286
- status_id?: string;
287
- status_type?: StatusType;
288
- author_id?: string;
289
- reviewer_id?: string;
282
+ withoutCollection?: boolean;
283
+ dataModelId?: string;
284
+ statusId?: string;
285
+ statusType?: StatusType;
286
+ authorId?: string;
287
+ reviewerId?: string;
290
288
  language?: string;
291
- translation_group_id?: string;
289
+ translationGroupId?: string;
292
290
  slug?: string;
293
- label_id?: string[];
294
- updated_after?: string;
295
- updated_before?: string;
296
- published_after?: string;
297
- published_before?: string;
291
+ requiredSlug?: boolean;
292
+ labelIds?: string[];
293
+ updatedAfter?: string;
294
+ updatedBefore?: string;
295
+ publishedAfter?: string;
296
+ publishedBefore?: string;
298
297
  published?: boolean;
299
298
  }
300
299
  export interface GetPageQuery {
301
- include_deleted?: boolean;
300
+ includeDeleted?: boolean;
302
301
  }
303
302
  export interface CreatePageRequest {
304
303
  title?: string;
305
- hero_url?: string | null;
306
- collection_id?: string | null;
307
- data_model_id?: string | null;
304
+ heroUrl?: string | null;
305
+ collectionId?: string | null;
306
+ dataModelId?: string | null;
308
307
  language?: string;
309
- status_id?: string | null;
310
- author_id?: string | null;
311
- reviewer_id?: string | null;
312
- published_at?: string | null;
313
- content_format?: PageContentFormat;
308
+ statusId?: string | null;
309
+ authorId?: string | null;
310
+ reviewerId?: string | null;
311
+ publishedAt?: string | null;
312
+ contentFormat?: PageContentFormat;
314
313
  content?: PageContent;
315
314
  fields?: Record<string, unknown>;
316
315
  slug?: string | null;
317
- meta_name?: string | null;
318
- meta_description?: string | null;
319
- label_ids?: string[];
316
+ metaName?: string | null;
317
+ metaDescription?: string | null;
318
+ labelIds?: string[];
320
319
  }
321
320
  export type UpdatePageRequest = CreatePageRequest;
322
321
  export interface CreatePageTranslationRequest {
@@ -325,28 +324,28 @@ export interface CreatePageTranslationRequest {
325
324
  model?: string;
326
325
  }
327
326
  export interface CollectionListQuery extends ListQuery {
328
- default_data_model_id?: string;
327
+ defaultDataModelId?: string;
329
328
  }
330
329
  export interface CreateCollectionRequest {
331
330
  name: string;
332
331
  description?: string | null;
333
- default_data_model_id?: string | null;
334
- team_ids?: string[];
332
+ defaultDataModelId?: string | null;
333
+ teamIds?: string[];
335
334
  }
336
335
  export type UpdateCollectionRequest = Partial<CreateCollectionRequest>;
337
336
  export interface MediaListQuery extends ListQuery {
338
- page_id?: string;
339
- mime_type?: string;
337
+ pageId?: string;
338
+ mimeType?: string;
340
339
  }
341
340
  export interface UploadMediaRequest {
342
341
  file: Uploadable;
343
- file_name?: string;
344
- content_type?: string;
345
- page_id: string;
342
+ fileName?: string;
343
+ contentType?: string;
344
+ pageId: string;
346
345
  alt?: string | null;
347
346
  }
348
347
  export interface UpdateMediaRequest {
349
- file_name?: string;
348
+ fileName?: string;
350
349
  alt?: string | null;
351
350
  }
352
351
  export interface MemberListQuery extends ListQuery {
@@ -364,7 +363,7 @@ export interface CreateStatusRequest {
364
363
  export type UpdateStatusRequest = Partial<CreateStatusRequest>;
365
364
  export interface ReorderStatusesRequest {
366
365
  type: StatusType;
367
- status_ids: string[];
366
+ statusIds: string[];
368
367
  }
369
368
  export interface CreateLabelRequest {
370
369
  name: string;
@@ -375,7 +374,7 @@ export type UpdateLabelRequest = Partial<CreateLabelRequest>;
375
374
  export interface LabelListQuery extends ListQuery {
376
375
  }
377
376
  export interface ReorderLabelsRequest {
378
- label_ids: string[];
377
+ labelIds: string[];
379
378
  }
380
379
  export interface DataModelListQuery extends ListQuery {
381
380
  }