@salefony/api-sdk 1.0.8 → 1.0.10
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 +24 -0
- package/dist/index.d.mts +172 -1
- package/dist/index.d.ts +172 -1
- package/dist/index.js +125 -0
- package/dist/index.mjs +125 -0
- package/package.json +1 -1
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`
|
|
@@ -528,6 +530,28 @@ Full guide: [Integrations Documentation](./docs/INTEGRATIONS.md)
|
|
|
528
530
|
|
|
529
531
|
---
|
|
530
532
|
|
|
533
|
+
## 📊 Datasets (Reference Data)
|
|
534
|
+
|
|
535
|
+
Dynamic reference data API. Dataset types (regions, themes, integrations, ...) are registered on the backend. New types can be added without API/SDK changes.
|
|
536
|
+
|
|
537
|
+
```typescript
|
|
538
|
+
// List available dataset types (regions, themes, integrations, ...)
|
|
539
|
+
const { data } = await sdk.admin.datasets.listTypes();
|
|
540
|
+
// data.types → ['regions', 'themes', 'integrations']
|
|
541
|
+
|
|
542
|
+
// Get dataset by type (works for any registered type)
|
|
543
|
+
const { data: regions } = await sdk.admin.datasets.get('regions');
|
|
544
|
+
const { data: themes } = await sdk.admin.datasets.get('themes');
|
|
545
|
+
const { data: integrations } = await sdk.admin.datasets.get('integrations');
|
|
546
|
+
|
|
547
|
+
// Type-safe for known types (optional generic)
|
|
548
|
+
const { data } = await sdk.admin.datasets.get<Region[]>('regions');
|
|
549
|
+
// Future types work without SDK update
|
|
550
|
+
const { data: currencies } = await sdk.admin.datasets.get('currencies');
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
---
|
|
554
|
+
|
|
531
555
|
## 🛠️ SSR Usage
|
|
532
556
|
|
|
533
557
|
### Next.js Server Component
|
package/dist/index.d.mts
CHANGED
|
@@ -1248,6 +1248,19 @@ interface IntegrationConnectionStatus {
|
|
|
1248
1248
|
expiresAt?: number | null;
|
|
1249
1249
|
createdAt?: string;
|
|
1250
1250
|
}
|
|
1251
|
+
/** Provider'a özel ayarlar - her entegrasyon farklı key'ler kullanabilir */
|
|
1252
|
+
type IntegrationSettingsData = Record<string, unknown>;
|
|
1253
|
+
/** Google Analytics ayarları örneği */
|
|
1254
|
+
interface GoogleAnalyticsSettings {
|
|
1255
|
+
activeAccountId?: string;
|
|
1256
|
+
activePropertyId?: string;
|
|
1257
|
+
uaId?: string;
|
|
1258
|
+
}
|
|
1259
|
+
/** Facebook Business ayarları örneği */
|
|
1260
|
+
interface FacebookBusinessSettings {
|
|
1261
|
+
pixelId?: string;
|
|
1262
|
+
catalogId?: string;
|
|
1263
|
+
}
|
|
1251
1264
|
/**
|
|
1252
1265
|
* 3. parti hesap bağlama API'si.
|
|
1253
1266
|
* Tüm OAuth akışları backend üzerinden yönetilir - proxy yok.
|
|
@@ -1294,10 +1307,99 @@ declare class IntegrationsResource extends BaseResource {
|
|
|
1294
1307
|
listProviders(): Promise<ApiResponse<{
|
|
1295
1308
|
providers: IntegrationProviderId[];
|
|
1296
1309
|
}>>;
|
|
1310
|
+
/**
|
|
1311
|
+
* Entegrasyon ayarlarını getirir
|
|
1312
|
+
*/
|
|
1313
|
+
getSettings(provider: IntegrationProviderId | string): Promise<ApiResponse<IntegrationSettingsData>>;
|
|
1314
|
+
/**
|
|
1315
|
+
* Entegrasyon ayarlarını günceller (merge - mevcut ayarlarla birleştirir)
|
|
1316
|
+
*/
|
|
1317
|
+
updateSettings(provider: IntegrationProviderId | string, settings: IntegrationSettingsData): Promise<ApiResponse<IntegrationSettingsData>>;
|
|
1297
1318
|
/** HttpClient'ın baseURL'ini alır */
|
|
1298
1319
|
private getBaseUrl;
|
|
1299
1320
|
}
|
|
1300
1321
|
|
|
1322
|
+
/** Bilinen dataset tipleri - yeni tipler dinamik olarak eklenebilir */
|
|
1323
|
+
type KnownDatasetType = 'regions' | 'themes' | 'integrations';
|
|
1324
|
+
/** Region country item (from regions dataset) */
|
|
1325
|
+
interface RegionCountry {
|
|
1326
|
+
code: string;
|
|
1327
|
+
country: string;
|
|
1328
|
+
language: string;
|
|
1329
|
+
label: string;
|
|
1330
|
+
labelEn: string;
|
|
1331
|
+
isRTL?: boolean;
|
|
1332
|
+
}
|
|
1333
|
+
/** Region with countries (language/locale list) */
|
|
1334
|
+
interface Region {
|
|
1335
|
+
id: string;
|
|
1336
|
+
name: string;
|
|
1337
|
+
countries: RegionCountry[];
|
|
1338
|
+
}
|
|
1339
|
+
/** Theme item from themes dataset */
|
|
1340
|
+
interface ThemeItem {
|
|
1341
|
+
id: string;
|
|
1342
|
+
title: string;
|
|
1343
|
+
originalPrice?: string;
|
|
1344
|
+
price?: string;
|
|
1345
|
+
category?: string;
|
|
1346
|
+
currencyCode?: string;
|
|
1347
|
+
description?: string;
|
|
1348
|
+
images?: string[];
|
|
1349
|
+
provider?: string;
|
|
1350
|
+
rate?: string;
|
|
1351
|
+
}
|
|
1352
|
+
/** Entegrasyon ayar alanı şeması */
|
|
1353
|
+
interface IntegrationSettingSchema {
|
|
1354
|
+
key: string;
|
|
1355
|
+
label: string;
|
|
1356
|
+
labelTr?: string;
|
|
1357
|
+
type: 'string' | 'number' | 'boolean' | 'select' | 'password';
|
|
1358
|
+
required?: boolean;
|
|
1359
|
+
placeholder?: string;
|
|
1360
|
+
description?: string;
|
|
1361
|
+
options?: {
|
|
1362
|
+
value: string;
|
|
1363
|
+
label: string;
|
|
1364
|
+
}[];
|
|
1365
|
+
}
|
|
1366
|
+
/** Entegrasyon kataloğu öğesi */
|
|
1367
|
+
interface IntegrationCatalogItem {
|
|
1368
|
+
id: string;
|
|
1369
|
+
name: string;
|
|
1370
|
+
nameTr?: string;
|
|
1371
|
+
description?: string;
|
|
1372
|
+
icon?: string;
|
|
1373
|
+
settingsSchema: IntegrationSettingSchema[];
|
|
1374
|
+
}
|
|
1375
|
+
/**
|
|
1376
|
+
* Dinamik dataset API.
|
|
1377
|
+
* Veri tipleri (themes, regions, integrations, ...) backend registry'de kayıtlıdır.
|
|
1378
|
+
* Yeni tipler eklendiğinde API/SDK değişiklik gerektirmez.
|
|
1379
|
+
*/
|
|
1380
|
+
declare class DatasetsResource extends BaseResource {
|
|
1381
|
+
constructor(httpClient: AxiosInstance);
|
|
1382
|
+
/**
|
|
1383
|
+
* Kayıtlı dataset tiplerini listeler (regions, themes, integrations, vb.)
|
|
1384
|
+
*/
|
|
1385
|
+
listTypes(): Promise<ApiResponse<{
|
|
1386
|
+
types: string[];
|
|
1387
|
+
}>>;
|
|
1388
|
+
/**
|
|
1389
|
+
* Verilen tipteki dataset verisini getirir.
|
|
1390
|
+
* Dinamik: Bilinen tipler dışında yeni tipler de çalışır.
|
|
1391
|
+
*
|
|
1392
|
+
* @param type - Dataset tipi: 'regions' | 'themes' | 'integrations' | (gelecekte eklenecek diğer tipler)
|
|
1393
|
+
*/
|
|
1394
|
+
get<T = unknown>(type: string): Promise<ApiResponse<T>>;
|
|
1395
|
+
/** @deprecated get('regions') kullanın */
|
|
1396
|
+
getRegions(): Promise<ApiResponse<Region[]>>;
|
|
1397
|
+
/** @deprecated get('themes') kullanın */
|
|
1398
|
+
getThemes(): Promise<ApiResponse<ThemeItem[]>>;
|
|
1399
|
+
/** @deprecated get('integrations') kullanın */
|
|
1400
|
+
getIntegrations(): Promise<ApiResponse<IntegrationCatalogItem[]>>;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1301
1403
|
declare class CloudflareResource extends BaseResource {
|
|
1302
1404
|
constructor(httpClient: AxiosInstance);
|
|
1303
1405
|
getAccounts(): Promise<ApiResponse<any>>;
|
|
@@ -1376,6 +1478,57 @@ declare class PurchaseResource extends BaseResource {
|
|
|
1376
1478
|
createPurchase(data: any): Promise<ApiResponse<any>>;
|
|
1377
1479
|
}
|
|
1378
1480
|
|
|
1481
|
+
type NotificationType = 'ANALYTICS' | 'ORDER' | 'MESSAGE' | 'SYSTEM';
|
|
1482
|
+
interface StoreNotification {
|
|
1483
|
+
id: string;
|
|
1484
|
+
type: NotificationType;
|
|
1485
|
+
titleKey: string;
|
|
1486
|
+
subtitleKey: string;
|
|
1487
|
+
read: boolean;
|
|
1488
|
+
metadata?: Record<string, unknown>;
|
|
1489
|
+
storeId: string;
|
|
1490
|
+
createdAt: string;
|
|
1491
|
+
updatedAt: string;
|
|
1492
|
+
}
|
|
1493
|
+
interface ListNotificationsParams {
|
|
1494
|
+
page?: number;
|
|
1495
|
+
limit?: number;
|
|
1496
|
+
type?: NotificationType;
|
|
1497
|
+
read?: boolean;
|
|
1498
|
+
}
|
|
1499
|
+
declare class NotificationResource extends BaseResource {
|
|
1500
|
+
protected readonly path: string;
|
|
1501
|
+
constructor(httpClient: AxiosInstance, path?: string);
|
|
1502
|
+
/**
|
|
1503
|
+
* Store bildirimlerini listeler
|
|
1504
|
+
*/
|
|
1505
|
+
list(params?: ListNotificationsParams): Promise<ApiResponse<StoreNotification[]>>;
|
|
1506
|
+
/**
|
|
1507
|
+
* Okunmamış bildirim sayısını döner
|
|
1508
|
+
*/
|
|
1509
|
+
getUnreadCount(): Promise<ApiResponse<{
|
|
1510
|
+
count: number;
|
|
1511
|
+
}>>;
|
|
1512
|
+
/**
|
|
1513
|
+
* Bildirimi okundu olarak işaretler
|
|
1514
|
+
*/
|
|
1515
|
+
markAsRead(id: string): Promise<ApiResponse<{
|
|
1516
|
+
success: boolean;
|
|
1517
|
+
}>>;
|
|
1518
|
+
/**
|
|
1519
|
+
* Tüm bildirimleri okundu olarak işaretler
|
|
1520
|
+
*/
|
|
1521
|
+
markAllAsRead(): Promise<ApiResponse<{
|
|
1522
|
+
success: boolean;
|
|
1523
|
+
}>>;
|
|
1524
|
+
/**
|
|
1525
|
+
* Bildirimi siler
|
|
1526
|
+
*/
|
|
1527
|
+
delete(id: string): Promise<ApiResponse<{
|
|
1528
|
+
success: boolean;
|
|
1529
|
+
}>>;
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1379
1532
|
type index$5_AdminMediaCreateInput = AdminMediaCreateInput;
|
|
1380
1533
|
type index$5_ApiKeyResource = ApiKeyResource;
|
|
1381
1534
|
declare const index$5_ApiKeyResource: typeof ApiKeyResource;
|
|
@@ -1386,22 +1539,36 @@ declare const index$5_CloudflareResource: typeof CloudflareResource;
|
|
|
1386
1539
|
type index$5_CreateDatasourceInput = CreateDatasourceInput;
|
|
1387
1540
|
type index$5_CustomDataResource = CustomDataResource;
|
|
1388
1541
|
declare const index$5_CustomDataResource: typeof CustomDataResource;
|
|
1542
|
+
type index$5_DatasetsResource = DatasetsResource;
|
|
1543
|
+
declare const index$5_DatasetsResource: typeof DatasetsResource;
|
|
1389
1544
|
type index$5_DatasourceResource = DatasourceResource;
|
|
1390
1545
|
declare const index$5_DatasourceResource: typeof DatasourceResource;
|
|
1546
|
+
type index$5_FacebookBusinessSettings = FacebookBusinessSettings;
|
|
1547
|
+
type index$5_GoogleAnalyticsSettings = GoogleAnalyticsSettings;
|
|
1391
1548
|
type index$5_GoogleResource = GoogleResource;
|
|
1392
1549
|
declare const index$5_GoogleResource: typeof GoogleResource;
|
|
1550
|
+
type index$5_IntegrationCatalogItem = IntegrationCatalogItem;
|
|
1393
1551
|
type index$5_IntegrationConnectionStatus = IntegrationConnectionStatus;
|
|
1394
1552
|
type index$5_IntegrationProviderId = IntegrationProviderId;
|
|
1553
|
+
type index$5_IntegrationSettingSchema = IntegrationSettingSchema;
|
|
1554
|
+
type index$5_IntegrationSettingsData = IntegrationSettingsData;
|
|
1395
1555
|
type index$5_IntegrationsResource = IntegrationsResource;
|
|
1396
1556
|
declare const index$5_IntegrationsResource: typeof IntegrationsResource;
|
|
1557
|
+
type index$5_KnownDatasetType = KnownDatasetType;
|
|
1397
1558
|
type index$5_LayoutResource = LayoutResource;
|
|
1398
1559
|
declare const index$5_LayoutResource: typeof LayoutResource;
|
|
1560
|
+
type index$5_ListNotificationsParams = ListNotificationsParams;
|
|
1399
1561
|
type index$5_MetadataResource = MetadataResource;
|
|
1400
1562
|
declare const index$5_MetadataResource: typeof MetadataResource;
|
|
1563
|
+
type index$5_NotificationResource = NotificationResource;
|
|
1564
|
+
declare const index$5_NotificationResource: typeof NotificationResource;
|
|
1565
|
+
type index$5_NotificationType = NotificationType;
|
|
1401
1566
|
type index$5_ProjectResource = ProjectResource;
|
|
1402
1567
|
declare const index$5_ProjectResource: typeof ProjectResource;
|
|
1403
1568
|
type index$5_PurchaseResource = PurchaseResource;
|
|
1404
1569
|
declare const index$5_PurchaseResource: typeof PurchaseResource;
|
|
1570
|
+
type index$5_Region = Region;
|
|
1571
|
+
type index$5_RegionCountry = RegionCountry;
|
|
1405
1572
|
type index$5_SEOResource = SEOResource;
|
|
1406
1573
|
declare const index$5_SEOResource: typeof SEOResource;
|
|
1407
1574
|
type index$5_SectionResource = SectionResource;
|
|
@@ -1410,8 +1577,10 @@ type index$5_SectorResource = SectorResource;
|
|
|
1410
1577
|
declare const index$5_SectorResource: typeof SectorResource;
|
|
1411
1578
|
type index$5_SettingsResource = SettingsResource;
|
|
1412
1579
|
declare const index$5_SettingsResource: typeof SettingsResource;
|
|
1580
|
+
type index$5_StoreNotification = StoreNotification;
|
|
1413
1581
|
type index$5_SubscriptionResource = SubscriptionResource;
|
|
1414
1582
|
declare const index$5_SubscriptionResource: typeof SubscriptionResource;
|
|
1583
|
+
type index$5_ThemeItem = ThemeItem;
|
|
1415
1584
|
type index$5_ThemeResource = ThemeResource;
|
|
1416
1585
|
declare const index$5_ThemeResource: typeof ThemeResource;
|
|
1417
1586
|
type index$5_UpdateDatasourceInput = UpdateDatasourceInput;
|
|
@@ -1431,7 +1600,7 @@ declare const index$5_sectorColumns: typeof sectorColumns;
|
|
|
1431
1600
|
declare const index$5_storeColumns: typeof storeColumns;
|
|
1432
1601
|
declare const index$5_vendorColumns: typeof vendorColumns;
|
|
1433
1602
|
declare namespace index$5 {
|
|
1434
|
-
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, index$5_GoogleResource as GoogleResource, type index$5_IntegrationConnectionStatus as IntegrationConnectionStatus, type index$5_IntegrationProviderId as IntegrationProviderId, index$5_IntegrationsResource as IntegrationsResource, LanguageResource$1 as LanguageResource, index$5_LayoutResource as LayoutResource, MediaResource$1 as MediaResource, index$5_MetadataResource as MetadataResource, NavigationResource$1 as NavigationResource, 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, 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 };
|
|
1603
|
+
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, 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_IntegrationSettingSchema as IntegrationSettingSchema, 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 };
|
|
1435
1604
|
}
|
|
1436
1605
|
|
|
1437
1606
|
declare class StoreResource extends CrudResource<Store, StoreWhereInput, StoreOrderByInput, StoreCreateInput, StoreUpdateInput> {
|
|
@@ -1866,6 +2035,7 @@ declare class AdminNamespace {
|
|
|
1866
2035
|
readonly themes: ThemeResource;
|
|
1867
2036
|
readonly google: GoogleResource;
|
|
1868
2037
|
readonly integrations: IntegrationsResource;
|
|
2038
|
+
readonly datasets: DatasetsResource;
|
|
1869
2039
|
readonly cloudflare: CloudflareResource;
|
|
1870
2040
|
readonly reviews: ReviewResource$1;
|
|
1871
2041
|
readonly customData: CustomDataResource;
|
|
@@ -1874,6 +2044,7 @@ declare class AdminNamespace {
|
|
|
1874
2044
|
readonly webmail: WebmailResource;
|
|
1875
2045
|
readonly subscriptions: SubscriptionResource;
|
|
1876
2046
|
readonly purchases: PurchaseResource;
|
|
2047
|
+
readonly notifications: NotificationResource;
|
|
1877
2048
|
constructor(client: ApiClient);
|
|
1878
2049
|
}
|
|
1879
2050
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1248,6 +1248,19 @@ interface IntegrationConnectionStatus {
|
|
|
1248
1248
|
expiresAt?: number | null;
|
|
1249
1249
|
createdAt?: string;
|
|
1250
1250
|
}
|
|
1251
|
+
/** Provider'a özel ayarlar - her entegrasyon farklı key'ler kullanabilir */
|
|
1252
|
+
type IntegrationSettingsData = Record<string, unknown>;
|
|
1253
|
+
/** Google Analytics ayarları örneği */
|
|
1254
|
+
interface GoogleAnalyticsSettings {
|
|
1255
|
+
activeAccountId?: string;
|
|
1256
|
+
activePropertyId?: string;
|
|
1257
|
+
uaId?: string;
|
|
1258
|
+
}
|
|
1259
|
+
/** Facebook Business ayarları örneği */
|
|
1260
|
+
interface FacebookBusinessSettings {
|
|
1261
|
+
pixelId?: string;
|
|
1262
|
+
catalogId?: string;
|
|
1263
|
+
}
|
|
1251
1264
|
/**
|
|
1252
1265
|
* 3. parti hesap bağlama API'si.
|
|
1253
1266
|
* Tüm OAuth akışları backend üzerinden yönetilir - proxy yok.
|
|
@@ -1294,10 +1307,99 @@ declare class IntegrationsResource extends BaseResource {
|
|
|
1294
1307
|
listProviders(): Promise<ApiResponse<{
|
|
1295
1308
|
providers: IntegrationProviderId[];
|
|
1296
1309
|
}>>;
|
|
1310
|
+
/**
|
|
1311
|
+
* Entegrasyon ayarlarını getirir
|
|
1312
|
+
*/
|
|
1313
|
+
getSettings(provider: IntegrationProviderId | string): Promise<ApiResponse<IntegrationSettingsData>>;
|
|
1314
|
+
/**
|
|
1315
|
+
* Entegrasyon ayarlarını günceller (merge - mevcut ayarlarla birleştirir)
|
|
1316
|
+
*/
|
|
1317
|
+
updateSettings(provider: IntegrationProviderId | string, settings: IntegrationSettingsData): Promise<ApiResponse<IntegrationSettingsData>>;
|
|
1297
1318
|
/** HttpClient'ın baseURL'ini alır */
|
|
1298
1319
|
private getBaseUrl;
|
|
1299
1320
|
}
|
|
1300
1321
|
|
|
1322
|
+
/** Bilinen dataset tipleri - yeni tipler dinamik olarak eklenebilir */
|
|
1323
|
+
type KnownDatasetType = 'regions' | 'themes' | 'integrations';
|
|
1324
|
+
/** Region country item (from regions dataset) */
|
|
1325
|
+
interface RegionCountry {
|
|
1326
|
+
code: string;
|
|
1327
|
+
country: string;
|
|
1328
|
+
language: string;
|
|
1329
|
+
label: string;
|
|
1330
|
+
labelEn: string;
|
|
1331
|
+
isRTL?: boolean;
|
|
1332
|
+
}
|
|
1333
|
+
/** Region with countries (language/locale list) */
|
|
1334
|
+
interface Region {
|
|
1335
|
+
id: string;
|
|
1336
|
+
name: string;
|
|
1337
|
+
countries: RegionCountry[];
|
|
1338
|
+
}
|
|
1339
|
+
/** Theme item from themes dataset */
|
|
1340
|
+
interface ThemeItem {
|
|
1341
|
+
id: string;
|
|
1342
|
+
title: string;
|
|
1343
|
+
originalPrice?: string;
|
|
1344
|
+
price?: string;
|
|
1345
|
+
category?: string;
|
|
1346
|
+
currencyCode?: string;
|
|
1347
|
+
description?: string;
|
|
1348
|
+
images?: string[];
|
|
1349
|
+
provider?: string;
|
|
1350
|
+
rate?: string;
|
|
1351
|
+
}
|
|
1352
|
+
/** Entegrasyon ayar alanı şeması */
|
|
1353
|
+
interface IntegrationSettingSchema {
|
|
1354
|
+
key: string;
|
|
1355
|
+
label: string;
|
|
1356
|
+
labelTr?: string;
|
|
1357
|
+
type: 'string' | 'number' | 'boolean' | 'select' | 'password';
|
|
1358
|
+
required?: boolean;
|
|
1359
|
+
placeholder?: string;
|
|
1360
|
+
description?: string;
|
|
1361
|
+
options?: {
|
|
1362
|
+
value: string;
|
|
1363
|
+
label: string;
|
|
1364
|
+
}[];
|
|
1365
|
+
}
|
|
1366
|
+
/** Entegrasyon kataloğu öğesi */
|
|
1367
|
+
interface IntegrationCatalogItem {
|
|
1368
|
+
id: string;
|
|
1369
|
+
name: string;
|
|
1370
|
+
nameTr?: string;
|
|
1371
|
+
description?: string;
|
|
1372
|
+
icon?: string;
|
|
1373
|
+
settingsSchema: IntegrationSettingSchema[];
|
|
1374
|
+
}
|
|
1375
|
+
/**
|
|
1376
|
+
* Dinamik dataset API.
|
|
1377
|
+
* Veri tipleri (themes, regions, integrations, ...) backend registry'de kayıtlıdır.
|
|
1378
|
+
* Yeni tipler eklendiğinde API/SDK değişiklik gerektirmez.
|
|
1379
|
+
*/
|
|
1380
|
+
declare class DatasetsResource extends BaseResource {
|
|
1381
|
+
constructor(httpClient: AxiosInstance);
|
|
1382
|
+
/**
|
|
1383
|
+
* Kayıtlı dataset tiplerini listeler (regions, themes, integrations, vb.)
|
|
1384
|
+
*/
|
|
1385
|
+
listTypes(): Promise<ApiResponse<{
|
|
1386
|
+
types: string[];
|
|
1387
|
+
}>>;
|
|
1388
|
+
/**
|
|
1389
|
+
* Verilen tipteki dataset verisini getirir.
|
|
1390
|
+
* Dinamik: Bilinen tipler dışında yeni tipler de çalışır.
|
|
1391
|
+
*
|
|
1392
|
+
* @param type - Dataset tipi: 'regions' | 'themes' | 'integrations' | (gelecekte eklenecek diğer tipler)
|
|
1393
|
+
*/
|
|
1394
|
+
get<T = unknown>(type: string): Promise<ApiResponse<T>>;
|
|
1395
|
+
/** @deprecated get('regions') kullanın */
|
|
1396
|
+
getRegions(): Promise<ApiResponse<Region[]>>;
|
|
1397
|
+
/** @deprecated get('themes') kullanın */
|
|
1398
|
+
getThemes(): Promise<ApiResponse<ThemeItem[]>>;
|
|
1399
|
+
/** @deprecated get('integrations') kullanın */
|
|
1400
|
+
getIntegrations(): Promise<ApiResponse<IntegrationCatalogItem[]>>;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1301
1403
|
declare class CloudflareResource extends BaseResource {
|
|
1302
1404
|
constructor(httpClient: AxiosInstance);
|
|
1303
1405
|
getAccounts(): Promise<ApiResponse<any>>;
|
|
@@ -1376,6 +1478,57 @@ declare class PurchaseResource extends BaseResource {
|
|
|
1376
1478
|
createPurchase(data: any): Promise<ApiResponse<any>>;
|
|
1377
1479
|
}
|
|
1378
1480
|
|
|
1481
|
+
type NotificationType = 'ANALYTICS' | 'ORDER' | 'MESSAGE' | 'SYSTEM';
|
|
1482
|
+
interface StoreNotification {
|
|
1483
|
+
id: string;
|
|
1484
|
+
type: NotificationType;
|
|
1485
|
+
titleKey: string;
|
|
1486
|
+
subtitleKey: string;
|
|
1487
|
+
read: boolean;
|
|
1488
|
+
metadata?: Record<string, unknown>;
|
|
1489
|
+
storeId: string;
|
|
1490
|
+
createdAt: string;
|
|
1491
|
+
updatedAt: string;
|
|
1492
|
+
}
|
|
1493
|
+
interface ListNotificationsParams {
|
|
1494
|
+
page?: number;
|
|
1495
|
+
limit?: number;
|
|
1496
|
+
type?: NotificationType;
|
|
1497
|
+
read?: boolean;
|
|
1498
|
+
}
|
|
1499
|
+
declare class NotificationResource extends BaseResource {
|
|
1500
|
+
protected readonly path: string;
|
|
1501
|
+
constructor(httpClient: AxiosInstance, path?: string);
|
|
1502
|
+
/**
|
|
1503
|
+
* Store bildirimlerini listeler
|
|
1504
|
+
*/
|
|
1505
|
+
list(params?: ListNotificationsParams): Promise<ApiResponse<StoreNotification[]>>;
|
|
1506
|
+
/**
|
|
1507
|
+
* Okunmamış bildirim sayısını döner
|
|
1508
|
+
*/
|
|
1509
|
+
getUnreadCount(): Promise<ApiResponse<{
|
|
1510
|
+
count: number;
|
|
1511
|
+
}>>;
|
|
1512
|
+
/**
|
|
1513
|
+
* Bildirimi okundu olarak işaretler
|
|
1514
|
+
*/
|
|
1515
|
+
markAsRead(id: string): Promise<ApiResponse<{
|
|
1516
|
+
success: boolean;
|
|
1517
|
+
}>>;
|
|
1518
|
+
/**
|
|
1519
|
+
* Tüm bildirimleri okundu olarak işaretler
|
|
1520
|
+
*/
|
|
1521
|
+
markAllAsRead(): Promise<ApiResponse<{
|
|
1522
|
+
success: boolean;
|
|
1523
|
+
}>>;
|
|
1524
|
+
/**
|
|
1525
|
+
* Bildirimi siler
|
|
1526
|
+
*/
|
|
1527
|
+
delete(id: string): Promise<ApiResponse<{
|
|
1528
|
+
success: boolean;
|
|
1529
|
+
}>>;
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1379
1532
|
type index$5_AdminMediaCreateInput = AdminMediaCreateInput;
|
|
1380
1533
|
type index$5_ApiKeyResource = ApiKeyResource;
|
|
1381
1534
|
declare const index$5_ApiKeyResource: typeof ApiKeyResource;
|
|
@@ -1386,22 +1539,36 @@ declare const index$5_CloudflareResource: typeof CloudflareResource;
|
|
|
1386
1539
|
type index$5_CreateDatasourceInput = CreateDatasourceInput;
|
|
1387
1540
|
type index$5_CustomDataResource = CustomDataResource;
|
|
1388
1541
|
declare const index$5_CustomDataResource: typeof CustomDataResource;
|
|
1542
|
+
type index$5_DatasetsResource = DatasetsResource;
|
|
1543
|
+
declare const index$5_DatasetsResource: typeof DatasetsResource;
|
|
1389
1544
|
type index$5_DatasourceResource = DatasourceResource;
|
|
1390
1545
|
declare const index$5_DatasourceResource: typeof DatasourceResource;
|
|
1546
|
+
type index$5_FacebookBusinessSettings = FacebookBusinessSettings;
|
|
1547
|
+
type index$5_GoogleAnalyticsSettings = GoogleAnalyticsSettings;
|
|
1391
1548
|
type index$5_GoogleResource = GoogleResource;
|
|
1392
1549
|
declare const index$5_GoogleResource: typeof GoogleResource;
|
|
1550
|
+
type index$5_IntegrationCatalogItem = IntegrationCatalogItem;
|
|
1393
1551
|
type index$5_IntegrationConnectionStatus = IntegrationConnectionStatus;
|
|
1394
1552
|
type index$5_IntegrationProviderId = IntegrationProviderId;
|
|
1553
|
+
type index$5_IntegrationSettingSchema = IntegrationSettingSchema;
|
|
1554
|
+
type index$5_IntegrationSettingsData = IntegrationSettingsData;
|
|
1395
1555
|
type index$5_IntegrationsResource = IntegrationsResource;
|
|
1396
1556
|
declare const index$5_IntegrationsResource: typeof IntegrationsResource;
|
|
1557
|
+
type index$5_KnownDatasetType = KnownDatasetType;
|
|
1397
1558
|
type index$5_LayoutResource = LayoutResource;
|
|
1398
1559
|
declare const index$5_LayoutResource: typeof LayoutResource;
|
|
1560
|
+
type index$5_ListNotificationsParams = ListNotificationsParams;
|
|
1399
1561
|
type index$5_MetadataResource = MetadataResource;
|
|
1400
1562
|
declare const index$5_MetadataResource: typeof MetadataResource;
|
|
1563
|
+
type index$5_NotificationResource = NotificationResource;
|
|
1564
|
+
declare const index$5_NotificationResource: typeof NotificationResource;
|
|
1565
|
+
type index$5_NotificationType = NotificationType;
|
|
1401
1566
|
type index$5_ProjectResource = ProjectResource;
|
|
1402
1567
|
declare const index$5_ProjectResource: typeof ProjectResource;
|
|
1403
1568
|
type index$5_PurchaseResource = PurchaseResource;
|
|
1404
1569
|
declare const index$5_PurchaseResource: typeof PurchaseResource;
|
|
1570
|
+
type index$5_Region = Region;
|
|
1571
|
+
type index$5_RegionCountry = RegionCountry;
|
|
1405
1572
|
type index$5_SEOResource = SEOResource;
|
|
1406
1573
|
declare const index$5_SEOResource: typeof SEOResource;
|
|
1407
1574
|
type index$5_SectionResource = SectionResource;
|
|
@@ -1410,8 +1577,10 @@ type index$5_SectorResource = SectorResource;
|
|
|
1410
1577
|
declare const index$5_SectorResource: typeof SectorResource;
|
|
1411
1578
|
type index$5_SettingsResource = SettingsResource;
|
|
1412
1579
|
declare const index$5_SettingsResource: typeof SettingsResource;
|
|
1580
|
+
type index$5_StoreNotification = StoreNotification;
|
|
1413
1581
|
type index$5_SubscriptionResource = SubscriptionResource;
|
|
1414
1582
|
declare const index$5_SubscriptionResource: typeof SubscriptionResource;
|
|
1583
|
+
type index$5_ThemeItem = ThemeItem;
|
|
1415
1584
|
type index$5_ThemeResource = ThemeResource;
|
|
1416
1585
|
declare const index$5_ThemeResource: typeof ThemeResource;
|
|
1417
1586
|
type index$5_UpdateDatasourceInput = UpdateDatasourceInput;
|
|
@@ -1431,7 +1600,7 @@ declare const index$5_sectorColumns: typeof sectorColumns;
|
|
|
1431
1600
|
declare const index$5_storeColumns: typeof storeColumns;
|
|
1432
1601
|
declare const index$5_vendorColumns: typeof vendorColumns;
|
|
1433
1602
|
declare namespace index$5 {
|
|
1434
|
-
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, index$5_GoogleResource as GoogleResource, type index$5_IntegrationConnectionStatus as IntegrationConnectionStatus, type index$5_IntegrationProviderId as IntegrationProviderId, index$5_IntegrationsResource as IntegrationsResource, LanguageResource$1 as LanguageResource, index$5_LayoutResource as LayoutResource, MediaResource$1 as MediaResource, index$5_MetadataResource as MetadataResource, NavigationResource$1 as NavigationResource, 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, 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 };
|
|
1603
|
+
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, 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_IntegrationSettingSchema as IntegrationSettingSchema, 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 };
|
|
1435
1604
|
}
|
|
1436
1605
|
|
|
1437
1606
|
declare class StoreResource extends CrudResource<Store, StoreWhereInput, StoreOrderByInput, StoreCreateInput, StoreUpdateInput> {
|
|
@@ -1866,6 +2035,7 @@ declare class AdminNamespace {
|
|
|
1866
2035
|
readonly themes: ThemeResource;
|
|
1867
2036
|
readonly google: GoogleResource;
|
|
1868
2037
|
readonly integrations: IntegrationsResource;
|
|
2038
|
+
readonly datasets: DatasetsResource;
|
|
1869
2039
|
readonly cloudflare: CloudflareResource;
|
|
1870
2040
|
readonly reviews: ReviewResource$1;
|
|
1871
2041
|
readonly customData: CustomDataResource;
|
|
@@ -1874,6 +2044,7 @@ declare class AdminNamespace {
|
|
|
1874
2044
|
readonly webmail: WebmailResource;
|
|
1875
2045
|
readonly subscriptions: SubscriptionResource;
|
|
1876
2046
|
readonly purchases: PurchaseResource;
|
|
2047
|
+
readonly notifications: NotificationResource;
|
|
1877
2048
|
constructor(client: ApiClient);
|
|
1878
2049
|
}
|
|
1879
2050
|
/**
|
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,
|
|
@@ -239,6 +240,7 @@ __export(admin_exports, {
|
|
|
239
240
|
MediaResource: () => MediaResource,
|
|
240
241
|
MetadataResource: () => MetadataResource,
|
|
241
242
|
NavigationResource: () => NavigationResource,
|
|
243
|
+
NotificationResource: () => NotificationResource,
|
|
242
244
|
ProjectResource: () => ProjectResource,
|
|
243
245
|
PurchaseResource: () => PurchaseResource,
|
|
244
246
|
ReviewResource: () => ReviewResource,
|
|
@@ -1410,6 +1412,25 @@ var IntegrationsResource = class extends BaseResource {
|
|
|
1410
1412
|
url: "/api/admin/integrations/providers/list"
|
|
1411
1413
|
});
|
|
1412
1414
|
}
|
|
1415
|
+
/**
|
|
1416
|
+
* Entegrasyon ayarlarını getirir
|
|
1417
|
+
*/
|
|
1418
|
+
async getSettings(provider) {
|
|
1419
|
+
return this.request({
|
|
1420
|
+
method: "GET",
|
|
1421
|
+
url: `/api/admin/integrations/${encodeURIComponent(provider)}/settings`
|
|
1422
|
+
});
|
|
1423
|
+
}
|
|
1424
|
+
/**
|
|
1425
|
+
* Entegrasyon ayarlarını günceller (merge - mevcut ayarlarla birleştirir)
|
|
1426
|
+
*/
|
|
1427
|
+
async updateSettings(provider, settings) {
|
|
1428
|
+
return this.request({
|
|
1429
|
+
method: "PUT",
|
|
1430
|
+
url: `/api/admin/integrations/${encodeURIComponent(provider)}/settings`,
|
|
1431
|
+
data: { settings }
|
|
1432
|
+
});
|
|
1433
|
+
}
|
|
1413
1434
|
/** HttpClient'ın baseURL'ini alır */
|
|
1414
1435
|
getBaseUrl() {
|
|
1415
1436
|
const baseURL = this.httpClient?.defaults?.baseURL;
|
|
@@ -1420,6 +1441,46 @@ var IntegrationsResource = class extends BaseResource {
|
|
|
1420
1441
|
}
|
|
1421
1442
|
};
|
|
1422
1443
|
|
|
1444
|
+
// src/resources/admin/datasets.ts
|
|
1445
|
+
var DatasetsResource = class extends BaseResource {
|
|
1446
|
+
constructor(httpClient) {
|
|
1447
|
+
super(httpClient);
|
|
1448
|
+
}
|
|
1449
|
+
/**
|
|
1450
|
+
* Kayıtlı dataset tiplerini listeler (regions, themes, integrations, vb.)
|
|
1451
|
+
*/
|
|
1452
|
+
async listTypes() {
|
|
1453
|
+
return this.request({
|
|
1454
|
+
method: "GET",
|
|
1455
|
+
url: "/api/admin/datasets"
|
|
1456
|
+
});
|
|
1457
|
+
}
|
|
1458
|
+
/**
|
|
1459
|
+
* Verilen tipteki dataset verisini getirir.
|
|
1460
|
+
* Dinamik: Bilinen tipler dışında yeni tipler de çalışır.
|
|
1461
|
+
*
|
|
1462
|
+
* @param type - Dataset tipi: 'regions' | 'themes' | 'integrations' | (gelecekte eklenecek diğer tipler)
|
|
1463
|
+
*/
|
|
1464
|
+
async get(type) {
|
|
1465
|
+
return this.request({
|
|
1466
|
+
method: "GET",
|
|
1467
|
+
url: `/api/admin/datasets/${encodeURIComponent(type)}`
|
|
1468
|
+
});
|
|
1469
|
+
}
|
|
1470
|
+
/** @deprecated get('regions') kullanın */
|
|
1471
|
+
async getRegions() {
|
|
1472
|
+
return this.get("regions");
|
|
1473
|
+
}
|
|
1474
|
+
/** @deprecated get('themes') kullanın */
|
|
1475
|
+
async getThemes() {
|
|
1476
|
+
return this.get("themes");
|
|
1477
|
+
}
|
|
1478
|
+
/** @deprecated get('integrations') kullanın */
|
|
1479
|
+
async getIntegrations() {
|
|
1480
|
+
return this.get("integrations");
|
|
1481
|
+
}
|
|
1482
|
+
};
|
|
1483
|
+
|
|
1423
1484
|
// src/resources/admin/cloudflare.ts
|
|
1424
1485
|
var CloudflareResource = class extends BaseResource {
|
|
1425
1486
|
constructor(httpClient) {
|
|
@@ -1720,6 +1781,66 @@ var PurchaseResource = class extends BaseResource {
|
|
|
1720
1781
|
}
|
|
1721
1782
|
};
|
|
1722
1783
|
|
|
1784
|
+
// src/resources/admin/notification.ts
|
|
1785
|
+
var NotificationResource = class extends BaseResource {
|
|
1786
|
+
path;
|
|
1787
|
+
constructor(httpClient, path = "/api/admin/notifications") {
|
|
1788
|
+
super(httpClient);
|
|
1789
|
+
this.path = path;
|
|
1790
|
+
}
|
|
1791
|
+
/**
|
|
1792
|
+
* Store bildirimlerini listeler
|
|
1793
|
+
*/
|
|
1794
|
+
async list(params) {
|
|
1795
|
+
const searchParams = new URLSearchParams();
|
|
1796
|
+
if (params?.page != null) searchParams.set("page", String(params.page));
|
|
1797
|
+
if (params?.limit != null) searchParams.set("limit", String(params.limit));
|
|
1798
|
+
if (params?.type) searchParams.set("type", params.type);
|
|
1799
|
+
if (params?.read != null) searchParams.set("read", String(params.read));
|
|
1800
|
+
const query = searchParams.toString();
|
|
1801
|
+
return this.request({
|
|
1802
|
+
method: "GET",
|
|
1803
|
+
url: query ? `${this.path}?${query}` : this.path
|
|
1804
|
+
});
|
|
1805
|
+
}
|
|
1806
|
+
/**
|
|
1807
|
+
* Okunmamış bildirim sayısını döner
|
|
1808
|
+
*/
|
|
1809
|
+
async getUnreadCount() {
|
|
1810
|
+
return this.request({
|
|
1811
|
+
method: "GET",
|
|
1812
|
+
url: `${this.path}/count`
|
|
1813
|
+
});
|
|
1814
|
+
}
|
|
1815
|
+
/**
|
|
1816
|
+
* Bildirimi okundu olarak işaretler
|
|
1817
|
+
*/
|
|
1818
|
+
async markAsRead(id) {
|
|
1819
|
+
return this.request({
|
|
1820
|
+
method: "PATCH",
|
|
1821
|
+
url: `${this.path}/${id}/read`
|
|
1822
|
+
});
|
|
1823
|
+
}
|
|
1824
|
+
/**
|
|
1825
|
+
* Tüm bildirimleri okundu olarak işaretler
|
|
1826
|
+
*/
|
|
1827
|
+
async markAllAsRead() {
|
|
1828
|
+
return this.request({
|
|
1829
|
+
method: "PATCH",
|
|
1830
|
+
url: `${this.path}/mark-all-read`
|
|
1831
|
+
});
|
|
1832
|
+
}
|
|
1833
|
+
/**
|
|
1834
|
+
* Bildirimi siler
|
|
1835
|
+
*/
|
|
1836
|
+
async delete(id) {
|
|
1837
|
+
return this.request({
|
|
1838
|
+
method: "DELETE",
|
|
1839
|
+
url: `${this.path}/${id}`
|
|
1840
|
+
});
|
|
1841
|
+
}
|
|
1842
|
+
};
|
|
1843
|
+
|
|
1723
1844
|
// src/resources/frontstore/index.ts
|
|
1724
1845
|
var frontstore_exports = {};
|
|
1725
1846
|
__export(frontstore_exports, {
|
|
@@ -2207,6 +2328,7 @@ var AdminNamespace = class {
|
|
|
2207
2328
|
themes;
|
|
2208
2329
|
google;
|
|
2209
2330
|
integrations;
|
|
2331
|
+
datasets;
|
|
2210
2332
|
cloudflare;
|
|
2211
2333
|
reviews;
|
|
2212
2334
|
customData;
|
|
@@ -2215,6 +2337,7 @@ var AdminNamespace = class {
|
|
|
2215
2337
|
webmail;
|
|
2216
2338
|
subscriptions;
|
|
2217
2339
|
purchases;
|
|
2340
|
+
notifications;
|
|
2218
2341
|
constructor(client) {
|
|
2219
2342
|
this.vendors = new VendorResource(client.instance);
|
|
2220
2343
|
this.contents = new ContentResource(client.instance);
|
|
@@ -2234,6 +2357,7 @@ var AdminNamespace = class {
|
|
|
2234
2357
|
this.themes = new ThemeResource(client.instance);
|
|
2235
2358
|
this.google = new GoogleResource(client.instance);
|
|
2236
2359
|
this.integrations = new IntegrationsResource(client.instance);
|
|
2360
|
+
this.datasets = new DatasetsResource(client.instance);
|
|
2237
2361
|
this.cloudflare = new CloudflareResource(client.instance);
|
|
2238
2362
|
this.reviews = new ReviewResource(client.instance);
|
|
2239
2363
|
this.customData = new CustomDataResource(client.instance);
|
|
@@ -2242,6 +2366,7 @@ var AdminNamespace = class {
|
|
|
2242
2366
|
this.webmail = new WebmailResource(client.instance);
|
|
2243
2367
|
this.subscriptions = new SubscriptionResource(client.instance);
|
|
2244
2368
|
this.purchases = new PurchaseResource(client.instance);
|
|
2369
|
+
this.notifications = new NotificationResource(client.instance);
|
|
2245
2370
|
}
|
|
2246
2371
|
};
|
|
2247
2372
|
var FrontstoreNamespace = class {
|
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,
|
|
@@ -176,6 +177,7 @@ __export(admin_exports, {
|
|
|
176
177
|
MediaResource: () => MediaResource,
|
|
177
178
|
MetadataResource: () => MetadataResource,
|
|
178
179
|
NavigationResource: () => NavigationResource,
|
|
180
|
+
NotificationResource: () => NotificationResource,
|
|
179
181
|
ProjectResource: () => ProjectResource,
|
|
180
182
|
PurchaseResource: () => PurchaseResource,
|
|
181
183
|
ReviewResource: () => ReviewResource,
|
|
@@ -1347,6 +1349,25 @@ var IntegrationsResource = class extends BaseResource {
|
|
|
1347
1349
|
url: "/api/admin/integrations/providers/list"
|
|
1348
1350
|
});
|
|
1349
1351
|
}
|
|
1352
|
+
/**
|
|
1353
|
+
* Entegrasyon ayarlarını getirir
|
|
1354
|
+
*/
|
|
1355
|
+
async getSettings(provider) {
|
|
1356
|
+
return this.request({
|
|
1357
|
+
method: "GET",
|
|
1358
|
+
url: `/api/admin/integrations/${encodeURIComponent(provider)}/settings`
|
|
1359
|
+
});
|
|
1360
|
+
}
|
|
1361
|
+
/**
|
|
1362
|
+
* Entegrasyon ayarlarını günceller (merge - mevcut ayarlarla birleştirir)
|
|
1363
|
+
*/
|
|
1364
|
+
async updateSettings(provider, settings) {
|
|
1365
|
+
return this.request({
|
|
1366
|
+
method: "PUT",
|
|
1367
|
+
url: `/api/admin/integrations/${encodeURIComponent(provider)}/settings`,
|
|
1368
|
+
data: { settings }
|
|
1369
|
+
});
|
|
1370
|
+
}
|
|
1350
1371
|
/** HttpClient'ın baseURL'ini alır */
|
|
1351
1372
|
getBaseUrl() {
|
|
1352
1373
|
const baseURL = this.httpClient?.defaults?.baseURL;
|
|
@@ -1357,6 +1378,46 @@ var IntegrationsResource = class extends BaseResource {
|
|
|
1357
1378
|
}
|
|
1358
1379
|
};
|
|
1359
1380
|
|
|
1381
|
+
// src/resources/admin/datasets.ts
|
|
1382
|
+
var DatasetsResource = class extends BaseResource {
|
|
1383
|
+
constructor(httpClient) {
|
|
1384
|
+
super(httpClient);
|
|
1385
|
+
}
|
|
1386
|
+
/**
|
|
1387
|
+
* Kayıtlı dataset tiplerini listeler (regions, themes, integrations, vb.)
|
|
1388
|
+
*/
|
|
1389
|
+
async listTypes() {
|
|
1390
|
+
return this.request({
|
|
1391
|
+
method: "GET",
|
|
1392
|
+
url: "/api/admin/datasets"
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
/**
|
|
1396
|
+
* Verilen tipteki dataset verisini getirir.
|
|
1397
|
+
* Dinamik: Bilinen tipler dışında yeni tipler de çalışır.
|
|
1398
|
+
*
|
|
1399
|
+
* @param type - Dataset tipi: 'regions' | 'themes' | 'integrations' | (gelecekte eklenecek diğer tipler)
|
|
1400
|
+
*/
|
|
1401
|
+
async get(type) {
|
|
1402
|
+
return this.request({
|
|
1403
|
+
method: "GET",
|
|
1404
|
+
url: `/api/admin/datasets/${encodeURIComponent(type)}`
|
|
1405
|
+
});
|
|
1406
|
+
}
|
|
1407
|
+
/** @deprecated get('regions') kullanın */
|
|
1408
|
+
async getRegions() {
|
|
1409
|
+
return this.get("regions");
|
|
1410
|
+
}
|
|
1411
|
+
/** @deprecated get('themes') kullanın */
|
|
1412
|
+
async getThemes() {
|
|
1413
|
+
return this.get("themes");
|
|
1414
|
+
}
|
|
1415
|
+
/** @deprecated get('integrations') kullanın */
|
|
1416
|
+
async getIntegrations() {
|
|
1417
|
+
return this.get("integrations");
|
|
1418
|
+
}
|
|
1419
|
+
};
|
|
1420
|
+
|
|
1360
1421
|
// src/resources/admin/cloudflare.ts
|
|
1361
1422
|
var CloudflareResource = class extends BaseResource {
|
|
1362
1423
|
constructor(httpClient) {
|
|
@@ -1657,6 +1718,66 @@ var PurchaseResource = class extends BaseResource {
|
|
|
1657
1718
|
}
|
|
1658
1719
|
};
|
|
1659
1720
|
|
|
1721
|
+
// src/resources/admin/notification.ts
|
|
1722
|
+
var NotificationResource = class extends BaseResource {
|
|
1723
|
+
path;
|
|
1724
|
+
constructor(httpClient, path = "/api/admin/notifications") {
|
|
1725
|
+
super(httpClient);
|
|
1726
|
+
this.path = path;
|
|
1727
|
+
}
|
|
1728
|
+
/**
|
|
1729
|
+
* Store bildirimlerini listeler
|
|
1730
|
+
*/
|
|
1731
|
+
async list(params) {
|
|
1732
|
+
const searchParams = new URLSearchParams();
|
|
1733
|
+
if (params?.page != null) searchParams.set("page", String(params.page));
|
|
1734
|
+
if (params?.limit != null) searchParams.set("limit", String(params.limit));
|
|
1735
|
+
if (params?.type) searchParams.set("type", params.type);
|
|
1736
|
+
if (params?.read != null) searchParams.set("read", String(params.read));
|
|
1737
|
+
const query = searchParams.toString();
|
|
1738
|
+
return this.request({
|
|
1739
|
+
method: "GET",
|
|
1740
|
+
url: query ? `${this.path}?${query}` : this.path
|
|
1741
|
+
});
|
|
1742
|
+
}
|
|
1743
|
+
/**
|
|
1744
|
+
* Okunmamış bildirim sayısını döner
|
|
1745
|
+
*/
|
|
1746
|
+
async getUnreadCount() {
|
|
1747
|
+
return this.request({
|
|
1748
|
+
method: "GET",
|
|
1749
|
+
url: `${this.path}/count`
|
|
1750
|
+
});
|
|
1751
|
+
}
|
|
1752
|
+
/**
|
|
1753
|
+
* Bildirimi okundu olarak işaretler
|
|
1754
|
+
*/
|
|
1755
|
+
async markAsRead(id) {
|
|
1756
|
+
return this.request({
|
|
1757
|
+
method: "PATCH",
|
|
1758
|
+
url: `${this.path}/${id}/read`
|
|
1759
|
+
});
|
|
1760
|
+
}
|
|
1761
|
+
/**
|
|
1762
|
+
* Tüm bildirimleri okundu olarak işaretler
|
|
1763
|
+
*/
|
|
1764
|
+
async markAllAsRead() {
|
|
1765
|
+
return this.request({
|
|
1766
|
+
method: "PATCH",
|
|
1767
|
+
url: `${this.path}/mark-all-read`
|
|
1768
|
+
});
|
|
1769
|
+
}
|
|
1770
|
+
/**
|
|
1771
|
+
* Bildirimi siler
|
|
1772
|
+
*/
|
|
1773
|
+
async delete(id) {
|
|
1774
|
+
return this.request({
|
|
1775
|
+
method: "DELETE",
|
|
1776
|
+
url: `${this.path}/${id}`
|
|
1777
|
+
});
|
|
1778
|
+
}
|
|
1779
|
+
};
|
|
1780
|
+
|
|
1660
1781
|
// src/resources/frontstore/index.ts
|
|
1661
1782
|
var frontstore_exports = {};
|
|
1662
1783
|
__export(frontstore_exports, {
|
|
@@ -2144,6 +2265,7 @@ var AdminNamespace = class {
|
|
|
2144
2265
|
themes;
|
|
2145
2266
|
google;
|
|
2146
2267
|
integrations;
|
|
2268
|
+
datasets;
|
|
2147
2269
|
cloudflare;
|
|
2148
2270
|
reviews;
|
|
2149
2271
|
customData;
|
|
@@ -2152,6 +2274,7 @@ var AdminNamespace = class {
|
|
|
2152
2274
|
webmail;
|
|
2153
2275
|
subscriptions;
|
|
2154
2276
|
purchases;
|
|
2277
|
+
notifications;
|
|
2155
2278
|
constructor(client) {
|
|
2156
2279
|
this.vendors = new VendorResource(client.instance);
|
|
2157
2280
|
this.contents = new ContentResource(client.instance);
|
|
@@ -2171,6 +2294,7 @@ var AdminNamespace = class {
|
|
|
2171
2294
|
this.themes = new ThemeResource(client.instance);
|
|
2172
2295
|
this.google = new GoogleResource(client.instance);
|
|
2173
2296
|
this.integrations = new IntegrationsResource(client.instance);
|
|
2297
|
+
this.datasets = new DatasetsResource(client.instance);
|
|
2174
2298
|
this.cloudflare = new CloudflareResource(client.instance);
|
|
2175
2299
|
this.reviews = new ReviewResource(client.instance);
|
|
2176
2300
|
this.customData = new CustomDataResource(client.instance);
|
|
@@ -2179,6 +2303,7 @@ var AdminNamespace = class {
|
|
|
2179
2303
|
this.webmail = new WebmailResource(client.instance);
|
|
2180
2304
|
this.subscriptions = new SubscriptionResource(client.instance);
|
|
2181
2305
|
this.purchases = new PurchaseResource(client.instance);
|
|
2306
|
+
this.notifications = new NotificationResource(client.instance);
|
|
2182
2307
|
}
|
|
2183
2308
|
};
|
|
2184
2309
|
var FrontstoreNamespace = class {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salefony/api-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
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",
|