@salefony/api-sdk 1.0.7 → 1.0.9

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
@@ -506,12 +506,8 @@ const { total, page, limit, totalPages, hasNextPage } = meta ?? {};
506
506
  Connect Google Analytics, Facebook Business, TikTok Pixel, etc. OAuth flow runs on the backend.
507
507
 
508
508
  ```typescript
509
- // Start OAuth – redirect user
510
- const url = sdk.admin.integrations.getAuthorizeUrl(
511
- 'google-analytics',
512
- 'https://app.example.com/admin/analytics'
513
- );
514
- window.location.href = url; // React/Next.js
509
+ // Start OAuth – URL oluşturur ve otomatik yönlendirir
510
+ sdk.admin.integrations.authorize('google-analytics', '/admin/analytics');
515
511
 
516
512
  // Check connection status
517
513
  const { data } = await sdk.admin.integrations.getStatus('google-analytics');
@@ -524,9 +520,9 @@ await sdk.admin.integrations.disconnect('google-analytics');
524
520
 
525
521
  | Platform | Flow |
526
522
  |--------------------|--------------------------------------------------------------|
527
- | React / Next.js | `window.location.href = getAuthorizeUrl(...)` |
528
- | Expo / React Native| `Linking.openURL(url)` or WebView with `redirect_uri`: `myapp://` |
529
- | Node.js | Return URL or `res.redirect(url)` |
523
+ | React / Next.js | `authorize('google-analytics', '/admin/analytics')` – otomatik redirect |
524
+ | Expo / React Native| `url = authorize(...)` + `Linking.openURL(url)` sadece URL döner |
525
+ | Node.js | `url = authorize(...)` – sadece URL döner, `res.redirect(url)` |
530
526
 
531
527
  Full guide: [Integrations Documentation](./docs/INTEGRATIONS.md)
532
528
 
package/dist/index.d.mts CHANGED
@@ -1248,26 +1248,48 @@ 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.
1254
1267
  *
1255
1268
  * Kullanım:
1256
- * - Bağlantı başlat: window.location.href = sdk.admin.integrations.getAuthorizeUrl('google-analytics', redirectUri)
1269
+ * - Bağlantı başlat: sdk.admin.integrations.authorize('google-analytics', '/admin/analytics')
1257
1270
  * - Durum: sdk.admin.integrations.getStatus('google-analytics')
1258
1271
  * - Bağlantı kes: sdk.admin.integrations.disconnect('google-analytics')
1259
1272
  */
