cmx-sdk 0.2.14 → 0.2.15

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.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/cli.js CHANGED
@@ -3372,8 +3372,12 @@ async function createDataEntry(options) {
3372
3372
  }
3373
3373
  const raw = readJsonInput(options);
3374
3374
  let input;
3375
- if (raw.dataJson && typeof raw.dataJson === "object") {
3376
- input = raw;
3375
+ if (raw.dataJson && typeof raw.dataJson === "object" && !Array.isArray(raw.dataJson)) {
3376
+ const statusFromJson = typeof raw.status === "string" && VALID_STATUSES.includes(raw.status) ? raw.status : void 0;
3377
+ input = {
3378
+ dataJson: raw.dataJson,
3379
+ ...statusFromJson ? { status: statusFromJson } : {}
3380
+ };
3377
3381
  } else {
3378
3382
  input = { dataJson: raw };
3379
3383
  }
package/dist/index.d.ts CHANGED
@@ -753,6 +753,21 @@ interface FormDefinitionResponse {
753
753
  updatedAt: Date;
754
754
  }
755
755
 
756
+ /**
757
+ * Generated by orval v8.4.0 🍺
758
+ * Do not edit manually.
759
+ * CMX SDK API
760
+ * CMX SDK API(コンテンツ配信+管理)
761
+ * OpenAPI spec version: 1.0.0
762
+ */
763
+ type GetAnalyticsDailyParams = {
764
+ provider?: string;
765
+ dateFrom?: string;
766
+ dateTo?: string;
767
+ path?: string;
768
+ limit?: string;
769
+ };
770
+
756
771
  /**
757
772
  * Generated by orval v8.4.0 🍺
758
773
  * Do not edit manually.
@@ -1359,6 +1374,51 @@ interface SdkAddCollectionDataTypeRequest {
1359
1374
  label?: string;
1360
1375
  }
1361
1376
 
1377
+ /**
1378
+ * Generated by orval v8.4.0 🍺
1379
+ * Do not edit manually.
1380
+ * CMX SDK API
1381
+ * CMX SDK API(コンテンツ配信+管理)
1382
+ * OpenAPI spec version: 1.0.0
1383
+ */
1384
+ type SdkAnalyticsDailyMetricRawJson = {
1385
+ [key: string]: unknown | null;
1386
+ } | null;
1387
+
1388
+ /**
1389
+ * Generated by orval v8.4.0 🍺
1390
+ * Do not edit manually.
1391
+ * CMX SDK API
1392
+ * CMX SDK API(コンテンツ配信+管理)
1393
+ * OpenAPI spec version: 1.0.0
1394
+ */
1395
+
1396
+ interface SdkAnalyticsDailyMetric {
1397
+ id: string;
1398
+ environmentId: string;
1399
+ provider: string;
1400
+ metricDate: string;
1401
+ path: string;
1402
+ pageviews: number;
1403
+ visitors: number;
1404
+ sessions: number;
1405
+ rawJson: SdkAnalyticsDailyMetricRawJson;
1406
+ createdAt: Date;
1407
+ updatedAt: Date;
1408
+ }
1409
+
1410
+ /**
1411
+ * Generated by orval v8.4.0 🍺
1412
+ * Do not edit manually.
1413
+ * CMX SDK API
1414
+ * CMX SDK API(コンテンツ配信+管理)
1415
+ * OpenAPI spec version: 1.0.0
1416
+ */
1417
+
1418
+ interface SdkAnalyticsDailyListResponse {
1419
+ metrics: SdkAnalyticsDailyMetric[];
1420
+ }
1421
+
1362
1422
  /**
1363
1423
  * Generated by orval v8.4.0 🍺
1364
1424
  * Do not edit manually.
@@ -2061,6 +2121,91 @@ interface SdkRequestReviewResponse {
2061
2121
  title: string;
2062
2122
  }
2063
2123
 
2124
+ /**
2125
+ * Generated by orval v8.4.0 🍺
2126
+ * Do not edit manually.
2127
+ * CMX SDK API
2128
+ * CMX SDK API(コンテンツ配信+管理)
2129
+ * OpenAPI spec version: 1.0.0
2130
+ */
2131
+ type SdkRuntimeSettingsResponseSettingsAnalyticsProvider = typeof SdkRuntimeSettingsResponseSettingsAnalyticsProvider[keyof typeof SdkRuntimeSettingsResponseSettingsAnalyticsProvider];
2132
+ declare const SdkRuntimeSettingsResponseSettingsAnalyticsProvider: {
2133
+ readonly none: "none";
2134
+ readonly ga: "ga";
2135
+ readonly plausible: "plausible";
2136
+ readonly umami: "umami";
2137
+ readonly matomo: "matomo";
2138
+ };
2139
+
2140
+ /**
2141
+ * Generated by orval v8.4.0 🍺
2142
+ * Do not edit manually.
2143
+ * CMX SDK API
2144
+ * CMX SDK API(コンテンツ配信+管理)
2145
+ * OpenAPI spec version: 1.0.0
2146
+ */
2147
+ type SdkRuntimeSettingsResponseSettingsAnalyticsTracking = {
2148
+ enabled: boolean;
2149
+ gaMeasurementId?: string;
2150
+ plausibleDomain?: string;
2151
+ plausibleScriptUrl?: string;
2152
+ umamiWebsiteId?: string;
2153
+ umamiScriptUrl?: string;
2154
+ matomoSiteId?: string;
2155
+ matomoBaseUrl?: string;
2156
+ };
2157
+
2158
+ /**
2159
+ * Generated by orval v8.4.0 🍺
2160
+ * Do not edit manually.
2161
+ * CMX SDK API
2162
+ * CMX SDK API(コンテンツ配信+管理)
2163
+ * OpenAPI spec version: 1.0.0
2164
+ */
2165
+
2166
+ type SdkRuntimeSettingsResponseSettingsAnalytics = {
2167
+ provider: SdkRuntimeSettingsResponseSettingsAnalyticsProvider;
2168
+ tracking: SdkRuntimeSettingsResponseSettingsAnalyticsTracking;
2169
+ };
2170
+
2171
+ /**
2172
+ * Generated by orval v8.4.0 🍺
2173
+ * Do not edit manually.
2174
+ * CMX SDK API
2175
+ * CMX SDK API(コンテンツ配信+管理)
2176
+ * OpenAPI spec version: 1.0.0
2177
+ */
2178
+ type SdkRuntimeSettingsResponseSettingsRevalidation = {
2179
+ enabled: boolean;
2180
+ baseUrl?: string;
2181
+ apiKey?: string;
2182
+ };
2183
+
2184
+ /**
2185
+ * Generated by orval v8.4.0 🍺
2186
+ * Do not edit manually.
2187
+ * CMX SDK API
2188
+ * CMX SDK API(コンテンツ配信+管理)
2189
+ * OpenAPI spec version: 1.0.0
2190
+ */
2191
+
2192
+ type SdkRuntimeSettingsResponseSettings = {
2193
+ analytics: SdkRuntimeSettingsResponseSettingsAnalytics;
2194
+ revalidation: SdkRuntimeSettingsResponseSettingsRevalidation;
2195
+ };
2196
+
2197
+ /**
2198
+ * Generated by orval v8.4.0 🍺
2199
+ * Do not edit manually.
2200
+ * CMX SDK API
2201
+ * CMX SDK API(コンテンツ配信+管理)
2202
+ * OpenAPI spec version: 1.0.0
2203
+ */
2204
+
2205
+ interface SdkRuntimeSettingsResponse {
2206
+ settings: SdkRuntimeSettingsResponseSettings;
2207
+ }
2208
+
2064
2209
  /**
2065
2210
  * Generated by orval v8.4.0 🍺
2066
2211
  * Do not edit manually.
@@ -2471,6 +2616,54 @@ type getPreviewTokenResponseError = (getPreviewTokenResponse404 | getPreviewToke
2471
2616
  type getPreviewTokenResponse = (getPreviewTokenResponseSuccess | getPreviewTokenResponseError);
2472
2617
  declare const getGetPreviewTokenUrl: (token: string) => string;
2473
2618
  declare const getPreviewToken: (token: string, options?: RequestInit) => Promise<getPreviewTokenResponse>;
2619
+ /**
2620
+ * @summary スターターキット用 Runtime Settings を取得
2621
+ */
2622
+ type getRuntimeSettingsResponse200 = {
2623
+ data: SdkRuntimeSettingsResponse;
2624
+ status: 200;
2625
+ };
2626
+ type getRuntimeSettingsResponse401 = {
2627
+ data: ErrorResponse;
2628
+ status: 401;
2629
+ };
2630
+ type getRuntimeSettingsResponse404 = {
2631
+ data: ErrorResponse;
2632
+ status: 404;
2633
+ };
2634
+ type getRuntimeSettingsResponseSuccess = (getRuntimeSettingsResponse200) & {
2635
+ headers: Headers;
2636
+ };
2637
+ type getRuntimeSettingsResponseError = (getRuntimeSettingsResponse401 | getRuntimeSettingsResponse404) & {
2638
+ headers: Headers;
2639
+ };
2640
+ type getRuntimeSettingsResponse = (getRuntimeSettingsResponseSuccess | getRuntimeSettingsResponseError);
2641
+ declare const getGetRuntimeSettingsUrl: () => string;
2642
+ declare const getRuntimeSettings: (options?: RequestInit) => Promise<getRuntimeSettingsResponse>;
2643
+ /**
2644
+ * @summary 日次アナリティクスメトリクスを取得
2645
+ */
2646
+ type getAnalyticsDailyResponse200 = {
2647
+ data: SdkAnalyticsDailyListResponse;
2648
+ status: 200;
2649
+ };
2650
+ type getAnalyticsDailyResponse401 = {
2651
+ data: ErrorResponse;
2652
+ status: 401;
2653
+ };
2654
+ type getAnalyticsDailyResponse500 = {
2655
+ data: ErrorResponse;
2656
+ status: 500;
2657
+ };
2658
+ type getAnalyticsDailyResponseSuccess = (getAnalyticsDailyResponse200) & {
2659
+ headers: Headers;
2660
+ };
2661
+ type getAnalyticsDailyResponseError = (getAnalyticsDailyResponse401 | getAnalyticsDailyResponse500) & {
2662
+ headers: Headers;
2663
+ };
2664
+ type getAnalyticsDailyResponse = (getAnalyticsDailyResponseSuccess | getAnalyticsDailyResponseError);
2665
+ declare const getGetAnalyticsDailyUrl: (params?: GetAnalyticsDailyParams) => string;
2666
+ declare const getAnalyticsDaily: (params?: GetAnalyticsDailyParams, options?: RequestInit) => Promise<getAnalyticsDailyResponse>;
2474
2667
 
2475
2668
  /**
2476
2669
  * CMX SDK — Convenience API functions
@@ -2561,6 +2754,14 @@ declare function submitFormData(typeSlug: string, data: Record<string, unknown>)
2561
2754
  success: true;
2562
2755
  id: string;
2563
2756
  }>;
2757
+ /**
2758
+ * Get runtime settings for starter kit deployment/runtime behavior.
2759
+ */
2760
+ declare function fetchRuntimeSettings(): Promise<SdkRuntimeSettingsResponse>;
2761
+ /**
2762
+ * Get daily analytics metrics collected by CMX.
2763
+ */
2764
+ declare function fetchAnalyticsDailyMetrics(params?: GetAnalyticsDailyParams): Promise<SdkAnalyticsDailyListResponse>;
2564
2765
 
2565
2766
  interface CalloutProps {
2566
2767
  type?: "info" | "warning" | "error" | "success" | "tip";
@@ -3181,4 +3382,4 @@ declare function renderMdx(mdx: string, references?: References, options?: Rende
3181
3382
  */
3182
3383
  declare function renderMdxPreview(mdx: string, additionalComponents?: Record<string, React.ComponentType<any>>): Promise<React.ReactElement>;
3183
3384
 
3184
- export { type ApiResponse, type AssetReference, type AssetReferenceVariants, BlogCard, Button, CACHE_TAGS, Callout, CmxApiError, type CollectionConfig, type CollectionConfigDefaults, type CollectionContentDetailResponse, type CollectionContentsOptions, type CollectionContentsResponse, type CollectionListResponse, type CollectionResponse, CollectionType, type ComponentDefinition, type ComponentName, type ContentReference, ContentStatus, type CreateCollectionRequest, type CreateContentRequest, type CreateDataTypeRequest, type CreateFormDefinitionRequest, type DataEntriesOptions, type DataEntryDetailResponse, type DataEntryItem, type DataListResponse, type DataTypeConfig, type DataTypeResponse, type DeleteManageContentsIdParams, type DeleteManageDataTypeSlugIdParams, Embed, type ErrorResponse, type ErrorResponseDetails, type FetchOptions, type FieldDefinition, type FieldOptions, type FieldOptionsChoicesItem, FieldType, type FormDefinitionResponse, type FormDefinitionResponseConfigJson, type GetCollectionsSlugContentsParams, GetCollectionsSlugContentsSortBy, GetCollectionsSlugContentsSortOrder, type GetDataTypeSlugParams, GetDataTypeSlugSortBy, GetDataTypeSlugSortOrder, type GetManageCollectionPresets200, type GetManageCollectionPresetsParams, GetManageCollectionPresetsType, type GetManageContentsIdParams, type GetManageContentsParams, type GetManageDataTypeSlugIdParams, type GetManageDataTypeSlugParams, GetManageDataTypeSlugSortBy, GetManageDataTypeSlugSortOrder, GetManageDataTypeSlugStatus, type GetPreviewToken200, type GetPreviewToken200Collection, type GetPreviewToken200Content, type GetPreviewToken200References, type GetPreviewToken200ReferencesAssets, type GetPreviewToken200ReferencesAssetsVariants, type GetPreviewToken200ReferencesContents, Image, type PreviewResponse, type PublicCollectionInfo, type PublicContentDetail, type PublicContentListItem, type PublicContentParent, type PublicFetcherOptions, type PublicSubmissionRequest, type PublicSubmissionRequestData, type PublicSubmissionResponse, type ReferenceField, ReferenceFieldReferenceType, type References, type ReferencesAssets, type ReferencesContents, type RenderOptions, type RenderResult, type ResolvedReferences, type RevalidationConfig, type SchemaCollection, type SchemaDataType, type SchemaFieldDefinition, type SchemaFieldOption, type SchemaFieldOptionChoicesItem, type SchemaFormDefinition, type SchemaResponse, type SdkAddCollectionDataTypeRequest, SdkAddCollectionDataTypeRequestReferenceType, type SdkCollectionDataTypeResponse, type SdkComponentDefinition, type SdkComponentDefinitionPropsSchema, type SdkComponentProp, type SdkComponentSuccessResponse, type SdkComponentSyncRequest, type SdkContentDetail, type SdkContentDetailFrontmatterJson, type SdkContentDetailSeoJson, type SdkContentDetailSeoJsonStructuredData, type SdkContentItem, type SdkContentListResponse, type SdkContentReferencesResponse, type SdkContentReferencesResponseReferencesItem, type SdkContentReferencesResponseReferencesItemDataEntriesItem, type SdkContentReferencesResponseReferencesItemDataEntriesItemData, type SdkCreateContentResponse, type SdkCreateContentResponseWarningsItem, SdkCreateContentResponseWarningsItemIssueType, SdkCreateContentResponseWarningsItemTargetType, type SdkCreateEntryRequest, type SdkCreateEntryRequestDataJson, SdkCreateEntryRequestStatus, type SdkCustomComponentResponse, type SdkCustomComponentResponsePropsSchema, SdkCustomComponentResponseStatus, type SdkCustomComponentsListResponse, type SdkDataEntriesListResponse, type SdkDataEntryDeletionImpactItem, type SdkDataEntryDeletionImpactResponse, type SdkDataEntryDetailResponse, type SdkDataEntryResponse, type SdkDataEntryResponseDataJson, SdkDataEntryResponseStatus, type SdkDataTypeInfo, type SdkDeleteCollectionDataTypeResponse, type SdkDeleteCollectionResponse, type SdkDeleteContentResponse, type SdkDeleteDataEntryResponse, type SdkDeleteDataTypeResponse, type SdkDeleteFormDefinitionResponse, type SdkDocResponse, SdkDocType, type SdkLinkExistingDataTypeRequest, SdkLinkExistingDataTypeRequestReferenceType, type SdkPreset, SdkPresetReferenceType, type SdkPublishContentResponse, type SdkRequestReviewResponse, type SdkSetContentReferencesRequest, type SdkSetContentReferencesRequestReferencesItem, type SdkSetContentReferencesResponse, type SdkUpdateContentResponse, type SdkUpdateContentResponseWarningsItem, SdkUpdateContentResponseWarningsItemIssueType, SdkUpdateContentResponseWarningsItemTargetType, type SdkUpdateEntryRequest, type SdkUpdateEntryRequestDataJson, SdkUpdateEntryRequestStatus, type SdkUpsertDocBody, type SdkValidateContentResponse, type SdkValidateContentResponseIssuesItem, SdkValidateContentResponseIssuesItemIssueType, SdkValidateContentResponseIssuesItemTargetType, type UpdateCollectionRequest, type UpdateContentRequest, type UpdateDataTypeRequest, type UpdateFormDefinitionRequest, type UpdateFormDefinitionRequestConfigJson, type ValidationError, type ValidationResult, basicComponents, componentCatalog, componentSchemas, customComponents, getCatalogForAI, getCollectionContentDetail, getCollectionContentDetailOrThrow, getCollectionContents, getCollectionContentsOrThrow, getCollections, getCollectionsSlugContents, getCollectionsSlugContentsContentSlug, getComponentsByCategory, getComponentsWithReferences, getDataEntries, getDataEntriesOrThrow, getDataEntry, getDataEntryOrThrow, getDataTypeSlug, getGetCollectionsSlugContentsContentSlugUrl, getGetCollectionsSlugContentsUrl, getGetDataTypeSlugUrl, getGetPreviewTokenUrl, getPreviewByToken, getPreviewToken, getSchema, getSdkApiBaseUrl, getSdkApiToken, isValidComponent, markdownComponents, mdxComponents, quickValidateMdx, renderMdx, renderMdxPreview, sdkCustomInstance, sdkFetchWithTags, sdkFetcher, sdkPostFetcher, submitFormData, validateComponentProps, validateMdx };
3385
+ export { type ApiResponse, type AssetReference, type AssetReferenceVariants, BlogCard, Button, CACHE_TAGS, Callout, CmxApiError, type CollectionConfig, type CollectionConfigDefaults, type CollectionContentDetailResponse, type CollectionContentsOptions, type CollectionContentsResponse, type CollectionListResponse, type CollectionResponse, CollectionType, type ComponentDefinition, type ComponentName, type ContentReference, ContentStatus, type CreateCollectionRequest, type CreateContentRequest, type CreateDataTypeRequest, type CreateFormDefinitionRequest, type DataEntriesOptions, type DataEntryDetailResponse, type DataEntryItem, type DataListResponse, type DataTypeConfig, type DataTypeResponse, type DeleteManageContentsIdParams, type DeleteManageDataTypeSlugIdParams, Embed, type ErrorResponse, type ErrorResponseDetails, type FetchOptions, type FieldDefinition, type FieldOptions, type FieldOptionsChoicesItem, FieldType, type FormDefinitionResponse, type FormDefinitionResponseConfigJson, type GetAnalyticsDailyParams, type GetCollectionsSlugContentsParams, GetCollectionsSlugContentsSortBy, GetCollectionsSlugContentsSortOrder, type GetDataTypeSlugParams, GetDataTypeSlugSortBy, GetDataTypeSlugSortOrder, type GetManageCollectionPresets200, type GetManageCollectionPresetsParams, GetManageCollectionPresetsType, type GetManageContentsIdParams, type GetManageContentsParams, type GetManageDataTypeSlugIdParams, type GetManageDataTypeSlugParams, GetManageDataTypeSlugSortBy, GetManageDataTypeSlugSortOrder, GetManageDataTypeSlugStatus, type GetPreviewToken200, type GetPreviewToken200Collection, type GetPreviewToken200Content, type GetPreviewToken200References, type GetPreviewToken200ReferencesAssets, type GetPreviewToken200ReferencesAssetsVariants, type GetPreviewToken200ReferencesContents, Image, type PreviewResponse, type PublicCollectionInfo, type PublicContentDetail, type PublicContentListItem, type PublicContentParent, type PublicFetcherOptions, type PublicSubmissionRequest, type PublicSubmissionRequestData, type PublicSubmissionResponse, type ReferenceField, ReferenceFieldReferenceType, type References, type ReferencesAssets, type ReferencesContents, type RenderOptions, type RenderResult, type ResolvedReferences, type RevalidationConfig, type SchemaCollection, type SchemaDataType, type SchemaFieldDefinition, type SchemaFieldOption, type SchemaFieldOptionChoicesItem, type SchemaFormDefinition, type SchemaResponse, type SdkAddCollectionDataTypeRequest, SdkAddCollectionDataTypeRequestReferenceType, type SdkAnalyticsDailyListResponse, type SdkAnalyticsDailyMetric, type SdkAnalyticsDailyMetricRawJson, type SdkCollectionDataTypeResponse, type SdkComponentDefinition, type SdkComponentDefinitionPropsSchema, type SdkComponentProp, type SdkComponentSuccessResponse, type SdkComponentSyncRequest, type SdkContentDetail, type SdkContentDetailFrontmatterJson, type SdkContentDetailSeoJson, type SdkContentDetailSeoJsonStructuredData, type SdkContentItem, type SdkContentListResponse, type SdkContentReferencesResponse, type SdkContentReferencesResponseReferencesItem, type SdkContentReferencesResponseReferencesItemDataEntriesItem, type SdkContentReferencesResponseReferencesItemDataEntriesItemData, type SdkCreateContentResponse, type SdkCreateContentResponseWarningsItem, SdkCreateContentResponseWarningsItemIssueType, SdkCreateContentResponseWarningsItemTargetType, type SdkCreateEntryRequest, type SdkCreateEntryRequestDataJson, SdkCreateEntryRequestStatus, type SdkCustomComponentResponse, type SdkCustomComponentResponsePropsSchema, SdkCustomComponentResponseStatus, type SdkCustomComponentsListResponse, type SdkDataEntriesListResponse, type SdkDataEntryDeletionImpactItem, type SdkDataEntryDeletionImpactResponse, type SdkDataEntryDetailResponse, type SdkDataEntryResponse, type SdkDataEntryResponseDataJson, SdkDataEntryResponseStatus, type SdkDataTypeInfo, type SdkDeleteCollectionDataTypeResponse, type SdkDeleteCollectionResponse, type SdkDeleteContentResponse, type SdkDeleteDataEntryResponse, type SdkDeleteDataTypeResponse, type SdkDeleteFormDefinitionResponse, type SdkDocResponse, SdkDocType, type SdkLinkExistingDataTypeRequest, SdkLinkExistingDataTypeRequestReferenceType, type SdkPreset, SdkPresetReferenceType, type SdkPublishContentResponse, type SdkRequestReviewResponse, type SdkRuntimeSettingsResponse, type SdkRuntimeSettingsResponseSettings, type SdkRuntimeSettingsResponseSettingsAnalytics, SdkRuntimeSettingsResponseSettingsAnalyticsProvider, type SdkRuntimeSettingsResponseSettingsAnalyticsTracking, type SdkRuntimeSettingsResponseSettingsRevalidation, type SdkSetContentReferencesRequest, type SdkSetContentReferencesRequestReferencesItem, type SdkSetContentReferencesResponse, type SdkUpdateContentResponse, type SdkUpdateContentResponseWarningsItem, SdkUpdateContentResponseWarningsItemIssueType, SdkUpdateContentResponseWarningsItemTargetType, type SdkUpdateEntryRequest, type SdkUpdateEntryRequestDataJson, SdkUpdateEntryRequestStatus, type SdkUpsertDocBody, type SdkValidateContentResponse, type SdkValidateContentResponseIssuesItem, SdkValidateContentResponseIssuesItemIssueType, SdkValidateContentResponseIssuesItemTargetType, type UpdateCollectionRequest, type UpdateContentRequest, type UpdateDataTypeRequest, type UpdateFormDefinitionRequest, type UpdateFormDefinitionRequestConfigJson, type ValidationError, type ValidationResult, basicComponents, componentCatalog, componentSchemas, customComponents, fetchAnalyticsDailyMetrics, fetchRuntimeSettings, getAnalyticsDaily, getCatalogForAI, getCollectionContentDetail, getCollectionContentDetailOrThrow, getCollectionContents, getCollectionContentsOrThrow, getCollections, getCollectionsSlugContents, getCollectionsSlugContentsContentSlug, getComponentsByCategory, getComponentsWithReferences, getDataEntries, getDataEntriesOrThrow, getDataEntry, getDataEntryOrThrow, getDataTypeSlug, getGetAnalyticsDailyUrl, getGetCollectionsSlugContentsContentSlugUrl, getGetCollectionsSlugContentsUrl, getGetDataTypeSlugUrl, getGetPreviewTokenUrl, getGetRuntimeSettingsUrl, getPreviewByToken, getPreviewToken, getRuntimeSettings, getSchema, getSdkApiBaseUrl, getSdkApiToken, isValidComponent, markdownComponents, mdxComponents, quickValidateMdx, renderMdx, renderMdxPreview, sdkCustomInstance, sdkFetchWithTags, sdkFetcher, sdkPostFetcher, submitFormData, validateComponentProps, validateMdx };
package/dist/index.js CHANGED
@@ -249,6 +249,43 @@ var getPreviewToken = async (token, options) => {
249
249
  const data = body ? JSON.parse(body, dateReviver) : {};
250
250
  return { data, status: res.status, headers: res.headers };
251
251
  };
252
+ var getGetRuntimeSettingsUrl = () => {
253
+ return `/api/v1/sdk/runtime/settings`;
254
+ };
255
+ var getRuntimeSettings = async (options) => {
256
+ const res = await fetch(
257
+ getGetRuntimeSettingsUrl(),
258
+ {
259
+ ...options,
260
+ method: "GET"
261
+ }
262
+ );
263
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
264
+ const data = body ? JSON.parse(body, dateReviver) : {};
265
+ return { data, status: res.status, headers: res.headers };
266
+ };
267
+ var getGetAnalyticsDailyUrl = (params) => {
268
+ const normalizedParams = new URLSearchParams();
269
+ Object.entries(params || {}).forEach(([key, value]) => {
270
+ if (value !== void 0) {
271
+ normalizedParams.append(key, value === null ? "null" : value.toString());
272
+ }
273
+ });
274
+ const stringifiedParams = normalizedParams.toString();
275
+ return stringifiedParams.length > 0 ? `/api/v1/sdk/analytics/daily?${stringifiedParams}` : `/api/v1/sdk/analytics/daily`;
276
+ };
277
+ var getAnalyticsDaily = async (params, options) => {
278
+ const res = await fetch(
279
+ getGetAnalyticsDailyUrl(params),
280
+ {
281
+ ...options,
282
+ method: "GET"
283
+ }
284
+ );
285
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
286
+ const data = body ? JSON.parse(body, dateReviver) : {};
287
+ return { data, status: res.status, headers: res.headers };
288
+ };
252
289
 
253
290
  // src/api.ts
254
291
  async function getCollectionContents(slug, options) {
@@ -353,6 +390,20 @@ async function submitFormData(typeSlug, data) {
353
390
  { data }
354
391
  );
355
392
  }
393
+ async function fetchRuntimeSettings() {
394
+ const response = await getRuntimeSettings();
395
+ if (response.status !== 200) {
396
+ throw new Error(`Failed to fetch runtime settings: ${response.status}`);
397
+ }
398
+ return response.data;
399
+ }
400
+ async function fetchAnalyticsDailyMetrics(params) {
401
+ const response = await getAnalyticsDaily(params);
402
+ if (response.status !== 200) {
403
+ throw new Error(`Failed to fetch analytics daily metrics: ${response.status}`);
404
+ }
405
+ return response.data;
406
+ }
356
407
 
357
408
  // src/mdx/components/basic/Callout.tsx
358
409
  import { AlertCircle, AlertTriangle, CheckCircle, Info, Lightbulb } from "lucide-react";
@@ -2116,6 +2167,9 @@ export {
2116
2167
  componentCatalog,
2117
2168
  componentSchemas,
2118
2169
  customComponents,
2170
+ fetchAnalyticsDailyMetrics,
2171
+ fetchRuntimeSettings,
2172
+ getAnalyticsDaily,
2119
2173
  getCatalogForAI,
2120
2174
  getCollectionContentDetail,
2121
2175
  getCollectionContentDetailOrThrow,
@@ -2131,12 +2185,15 @@ export {
2131
2185
  getDataEntry,
2132
2186
  getDataEntryOrThrow,
2133
2187
  getDataTypeSlug,
2188
+ getGetAnalyticsDailyUrl,
2134
2189
  getGetCollectionsSlugContentsContentSlugUrl,
2135
2190
  getGetCollectionsSlugContentsUrl,
2136
2191
  getGetDataTypeSlugUrl,
2137
2192
  getGetPreviewTokenUrl,
2193
+ getGetRuntimeSettingsUrl,
2138
2194
  getPreviewByToken,
2139
2195
  getPreviewToken,
2196
+ getRuntimeSettings,
2140
2197
  getSchema,
2141
2198
  getSdkApiBaseUrl,
2142
2199
  getSdkApiToken,