@salefony/api-sdk 1.0.9 → 1.0.11

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 CHANGED
@@ -21,6 +21,7 @@ Salefony API SDK - Official SDK for Salefony Backend API. Full TypeScript suppor
21
21
  - [Response Helpers](#-response-helpers)
22
22
  - [Admin vs Frontstore](#-admin-vs-frontstore)
23
23
  - [Integrations (3rd Party OAuth)](#-integrations-3rd-party-oauth)
24
+ - [Datasets (Reference Data)](#-datasets-reference-data)
24
25
  - [SSR Usage](#-ssr-usage)
25
26
  - [Error Handling](#-error-handling)
26
27
  - [API Reference](#-api-reference)
@@ -483,6 +484,7 @@ const { total, page, limit, totalPages, hasNextPage } = meta ?? {};
483
484
 
484
485
  - `collections`, `contents`, `layouts`, `navigations`
485
486
  - `integrations` – 3rd party OAuth (Google Analytics, Facebook, TikTok, etc.)
487
+ - `datasets` – reference data (regions/languages, themes, integrations catalog)
486
488
  - `languages`, `datasource`, `metadata`
487
489
  - `vendors`, `stores`, `apiKeys`
488
490
  - `settings`, `seo`, `media`
@@ -514,6 +516,16 @@ const { data } = await sdk.admin.integrations.getStatus('google-analytics');
514
516
 
515
517
  // Disconnect
516
518
  await sdk.admin.integrations.disconnect('google-analytics');
519
+
520
+ // Ayarlar (google-analytics: her alan kendi options parametresi ile)
521
+ const { data } = await sdk.admin.integrations.getSettings('google-analytics');
522
+ // data.fields → [{ key, value, label, type: 'select', options: [...] }]
523
+
524
+ await sdk.admin.integrations.updateSettings('google-analytics', {
525
+ activeAccountId: '123',
526
+ measurementId: 'G-XXXXXXXXXX',
527
+ uaId: 'UA-123456-1',
528
+ });
517
529
  ```
518
530
 
519
531
  **Platform usage:**
@@ -528,6 +540,28 @@ Full guide: [Integrations Documentation](./docs/INTEGRATIONS.md)
528
540
 
529
541
  ---
530
542
 
543
+ ## 📊 Datasets (Reference Data)
544
+
545
+ Dynamic reference data API. Dataset types (regions, themes, integrations, ...) are registered on the backend. New types can be added without API/SDK changes.
546
+
547
+ ```typescript
548
+ // List available dataset types (regions, themes, integrations, ...)
549
+ const { data } = await sdk.admin.datasets.listTypes();
550
+ // data.types → ['regions', 'themes', 'integrations']
551
+
552
+ // Get dataset by type (works for any registered type)
553
+ const { data: regions } = await sdk.admin.datasets.get('regions');
554
+ const { data: themes } = await sdk.admin.datasets.get('themes');
555
+ const { data: integrations } = await sdk.admin.datasets.get('integrations');
556
+
557
+ // Type-safe for known types (optional generic)
558
+ const { data } = await sdk.admin.datasets.get<Region[]>('regions');
559
+ // Future types work without SDK update
560
+ const { data: currencies } = await sdk.admin.datasets.get('currencies');
561
+ ```
562
+
563
+ ---
564
+
531
565
  ## 🛠️ SSR Usage
532
566
 
533
567
  ### Next.js Server Component
package/dist/index.d.mts CHANGED
@@ -1223,7 +1223,10 @@ declare class AuthResource extends BaseResource {
1223
1223
  declare class GoogleResource extends BaseResource {
1224
1224
  constructor(httpClient: AxiosInstance);
1225
1225
  getSites(): Promise<ApiResponse<any>>;
1226
- getAnalytics(propertyId: string): Promise<ApiResponse<any>>;
1226
+ /**
1227
+ * Temel analytics verisi. propertyId verilmezse Integration Settings'teki activePropertyId kullanılır.
1228
+ */
1229
+ getAnalytics(propertyId?: string): Promise<ApiResponse<any>>;
1227
1230
  updateSitemap(siteUrl: string, sitemapUrl: string): Promise<ApiResponse<any>>;
1228
1231
  getPerformance(siteUrl: string, startDate: string, endDate: string): Promise<ApiResponse<any>>;
1229
1232
  connectGoogleAnalytics(data: {
@@ -1232,9 +1235,20 @@ declare class GoogleResource extends BaseResource {
1232
1235
  scope?: string;
1233
1236
  expiresAt?: number;
1234
1237
  }): Promise<ApiResponse<any>>;
1238
+ /** Entegrasyon ayarlarındaki aktif hesaba göre account listesi. */
1235
1239
  getAnalyticsAccount(): Promise<ApiResponse<any>>;
1236
- getAnalyticsAccountDetails(acc: string): Promise<ApiResponse<any>>;
1237
- getDetailedAnalytics(acc: string, propertyId: string, reportType: string): Promise<ApiResponse<any>>;
1240
+ /**
1241
+ * Detaylı account raporları. acc verilmezse Integration Settings'teki activeAccountId kullanılır.
1242
+ */
1243
+ getAnalyticsAccountDetails(acc?: string): Promise<ApiResponse<any>>;
1244
+ /**
1245
+ * Detaylı rapor (ecommerce, demographics).
1246
+ * propertyId/acc verilmezse Integration Settings kullanılır.
1247
+ */
1248
+ getDetailedAnalytics(reportType: string, options?: {
1249
+ acc?: string;
1250
+ propertyId?: string;
1251
+ }): Promise<ApiResponse<any>>;
1238
1252
  }
1239
1253
 
1240
1254
  /**
@@ -1248,13 +1262,27 @@ interface IntegrationConnectionStatus {
1248
1262
  expiresAt?: number | null;
1249
1263
  createdAt?: string;
1250
1264
  }
1251
- /** Provider'a özel ayarlar - her entegrasyon farklı key'ler kullanabilir */
1265
+ /** Provider-specific settings - each integration can use different keys */
1252
1266
  type IntegrationSettingsData = Record<string, unknown>;
1253
- /** Google Analytics ayarları örneği */
1267
+ /** Integration setting field types - use only these in schema */
1268
+ type IntegrationSettingType = 'image' | 'input' | 'select' | 'listEdit' | 'parentSelect' | 'mediaSelect' | 'tagsListEdit' | 'tagsEdit' | 'boolean' | 'password';
1269
+ /** Select option - filled by backend */
1270
+ interface IntegrationSettingOption {
1271
+ value: string;
1272
+ label: string;
1273
+ }
1274
+ /** Google Analytics field - each field has its own options */
1275
+ interface GoogleAnalyticsSettingsField {
1276
+ key: string;
1277
+ value?: string;
1278
+ label: string;
1279
+ labelTr?: string;
1280
+ type: IntegrationSettingType;
1281
+ options: IntegrationSettingOption[];
1282
+ }
1283
+ /** Google Analytics ayarları - getSettings ile döner, her field kendi options parametresi ile */
1254
1284
  interface GoogleAnalyticsSettings {
1255
- activeAccountId?: string;
1256
- activePropertyId?: string;
1257
- uaId?: string;
1285
+ fields: GoogleAnalyticsSettingsField[];
1258
1286
  }
1259
1287
  /** Facebook Business ayarları örneği */
1260
1288
  interface FacebookBusinessSettings {
@@ -1308,17 +1336,108 @@ declare class IntegrationsResource extends BaseResource {
1308
1336
  providers: IntegrationProviderId[];
1309
1337
  }>>;
1310
1338
  /**
1311
- * Entegrasyon ayarlarını getirir
1339
+ * Entegrasyon ayarlarını getirir.
1340
+ * google-analytics için: { fields: [...] } - her alan kendi options parametresi ile
1341
+ * (activeAccountId → account listesi, activePropertyId → property listesi, uaId → UA listesi)
1312
1342
  */
1313
- getSettings(provider: IntegrationProviderId | string): Promise<ApiResponse<IntegrationSettingsData>>;
1343
+ getSettings(provider: IntegrationProviderId | string): Promise<ApiResponse<IntegrationSettingsData | GoogleAnalyticsSettings>>;
1314
1344
  /**
1315
- * Entegrasyon ayarlarını günceller (merge - mevcut ayarlarla birleştirir)
1345
+ * Entegrasyon ayarlarını günceller (merge - mevcut ayarlarla birleştirir).
1346
+ * google-analytics için: { activeAccountId, activePropertyId, measurementId, uaId } flat format ile gönderilebilir.
1347
+ * Response yine fields formatında döner (options backend'de doldurulur).
1316
1348
  */
1317
- updateSettings(provider: IntegrationProviderId | string, settings: IntegrationSettingsData): Promise<ApiResponse<IntegrationSettingsData>>;
1349
+ updateSettings(provider: IntegrationProviderId | string, settings: IntegrationSettingsData | {
1350
+ fields: {
1351
+ key: string;
1352
+ value?: string;
1353
+ }[];
1354
+ }): Promise<ApiResponse<IntegrationSettingsData | GoogleAnalyticsSettings>>;
1318
1355
  /** HttpClient'ın baseURL'ini alır */
1319
1356
  private getBaseUrl;
1320
1357
  }
1321
1358
 
1359
+ /** Bilinen dataset tipleri - yeni tipler dinamik olarak eklenebilir */
1360
+ type KnownDatasetType = 'regions' | 'themes' | 'integrations';
1361
+ /** Region country item (from regions dataset) */
1362
+ interface RegionCountry {
1363
+ code: string;
1364
+ country: string;
1365
+ language: string;
1366
+ label: string;
1367
+ labelEn: string;
1368
+ isRTL?: boolean;
1369
+ }
1370
+ /** Region with countries (language/locale list) */
1371
+ interface Region {
1372
+ id: string;
1373
+ name: string;
1374
+ countries: RegionCountry[];
1375
+ }
1376
+ /** Theme item from themes dataset */
1377
+ interface ThemeItem {
1378
+ id: string;
1379
+ title: string;
1380
+ originalPrice?: string;
1381
+ price?: string;
1382
+ category?: string;
1383
+ currencyCode?: string;
1384
+ description?: string;
1385
+ images?: string[];
1386
+ provider?: string;
1387
+ rate?: string;
1388
+ }
1389
+
1390
+ /** Integration setting field schema (catalog from datasets) */
1391
+ interface IntegrationSettingSchema {
1392
+ key: string;
1393
+ label: string;
1394
+ labelTr?: string;
1395
+ type: IntegrationSettingType;
1396
+ required?: boolean;
1397
+ placeholder?: string;
1398
+ description?: string;
1399
+ options?: {
1400
+ value: string;
1401
+ label: string;
1402
+ }[];
1403
+ }
1404
+ /** Entegrasyon kataloğu öğesi */
1405
+ interface IntegrationCatalogItem {
1406
+ id: string;
1407
+ name: string;
1408
+ nameTr?: string;
1409
+ description?: string;
1410
+ icon?: string;
1411
+ settingsSchema: IntegrationSettingSchema[];
1412
+ }
1413
+ /**
1414
+ * Dinamik dataset API.
1415
+ * Veri tipleri (themes, regions, integrations, ...) backend registry'de kayıtlıdır.
1416
+ * Yeni tipler eklendiğinde API/SDK değişiklik gerektirmez.
1417
+ */
1418
+ declare class DatasetsResource extends BaseResource {
1419
+ constructor(httpClient: AxiosInstance);
1420
+ /**
1421
+ * Kayıtlı dataset tiplerini listeler (regions, themes, integrations, vb.)
1422
+ */
1423
+ listTypes(): Promise<ApiResponse<{
1424
+ types: string[];
1425
+ }>>;
1426
+ /**
1427
+ * Verilen tipteki dataset verisini getirir.
1428
+ * Dinamik: Bilinen tipler dışında yeni tipler de çalışır.
1429
+ *
1430
+ * @param type - Dataset tipi: 'regions' | 'themes' | 'integrations' | (gelecekte eklenecek diğer tipler)
1431
+ */
1432
+ get<T = unknown>(type: string): Promise<ApiResponse<T>>;
1433
+ /** @deprecated get('regions') kullanın */
1434
+ getRegions(): Promise<ApiResponse<Region[]>>;
1435
+ /** @deprecated get('themes') kullanın */
1436
+ getThemes(): Promise<ApiResponse<ThemeItem[]>>;
1437
+ /** @deprecated get('integrations') kullanın */
1438
+ getIntegrations(): Promise<ApiResponse<IntegrationCatalogItem[]>>;
1439
+ }
1440
+
1322
1441
  declare class CloudflareResource extends BaseResource {
1323
1442
  constructor(httpClient: AxiosInstance);
1324
1443
  getAccounts(): Promise<ApiResponse<any>>;
@@ -1458,17 +1577,25 @@ declare const index$5_CloudflareResource: typeof CloudflareResource;
1458
1577
  type index$5_CreateDatasourceInput = CreateDatasourceInput;
1459
1578
  type index$5_CustomDataResource = CustomDataResource;
1460
1579
  declare const index$5_CustomDataResource: typeof CustomDataResource;
1580
+ type index$5_DatasetsResource = DatasetsResource;
1581
+ declare const index$5_DatasetsResource: typeof DatasetsResource;
1461
1582
  type index$5_DatasourceResource = DatasourceResource;
1462
1583
  declare const index$5_DatasourceResource: typeof DatasourceResource;
1463
1584
  type index$5_FacebookBusinessSettings = FacebookBusinessSettings;
1464
1585
  type index$5_GoogleAnalyticsSettings = GoogleAnalyticsSettings;
1586
+ type index$5_GoogleAnalyticsSettingsField = GoogleAnalyticsSettingsField;
1465
1587
  type index$5_GoogleResource = GoogleResource;
1466
1588
  declare const index$5_GoogleResource: typeof GoogleResource;
1589
+ type index$5_IntegrationCatalogItem = IntegrationCatalogItem;
1467
1590
  type index$5_IntegrationConnectionStatus = IntegrationConnectionStatus;
1468
1591
  type index$5_IntegrationProviderId = IntegrationProviderId;
1592
+ type index$5_IntegrationSettingOption = IntegrationSettingOption;
1593
+ type index$5_IntegrationSettingSchema = IntegrationSettingSchema;
1594
+ type index$5_IntegrationSettingType = IntegrationSettingType;
1469
1595
  type index$5_IntegrationSettingsData = IntegrationSettingsData;
1470
1596
  type index$5_IntegrationsResource = IntegrationsResource;
1471
1597
  declare const index$5_IntegrationsResource: typeof IntegrationsResource;
1598
+ type index$5_KnownDatasetType = KnownDatasetType;
1472
1599
  type index$5_LayoutResource = LayoutResource;
1473
1600
  declare const index$5_LayoutResource: typeof LayoutResource;
1474
1601
  type index$5_ListNotificationsParams = ListNotificationsParams;
@@ -1481,6 +1608,8 @@ type index$5_ProjectResource = ProjectResource;
1481
1608
  declare const index$5_ProjectResource: typeof ProjectResource;
1482
1609
  type index$5_PurchaseResource = PurchaseResource;
1483
1610
  declare const index$5_PurchaseResource: typeof PurchaseResource;
1611
+ type index$5_Region = Region;
1612
+ type index$5_RegionCountry = RegionCountry;
1484
1613
  type index$5_SEOResource = SEOResource;
1485
1614
  declare const index$5_SEOResource: typeof SEOResource;
1486
1615
  type index$5_SectionResource = SectionResource;
@@ -1492,6 +1621,7 @@ declare const index$5_SettingsResource: typeof SettingsResource;
1492
1621
  type index$5_StoreNotification = StoreNotification;
1493
1622
  type index$5_SubscriptionResource = SubscriptionResource;
1494
1623
  declare const index$5_SubscriptionResource: typeof SubscriptionResource;
1624
+ type index$5_ThemeItem = ThemeItem;
1495
1625
  type index$5_ThemeResource = ThemeResource;
1496
1626
  declare const index$5_ThemeResource: typeof ThemeResource;
1497
1627
  type index$5_UpdateDatasourceInput = UpdateDatasourceInput;
@@ -1511,7 +1641,7 @@ declare const index$5_sectorColumns: typeof sectorColumns;
1511
1641
  declare const index$5_storeColumns: typeof storeColumns;
1512
1642
  declare const index$5_vendorColumns: typeof vendorColumns;
1513
1643
  declare namespace index$5 {
1514
- export { type index$5_AdminMediaCreateInput as AdminMediaCreateInput, index$5_ApiKeyResource as ApiKeyResource, index$5_AuthResource as AuthResource, index$5_CloudflareResource as CloudflareResource, CollectionResource$1 as CollectionResource, ContentResource$1 as ContentResource, type index$5_CreateDatasourceInput as CreateDatasourceInput, index$5_CustomDataResource as CustomDataResource, index$5_DatasourceResource as DatasourceResource, type index$5_FacebookBusinessSettings as FacebookBusinessSettings, type index$5_GoogleAnalyticsSettings as GoogleAnalyticsSettings, index$5_GoogleResource as GoogleResource, type index$5_IntegrationConnectionStatus as IntegrationConnectionStatus, type index$5_IntegrationProviderId as IntegrationProviderId, type index$5_IntegrationSettingsData as IntegrationSettingsData, index$5_IntegrationsResource as IntegrationsResource, LanguageResource$1 as LanguageResource, index$5_LayoutResource as LayoutResource, type index$5_ListNotificationsParams as ListNotificationsParams, MediaResource$1 as MediaResource, index$5_MetadataResource as MetadataResource, NavigationResource$1 as NavigationResource, index$5_NotificationResource as NotificationResource, type index$5_NotificationType as NotificationType, index$5_ProjectResource as ProjectResource, index$5_PurchaseResource as PurchaseResource, ReviewResource$1 as ReviewResource, index$5_SEOResource as SEOResource, index$5_SectionResource as SectionResource, index$5_SectorResource as SectorResource, index$5_SettingsResource as SettingsResource, type index$5_StoreNotification as StoreNotification, StoreResource$1 as StoreResource, index$5_SubscriptionResource as SubscriptionResource, index$5_ThemeResource as ThemeResource, type index$5_UpdateDatasourceInput as UpdateDatasourceInput, index$5_VendorResource as VendorResource, index$5_WebmailResource as WebmailResource, index$5_apiKeyColumns as apiKeyColumns, collectionColumns$1 as collectionColumns, contentColumns$1 as contentColumns, index$5_datasourceColumns as datasourceColumns, index$5_languageColumns as languageColumns, index$5_layoutColumns as layoutColumns, index$5_metadataColumns as metadataColumns, index$5_navigationColumns as navigationColumns, index$5_projectColumns as projectColumns, index$5_sectionColumns as sectionColumns, index$5_sectorColumns as sectorColumns, index$5_storeColumns as storeColumns, index$5_vendorColumns as vendorColumns };
1644
+ export { type index$5_AdminMediaCreateInput as AdminMediaCreateInput, index$5_ApiKeyResource as ApiKeyResource, index$5_AuthResource as AuthResource, index$5_CloudflareResource as CloudflareResource, CollectionResource$1 as CollectionResource, ContentResource$1 as ContentResource, type index$5_CreateDatasourceInput as CreateDatasourceInput, index$5_CustomDataResource as CustomDataResource, index$5_DatasetsResource as DatasetsResource, index$5_DatasourceResource as DatasourceResource, type index$5_FacebookBusinessSettings as FacebookBusinessSettings, type index$5_GoogleAnalyticsSettings as GoogleAnalyticsSettings, type index$5_GoogleAnalyticsSettingsField as GoogleAnalyticsSettingsField, index$5_GoogleResource as GoogleResource, type index$5_IntegrationCatalogItem as IntegrationCatalogItem, type index$5_IntegrationConnectionStatus as IntegrationConnectionStatus, type index$5_IntegrationProviderId as IntegrationProviderId, type index$5_IntegrationSettingOption as IntegrationSettingOption, type index$5_IntegrationSettingSchema as IntegrationSettingSchema, type index$5_IntegrationSettingType as IntegrationSettingType, type index$5_IntegrationSettingsData as IntegrationSettingsData, index$5_IntegrationsResource as IntegrationsResource, type index$5_KnownDatasetType as KnownDatasetType, LanguageResource$1 as LanguageResource, index$5_LayoutResource as LayoutResource, type index$5_ListNotificationsParams as ListNotificationsParams, MediaResource$1 as MediaResource, index$5_MetadataResource as MetadataResource, NavigationResource$1 as NavigationResource, index$5_NotificationResource as NotificationResource, type index$5_NotificationType as NotificationType, index$5_ProjectResource as ProjectResource, index$5_PurchaseResource as PurchaseResource, type index$5_Region as Region, type index$5_RegionCountry as RegionCountry, ReviewResource$1 as ReviewResource, index$5_SEOResource as SEOResource, index$5_SectionResource as SectionResource, index$5_SectorResource as SectorResource, index$5_SettingsResource as SettingsResource, type index$5_StoreNotification as StoreNotification, StoreResource$1 as StoreResource, index$5_SubscriptionResource as SubscriptionResource, type index$5_ThemeItem as ThemeItem, index$5_ThemeResource as ThemeResource, type index$5_UpdateDatasourceInput as UpdateDatasourceInput, index$5_VendorResource as VendorResource, index$5_WebmailResource as WebmailResource, index$5_apiKeyColumns as apiKeyColumns, collectionColumns$1 as collectionColumns, contentColumns$1 as contentColumns, index$5_datasourceColumns as datasourceColumns, index$5_languageColumns as languageColumns, index$5_layoutColumns as layoutColumns, index$5_metadataColumns as metadataColumns, index$5_navigationColumns as navigationColumns, index$5_projectColumns as projectColumns, index$5_sectionColumns as sectionColumns, index$5_sectorColumns as sectorColumns, index$5_storeColumns as storeColumns, index$5_vendorColumns as vendorColumns };
1515
1645
  }
1516
1646
 
1517
1647
  declare class StoreResource extends CrudResource<Store, StoreWhereInput, StoreOrderByInput, StoreCreateInput, StoreUpdateInput> {
@@ -1946,6 +2076,7 @@ declare class AdminNamespace {
1946
2076
  readonly themes: ThemeResource;
1947
2077
  readonly google: GoogleResource;
1948
2078
  readonly integrations: IntegrationsResource;
2079
+ readonly datasets: DatasetsResource;
1949
2080
  readonly cloudflare: CloudflareResource;
1950
2081
  readonly reviews: ReviewResource$1;
1951
2082
  readonly customData: CustomDataResource;
package/dist/index.d.ts CHANGED
@@ -1223,7 +1223,10 @@ declare class AuthResource extends BaseResource {
1223
1223
  declare class GoogleResource extends BaseResource {
1224
1224
  constructor(httpClient: AxiosInstance);
1225
1225
  getSites(): Promise<ApiResponse<any>>;
1226
- getAnalytics(propertyId: string): Promise<ApiResponse<any>>;
1226
+ /**
1227
+ * Temel analytics verisi. propertyId verilmezse Integration Settings'teki activePropertyId kullanılır.
1228
+ */
1229
+ getAnalytics(propertyId?: string): Promise<ApiResponse<any>>;
1227
1230
  updateSitemap(siteUrl: string, sitemapUrl: string): Promise<ApiResponse<any>>;
1228
1231
  getPerformance(siteUrl: string, startDate: string, endDate: string): Promise<ApiResponse<any>>;
1229
1232
  connectGoogleAnalytics(data: {
@@ -1232,9 +1235,20 @@ declare class GoogleResource extends BaseResource {
1232
1235
  scope?: string;
1233
1236
  expiresAt?: number;
1234
1237
  }): Promise<ApiResponse<any>>;
1238
+ /** Entegrasyon ayarlarındaki aktif hesaba göre account listesi. */
1235
1239
  getAnalyticsAccount(): Promise<ApiResponse<any>>;
1236
- getAnalyticsAccountDetails(acc: string): Promise<ApiResponse<any>>;
1237
- getDetailedAnalytics(acc: string, propertyId: string, reportType: string): Promise<ApiResponse<any>>;
1240
+ /**
1241
+ * Detaylı account raporları. acc verilmezse Integration Settings'teki activeAccountId kullanılır.
1242
+ */
1243
+ getAnalyticsAccountDetails(acc?: string): Promise<ApiResponse<any>>;
1244
+ /**
1245
+ * Detaylı rapor (ecommerce, demographics).
1246
+ * propertyId/acc verilmezse Integration Settings kullanılır.
1247
+ */
1248
+ getDetailedAnalytics(reportType: string, options?: {
1249
+ acc?: string;
1250
+ propertyId?: string;
1251
+ }): Promise<ApiResponse<any>>;
1238
1252
  }
1239
1253
 
1240
1254
  /**
@@ -1248,13 +1262,27 @@ interface IntegrationConnectionStatus {
1248
1262
  expiresAt?: number | null;
1249
1263
  createdAt?: string;
1250
1264
  }
1251
- /** Provider'a özel ayarlar - her entegrasyon farklı key'ler kullanabilir */
1265
+ /** Provider-specific settings - each integration can use different keys */
1252
1266
  type IntegrationSettingsData = Record<string, unknown>;
1253
- /** Google Analytics ayarları örneği */
1267
+ /** Integration setting field types - use only these in schema */
1268
+ type IntegrationSettingType = 'image' | 'input' | 'select' | 'listEdit' | 'parentSelect' | 'mediaSelect' | 'tagsListEdit' | 'tagsEdit' | 'boolean' | 'password';
1269
+ /** Select option - filled by backend */
1270
+ interface IntegrationSettingOption {
1271
+ value: string;
1272
+ label: string;
1273
+ }
1274
+ /** Google Analytics field - each field has its own options */
1275
+ interface GoogleAnalyticsSettingsField {
1276
+ key: string;
1277
+ value?: string;
1278
+ label: string;
1279
+ labelTr?: string;
1280
+ type: IntegrationSettingType;
1281
+ options: IntegrationSettingOption[];
1282
+ }
1283
+ /** Google Analytics ayarları - getSettings ile döner, her field kendi options parametresi ile */
1254
1284
  interface GoogleAnalyticsSettings {
1255
- activeAccountId?: string;
1256
- activePropertyId?: string;
1257
- uaId?: string;
1285
+ fields: GoogleAnalyticsSettingsField[];
1258
1286
  }
1259
1287
  /** Facebook Business ayarları örneği */
1260
1288
  interface FacebookBusinessSettings {
@@ -1308,17 +1336,108 @@ declare class IntegrationsResource extends BaseResource {
1308
1336
  providers: IntegrationProviderId[];
1309
1337
  }>>;
1310
1338
  /**
1311
- * Entegrasyon ayarlarını getirir
1339
+ * Entegrasyon ayarlarını getirir.
1340
+ * google-analytics için: { fields: [...] } - her alan kendi options parametresi ile
1341
+ * (activeAccountId → account listesi, activePropertyId → property listesi, uaId → UA listesi)
1312
1342
  */
1313
- getSettings(provider: IntegrationProviderId | string): Promise<ApiResponse<IntegrationSettingsData>>;
1343
+ getSettings(provider: IntegrationProviderId | string): Promise<ApiResponse<IntegrationSettingsData | GoogleAnalyticsSettings>>;
1314
1344
  /**
1315
- * Entegrasyon ayarlarını günceller (merge - mevcut ayarlarla birleştirir)
1345
+ * Entegrasyon ayarlarını günceller (merge - mevcut ayarlarla birleştirir).
1346
+ * google-analytics için: { activeAccountId, activePropertyId, measurementId, uaId } flat format ile gönderilebilir.
1347
+ * Response yine fields formatında döner (options backend'de doldurulur).
1316
1348
  */
1317
- updateSettings(provider: IntegrationProviderId | string, settings: IntegrationSettingsData): Promise<ApiResponse<IntegrationSettingsData>>;
1349
+ updateSettings(provider: IntegrationProviderId | string, settings: IntegrationSettingsData | {
1350
+ fields: {
1351
+ key: string;
1352
+ value?: string;
1353
+ }[];
1354
+ }): Promise<ApiResponse<IntegrationSettingsData | GoogleAnalyticsSettings>>;
1318
1355
  /** HttpClient'ın baseURL'ini alır */
1319
1356
  private getBaseUrl;
1320
1357
  }
1321
1358
 
1359
+ /** Bilinen dataset tipleri - yeni tipler dinamik olarak eklenebilir */
1360
+ type KnownDatasetType = 'regions' | 'themes' | 'integrations';
1361
+ /** Region country item (from regions dataset) */
1362
+ interface RegionCountry {
1363
+ code: string;
1364
+ country: string;
1365
+ language: string;
1366
+ label: string;
1367
+ labelEn: string;
1368
+ isRTL?: boolean;
1369
+ }
1370
+ /** Region with countries (language/locale list) */
1371
+ interface Region {
1372
+ id: string;
1373
+ name: string;
1374
+ countries: RegionCountry[];
1375
+ }
1376
+ /** Theme item from themes dataset */
1377
+ interface ThemeItem {
1378
+ id: string;
1379
+ title: string;
1380
+ originalPrice?: string;
1381
+ price?: string;
1382
+ category?: string;
1383
+ currencyCode?: string;
1384
+ description?: string;
1385
+ images?: string[];
1386
+ provider?: string;
1387
+ rate?: string;
1388
+ }
1389
+
1390
+ /** Integration setting field schema (catalog from datasets) */
1391
+ interface IntegrationSettingSchema {
1392
+ key: string;
1393
+ label: string;
1394
+ labelTr?: string;
1395
+ type: IntegrationSettingType;
1396
+ required?: boolean;
1397
+ placeholder?: string;
1398
+ description?: string;
1399
+ options?: {
1400
+ value: string;
1401
+ label: string;
1402
+ }[];
1403
+ }
1404
+ /** Entegrasyon kataloğu öğesi */
1405
+ interface IntegrationCatalogItem {
1406
+ id: string;
1407
+ name: string;
1408
+ nameTr?: string;
1409
+ description?: string;
1410
+ icon?: string;
1411
+ settingsSchema: IntegrationSettingSchema[];
1412
+ }
1413
+ /**
1414
+ * Dinamik dataset API.
1415
+ * Veri tipleri (themes, regions, integrations, ...) backend registry'de kayıtlıdır.
1416
+ * Yeni tipler eklendiğinde API/SDK değişiklik gerektirmez.
1417
+ */
1418
+ declare class DatasetsResource extends BaseResource {
1419
+ constructor(httpClient: AxiosInstance);
1420
+ /**
1421
+ * Kayıtlı dataset tiplerini listeler (regions, themes, integrations, vb.)
1422
+ */
1423
+ listTypes(): Promise<ApiResponse<{
1424
+ types: string[];
1425
+ }>>;
1426
+ /**
1427
+ * Verilen tipteki dataset verisini getirir.
1428
+ * Dinamik: Bilinen tipler dışında yeni tipler de çalışır.
1429
+ *
1430
+ * @param type - Dataset tipi: 'regions' | 'themes' | 'integrations' | (gelecekte eklenecek diğer tipler)
1431
+ */
1432
+ get<T = unknown>(type: string): Promise<ApiResponse<T>>;
1433
+ /** @deprecated get('regions') kullanın */
1434
+ getRegions(): Promise<ApiResponse<Region[]>>;
1435
+ /** @deprecated get('themes') kullanın */
1436
+ getThemes(): Promise<ApiResponse<ThemeItem[]>>;
1437
+ /** @deprecated get('integrations') kullanın */
1438
+ getIntegrations(): Promise<ApiResponse<IntegrationCatalogItem[]>>;
1439
+ }
1440
+
1322
1441
  declare class CloudflareResource extends BaseResource {
1323
1442
  constructor(httpClient: AxiosInstance);
1324
1443
  getAccounts(): Promise<ApiResponse<any>>;
@@ -1458,17 +1577,25 @@ declare const index$5_CloudflareResource: typeof CloudflareResource;
1458
1577
  type index$5_CreateDatasourceInput = CreateDatasourceInput;
1459
1578
  type index$5_CustomDataResource = CustomDataResource;
1460
1579
  declare const index$5_CustomDataResource: typeof CustomDataResource;
1580
+ type index$5_DatasetsResource = DatasetsResource;
1581
+ declare const index$5_DatasetsResource: typeof DatasetsResource;
1461
1582
  type index$5_DatasourceResource = DatasourceResource;
1462
1583
  declare const index$5_DatasourceResource: typeof DatasourceResource;
1463
1584
  type index$5_FacebookBusinessSettings = FacebookBusinessSettings;
1464
1585
  type index$5_GoogleAnalyticsSettings = GoogleAnalyticsSettings;
1586
+ type index$5_GoogleAnalyticsSettingsField = GoogleAnalyticsSettingsField;
1465
1587
  type index$5_GoogleResource = GoogleResource;
1466
1588
  declare const index$5_GoogleResource: typeof GoogleResource;
1589
+ type index$5_IntegrationCatalogItem = IntegrationCatalogItem;
1467
1590
  type index$5_IntegrationConnectionStatus = IntegrationConnectionStatus;
1468
1591
  type index$5_IntegrationProviderId = IntegrationProviderId;
1592
+ type index$5_IntegrationSettingOption = IntegrationSettingOption;
1593
+ type index$5_IntegrationSettingSchema = IntegrationSettingSchema;
1594
+ type index$5_IntegrationSettingType = IntegrationSettingType;
1469
1595
  type index$5_IntegrationSettingsData = IntegrationSettingsData;
1470
1596
  type index$5_IntegrationsResource = IntegrationsResource;
1471
1597
  declare const index$5_IntegrationsResource: typeof IntegrationsResource;
1598
+ type index$5_KnownDatasetType = KnownDatasetType;
1472
1599
  type index$5_LayoutResource = LayoutResource;
1473
1600
  declare const index$5_LayoutResource: typeof LayoutResource;
1474
1601
  type index$5_ListNotificationsParams = ListNotificationsParams;
@@ -1481,6 +1608,8 @@ type index$5_ProjectResource = ProjectResource;
1481
1608
  declare const index$5_ProjectResource: typeof ProjectResource;
1482
1609
  type index$5_PurchaseResource = PurchaseResource;
1483
1610
  declare const index$5_PurchaseResource: typeof PurchaseResource;
1611
+ type index$5_Region = Region;
1612
+ type index$5_RegionCountry = RegionCountry;
1484
1613
  type index$5_SEOResource = SEOResource;
1485
1614
  declare const index$5_SEOResource: typeof SEOResource;
1486
1615
  type index$5_SectionResource = SectionResource;
@@ -1492,6 +1621,7 @@ declare const index$5_SettingsResource: typeof SettingsResource;
1492
1621
  type index$5_StoreNotification = StoreNotification;
1493
1622
  type index$5_SubscriptionResource = SubscriptionResource;
1494
1623
  declare const index$5_SubscriptionResource: typeof SubscriptionResource;
1624
+ type index$5_ThemeItem = ThemeItem;
1495
1625
  type index$5_ThemeResource = ThemeResource;
1496
1626
  declare const index$5_ThemeResource: typeof ThemeResource;
1497
1627
  type index$5_UpdateDatasourceInput = UpdateDatasourceInput;
@@ -1511,7 +1641,7 @@ declare const index$5_sectorColumns: typeof sectorColumns;
1511
1641
  declare const index$5_storeColumns: typeof storeColumns;
1512
1642
  declare const index$5_vendorColumns: typeof vendorColumns;
1513
1643
  declare namespace index$5 {
1514
- export { type index$5_AdminMediaCreateInput as AdminMediaCreateInput, index$5_ApiKeyResource as ApiKeyResource, index$5_AuthResource as AuthResource, index$5_CloudflareResource as CloudflareResource, CollectionResource$1 as CollectionResource, ContentResource$1 as ContentResource, type index$5_CreateDatasourceInput as CreateDatasourceInput, index$5_CustomDataResource as CustomDataResource, index$5_DatasourceResource as DatasourceResource, type index$5_FacebookBusinessSettings as FacebookBusinessSettings, type index$5_GoogleAnalyticsSettings as GoogleAnalyticsSettings, index$5_GoogleResource as GoogleResource, type index$5_IntegrationConnectionStatus as IntegrationConnectionStatus, type index$5_IntegrationProviderId as IntegrationProviderId, type index$5_IntegrationSettingsData as IntegrationSettingsData, index$5_IntegrationsResource as IntegrationsResource, LanguageResource$1 as LanguageResource, index$5_LayoutResource as LayoutResource, type index$5_ListNotificationsParams as ListNotificationsParams, MediaResource$1 as MediaResource, index$5_MetadataResource as MetadataResource, NavigationResource$1 as NavigationResource, index$5_NotificationResource as NotificationResource, type index$5_NotificationType as NotificationType, index$5_ProjectResource as ProjectResource, index$5_PurchaseResource as PurchaseResource, ReviewResource$1 as ReviewResource, index$5_SEOResource as SEOResource, index$5_SectionResource as SectionResource, index$5_SectorResource as SectorResource, index$5_SettingsResource as SettingsResource, type index$5_StoreNotification as StoreNotification, StoreResource$1 as StoreResource, index$5_SubscriptionResource as SubscriptionResource, index$5_ThemeResource as ThemeResource, type index$5_UpdateDatasourceInput as UpdateDatasourceInput, index$5_VendorResource as VendorResource, index$5_WebmailResource as WebmailResource, index$5_apiKeyColumns as apiKeyColumns, collectionColumns$1 as collectionColumns, contentColumns$1 as contentColumns, index$5_datasourceColumns as datasourceColumns, index$5_languageColumns as languageColumns, index$5_layoutColumns as layoutColumns, index$5_metadataColumns as metadataColumns, index$5_navigationColumns as navigationColumns, index$5_projectColumns as projectColumns, index$5_sectionColumns as sectionColumns, index$5_sectorColumns as sectorColumns, index$5_storeColumns as storeColumns, index$5_vendorColumns as vendorColumns };
1644
+ export { type index$5_AdminMediaCreateInput as AdminMediaCreateInput, index$5_ApiKeyResource as ApiKeyResource, index$5_AuthResource as AuthResource, index$5_CloudflareResource as CloudflareResource, CollectionResource$1 as CollectionResource, ContentResource$1 as ContentResource, type index$5_CreateDatasourceInput as CreateDatasourceInput, index$5_CustomDataResource as CustomDataResource, index$5_DatasetsResource as DatasetsResource, index$5_DatasourceResource as DatasourceResource, type index$5_FacebookBusinessSettings as FacebookBusinessSettings, type index$5_GoogleAnalyticsSettings as GoogleAnalyticsSettings, type index$5_GoogleAnalyticsSettingsField as GoogleAnalyticsSettingsField, index$5_GoogleResource as GoogleResource, type index$5_IntegrationCatalogItem as IntegrationCatalogItem, type index$5_IntegrationConnectionStatus as IntegrationConnectionStatus, type index$5_IntegrationProviderId as IntegrationProviderId, type index$5_IntegrationSettingOption as IntegrationSettingOption, type index$5_IntegrationSettingSchema as IntegrationSettingSchema, type index$5_IntegrationSettingType as IntegrationSettingType, type index$5_IntegrationSettingsData as IntegrationSettingsData, index$5_IntegrationsResource as IntegrationsResource, type index$5_KnownDatasetType as KnownDatasetType, LanguageResource$1 as LanguageResource, index$5_LayoutResource as LayoutResource, type index$5_ListNotificationsParams as ListNotificationsParams, MediaResource$1 as MediaResource, index$5_MetadataResource as MetadataResource, NavigationResource$1 as NavigationResource, index$5_NotificationResource as NotificationResource, type index$5_NotificationType as NotificationType, index$5_ProjectResource as ProjectResource, index$5_PurchaseResource as PurchaseResource, type index$5_Region as Region, type index$5_RegionCountry as RegionCountry, ReviewResource$1 as ReviewResource, index$5_SEOResource as SEOResource, index$5_SectionResource as SectionResource, index$5_SectorResource as SectorResource, index$5_SettingsResource as SettingsResource, type index$5_StoreNotification as StoreNotification, StoreResource$1 as StoreResource, index$5_SubscriptionResource as SubscriptionResource, type index$5_ThemeItem as ThemeItem, index$5_ThemeResource as ThemeResource, type index$5_UpdateDatasourceInput as UpdateDatasourceInput, index$5_VendorResource as VendorResource, index$5_WebmailResource as WebmailResource, index$5_apiKeyColumns as apiKeyColumns, collectionColumns$1 as collectionColumns, contentColumns$1 as contentColumns, index$5_datasourceColumns as datasourceColumns, index$5_languageColumns as languageColumns, index$5_layoutColumns as layoutColumns, index$5_metadataColumns as metadataColumns, index$5_navigationColumns as navigationColumns, index$5_projectColumns as projectColumns, index$5_sectionColumns as sectionColumns, index$5_sectorColumns as sectorColumns, index$5_storeColumns as storeColumns, index$5_vendorColumns as vendorColumns };
1515
1645
  }
1516
1646
 
1517
1647
  declare class StoreResource extends CrudResource<Store, StoreWhereInput, StoreOrderByInput, StoreCreateInput, StoreUpdateInput> {
@@ -1946,6 +2076,7 @@ declare class AdminNamespace {
1946
2076
  readonly themes: ThemeResource;
1947
2077
  readonly google: GoogleResource;
1948
2078
  readonly integrations: IntegrationsResource;
2079
+ readonly datasets: DatasetsResource;
1949
2080
  readonly cloudflare: CloudflareResource;
1950
2081
  readonly reviews: ReviewResource$1;
1951
2082
  readonly customData: CustomDataResource;
package/dist/index.js CHANGED
@@ -231,6 +231,7 @@ __export(admin_exports, {
231
231
  CollectionResource: () => CollectionResource,
232
232
  ContentResource: () => ContentResource,
233
233
  CustomDataResource: () => CustomDataResource,
234
+ DatasetsResource: () => DatasetsResource,
234
235
  DatasourceResource: () => DatasourceResource,
235
236
  GoogleResource: () => GoogleResource,
236
237
  IntegrationsResource: () => IntegrationsResource,
@@ -1286,11 +1287,14 @@ var GoogleResource = class extends BaseResource {
1286
1287
  url: "/api/admin/google"
1287
1288
  });
1288
1289
  }
1290
+ /**
1291
+ * Temel analytics verisi. propertyId verilmezse Integration Settings'teki activePropertyId kullanılır.
1292
+ */
1289
1293
  async getAnalytics(propertyId) {
1290
1294
  return this.request({
1291
1295
  method: "GET",
1292
1296
  url: "/api/admin/google/analytics",
1293
- params: { propertyId }
1297
+ params: propertyId ? { propertyId } : void 0
1294
1298
  });
1295
1299
  }
1296
1300
  async updateSitemap(siteUrl, sitemapUrl) {
@@ -1314,23 +1318,44 @@ var GoogleResource = class extends BaseResource {
1314
1318
  data
1315
1319
  });
1316
1320
  }
1321
+ /** Entegrasyon ayarlarındaki aktif hesaba göre account listesi. */
1317
1322
  async getAnalyticsAccount() {
1318
1323
  return this.request({
1319
1324
  method: "GET",
1320
1325
  url: "/api/admin/google/analytics/account"
1321
1326
  });
1322
1327
  }
1328
+ /**
1329
+ * Detaylı account raporları. acc verilmezse Integration Settings'teki activeAccountId kullanılır.
1330
+ */
1323
1331
  async getAnalyticsAccountDetails(acc) {
1332
+ if (acc) {
1333
+ return this.request({
1334
+ method: "GET",
1335
+ url: `/api/admin/google/analytics/account/${acc}`
1336
+ });
1337
+ }
1324
1338
  return this.request({
1325
1339
  method: "GET",
1326
- url: `/api/admin/google/analytics/account/${acc}`
1340
+ url: "/api/admin/google/analytics/details"
1327
1341
  });
1328
1342
  }
1329
- async getDetailedAnalytics(acc, propertyId, reportType) {
1343
+ /**
1344
+ * Detaylı rapor (ecommerce, demographics).
1345
+ * propertyId/acc verilmezse Integration Settings kullanılır.
1346
+ */
1347
+ async getDetailedAnalytics(reportType, options) {
1348
+ if (options?.acc) {
1349
+ return this.request({
1350
+ method: "POST",
1351
+ url: `/api/admin/google/analytics/account/${options.acc}`,
1352
+ data: { propertyId: options.propertyId, reportType }
1353
+ });
1354
+ }
1330
1355
  return this.request({
1331
1356
  method: "POST",
1332
- url: `/api/admin/google/analytics/account/${acc}`,
1333
- data: { propertyId, reportType }
1357
+ url: "/api/admin/google/analytics/report",
1358
+ data: { reportType }
1334
1359
  });
1335
1360
  }
1336
1361
  };
@@ -1412,7 +1437,9 @@ var IntegrationsResource = class extends BaseResource {
1412
1437
  });
1413
1438
  }
1414
1439
  /**
1415
- * Entegrasyon ayarlarını getirir
1440
+ * Entegrasyon ayarlarını getirir.
1441
+ * google-analytics için: { fields: [...] } - her alan kendi options parametresi ile
1442
+ * (activeAccountId → account listesi, activePropertyId → property listesi, uaId → UA listesi)
1416
1443
  */
1417
1444
  async getSettings(provider) {
1418
1445
  return this.request({
@@ -1421,7 +1448,9 @@ var IntegrationsResource = class extends BaseResource {
1421
1448
  });
1422
1449
  }
1423
1450
  /**
1424
- * Entegrasyon ayarlarını günceller (merge - mevcut ayarlarla birleştirir)
1451
+ * Entegrasyon ayarlarını günceller (merge - mevcut ayarlarla birleştirir).
1452
+ * google-analytics için: { activeAccountId, activePropertyId, measurementId, uaId } flat format ile gönderilebilir.
1453
+ * Response yine fields formatında döner (options backend'de doldurulur).
1425
1454
  */
1426
1455
  async updateSettings(provider, settings) {
1427
1456
  return this.request({
@@ -1440,6 +1469,46 @@ var IntegrationsResource = class extends BaseResource {
1440
1469
  }
1441
1470
  };
1442
1471
 
1472
+ // src/resources/admin/datasets.ts
1473
+ var DatasetsResource = class extends BaseResource {
1474
+ constructor(httpClient) {
1475
+ super(httpClient);
1476
+ }
1477
+ /**
1478
+ * Kayıtlı dataset tiplerini listeler (regions, themes, integrations, vb.)
1479
+ */
1480
+ async listTypes() {
1481
+ return this.request({
1482
+ method: "GET",
1483
+ url: "/api/admin/datasets"
1484
+ });
1485
+ }
1486
+ /**
1487
+ * Verilen tipteki dataset verisini getirir.
1488
+ * Dinamik: Bilinen tipler dışında yeni tipler de çalışır.
1489
+ *
1490
+ * @param type - Dataset tipi: 'regions' | 'themes' | 'integrations' | (gelecekte eklenecek diğer tipler)
1491
+ */
1492
+ async get(type) {
1493
+ return this.request({
1494
+ method: "GET",
1495
+ url: `/api/admin/datasets/${encodeURIComponent(type)}`
1496
+ });
1497
+ }
1498
+ /** @deprecated get('regions') kullanın */
1499
+ async getRegions() {
1500
+ return this.get("regions");
1501
+ }
1502
+ /** @deprecated get('themes') kullanın */
1503
+ async getThemes() {
1504
+ return this.get("themes");
1505
+ }
1506
+ /** @deprecated get('integrations') kullanın */
1507
+ async getIntegrations() {
1508
+ return this.get("integrations");
1509
+ }
1510
+ };
1511
+
1443
1512
  // src/resources/admin/cloudflare.ts
1444
1513
  var CloudflareResource = class extends BaseResource {
1445
1514
  constructor(httpClient) {
@@ -2287,6 +2356,7 @@ var AdminNamespace = class {
2287
2356
  themes;
2288
2357
  google;
2289
2358
  integrations;
2359
+ datasets;
2290
2360
  cloudflare;
2291
2361
  reviews;
2292
2362
  customData;
@@ -2315,6 +2385,7 @@ var AdminNamespace = class {
2315
2385
  this.themes = new ThemeResource(client.instance);
2316
2386
  this.google = new GoogleResource(client.instance);
2317
2387
  this.integrations = new IntegrationsResource(client.instance);
2388
+ this.datasets = new DatasetsResource(client.instance);
2318
2389
  this.cloudflare = new CloudflareResource(client.instance);
2319
2390
  this.reviews = new ReviewResource(client.instance);
2320
2391
  this.customData = new CustomDataResource(client.instance);
package/dist/index.mjs CHANGED
@@ -168,6 +168,7 @@ __export(admin_exports, {
168
168
  CollectionResource: () => CollectionResource,
169
169
  ContentResource: () => ContentResource,
170
170
  CustomDataResource: () => CustomDataResource,
171
+ DatasetsResource: () => DatasetsResource,
171
172
  DatasourceResource: () => DatasourceResource,
172
173
  GoogleResource: () => GoogleResource,
173
174
  IntegrationsResource: () => IntegrationsResource,
@@ -1223,11 +1224,14 @@ var GoogleResource = class extends BaseResource {
1223
1224
  url: "/api/admin/google"
1224
1225
  });
1225
1226
  }
1227
+ /**
1228
+ * Temel analytics verisi. propertyId verilmezse Integration Settings'teki activePropertyId kullanılır.
1229
+ */
1226
1230
  async getAnalytics(propertyId) {
1227
1231
  return this.request({
1228
1232
  method: "GET",
1229
1233
  url: "/api/admin/google/analytics",
1230
- params: { propertyId }
1234
+ params: propertyId ? { propertyId } : void 0
1231
1235
  });
1232
1236
  }
1233
1237
  async updateSitemap(siteUrl, sitemapUrl) {
@@ -1251,23 +1255,44 @@ var GoogleResource = class extends BaseResource {
1251
1255
  data
1252
1256
  });
1253
1257
  }
1258
+ /** Entegrasyon ayarlarındaki aktif hesaba göre account listesi. */
1254
1259
  async getAnalyticsAccount() {
1255
1260
  return this.request({
1256
1261
  method: "GET",
1257
1262
  url: "/api/admin/google/analytics/account"
1258
1263
  });
1259
1264
  }
1265
+ /**
1266
+ * Detaylı account raporları. acc verilmezse Integration Settings'teki activeAccountId kullanılır.
1267
+ */
1260
1268
  async getAnalyticsAccountDetails(acc) {
1269
+ if (acc) {
1270
+ return this.request({
1271
+ method: "GET",
1272
+ url: `/api/admin/google/analytics/account/${acc}`
1273
+ });
1274
+ }
1261
1275
  return this.request({
1262
1276
  method: "GET",
1263
- url: `/api/admin/google/analytics/account/${acc}`
1277
+ url: "/api/admin/google/analytics/details"
1264
1278
  });
1265
1279
  }
1266
- async getDetailedAnalytics(acc, propertyId, reportType) {
1280
+ /**
1281
+ * Detaylı rapor (ecommerce, demographics).
1282
+ * propertyId/acc verilmezse Integration Settings kullanılır.
1283
+ */
1284
+ async getDetailedAnalytics(reportType, options) {
1285
+ if (options?.acc) {
1286
+ return this.request({
1287
+ method: "POST",
1288
+ url: `/api/admin/google/analytics/account/${options.acc}`,
1289
+ data: { propertyId: options.propertyId, reportType }
1290
+ });
1291
+ }
1267
1292
  return this.request({
1268
1293
  method: "POST",
1269
- url: `/api/admin/google/analytics/account/${acc}`,
1270
- data: { propertyId, reportType }
1294
+ url: "/api/admin/google/analytics/report",
1295
+ data: { reportType }
1271
1296
  });
1272
1297
  }
1273
1298
  };
@@ -1349,7 +1374,9 @@ var IntegrationsResource = class extends BaseResource {
1349
1374
  });
1350
1375
  }
1351
1376
  /**
1352
- * Entegrasyon ayarlarını getirir
1377
+ * Entegrasyon ayarlarını getirir.
1378
+ * google-analytics için: { fields: [...] } - her alan kendi options parametresi ile
1379
+ * (activeAccountId → account listesi, activePropertyId → property listesi, uaId → UA listesi)
1353
1380
  */
1354
1381
  async getSettings(provider) {
1355
1382
  return this.request({
@@ -1358,7 +1385,9 @@ var IntegrationsResource = class extends BaseResource {
1358
1385
  });
1359
1386
  }
1360
1387
  /**
1361
- * Entegrasyon ayarlarını günceller (merge - mevcut ayarlarla birleştirir)
1388
+ * Entegrasyon ayarlarını günceller (merge - mevcut ayarlarla birleştirir).
1389
+ * google-analytics için: { activeAccountId, activePropertyId, measurementId, uaId } flat format ile gönderilebilir.
1390
+ * Response yine fields formatında döner (options backend'de doldurulur).
1362
1391
  */
1363
1392
  async updateSettings(provider, settings) {
1364
1393
  return this.request({
@@ -1377,6 +1406,46 @@ var IntegrationsResource = class extends BaseResource {
1377
1406
  }
1378
1407
  };
1379
1408
 
1409
+ // src/resources/admin/datasets.ts
1410
+ var DatasetsResource = class extends BaseResource {
1411
+ constructor(httpClient) {
1412
+ super(httpClient);
1413
+ }
1414
+ /**
1415
+ * Kayıtlı dataset tiplerini listeler (regions, themes, integrations, vb.)
1416
+ */
1417
+ async listTypes() {
1418
+ return this.request({
1419
+ method: "GET",
1420
+ url: "/api/admin/datasets"
1421
+ });
1422
+ }
1423
+ /**
1424
+ * Verilen tipteki dataset verisini getirir.
1425
+ * Dinamik: Bilinen tipler dışında yeni tipler de çalışır.
1426
+ *
1427
+ * @param type - Dataset tipi: 'regions' | 'themes' | 'integrations' | (gelecekte eklenecek diğer tipler)
1428
+ */
1429
+ async get(type) {
1430
+ return this.request({
1431
+ method: "GET",
1432
+ url: `/api/admin/datasets/${encodeURIComponent(type)}`
1433
+ });
1434
+ }
1435
+ /** @deprecated get('regions') kullanın */
1436
+ async getRegions() {
1437
+ return this.get("regions");
1438
+ }
1439
+ /** @deprecated get('themes') kullanın */
1440
+ async getThemes() {
1441
+ return this.get("themes");
1442
+ }
1443
+ /** @deprecated get('integrations') kullanın */
1444
+ async getIntegrations() {
1445
+ return this.get("integrations");
1446
+ }
1447
+ };
1448
+
1380
1449
  // src/resources/admin/cloudflare.ts
1381
1450
  var CloudflareResource = class extends BaseResource {
1382
1451
  constructor(httpClient) {
@@ -2224,6 +2293,7 @@ var AdminNamespace = class {
2224
2293
  themes;
2225
2294
  google;
2226
2295
  integrations;
2296
+ datasets;
2227
2297
  cloudflare;
2228
2298
  reviews;
2229
2299
  customData;
@@ -2252,6 +2322,7 @@ var AdminNamespace = class {
2252
2322
  this.themes = new ThemeResource(client.instance);
2253
2323
  this.google = new GoogleResource(client.instance);
2254
2324
  this.integrations = new IntegrationsResource(client.instance);
2325
+ this.datasets = new DatasetsResource(client.instance);
2255
2326
  this.cloudflare = new CloudflareResource(client.instance);
2256
2327
  this.reviews = new ReviewResource(client.instance);
2257
2328
  this.customData = new CustomDataResource(client.instance);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salefony/api-sdk",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "Salefony API SDK - Official SDK for Salefony Backend API. Full TypeScript support, SSR-ready, Admin & Frontstore resources.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",