1260
1273
  declare class IntegrationsResource extends BaseResource {
1261
1274
  constructor(httpClient: AxiosInstance);
1262
1275
  /**
1263
- * OAuth başlatma URL'ini döner.
1264
- * Frontend bu URL'e yönlendirir (window.location.href = url).
1265
- * Cookie/Authorization ile backend'e gidilir, backend Google'a redirect eder.
1276
+ * OAuth başlatır: URL üretir ve tarayıcıda yönlendirir.
1277
+ * Kullanıcının URL oluşturup window.location atamasına gerek kalmaz.
1278
+ *
1279
+ * @param provider - Provider ID (google-analytics, facebook-business, vb.)
1280
+ * @param redirectUriOrPath - Tam URL veya path (örn: '/admin/analytics'). Verilmezse mevcut sayfa kullanılır.
1281
+ * @returns Oluşturulan URL (Node.js / Expo gibi ortamlarda manuel kullanım için)
1282
+ */
1283
+ authorize(provider: IntegrationProviderId | string, redirectUriOrPath?: string): string;
1284
+ /**
1285
+ * OAuth başlatma URL'ini döner (redirect yapmaz).
1286
+ * Tarayıcıda otomatik yönlendirme için `authorize()` kullanın.
1266
1287
  *
1267
1288
  * @param provider - Provider ID (google-analytics, facebook-business, vb.)
1268
1289
  * @param redirectUri - OAuth tamamlandıktan sonra dönülecek URL (opsiyonel)
1269
1290
  */
1270
1291
  getAuthorizeUrl(provider: IntegrationProviderId | string, redirectUri?: string): string;
1292
+ private resolveRedirectUri;
1271
1293
  /**
1272
1294
  * Bağlantı durumunu sorgular
1273
1295
  */
@@ -1285,6 +1307,14 @@ declare class IntegrationsResource extends BaseResource {
1285
1307
  listProviders(): Promise<ApiResponse<{
1286
1308
  providers: IntegrationProviderId[];
1287
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>>;
1288
1318
  /** HttpClient'ın baseURL'ini alır */
1289
1319
  private getBaseUrl;
1290
1320
  }
@@ -1367,6 +1397,57 @@ declare class PurchaseResource extends BaseResource {
1367
1397
  createPurchase(data: any): Promise<ApiResponse<any>>;
1368
1398
  }
1369
1399
 
1400
+ type NotificationType = 'ANALYTICS' | 'ORDER' | 'MESSAGE' | 'SYSTEM';
1401
+ interface StoreNotification {
1402
+ id: string;
1403
+ type: NotificationType;
1404
+ titleKey: string;
1405
+ subtitleKey: string;
1406
+ read: boolean;
1407
+ metadata?: Record<string, unknown>;
1408
+ storeId: string;
1409
+ createdAt: string;
1410
+ updatedAt: string;
1411
+ }
1412
+ interface ListNotificationsParams {
1413
+ page?: number;
1414
+ limit?: number;
1415
+ type?: NotificationType;
1416
+ read?: boolean;
1417
+ }
1418
+ declare class NotificationResource extends BaseResource {
1419
+ protected readonly path: string;
1420
+ constructor(httpClient: AxiosInstance, path?: string);
1421
+ /**
1422
+ * Store bildirimlerini listeler
1423
+ */
1424
+ list(params?: ListNotificationsParams): Promise<ApiResponse<StoreNotification[]>>;
1425
+ /**
1426
+ * Okunmamış bildirim sayısını döner
1427
+ */
1428
+ getUnreadCount(): Promise<ApiResponse<{
1429
+ count: number;
1430
+ }>>;
1431
+ /**
1432
+ * Bildirimi okundu olarak işaretler
1433
+ */
1434
+ markAsRead(id: string): Promise<ApiResponse<{
1435
+ success: boolean;
1436
+ }>>;
1437
+ /**
1438
+ * Tüm bildirimleri okundu olarak işaretler
1439
+ */
1440
+ markAllAsRead(): Promise<ApiResponse<{
1441
+ success: boolean;
1442
+ }>>;
1443
+ /**
1444
+ * Bildirimi siler
1445
+ */
1446
+ delete(id: string): Promise<ApiResponse<{
1447
+ success: boolean;
1448
+ }>>;
1449
+ }
1450
+
1370
1451
  type index$5_AdminMediaCreateInput = AdminMediaCreateInput;
1371
1452
  type index$5_ApiKeyResource = ApiKeyResource;
1372
1453
  declare const index$5_ApiKeyResource: typeof ApiKeyResource;
@@ -1379,16 +1460,23 @@ type index$5_CustomDataResource = CustomDataResource;
1379
1460
  declare const index$5_CustomDataResource: typeof CustomDataResource;
1380
1461
  type index$5_DatasourceResource = DatasourceResource;
1381
1462
  declare const index$5_DatasourceResource: typeof DatasourceResource;
1463
+ type index$5_FacebookBusinessSettings = FacebookBusinessSettings;
1464
+ type index$5_GoogleAnalyticsSettings = GoogleAnalyticsSettings;
1382
1465
  type index$5_GoogleResource = GoogleResource;
1383
1466
  declare const index$5_GoogleResource: typeof GoogleResource;
1384
1467
  type index$5_IntegrationConnectionStatus = IntegrationConnectionStatus;
1385
1468
  type index$5_IntegrationProviderId = IntegrationProviderId;
1469
+ type index$5_IntegrationSettingsData = IntegrationSettingsData;
1386
1470
  type index$5_IntegrationsResource = IntegrationsResource;
1387
1471
  declare const index$5_IntegrationsResource: typeof IntegrationsResource;
1388
1472
  type index$5_LayoutResource = LayoutResource;
1389
1473
  declare const index$5_LayoutResource: typeof LayoutResource;
1474
+ type index$5_ListNotificationsParams = ListNotificationsParams;
1390
1475
  type index$5_MetadataResource = MetadataResource;
1391
1476
  declare const index$5_MetadataResource: typeof MetadataResource;
1477
+ type index$5_NotificationResource = NotificationResource;
1478
+ declare const index$5_NotificationResource: typeof NotificationResource;
1479
+ type index$5_NotificationType = NotificationType;
1392
1480
  type index$5_ProjectResource = ProjectResource;
1393
1481
  declare const index$5_ProjectResource: typeof ProjectResource;
1394
1482
  type index$5_PurchaseResource = PurchaseResource;
@@ -1401,6 +1489,7 @@ type index$5_SectorResource = SectorResource;
1401
1489
  declare const index$5_SectorResource: typeof SectorResource;
1402
1490
  type index$5_SettingsResource = SettingsResource;
1403
1491
  declare const index$5_SettingsResource: typeof SettingsResource;
1492
+ type index$5_StoreNotification = StoreNotification;
1404
1493
  type index$5_SubscriptionResource = SubscriptionResource;
1405
1494
  declare const index$5_SubscriptionResource: typeof SubscriptionResource;
1406
1495
  type index$5_ThemeResource = ThemeResource;
@@ -1422,7 +1511,7 @@ declare const index$5_sectorColumns: typeof sectorColumns;
1422
1511
  declare const index$5_storeColumns: typeof storeColumns;
1423
1512
  declare const index$5_vendorColumns: typeof vendorColumns;
1424
1513
  declare namespace index$5 {
1425
- 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 };
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 };
1426
1515
  }
1427
1516
 
1428
1517
  declare class StoreResource extends CrudResource<Store, StoreWhereInput, StoreOrderByInput, StoreCreateInput, StoreUpdateInput> {
@@ -1865,6 +1954,7 @@ declare class AdminNamespace {
1865
1954
  readonly webmail: WebmailResource;
1866
1955
  readonly subscriptions: SubscriptionResource;
1867
1956
  readonly purchases: PurchaseResource;
1957
+ readonly notifications: NotificationResource;
1868
1958
  constructor(client: ApiClient);
1869
1959
  }
1870
1960
  /**
package/dist/index.d.ts CHANGED
@@ -1248,26 +1248,48 @@ 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.
1254
1267
  *
1255
1268
  * Kullanım:
1256
- * - Bağlantı başlat: window.location.href = sdk.admin.integrations.getAuthorizeUrl('google-analytics', redirectUri)
1269
+ * - Bağlantı başlat: sdk.admin.integrations.authorize('google-analytics', '/admin/analytics')
1257
1270
  * - Durum: sdk.admin.integrations.getStatus('google-analytics')
1258
1271
  * - Bağlantı kes: sdk.admin.integrations.disconnect('google-analytics')
1259
1272
  */
1260
1273
  declare class IntegrationsResource extends BaseResource {
1261
1274
  constructor(httpClient: AxiosInstance);
1262
1275
  /**
1263
- * OAuth başlatma URL'ini döner.
1264
- * Frontend bu URL'e yönlendirir (window.location.href = url).
1265
- * Cookie/Authorization ile backend'e gidilir, backend Google'a redirect eder.
1276
+ * OAuth başlatır: URL üretir ve tarayıcıda yönlendirir.
1277
+ * Kullanıcının URL oluşturup window.location atamasına gerek kalmaz.
1278
+ *
1279
+ * @param provider - Provider ID (google-analytics, facebook-business, vb.)
1280
+ * @param redirectUriOrPath - Tam URL veya path (örn: '/admin/analytics'). Verilmezse mevcut sayfa kullanılır.
1281
+ * @returns Oluşturulan URL (Node.js / Expo gibi ortamlarda manuel kullanım için)
1282
+ */
1283
+ authorize(provider: IntegrationProviderId | string, redirectUriOrPath?: string): string;
1284
+ /**
1285
+ * OAuth başlatma URL'ini döner (redirect yapmaz).
1286
+ * Tarayıcıda otomatik yönlendirme için `authorize()` kullanın.
1266
1287
  *
1267
1288
  * @param provider - Provider ID (google-analytics, facebook-business, vb.)
1268
1289
  * @param redirectUri - OAuth tamamlandıktan sonra dönülecek URL (opsiyonel)
1269
1290
  */
1270
1291
  getAuthorizeUrl(provider: IntegrationProviderId | string, redirectUri?: string): string;
1292
+ private resolveRedirectUri;
1271
1293
  /**
1272
1294
  * Bağlantı durumunu sorgular
1273
1295
  */
@@ -1285,6 +1307,14 @@ declare class IntegrationsResource extends BaseResource {
1285
1307
  listProviders(): Promise<ApiResponse<{
1286
1308
  providers: IntegrationProviderId[];
1287
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>>;
1288
1318
  /** HttpClient'ın baseURL'ini alır */
1289
1319
  private getBaseUrl;
1290
1320
  }
@@ -1367,6 +1397,57 @@ declare class PurchaseResource extends BaseResource {
1367
1397
  createPurchase(data: any): Promise<ApiResponse<any>>;
1368
1398
  }
1369
1399
 
1400
+ type NotificationType = 'ANALYTICS' | 'ORDER' | 'MESSAGE' | 'SYSTEM';
1401
+ interface StoreNotification {
1402
+ id: string;
1403
+ type: NotificationType;
1404
+ titleKey: string;
1405
+ subtitleKey: string;
1406
+ read: boolean;
1407
+ metadata?: Record<string, unknown>;
1408
+ storeId: string;
1409
+ createdAt: string;
1410
+ updatedAt: string;
1411
+ }
1412
+ interface ListNotificationsParams {
1413
+ page?: number;
1414
+ limit?: number;
1415
+ type?: NotificationType;
1416
+ read?: boolean;
1417
+ }
1418
+ declare class NotificationResource extends BaseResource {
1419
+ protected readonly path: string;
1420
+ constructor(httpClient: AxiosInstance, path?: string);
1421
+ /**
1422
+ * Store bildirimlerini listeler
1423
+ */
1424
+ list(params?: ListNotificationsParams): Promise<ApiResponse<StoreNotification[]>>;
1425
+ /**
1426
+ * Okunmamış bildirim sayısını döner
1427
+ */
1428
+ getUnreadCount(): Promise<ApiResponse<{
1429
+ count: number;
1430
+ }>>;
1431
+ /**
1432
+ * Bildirimi okundu olarak işaretler
1433
+ */
1434
+ markAsRead(id: string): Promise<ApiResponse<{
1435
+ success: boolean;
1436
+ }>>;
1437
+ /**
1438
+ * Tüm bildirimleri okundu olarak işaretler
1439
+ */
1440
+ markAllAsRead(): Promise<ApiResponse<{
1441
+ success: boolean;
1442
+ }>>;
1443
+ /**
1444
+ * Bildirimi siler
1445
+ */
1446
+ delete(id: string): Promise<ApiResponse<{
1447
+ success: boolean;
1448
+ }>>;
1449
+ }
1450
+
1370
1451
  type index$5_AdminMediaCreateInput = AdminMediaCreateInput;
1371
1452
  type index$5_ApiKeyResource = ApiKeyResource;
1372
1453
  declare const index$5_ApiKeyResource: typeof ApiKeyResource;
@@ -1379,16 +1460,23 @@ type index$5_CustomDataResource = CustomDataResource;
1379
1460
  declare const index$5_CustomDataResource: typeof CustomDataResource;
1380
1461
  type index$5_DatasourceResource = DatasourceResource;
1381
1462
  declare const index$5_DatasourceResource: typeof DatasourceResource;
1463
+ type index$5_FacebookBusinessSettings = FacebookBusinessSettings;
1464
+ type index$5_GoogleAnalyticsSettings = GoogleAnalyticsSettings;
1382
1465
  type index$5_GoogleResource = GoogleResource;
1383
1466
  declare const index$5_GoogleResource: typeof GoogleResource;
1384
1467
  type index$5_IntegrationConnectionStatus = IntegrationConnectionStatus;
1385
1468
  type index$5_IntegrationProviderId = IntegrationProviderId;
1469
+ type index$5_IntegrationSettingsData = IntegrationSettingsData;
1386
1470
  type index$5_IntegrationsResource = IntegrationsResource;
1387
1471
  declare const index$5_IntegrationsResource: typeof IntegrationsResource;
1388
1472
  type index$5_LayoutResource = LayoutResource;
1389
1473
  declare const index$5_LayoutResource: typeof LayoutResource;
1474
+ type index$5_ListNotificationsParams = ListNotificationsParams;
1390
1475
  type index$5_MetadataResource = MetadataResource;
1391
1476
  declare const index$5_MetadataResource: typeof MetadataResource;
1477
+ type index$5_NotificationResource = NotificationResource;
1478
+ declare const index$5_NotificationResource: typeof NotificationResource;
1479
+ type index$5_NotificationType = NotificationType;
1392
1480
  type index$5_ProjectResource = ProjectResource;
1393
1481
  declare const index$5_ProjectResource: typeof ProjectResource;
1394
1482
  type index$5_PurchaseResource = PurchaseResource;
@@ -1401,6 +1489,7 @@ type index$5_SectorResource = SectorResource;
1401
1489
  declare const index$5_SectorResource: typeof SectorResource;
1402
1490
  type index$5_SettingsResource = SettingsResource;
1403
1491
  declare const index$5_SettingsResource: typeof SettingsResource;
1492
+ type index$5_StoreNotification = StoreNotification;
1404
1493
  type index$5_SubscriptionResource = SubscriptionResource;
1405
1494
  declare const index$5_SubscriptionResource: typeof SubscriptionResource;
1406
1495
  type index$5_ThemeResource = ThemeResource;
@@ -1422,7 +1511,7 @@ declare const index$5_sectorColumns: typeof sectorColumns;
1422
1511
  declare const index$5_storeColumns: typeof storeColumns;
1423
1512
  declare const index$5_vendorColumns: typeof vendorColumns;
1424
1513
  declare namespace index$5 {
1425
- 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 };
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 };
1426
1515
  }
1427
1516
 
1428
1517
  declare class StoreResource extends CrudResource<Store, StoreWhereInput, StoreOrderByInput, StoreCreateInput, StoreUpdateInput> {
@@ -1865,6 +1954,7 @@ declare class AdminNamespace {
1865
1954
  readonly webmail: WebmailResource;
1866
1955
  readonly subscriptions: SubscriptionResource;
1867
1956
  readonly purchases: PurchaseResource;
1957
+ readonly notifications: NotificationResource;
1868
1958
  constructor(client: ApiClient);
1869
1959
  }
1870
1960
  /**
package/dist/index.js CHANGED
@@ -239,6 +239,7 @@ __export(admin_exports, {
239
239
  MediaResource: () => MediaResource,
240
240
  MetadataResource: () => MetadataResource,
241
241
  NavigationResource: () => NavigationResource,
242
+ NotificationResource: () => NotificationResource,
242
243
  ProjectResource: () => ProjectResource,
243
244
  PurchaseResource: () => PurchaseResource,
244
245
  ReviewResource: () => ReviewResource,
@@ -1340,9 +1341,24 @@ var IntegrationsResource = class extends BaseResource {
1340
1341
  super(httpClient);
1341
1342
  }
1342
1343
  /**
1343
- * OAuth başlatma URL'ini döner.
1344
- * Frontend bu URL'e yönlendirir (window.location.href = url).
1345
- * Cookie/Authorization ile backend'e gidilir, backend Google'a redirect eder.
1344
+ * OAuth başlatır: URL üretir ve tarayıcıda yönlendirir.
1345
+ * Kullanıcının URL oluşturup window.location atamasına gerek kalmaz.
1346
+ *
1347
+ * @param provider - Provider ID (google-analytics, facebook-business, vb.)
1348
+ * @param redirectUriOrPath - Tam URL veya path (örn: '/admin/analytics'). Verilmezse mevcut sayfa kullanılır.
1349
+ * @returns Oluşturulan URL (Node.js / Expo gibi ortamlarda manuel kullanım için)
1350
+ */
1351
+ authorize(provider, redirectUriOrPath) {
1352
+ const redirectUri = this.resolveRedirectUri(redirectUriOrPath);
1353
+ const url = this.getAuthorizeUrl(provider, redirectUri);
1354
+ if (typeof window !== "undefined") {
1355
+ window.location.href = url;
1356
+ }
1357
+ return url;
1358
+ }
1359
+ /**
1360
+ * OAuth başlatma URL'ini döner (redirect yapmaz).
1361
+ * Tarayıcıda otomatik yönlendirme için `authorize()` kullanın.
1346
1362
  *
1347
1363
  * @param provider - Provider ID (google-analytics, facebook-business, vb.)
1348
1364
  * @param redirectUri - OAuth tamamlandıktan sonra dönülecek URL (opsiyonel)
@@ -1353,6 +1369,21 @@ var IntegrationsResource = class extends BaseResource {
1353
1369
  const params = redirectUri ? `?redirect_uri=${encodeURIComponent(redirectUri)}` : "";
1354
1370
  return `${baseUrl}${path}${params}`;
1355
1371
  }
1372
+ resolveRedirectUri(redirectUriOrPath) {
1373
+ if (redirectUriOrPath) {
1374
+ if (redirectUriOrPath.startsWith("http://") || redirectUriOrPath.startsWith("https://")) {
1375
+ return redirectUriOrPath;
1376
+ }
1377
+ if (typeof window !== "undefined") {
1378
+ const path = redirectUriOrPath.startsWith("/") ? redirectUriOrPath : `/${redirectUriOrPath}`;
1379
+ return `${window.location.origin}${path}`;
1380
+ }
1381
+ }
1382
+ if (typeof window !== "undefined") {
1383
+ return window.location.href;
1384
+ }
1385
+ return void 0;
1386
+ }
1356
1387
  /**
1357
1388
  * Bağlantı durumunu sorgular
1358
1389
  */
@@ -1380,6 +1411,25 @@ var IntegrationsResource = class extends BaseResource {
1380
1411
  url: "/api/admin/integrations/providers/list"
1381
1412
  });
1382
1413
  }
1414
+ /**
1415
+ * Entegrasyon ayarlarını getirir
1416
+ */
1417
+ async getSettings(provider) {
1418
+ return this.request({
1419
+ method: "GET",
1420
+ url: `/api/admin/integrations/${encodeURIComponent(provider)}/settings`
1421
+ });
1422
+ }
1423
+ /**
1424
+ * Entegrasyon ayarlarını günceller (merge - mevcut ayarlarla birleştirir)
1425
+ */
1426
+ async updateSettings(provider, settings) {
1427
+ return this.request({
1428
+ method: "PUT",
1429
+ url: `/api/admin/integrations/${encodeURIComponent(provider)}/settings`,
1430
+ data: { settings }
1431
+ });
1432
+ }
1383
1433
  /** HttpClient'ın baseURL'ini alır */
1384
1434
  getBaseUrl() {
1385
1435
  const baseURL = this.httpClient?.defaults?.baseURL;
@@ -1690,6 +1740,66 @@ var PurchaseResource = class extends BaseResource {
1690
1740
  }
1691
1741
  };
1692
1742
 
1743
+ // src/resources/admin/notification.ts
1744
+ var NotificationResource = class extends BaseResource {
1745
+ path;
1746
+ constructor(httpClient, path = "/api/admin/notifications") {
1747
+ super(httpClient);
1748
+ this.path = path;
1749
+ }
1750
+ /**
1751
+ * Store bildirimlerini listeler
1752
+ */
1753
+ async list(params) {
1754
+ const searchParams = new URLSearchParams();
1755
+ if (params?.page != null) searchParams.set("page", String(params.page));
1756
+ if (params?.limit != null) searchParams.set("limit", String(params.limit));
1757
+ if (params?.type) searchParams.set("type", params.type);
1758
+ if (params?.read != null) searchParams.set("read", String(params.read));
1759
+ const query = searchParams.toString();
1760
+ return this.request({
1761
+ method: "GET",
1762
+ url: query ? `${this.path}?${query}` : this.path
1763
+ });
1764
+ }
1765
+ /**
1766
+ * Okunmamış bildirim sayısını döner
1767
+ */
1768
+ async getUnreadCount() {
1769
+ return this.request({
1770
+ method: "GET",
1771
+ url: `${this.path}/count`
1772
+ });
1773
+ }
1774
+ /**
1775
+ * Bildirimi okundu olarak işaretler
1776
+ */
1777
+ async markAsRead(id) {
1778
+ return this.request({
1779
+ method: "PATCH",
1780
+ url: `${this.path}/${id}/read`
1781
+ });
1782
+ }
1783
+ /**
1784
+ * Tüm bildirimleri okundu olarak işaretler
1785
+ */
1786
+ async markAllAsRead() {
1787
+ return this.request({
1788
+ method: "PATCH",
1789
+ url: `${this.path}/mark-all-read`
1790
+ });
1791
+ }
1792
+ /**
1793
+ * Bildirimi siler
1794
+ */
1795
+ async delete(id) {
1796
+ return this.request({
1797
+ method: "DELETE",
1798
+ url: `${this.path}/${id}`
1799
+ });
1800
+ }
1801
+ };
1802
+
1693
1803
  // src/resources/frontstore/index.ts
1694
1804
  var frontstore_exports = {};
1695
1805
  __export(frontstore_exports, {
@@ -2185,6 +2295,7 @@ var AdminNamespace = class {
2185
2295
  webmail;
2186
2296
  subscriptions;
2187
2297
  purchases;
2298
+ notifications;
2188
2299
  constructor(client) {
2189
2300
  this.vendors = new VendorResource(client.instance);
2190
2301
  this.contents = new ContentResource(client.instance);
@@ -2212,6 +2323,7 @@ var AdminNamespace = class {
2212
2323
  this.webmail = new WebmailResource(client.instance);
2213
2324
  this.subscriptions = new SubscriptionResource(client.instance);
2214
2325
  this.purchases = new PurchaseResource(client.instance);
2326
+ this.notifications = new NotificationResource(client.instance);
2215
2327
  }
2216
2328
  };
2217
2329
  var FrontstoreNamespace = class {
package/dist/index.mjs CHANGED
@@ -176,6 +176,7 @@ __export(admin_exports, {
176
176
  MediaResource: () => MediaResource,
177
177
  MetadataResource: () => MetadataResource,
178
178
  NavigationResource: () => NavigationResource,
179
+ NotificationResource: () => NotificationResource,
179
180
  ProjectResource: () => ProjectResource,
180
181
  PurchaseResource: () => PurchaseResource,
181
182
  ReviewResource: () => ReviewResource,
@@ -1277,9 +1278,24 @@ var IntegrationsResource = class extends BaseResource {
1277
1278
  super(httpClient);
1278
1279
  }
1279
1280
  /**
1280
- * OAuth başlatma URL'ini döner.
1281
- * Frontend bu URL'e yönlendirir (window.location.href = url).
1282
- * Cookie/Authorization ile backend'e gidilir, backend Google'a redirect eder.
1281
+ * OAuth başlatır: URL üretir ve tarayıcıda yönlendirir.
1282
+ * Kullanıcının URL oluşturup window.location atamasına gerek kalmaz.
1283
+ *
1284
+ * @param provider - Provider ID (google-analytics, facebook-business, vb.)
1285
+ * @param redirectUriOrPath - Tam URL veya path (örn: '/admin/analytics'). Verilmezse mevcut sayfa kullanılır.
1286
+ * @returns Oluşturulan URL (Node.js / Expo gibi ortamlarda manuel kullanım için)
1287
+ */
1288
+ authorize(provider, redirectUriOrPath) {
1289
+ const redirectUri = this.resolveRedirectUri(redirectUriOrPath);
1290
+ const url = this.getAuthorizeUrl(provider, redirectUri);
1291
+ if (typeof window !== "undefined") {
1292
+ window.location.href = url;
1293
+ }
1294
+ return url;
1295
+ }
1296
+ /**
1297
+ * OAuth başlatma URL'ini döner (redirect yapmaz).
1298
+ * Tarayıcıda otomatik yönlendirme için `authorize()` kullanın.
1283
1299
  *
1284
1300
  * @param provider - Provider ID (google-analytics, facebook-business, vb.)
1285
1301
  * @param redirectUri - OAuth tamamlandıktan sonra dönülecek URL (opsiyonel)
@@ -1290,6 +1306,21 @@ var IntegrationsResource = class extends BaseResource {
1290
1306
  const params = redirectUri ? `?redirect_uri=${encodeURIComponent(redirectUri)}` : "";
1291
1307
  return `${baseUrl}${path}${params}`;
1292
1308
  }
1309
+ resolveRedirectUri(redirectUriOrPath) {
1310
+ if (redirectUriOrPath) {
1311
+ if (redirectUriOrPath.startsWith("http://") || redirectUriOrPath.startsWith("https://")) {
1312
+ return redirectUriOrPath;
1313
+ }
1314
+ if (typeof window !== "undefined") {
1315
+ const path = redirectUriOrPath.startsWith("/") ? redirectUriOrPath : `/${redirectUriOrPath}`;
1316
+ return `${window.location.origin}${path}`;
1317
+ }
1318
+ }
1319
+ if (typeof window !== "undefined") {
1320
+ return window.location.href;
1321
+ }
1322
+ return void 0;
1323
+ }
1293
1324
  /**
1294
1325
  * Bağlantı durumunu sorgular
1295
1326
  */
@@ -1317,6 +1348,25 @@ var IntegrationsResource = class extends BaseResource {
1317
1348
  url: "/api/admin/integrations/providers/list"
1318
1349
  });
1319
1350
  }
1351
+ /**
1352
+ * Entegrasyon ayarlarını getirir
1353
+ */
1354
+ async getSettings(provider) {
1355
+ return this.request({
1356
+ method: "GET",
1357
+ url: `/api/admin/integrations/${encodeURIComponent(provider)}/settings`
1358
+ });
1359
+ }
1360
+ /**
1361
+ * Entegrasyon ayarlarını günceller (merge - mevcut ayarlarla birleştirir)
1362
+ */
1363
+ async updateSettings(provider, settings) {
1364
+ return this.request({
1365
+ method: "PUT",
1366
+ url: `/api/admin/integrations/${encodeURIComponent(provider)}/settings`,
1367
+ data: { settings }
1368
+ });
1369
+ }
1320
1370
  /** HttpClient'ın baseURL'ini alır */
1321
1371
  getBaseUrl() {
1322
1372
  const baseURL = this.httpClient?.defaults?.baseURL;
@@ -1627,6 +1677,66 @@ var PurchaseResource = class extends BaseResource {
1627
1677
  }
1628
1678
  };
1629
1679
 
1680
+ // src/resources/admin/notification.ts
1681
+ var NotificationResource = class extends BaseResource {
1682
+ path;
1683
+ constructor(httpClient, path = "/api/admin/notifications") {
1684
+ super(httpClient);
1685
+ this.path = path;
1686
+ }
1687
+ /**
1688
+ * Store bildirimlerini listeler
1689
+ */
1690
+ async list(params) {
1691
+ const searchParams = new URLSearchParams();
1692
+ if (params?.page != null) searchParams.set("page", String(params.page));
1693
+ if (params?.limit != null) searchParams.set("limit", String(params.limit));
1694
+ if (params?.type) searchParams.set("type", params.type);
1695
+ if (params?.read != null) searchParams.set("read", String(params.read));
1696
+ const query = searchParams.toString();
1697
+ return this.request({
1698
+ method: "GET",
1699
+ url: query ? `${this.path}?${query}` : this.path
1700
+ });
1701
+ }
1702
+ /**
1703
+ * Okunmamış bildirim sayısını döner
1704
+ */
1705
+ async getUnreadCount() {
1706
+ return this.request({
1707
+ method: "GET",
1708
+ url: `${this.path}/count`
1709
+ });
1710
+ }
1711
+ /**
1712
+ * Bildirimi okundu olarak işaretler
1713
+ */
1714
+ async markAsRead(id) {
1715
+ return this.request({
1716
+ method: "PATCH",
1717
+ url: `${this.path}/${id}/read`
1718
+ });
1719
+ }
1720
+ /**
1721
+ * Tüm bildirimleri okundu olarak işaretler
1722
+ */
1723
+ async markAllAsRead() {
1724
+ return this.request({
1725
+ method: "PATCH",
1726
+ url: `${this.path}/mark-all-read`
1727
+ });
1728
+ }
1729
+ /**
1730
+ * Bildirimi siler
1731
+ */
1732
+ async delete(id) {
1733
+ return this.request({
1734
+ method: "DELETE",
1735
+ url: `${this.path}/${id}`
1736
+ });
1737
+ }
1738
+ };
1739
+
1630
1740
  // src/resources/frontstore/index.ts
1631
1741
  var frontstore_exports = {};
1632
1742
  __export(frontstore_exports, {
@@ -2122,6 +2232,7 @@ var AdminNamespace = class {
2122
2232
  webmail;
2123
2233
  subscriptions;
2124
2234
  purchases;
2235
+ notifications;
2125
2236
  constructor(client) {
2126
2237
  this.vendors = new VendorResource(client.instance);
2127
2238
  this.contents = new ContentResource(client.instance);
@@ -2149,6 +2260,7 @@ var AdminNamespace = class {
2149
2260
  this.webmail = new WebmailResource(client.instance);
2150
2261
  this.subscriptions = new SubscriptionResource(client.instance);
2151
2262
  this.purchases = new PurchaseResource(client.instance);
2263
+ this.notifications = new NotificationResource(client.instance);
2152
2264
  }
2153
2265
  };
2154
2266
  var FrontstoreNamespace = class {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salefony/api-sdk",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
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",