@salefony/api-sdk 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +238 -10
- package/dist/index.d.ts +238 -10
- package/dist/index.js +209 -6
- package/dist/index.mjs +179 -6
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1075,7 +1075,11 @@ interface AdminMediaCreateInput {
|
|
|
1075
1075
|
declare class MediaResource$1 extends BaseResource {
|
|
1076
1076
|
private path;
|
|
1077
1077
|
constructor(httpClient: AxiosInstance, path?: string);
|
|
1078
|
-
getAll(
|
|
1078
|
+
getAll(params?: {
|
|
1079
|
+
type?: string;
|
|
1080
|
+
}): Promise<ApiResponse<Media[]>>;
|
|
1081
|
+
/** List only documents (media with type === 'document'). */
|
|
1082
|
+
getDocuments(): Promise<ApiResponse<Media[]>>;
|
|
1079
1083
|
create(data: AdminMediaCreateInput): Promise<ApiResponse<{
|
|
1080
1084
|
media: Media;
|
|
1081
1085
|
uploadUrl: string;
|
|
@@ -1207,15 +1211,15 @@ declare class AuthResource extends BaseResource {
|
|
|
1207
1211
|
*/
|
|
1208
1212
|
mobileValidate(): Promise<ApiResponse<TokenValidateResponse>>;
|
|
1209
1213
|
/**
|
|
1210
|
-
* Mevcut session bilgisini getirir
|
|
1214
|
+
* Mevcut session bilgisini getirir (Backend: GET /api/auth/session)
|
|
1211
1215
|
*/
|
|
1212
1216
|
getSession(): Promise<ApiResponse<SessionResponse>>;
|
|
1213
1217
|
/**
|
|
1214
|
-
* Çıkış yap (Backend: POST /api/auth/logout)
|
|
1218
|
+
* Çıkış yap – backend'deki logout endpoint'ini kullanır (Backend: POST /api/auth/logout)
|
|
1215
1219
|
*/
|
|
1216
1220
|
signOut(): Promise<ApiResponse<any>>;
|
|
1217
1221
|
/**
|
|
1218
|
-
* Logout
|
|
1222
|
+
* Logout – session'ı backend'de geçersiz kılar (Backend: POST /api/auth/logout)
|
|
1219
1223
|
*/
|
|
1220
1224
|
logout(): Promise<ApiResponse<any>>;
|
|
1221
1225
|
}
|
|
@@ -1336,6 +1340,15 @@ declare class IntegrationsResource extends BaseResource {
|
|
|
1336
1340
|
* @param redirectUri - OAuth tamamlandıktan sonra dönülecek URL (opsiyonel)
|
|
1337
1341
|
*/
|
|
1338
1342
|
getAuthorizeUrl(provider: IntegrationProviderId | string, redirectUri?: string): string;
|
|
1343
|
+
/**
|
|
1344
|
+
* Backend'den OAuth URL'ini alır (JWT ile). Dashboard gibi JWT kullanan client'lar
|
|
1345
|
+
* tam sayfa redirect'te token gönderemediği için bu endpoint ile URL alıp sonra
|
|
1346
|
+
* yönlendirmeli; böylece state içinde doğru storeId/userId olur ve bağlantı sonrası
|
|
1347
|
+
* getStatus doğru döner.
|
|
1348
|
+
*/
|
|
1349
|
+
fetchAuthorizeUrl(provider: IntegrationProviderId | string, redirectUri?: string): Promise<ApiResponse<{
|
|
1350
|
+
url: string;
|
|
1351
|
+
}>>;
|
|
1339
1352
|
private resolveRedirectUri;
|
|
1340
1353
|
/**
|
|
1341
1354
|
* Bağlantı durumunu sorgular
|
|
@@ -1485,12 +1498,56 @@ declare class ReviewResource$1 extends CrudResource<any> {
|
|
|
1485
1498
|
getReviews(params?: any): Promise<ApiResponse<any>>;
|
|
1486
1499
|
}
|
|
1487
1500
|
|
|
1501
|
+
/** Payload for creating a custom data (meta object) in a scope */
|
|
1502
|
+
interface AdminCustomDataCreatePayload {
|
|
1503
|
+
slug: string;
|
|
1504
|
+
title: string;
|
|
1505
|
+
description?: string;
|
|
1506
|
+
inputType?: string;
|
|
1507
|
+
/** Metadata (metafield) id when inputType is "metafield" */
|
|
1508
|
+
metaDataId?: string | null;
|
|
1509
|
+
linking?: Array<{
|
|
1510
|
+
value: string;
|
|
1511
|
+
}>;
|
|
1512
|
+
isFilterEnabled?: boolean;
|
|
1513
|
+
isSmartCollectionEnabled?: boolean;
|
|
1514
|
+
isStorefrontApiEnabled?: boolean;
|
|
1515
|
+
}
|
|
1516
|
+
/** Payload for updating a custom data (meta object) */
|
|
1517
|
+
interface AdminCustomDataUpdatePayload {
|
|
1518
|
+
title?: string;
|
|
1519
|
+
description?: string;
|
|
1520
|
+
inputType?: string;
|
|
1521
|
+
/** Metadata (metafield) id when inputType is "metafield"; null to clear */
|
|
1522
|
+
metaDataId?: string | null;
|
|
1523
|
+
linking?: Array<{
|
|
1524
|
+
value: string;
|
|
1525
|
+
}>;
|
|
1526
|
+
isFilterEnabled?: boolean;
|
|
1527
|
+
isSmartCollectionEnabled?: boolean;
|
|
1528
|
+
isStorefrontApiEnabled?: boolean;
|
|
1529
|
+
}
|
|
1530
|
+
/** Custom data item returned by getAll / getById */
|
|
1531
|
+
interface AdminCustomDataItem {
|
|
1532
|
+
id: string;
|
|
1533
|
+
title?: string;
|
|
1534
|
+
description?: string;
|
|
1535
|
+
slug?: string;
|
|
1536
|
+
inputType?: string;
|
|
1537
|
+
/** Metadata (metafield) id when inputType is "metafield" */
|
|
1538
|
+
metaDataId?: string | null;
|
|
1539
|
+
linking?: Array<{
|
|
1540
|
+
id?: string;
|
|
1541
|
+
name?: string;
|
|
1542
|
+
value?: string;
|
|
1543
|
+
}>;
|
|
1544
|
+
}
|
|
1488
1545
|
declare class CustomDataResource extends BaseResource {
|
|
1489
1546
|
constructor(httpClient: AxiosInstance);
|
|
1490
|
-
getAll(scope: string): Promise<ApiResponse<
|
|
1491
|
-
create(scope: string, data:
|
|
1492
|
-
getById(scope: string, id: string): Promise<ApiResponse<
|
|
1493
|
-
update(scope: string, id: string, data:
|
|
1547
|
+
getAll(scope: string): Promise<ApiResponse<AdminCustomDataItem[]>>;
|
|
1548
|
+
create(scope: string, data: AdminCustomDataCreatePayload): Promise<ApiResponse<AdminCustomDataItem>>;
|
|
1549
|
+
getById(scope: string, id: string): Promise<ApiResponse<AdminCustomDataItem>>;
|
|
1550
|
+
update(scope: string, id: string, data: AdminCustomDataUpdatePayload): Promise<ApiResponse<AdminCustomDataItem>>;
|
|
1494
1551
|
delete(scope: string, id: string): Promise<ApiResponse<any>>;
|
|
1495
1552
|
getForm(scope: string, type: string): Promise<ApiResponse<any>>;
|
|
1496
1553
|
getFormVariants(scope: string, categoryId: string): Promise<ApiResponse<any>>;
|
|
@@ -1586,7 +1643,172 @@ declare class NotificationResource extends BaseResource {
|
|
|
1586
1643
|
}>>;
|
|
1587
1644
|
}
|
|
1588
1645
|
|
|
1646
|
+
/** Backend invite list response: { invites, count, limit, offset } */
|
|
1647
|
+
interface AdminInviteListResponse {
|
|
1648
|
+
invites: AdminInvite[];
|
|
1649
|
+
count: number;
|
|
1650
|
+
limit: number;
|
|
1651
|
+
offset: number;
|
|
1652
|
+
}
|
|
1653
|
+
/** Backend invite single response: { invite } */
|
|
1654
|
+
interface AdminInviteResponse {
|
|
1655
|
+
invite: AdminInvite;
|
|
1656
|
+
}
|
|
1657
|
+
/** Backend invite delete response */
|
|
1658
|
+
interface AdminInviteDeleteResponse {
|
|
1659
|
+
id: string;
|
|
1660
|
+
object: 'invite';
|
|
1661
|
+
deleted: boolean;
|
|
1662
|
+
}
|
|
1663
|
+
/** Backend accept response: { user } */
|
|
1664
|
+
interface AdminAcceptInviteResponse {
|
|
1665
|
+
user: {
|
|
1666
|
+
id: string;
|
|
1667
|
+
email: string;
|
|
1668
|
+
first_name?: string;
|
|
1669
|
+
last_name?: string;
|
|
1670
|
+
metadata?: Record<string, unknown>;
|
|
1671
|
+
};
|
|
1672
|
+
}
|
|
1673
|
+
interface AdminInvite {
|
|
1674
|
+
id: string;
|
|
1675
|
+
email: string;
|
|
1676
|
+
token: string;
|
|
1677
|
+
status: 'pending' | 'accepted' | 'expired';
|
|
1678
|
+
accepted?: boolean;
|
|
1679
|
+
created_at: string;
|
|
1680
|
+
updated_at: string;
|
|
1681
|
+
expires_at: string;
|
|
1682
|
+
accepted_at?: string | null;
|
|
1683
|
+
metadata?: Record<string, unknown>;
|
|
1684
|
+
}
|
|
1685
|
+
interface AdminCreateInvitePayload {
|
|
1686
|
+
email: string;
|
|
1687
|
+
}
|
|
1688
|
+
interface AdminAcceptInvitePayload {
|
|
1689
|
+
invite_token: string;
|
|
1690
|
+
user?: {
|
|
1691
|
+
email?: string;
|
|
1692
|
+
first_name?: string;
|
|
1693
|
+
last_name?: string;
|
|
1694
|
+
password: string;
|
|
1695
|
+
};
|
|
1696
|
+
}
|
|
1697
|
+
/**
|
|
1698
|
+
* Store erişim davetleri API - backend /admin/invites uç noktaları.
|
|
1699
|
+
*/
|
|
1700
|
+
declare class InviteResource extends BaseResource {
|
|
1701
|
+
constructor(httpClient: AxiosInstance, path?: string);
|
|
1702
|
+
private get path();
|
|
1703
|
+
/**
|
|
1704
|
+
* Davet listesi: GET /admin/invites?limit=&offset=&q=
|
|
1705
|
+
*/
|
|
1706
|
+
list(query?: {
|
|
1707
|
+
limit?: number;
|
|
1708
|
+
offset?: number;
|
|
1709
|
+
q?: string;
|
|
1710
|
+
}, options?: RequestOptions): Promise<AdminInviteListResponse>;
|
|
1711
|
+
/**
|
|
1712
|
+
* Tek davet: GET /admin/invites/:id
|
|
1713
|
+
*/
|
|
1714
|
+
retrieve(id: string, options?: RequestOptions): Promise<AdminInviteResponse>;
|
|
1715
|
+
/**
|
|
1716
|
+
* Yeni davet: POST /admin/invites body: { email }
|
|
1717
|
+
*/
|
|
1718
|
+
create(payload: AdminCreateInvitePayload, options?: RequestOptions): Promise<AdminInviteResponse>;
|
|
1719
|
+
/**
|
|
1720
|
+
* Daveti yeniden gönder: POST /admin/invites/:id/resend
|
|
1721
|
+
*/
|
|
1722
|
+
resend(id: string, options?: RequestOptions): Promise<AdminInviteResponse>;
|
|
1723
|
+
/**
|
|
1724
|
+
* Daveti sil: DELETE /admin/invites/:id
|
|
1725
|
+
*/
|
|
1726
|
+
delete(id: string, options?: RequestOptions): Promise<AdminInviteDeleteResponse>;
|
|
1727
|
+
/**
|
|
1728
|
+
* Daveti kabul et: POST /admin/invites/accept body: { invite_token, user }
|
|
1729
|
+
*/
|
|
1730
|
+
accept(payload: AdminAcceptInvitePayload, _query?: Record<string, unknown>, extraHeaders?: Record<string, string>, options?: RequestOptions): Promise<AdminAcceptInviteResponse>;
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
/** Medusa uyumlu region (Language tablosu ile aynı kaynak) */
|
|
1734
|
+
interface AdminRegion {
|
|
1735
|
+
id: string;
|
|
1736
|
+
name: string;
|
|
1737
|
+
code: string;
|
|
1738
|
+
created_at: string;
|
|
1739
|
+
updated_at: string;
|
|
1740
|
+
deleted_at: null;
|
|
1741
|
+
metadata: Record<string, unknown>;
|
|
1742
|
+
automatic_taxes: boolean;
|
|
1743
|
+
countries: string[];
|
|
1744
|
+
currency_code: string;
|
|
1745
|
+
tax_provider_id: string | null;
|
|
1746
|
+
tax_rate: number | string | null;
|
|
1747
|
+
}
|
|
1748
|
+
/** List response: { regions, count, limit, offset } */
|
|
1749
|
+
interface AdminRegionListResponse {
|
|
1750
|
+
regions: AdminRegion[];
|
|
1751
|
+
count: number;
|
|
1752
|
+
limit: number;
|
|
1753
|
+
offset: number;
|
|
1754
|
+
}
|
|
1755
|
+
/** Single response: { region } */
|
|
1756
|
+
interface AdminRegionResponse {
|
|
1757
|
+
region: AdminRegion;
|
|
1758
|
+
}
|
|
1759
|
+
/** Delete response */
|
|
1760
|
+
interface AdminRegionDeleteResponse {
|
|
1761
|
+
id: string;
|
|
1762
|
+
object: 'region';
|
|
1763
|
+
deleted: boolean;
|
|
1764
|
+
}
|
|
1765
|
+
interface AdminCreateRegionPayload {
|
|
1766
|
+
name: string;
|
|
1767
|
+
code: string;
|
|
1768
|
+
currency_code?: string;
|
|
1769
|
+
countries?: string[];
|
|
1770
|
+
automatic_taxes?: boolean;
|
|
1771
|
+
tax_rate?: number | null;
|
|
1772
|
+
tax_provider_id?: string | null;
|
|
1773
|
+
}
|
|
1774
|
+
interface AdminUpdateRegionPayload extends Partial<AdminCreateRegionPayload> {
|
|
1775
|
+
is_active?: boolean;
|
|
1776
|
+
is_default?: boolean;
|
|
1777
|
+
}
|
|
1778
|
+
/**
|
|
1779
|
+
* Regions API - backend /admin/regions (Language tablosu = regions + languages tek şema).
|
|
1780
|
+
*/
|
|
1781
|
+
declare class RegionResource extends BaseResource {
|
|
1782
|
+
constructor(httpClient: AxiosInstance, path?: string);
|
|
1783
|
+
private get path();
|
|
1784
|
+
list(query?: {
|
|
1785
|
+
limit?: number;
|
|
1786
|
+
offset?: number;
|
|
1787
|
+
q?: string;
|
|
1788
|
+
}, options?: RequestOptions): Promise<AdminRegionListResponse>;
|
|
1789
|
+
retrieve(id: string, _query?: Record<string, unknown>, options?: RequestOptions): Promise<AdminRegionResponse>;
|
|
1790
|
+
create(payload: AdminCreateRegionPayload, options?: RequestOptions): Promise<AdminRegionResponse>;
|
|
1791
|
+
update(id: string, payload: AdminUpdateRegionPayload, options?: RequestOptions): Promise<AdminRegionResponse>;
|
|
1792
|
+
delete(id: string, options?: RequestOptions): Promise<AdminRegionDeleteResponse>;
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
type index$5_AdminAcceptInvitePayload = AdminAcceptInvitePayload;
|
|
1796
|
+
type index$5_AdminAcceptInviteResponse = AdminAcceptInviteResponse;
|
|
1797
|
+
type index$5_AdminCreateInvitePayload = AdminCreateInvitePayload;
|
|
1798
|
+
type index$5_AdminCreateRegionPayload = AdminCreateRegionPayload;
|
|
1799
|
+
type index$5_AdminCustomDataCreatePayload = AdminCustomDataCreatePayload;
|
|
1800
|
+
type index$5_AdminCustomDataItem = AdminCustomDataItem;
|
|
1801
|
+
type index$5_AdminCustomDataUpdatePayload = AdminCustomDataUpdatePayload;
|
|
1802
|
+
type index$5_AdminInvite = AdminInvite;
|
|
1803
|
+
type index$5_AdminInviteDeleteResponse = AdminInviteDeleteResponse;
|
|
1804
|
+
type index$5_AdminInviteListResponse = AdminInviteListResponse;
|
|
1805
|
+
type index$5_AdminInviteResponse = AdminInviteResponse;
|
|
1589
1806
|
type index$5_AdminMediaCreateInput = AdminMediaCreateInput;
|
|
1807
|
+
type index$5_AdminRegion = AdminRegion;
|
|
1808
|
+
type index$5_AdminRegionDeleteResponse = AdminRegionDeleteResponse;
|
|
1809
|
+
type index$5_AdminRegionListResponse = AdminRegionListResponse;
|
|
1810
|
+
type index$5_AdminRegionResponse = AdminRegionResponse;
|
|
1811
|
+
type index$5_AdminUpdateRegionPayload = AdminUpdateRegionPayload;
|
|
1590
1812
|
type index$5_ApiKeyResource = ApiKeyResource;
|
|
1591
1813
|
declare const index$5_ApiKeyResource: typeof ApiKeyResource;
|
|
1592
1814
|
type index$5_AuthResource = AuthResource;
|
|
@@ -1614,6 +1836,8 @@ type index$5_IntegrationSettingType = IntegrationSettingType;
|
|
|
1614
1836
|
type index$5_IntegrationSettingsData = IntegrationSettingsData;
|
|
1615
1837
|
type index$5_IntegrationsResource = IntegrationsResource;
|
|
1616
1838
|
declare const index$5_IntegrationsResource: typeof IntegrationsResource;
|
|
1839
|
+
type index$5_InviteResource = InviteResource;
|
|
1840
|
+
declare const index$5_InviteResource: typeof InviteResource;
|
|
1617
1841
|
type index$5_KnownDatasetType = KnownDatasetType;
|
|
1618
1842
|
type index$5_LayoutResource = LayoutResource;
|
|
1619
1843
|
declare const index$5_LayoutResource: typeof LayoutResource;
|
|
@@ -1629,6 +1853,8 @@ type index$5_PurchaseResource = PurchaseResource;
|
|
|
1629
1853
|
declare const index$5_PurchaseResource: typeof PurchaseResource;
|
|
1630
1854
|
type index$5_Region = Region;
|
|
1631
1855
|
type index$5_RegionCountry = RegionCountry;
|
|
1856
|
+
type index$5_RegionResource = RegionResource;
|
|
1857
|
+
declare const index$5_RegionResource: typeof RegionResource;
|
|
1632
1858
|
type index$5_SEOResource = SEOResource;
|
|
1633
1859
|
declare const index$5_SEOResource: typeof SEOResource;
|
|
1634
1860
|
type index$5_SectionResource = SectionResource;
|
|
@@ -1660,7 +1886,7 @@ declare const index$5_sectorColumns: typeof sectorColumns;
|
|
|
1660
1886
|
declare const index$5_storeColumns: typeof storeColumns;
|
|
1661
1887
|
declare const index$5_vendorColumns: typeof vendorColumns;
|
|
1662
1888
|
declare namespace index$5 {
|
|
1663
|
-
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 };
|
|
1889
|
+
export { type index$5_AdminAcceptInvitePayload as AdminAcceptInvitePayload, type index$5_AdminAcceptInviteResponse as AdminAcceptInviteResponse, type index$5_AdminCreateInvitePayload as AdminCreateInvitePayload, type index$5_AdminCreateRegionPayload as AdminCreateRegionPayload, type index$5_AdminCustomDataCreatePayload as AdminCustomDataCreatePayload, type index$5_AdminCustomDataItem as AdminCustomDataItem, type index$5_AdminCustomDataUpdatePayload as AdminCustomDataUpdatePayload, type index$5_AdminInvite as AdminInvite, type index$5_AdminInviteDeleteResponse as AdminInviteDeleteResponse, type index$5_AdminInviteListResponse as AdminInviteListResponse, type index$5_AdminInviteResponse as AdminInviteResponse, type index$5_AdminMediaCreateInput as AdminMediaCreateInput, type index$5_AdminRegion as AdminRegion, type index$5_AdminRegionDeleteResponse as AdminRegionDeleteResponse, type index$5_AdminRegionListResponse as AdminRegionListResponse, type index$5_AdminRegionResponse as AdminRegionResponse, type index$5_AdminUpdateRegionPayload as AdminUpdateRegionPayload, 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, index$5_InviteResource as InviteResource, 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, index$5_RegionResource as RegionResource, 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 };
|
|
1664
1890
|
}
|
|
1665
1891
|
|
|
1666
1892
|
declare class StoreResource extends CrudResource<Store, StoreWhereInput, StoreOrderByInput, StoreCreateInput, StoreUpdateInput> {
|
|
@@ -2105,6 +2331,8 @@ declare class AdminNamespace {
|
|
|
2105
2331
|
readonly subscriptions: SubscriptionResource;
|
|
2106
2332
|
readonly purchases: PurchaseResource;
|
|
2107
2333
|
readonly notifications: NotificationResource;
|
|
2334
|
+
readonly invite: InviteResource;
|
|
2335
|
+
readonly region: RegionResource;
|
|
2108
2336
|
constructor(client: ApiClient);
|
|
2109
2337
|
}
|
|
2110
2338
|
/**
|
|
@@ -2189,4 +2417,4 @@ declare function createSDKFromEnv(config?: Partial<SDKConfig> & {
|
|
|
2189
2417
|
baseUrl?: string;
|
|
2190
2418
|
}): SalefonyApiSdk;
|
|
2191
2419
|
|
|
2192
|
-
export { index$5 as AdminResources, index$3 as AdminTypes, type AnyColumn, ApiClient, type ApiKeyColumn, type ApiResponse, BaseResource, type CollectionColumn, index$1 as CommonTypes, type ContentColumn, CrudResource, type DatasourceColumn, index$4 as FrontstoreResources, index$2 as FrontstoreTypes, type GenericColumn, type GetParams, type LanguageColumn, type LayoutColumn, type ListMeta, type ListParams, type MediaColumn, type MetadataColumn, type NavigationColumn, type ProjectColumn, QueryBuilder, type RequestOptions, type ReviewColumn, type SDKConfig, SalefonyApiSdk, SalefonyAuthError, SalefonyError, SalefonyNotFoundError, SalefonyValidationError, index as SchemaTypes, type SectionColumn, type SectorColumn, type SiteSettingsColumn, type StoreColumn, type VendorColumn, apiKeyColumns, collectionColumns$1 as collectionColumns, columns, contentColumns$1 as contentColumns, createSDK, createSDKFromEnv, datasourceColumns, languageColumns, layoutColumns, metadataColumns, navigationColumns, projectColumns, sectionColumns, sectorColumns, storeColumns, unwrap, unwrapList, unwrapMeta, vendorColumns };
|
|
2420
|
+
export { type AdminAcceptInvitePayload, type AdminAcceptInviteResponse, type AdminCreateInvitePayload, type AdminCreateRegionPayload, type AdminCustomDataCreatePayload, type AdminCustomDataItem, type AdminCustomDataUpdatePayload, type AdminInvite, type AdminInviteDeleteResponse, type AdminInviteListResponse, type AdminInviteResponse, type AdminMediaCreateInput, type AdminRegion, type AdminRegionDeleteResponse, type AdminRegionListResponse, type AdminRegionResponse, index$5 as AdminResources, index$3 as AdminTypes, type AdminUpdateRegionPayload, type AnyColumn, ApiClient, type ApiKeyColumn, ApiKeyResource, type ApiResponse, AuthResource, BaseResource, CloudflareResource, type CollectionColumn, CollectionResource$1 as CollectionResource, index$1 as CommonTypes, type ContentColumn, ContentResource$1 as ContentResource, type CreateDatasourceInput, CrudResource, CustomDataResource, DatasetsResource, type DatasourceColumn, DatasourceResource, type FacebookBusinessSettings, index$4 as FrontstoreResources, index$2 as FrontstoreTypes, type GenericColumn, type GetParams, type GoogleAnalyticsSettings, type GoogleAnalyticsSettingsField, GoogleResource, type IntegrationCatalogItem, type IntegrationConnectionStatus, type IntegrationProviderId, type IntegrationSettingOption, type IntegrationSettingSchema, type IntegrationSettingType, type IntegrationSettingsData, IntegrationsResource, InviteResource, type KnownDatasetType, type LanguageColumn, LanguageResource$1 as LanguageResource, type LayoutColumn, LayoutResource, type ListMeta, type ListNotificationsParams, type ListParams, type MediaColumn, MediaResource$1 as MediaResource, type MetadataColumn, MetadataResource, type NavigationColumn, NavigationResource$1 as NavigationResource, NotificationResource, type NotificationType, type ProjectColumn, ProjectResource, PurchaseResource, QueryBuilder, type Region, type RegionCountry, RegionResource, type RequestOptions, type ReviewColumn, ReviewResource$1 as ReviewResource, type SDKConfig, SEOResource, SalefonyApiSdk, SalefonyAuthError, SalefonyError, SalefonyNotFoundError, SalefonyValidationError, index as SchemaTypes, type SectionColumn, SectionResource, type SectorColumn, SectorResource, SettingsResource, type SiteSettingsColumn, type StoreColumn, type StoreNotification, StoreResource$1 as StoreResource, SubscriptionResource, type ThemeItem, ThemeResource, type UpdateDatasourceInput, type VendorColumn, VendorResource, WebmailResource, apiKeyColumns, collectionColumns$1 as collectionColumns, columns, contentColumns$1 as contentColumns, createSDK, createSDKFromEnv, datasourceColumns, languageColumns, layoutColumns, metadataColumns, navigationColumns, projectColumns, sectionColumns, sectorColumns, storeColumns, unwrap, unwrapList, unwrapMeta, vendorColumns };
|
package/dist/index.d.ts
CHANGED
|
@@ -1075,7 +1075,11 @@ interface AdminMediaCreateInput {
|
|
|
1075
1075
|
declare class MediaResource$1 extends BaseResource {
|
|
1076
1076
|
private path;
|
|
1077
1077
|
constructor(httpClient: AxiosInstance, path?: string);
|
|
1078
|
-
getAll(
|
|
1078
|
+
getAll(params?: {
|
|
1079
|
+
type?: string;
|
|
1080
|
+
}): Promise<ApiResponse<Media[]>>;
|
|
1081
|
+
/** List only documents (media with type === 'document'). */
|
|
1082
|
+
getDocuments(): Promise<ApiResponse<Media[]>>;
|
|
1079
1083
|
create(data: AdminMediaCreateInput): Promise<ApiResponse<{
|
|
1080
1084
|
media: Media;
|
|
1081
1085
|
uploadUrl: string;
|
|
@@ -1207,15 +1211,15 @@ declare class AuthResource extends BaseResource {
|
|
|
1207
1211
|
*/
|
|
1208
1212
|
mobileValidate(): Promise<ApiResponse<TokenValidateResponse>>;
|
|
1209
1213
|
/**
|
|
1210
|
-
* Mevcut session bilgisini getirir
|
|
1214
|
+
* Mevcut session bilgisini getirir (Backend: GET /api/auth/session)
|
|
1211
1215
|
*/
|
|
1212
1216
|
getSession(): Promise<ApiResponse<SessionResponse>>;
|
|
1213
1217
|
/**
|
|
1214
|
-
* Çıkış yap (Backend: POST /api/auth/logout)
|
|
1218
|
+
* Çıkış yap – backend'deki logout endpoint'ini kullanır (Backend: POST /api/auth/logout)
|
|
1215
1219
|
*/
|
|
1216
1220
|
signOut(): Promise<ApiResponse<any>>;
|
|
1217
1221
|
/**
|
|
1218
|
-
* Logout
|
|
1222
|
+
* Logout – session'ı backend'de geçersiz kılar (Backend: POST /api/auth/logout)
|
|
1219
1223
|
*/
|
|
1220
1224
|
logout(): Promise<ApiResponse<any>>;
|
|
1221
1225
|
}
|
|
@@ -1336,6 +1340,15 @@ declare class IntegrationsResource extends BaseResource {
|
|
|
1336
1340
|
* @param redirectUri - OAuth tamamlandıktan sonra dönülecek URL (opsiyonel)
|
|
1337
1341
|
*/
|
|
1338
1342
|
getAuthorizeUrl(provider: IntegrationProviderId | string, redirectUri?: string): string;
|
|
1343
|
+
/**
|
|
1344
|
+
* Backend'den OAuth URL'ini alır (JWT ile). Dashboard gibi JWT kullanan client'lar
|
|
1345
|
+
* tam sayfa redirect'te token gönderemediği için bu endpoint ile URL alıp sonra
|
|
1346
|
+
* yönlendirmeli; böylece state içinde doğru storeId/userId olur ve bağlantı sonrası
|
|
1347
|
+
* getStatus doğru döner.
|
|
1348
|
+
*/
|
|
1349
|
+
fetchAuthorizeUrl(provider: IntegrationProviderId | string, redirectUri?: string): Promise<ApiResponse<{
|
|
1350
|
+
url: string;
|
|
1351
|
+
}>>;
|
|
1339
1352
|
private resolveRedirectUri;
|
|
1340
1353
|
/**
|
|
1341
1354
|
* Bağlantı durumunu sorgular
|
|
@@ -1485,12 +1498,56 @@ declare class ReviewResource$1 extends CrudResource<any> {
|
|
|
1485
1498
|
getReviews(params?: any): Promise<ApiResponse<any>>;
|
|
1486
1499
|
}
|
|
1487
1500
|
|
|
1501
|
+
/** Payload for creating a custom data (meta object) in a scope */
|
|
1502
|
+
interface AdminCustomDataCreatePayload {
|
|
1503
|
+
slug: string;
|
|
1504
|
+
title: string;
|
|
1505
|
+
description?: string;
|
|
1506
|
+
inputType?: string;
|
|
1507
|
+
/** Metadata (metafield) id when inputType is "metafield" */
|
|
1508
|
+
metaDataId?: string | null;
|
|
1509
|
+
linking?: Array<{
|
|
1510
|
+
value: string;
|
|
1511
|
+
}>;
|
|
1512
|
+
isFilterEnabled?: boolean;
|
|
1513
|
+
isSmartCollectionEnabled?: boolean;
|
|
1514
|
+
isStorefrontApiEnabled?: boolean;
|
|
1515
|
+
}
|
|
1516
|
+
/** Payload for updating a custom data (meta object) */
|
|
1517
|
+
interface AdminCustomDataUpdatePayload {
|
|
1518
|
+
title?: string;
|
|
1519
|
+
description?: string;
|
|
1520
|
+
inputType?: string;
|
|
1521
|
+
/** Metadata (metafield) id when inputType is "metafield"; null to clear */
|
|
1522
|
+
metaDataId?: string | null;
|
|
1523
|
+
linking?: Array<{
|
|
1524
|
+
value: string;
|
|
1525
|
+
}>;
|
|
1526
|
+
isFilterEnabled?: boolean;
|
|
1527
|
+
isSmartCollectionEnabled?: boolean;
|
|
1528
|
+
isStorefrontApiEnabled?: boolean;
|
|
1529
|
+
}
|
|
1530
|
+
/** Custom data item returned by getAll / getById */
|
|
1531
|
+
interface AdminCustomDataItem {
|
|
1532
|
+
id: string;
|
|
1533
|
+
title?: string;
|
|
1534
|
+
description?: string;
|
|
1535
|
+
slug?: string;
|
|
1536
|
+
inputType?: string;
|
|
1537
|
+
/** Metadata (metafield) id when inputType is "metafield" */
|
|
1538
|
+
metaDataId?: string | null;
|
|
1539
|
+
linking?: Array<{
|
|
1540
|
+
id?: string;
|
|
1541
|
+
name?: string;
|
|
1542
|
+
value?: string;
|
|
1543
|
+
}>;
|
|
1544
|
+
}
|
|
1488
1545
|
declare class CustomDataResource extends BaseResource {
|
|
1489
1546
|
constructor(httpClient: AxiosInstance);
|
|
1490
|
-
getAll(scope: string): Promise<ApiResponse<
|
|
1491
|
-
create(scope: string, data:
|
|
1492
|
-
getById(scope: string, id: string): Promise<ApiResponse<
|
|
1493
|
-
update(scope: string, id: string, data:
|
|
1547
|
+
getAll(scope: string): Promise<ApiResponse<AdminCustomDataItem[]>>;
|
|
1548
|
+
create(scope: string, data: AdminCustomDataCreatePayload): Promise<ApiResponse<AdminCustomDataItem>>;
|
|
1549
|
+
getById(scope: string, id: string): Promise<ApiResponse<AdminCustomDataItem>>;
|
|
1550
|
+
update(scope: string, id: string, data: AdminCustomDataUpdatePayload): Promise<ApiResponse<AdminCustomDataItem>>;
|
|
1494
1551
|
delete(scope: string, id: string): Promise<ApiResponse<any>>;
|
|
1495
1552
|
getForm(scope: string, type: string): Promise<ApiResponse<any>>;
|
|
1496
1553
|
getFormVariants(scope: string, categoryId: string): Promise<ApiResponse<any>>;
|
|
@@ -1586,7 +1643,172 @@ declare class NotificationResource extends BaseResource {
|
|
|
1586
1643
|
}>>;
|
|
1587
1644
|
}
|
|
1588
1645
|
|
|
1646
|
+
/** Backend invite list response: { invites, count, limit, offset } */
|
|
1647
|
+
interface AdminInviteListResponse {
|
|
1648
|
+
invites: AdminInvite[];
|
|
1649
|
+
count: number;
|
|
1650
|
+
limit: number;
|
|
1651
|
+
offset: number;
|
|
1652
|
+
}
|
|
1653
|
+
/** Backend invite single response: { invite } */
|
|
1654
|
+
interface AdminInviteResponse {
|
|
1655
|
+
invite: AdminInvite;
|
|
1656
|
+
}
|
|
1657
|
+
/** Backend invite delete response */
|
|
1658
|
+
interface AdminInviteDeleteResponse {
|
|
1659
|
+
id: string;
|
|
1660
|
+
object: 'invite';
|
|
1661
|
+
deleted: boolean;
|
|
1662
|
+
}
|
|
1663
|
+
/** Backend accept response: { user } */
|
|
1664
|
+
interface AdminAcceptInviteResponse {
|
|
1665
|
+
user: {
|
|
1666
|
+
id: string;
|
|
1667
|
+
email: string;
|
|
1668
|
+
first_name?: string;
|
|
1669
|
+
last_name?: string;
|
|
1670
|
+
metadata?: Record<string, unknown>;
|
|
1671
|
+
};
|
|
1672
|
+
}
|
|
1673
|
+
interface AdminInvite {
|
|
1674
|
+
id: string;
|
|
1675
|
+
email: string;
|
|
1676
|
+
token: string;
|
|
1677
|
+
status: 'pending' | 'accepted' | 'expired';
|
|
1678
|
+
accepted?: boolean;
|
|
1679
|
+
created_at: string;
|
|
1680
|
+
updated_at: string;
|
|
1681
|
+
expires_at: string;
|
|
1682
|
+
accepted_at?: string | null;
|
|
1683
|
+
metadata?: Record<string, unknown>;
|
|
1684
|
+
}
|
|
1685
|
+
interface AdminCreateInvitePayload {
|
|
1686
|
+
email: string;
|
|
1687
|
+
}
|
|
1688
|
+
interface AdminAcceptInvitePayload {
|
|
1689
|
+
invite_token: string;
|
|
1690
|
+
user?: {
|
|
1691
|
+
email?: string;
|
|
1692
|
+
first_name?: string;
|
|
1693
|
+
last_name?: string;
|
|
1694
|
+
password: string;
|
|
1695
|
+
};
|
|
1696
|
+
}
|
|
1697
|
+
/**
|
|
1698
|
+
* Store erişim davetleri API - backend /admin/invites uç noktaları.
|
|
1699
|
+
*/
|
|
1700
|
+
declare class InviteResource extends BaseResource {
|
|
1701
|
+
constructor(httpClient: AxiosInstance, path?: string);
|
|
1702
|
+
private get path();
|
|
1703
|
+
/**
|
|
1704
|
+
* Davet listesi: GET /admin/invites?limit=&offset=&q=
|
|
1705
|
+
*/
|
|
1706
|
+
list(query?: {
|
|
1707
|
+
limit?: number;
|
|
1708
|
+
offset?: number;
|
|
1709
|
+
q?: string;
|
|
1710
|
+
}, options?: RequestOptions): Promise<AdminInviteListResponse>;
|
|
1711
|
+
/**
|
|
1712
|
+
* Tek davet: GET /admin/invites/:id
|
|
1713
|
+
*/
|
|
1714
|
+
retrieve(id: string, options?: RequestOptions): Promise<AdminInviteResponse>;
|
|
1715
|
+
/**
|
|
1716
|
+
* Yeni davet: POST /admin/invites body: { email }
|
|
1717
|
+
*/
|
|
1718
|
+
create(payload: AdminCreateInvitePayload, options?: RequestOptions): Promise<AdminInviteResponse>;
|
|
1719
|
+
/**
|
|
1720
|
+
* Daveti yeniden gönder: POST /admin/invites/:id/resend
|
|
1721
|
+
*/
|
|
1722
|
+
resend(id: string, options?: RequestOptions): Promise<AdminInviteResponse>;
|
|
1723
|
+
/**
|
|
1724
|
+
* Daveti sil: DELETE /admin/invites/:id
|
|
1725
|
+
*/
|
|
1726
|
+
delete(id: string, options?: RequestOptions): Promise<AdminInviteDeleteResponse>;
|
|
1727
|
+
/**
|
|
1728
|
+
* Daveti kabul et: POST /admin/invites/accept body: { invite_token, user }
|
|
1729
|
+
*/
|
|
1730
|
+
accept(payload: AdminAcceptInvitePayload, _query?: Record<string, unknown>, extraHeaders?: Record<string, string>, options?: RequestOptions): Promise<AdminAcceptInviteResponse>;
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
/** Medusa uyumlu region (Language tablosu ile aynı kaynak) */
|
|
1734
|
+
interface AdminRegion {
|
|
1735
|
+
id: string;
|
|
1736
|
+
name: string;
|
|
1737
|
+
code: string;
|
|
1738
|
+
created_at: string;
|
|
1739
|
+
updated_at: string;
|
|
1740
|
+
deleted_at: null;
|
|
1741
|
+
metadata: Record<string, unknown>;
|
|
1742
|
+
automatic_taxes: boolean;
|
|
1743
|
+
countries: string[];
|
|
1744
|
+
currency_code: string;
|
|
1745
|
+
tax_provider_id: string | null;
|
|
1746
|
+
tax_rate: number | string | null;
|
|
1747
|
+
}
|
|
1748
|
+
/** List response: { regions, count, limit, offset } */
|
|
1749
|
+
interface AdminRegionListResponse {
|
|
1750
|
+
regions: AdminRegion[];
|
|
1751
|
+
count: number;
|
|
1752
|
+
limit: number;
|
|
1753
|
+
offset: number;
|
|
1754
|
+
}
|
|
1755
|
+
/** Single response: { region } */
|
|
1756
|
+
interface AdminRegionResponse {
|
|
1757
|
+
region: AdminRegion;
|
|
1758
|
+
}
|
|
1759
|
+
/** Delete response */
|
|
1760
|
+
interface AdminRegionDeleteResponse {
|
|
1761
|
+
id: string;
|
|
1762
|
+
object: 'region';
|
|
1763
|
+
deleted: boolean;
|
|
1764
|
+
}
|
|
1765
|
+
interface AdminCreateRegionPayload {
|
|
1766
|
+
name: string;
|
|
1767
|
+
code: string;
|
|
1768
|
+
currency_code?: string;
|
|
1769
|
+
countries?: string[];
|
|
1770
|
+
automatic_taxes?: boolean;
|
|
1771
|
+
tax_rate?: number | null;
|
|
1772
|
+
tax_provider_id?: string | null;
|
|
1773
|
+
}
|
|
1774
|
+
interface AdminUpdateRegionPayload extends Partial<AdminCreateRegionPayload> {
|
|
1775
|
+
is_active?: boolean;
|
|
1776
|
+
is_default?: boolean;
|
|
1777
|
+
}
|
|
1778
|
+
/**
|
|
1779
|
+
* Regions API - backend /admin/regions (Language tablosu = regions + languages tek şema).
|
|
1780
|
+
*/
|
|
1781
|
+
declare class RegionResource extends BaseResource {
|
|
1782
|
+
constructor(httpClient: AxiosInstance, path?: string);
|
|
1783
|
+
private get path();
|
|
1784
|
+
list(query?: {
|
|
1785
|
+
limit?: number;
|
|
1786
|
+
offset?: number;
|
|
1787
|
+
q?: string;
|
|
1788
|
+
}, options?: RequestOptions): Promise<AdminRegionListResponse>;
|
|
1789
|
+
retrieve(id: string, _query?: Record<string, unknown>, options?: RequestOptions): Promise<AdminRegionResponse>;
|
|
1790
|
+
create(payload: AdminCreateRegionPayload, options?: RequestOptions): Promise<AdminRegionResponse>;
|
|
1791
|
+
update(id: string, payload: AdminUpdateRegionPayload, options?: RequestOptions): Promise<AdminRegionResponse>;
|
|
1792
|
+
delete(id: string, options?: RequestOptions): Promise<AdminRegionDeleteResponse>;
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
type index$5_AdminAcceptInvitePayload = AdminAcceptInvitePayload;
|
|
1796
|
+
type index$5_AdminAcceptInviteResponse = AdminAcceptInviteResponse;
|
|
1797
|
+
type index$5_AdminCreateInvitePayload = AdminCreateInvitePayload;
|
|
1798
|
+
type index$5_AdminCreateRegionPayload = AdminCreateRegionPayload;
|
|
1799
|
+
type index$5_AdminCustomDataCreatePayload = AdminCustomDataCreatePayload;
|
|
1800
|
+
type index$5_AdminCustomDataItem = AdminCustomDataItem;
|
|
1801
|
+
type index$5_AdminCustomDataUpdatePayload = AdminCustomDataUpdatePayload;
|
|
1802
|
+
type index$5_AdminInvite = AdminInvite;
|
|
1803
|
+
type index$5_AdminInviteDeleteResponse = AdminInviteDeleteResponse;
|
|
1804
|
+
type index$5_AdminInviteListResponse = AdminInviteListResponse;
|
|
1805
|
+
type index$5_AdminInviteResponse = AdminInviteResponse;
|
|
1589
1806
|
type index$5_AdminMediaCreateInput = AdminMediaCreateInput;
|
|
1807
|
+
type index$5_AdminRegion = AdminRegion;
|
|
1808
|
+
type index$5_AdminRegionDeleteResponse = AdminRegionDeleteResponse;
|
|
1809
|
+
type index$5_AdminRegionListResponse = AdminRegionListResponse;
|
|
1810
|
+
type index$5_AdminRegionResponse = AdminRegionResponse;
|
|
1811
|
+
type index$5_AdminUpdateRegionPayload = AdminUpdateRegionPayload;
|
|
1590
1812
|
type index$5_ApiKeyResource = ApiKeyResource;
|
|
1591
1813
|
declare const index$5_ApiKeyResource: typeof ApiKeyResource;
|
|
1592
1814
|
type index$5_AuthResource = AuthResource;
|
|
@@ -1614,6 +1836,8 @@ type index$5_IntegrationSettingType = IntegrationSettingType;
|
|
|
1614
1836
|
type index$5_IntegrationSettingsData = IntegrationSettingsData;
|
|
1615
1837
|
type index$5_IntegrationsResource = IntegrationsResource;
|
|
1616
1838
|
declare const index$5_IntegrationsResource: typeof IntegrationsResource;
|
|
1839
|
+
type index$5_InviteResource = InviteResource;
|
|
1840
|
+
declare const index$5_InviteResource: typeof InviteResource;
|
|
1617
1841
|
type index$5_KnownDatasetType = KnownDatasetType;
|
|
1618
1842
|
type index$5_LayoutResource = LayoutResource;
|
|
1619
1843
|
declare const index$5_LayoutResource: typeof LayoutResource;
|
|
@@ -1629,6 +1853,8 @@ type index$5_PurchaseResource = PurchaseResource;
|
|
|
1629
1853
|
declare const index$5_PurchaseResource: typeof PurchaseResource;
|
|
1630
1854
|
type index$5_Region = Region;
|
|
1631
1855
|
type index$5_RegionCountry = RegionCountry;
|
|
1856
|
+
type index$5_RegionResource = RegionResource;
|
|
1857
|
+
declare const index$5_RegionResource: typeof RegionResource;
|
|
1632
1858
|
type index$5_SEOResource = SEOResource;
|
|
1633
1859
|
declare const index$5_SEOResource: typeof SEOResource;
|
|
1634
1860
|
type index$5_SectionResource = SectionResource;
|
|
@@ -1660,7 +1886,7 @@ declare const index$5_sectorColumns: typeof sectorColumns;
|
|
|
1660
1886
|
declare const index$5_storeColumns: typeof storeColumns;
|
|
1661
1887
|
declare const index$5_vendorColumns: typeof vendorColumns;
|
|
1662
1888
|
declare namespace index$5 {
|
|
1663
|
-
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 };
|
|
1889
|
+
export { type index$5_AdminAcceptInvitePayload as AdminAcceptInvitePayload, type index$5_AdminAcceptInviteResponse as AdminAcceptInviteResponse, type index$5_AdminCreateInvitePayload as AdminCreateInvitePayload, type index$5_AdminCreateRegionPayload as AdminCreateRegionPayload, type index$5_AdminCustomDataCreatePayload as AdminCustomDataCreatePayload, type index$5_AdminCustomDataItem as AdminCustomDataItem, type index$5_AdminCustomDataUpdatePayload as AdminCustomDataUpdatePayload, type index$5_AdminInvite as AdminInvite, type index$5_AdminInviteDeleteResponse as AdminInviteDeleteResponse, type index$5_AdminInviteListResponse as AdminInviteListResponse, type index$5_AdminInviteResponse as AdminInviteResponse, type index$5_AdminMediaCreateInput as AdminMediaCreateInput, type index$5_AdminRegion as AdminRegion, type index$5_AdminRegionDeleteResponse as AdminRegionDeleteResponse, type index$5_AdminRegionListResponse as AdminRegionListResponse, type index$5_AdminRegionResponse as AdminRegionResponse, type index$5_AdminUpdateRegionPayload as AdminUpdateRegionPayload, 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, index$5_InviteResource as InviteResource, 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, index$5_RegionResource as RegionResource, 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 };
|
|
1664
1890
|
}
|
|
1665
1891
|
|
|
1666
1892
|
declare class StoreResource extends CrudResource<Store, StoreWhereInput, StoreOrderByInput, StoreCreateInput, StoreUpdateInput> {
|
|
@@ -2105,6 +2331,8 @@ declare class AdminNamespace {
|
|
|
2105
2331
|
readonly subscriptions: SubscriptionResource;
|
|
2106
2332
|
readonly purchases: PurchaseResource;
|
|
2107
2333
|
readonly notifications: NotificationResource;
|
|
2334
|
+
readonly invite: InviteResource;
|
|
2335
|
+
readonly region: RegionResource;
|
|
2108
2336
|
constructor(client: ApiClient);
|
|
2109
2337
|
}
|
|
2110
2338
|
/**
|
|
@@ -2189,4 +2417,4 @@ declare function createSDKFromEnv(config?: Partial<SDKConfig> & {
|
|
|
2189
2417
|
baseUrl?: string;
|
|
2190
2418
|
}): SalefonyApiSdk;
|
|
2191
2419
|
|
|
2192
|
-
export { index$5 as AdminResources, index$3 as AdminTypes, type AnyColumn, ApiClient, type ApiKeyColumn, type ApiResponse, BaseResource, type CollectionColumn, index$1 as CommonTypes, type ContentColumn, CrudResource, type DatasourceColumn, index$4 as FrontstoreResources, index$2 as FrontstoreTypes, type GenericColumn, type GetParams, type LanguageColumn, type LayoutColumn, type ListMeta, type ListParams, type MediaColumn, type MetadataColumn, type NavigationColumn, type ProjectColumn, QueryBuilder, type RequestOptions, type ReviewColumn, type SDKConfig, SalefonyApiSdk, SalefonyAuthError, SalefonyError, SalefonyNotFoundError, SalefonyValidationError, index as SchemaTypes, type SectionColumn, type SectorColumn, type SiteSettingsColumn, type StoreColumn, type VendorColumn, apiKeyColumns, collectionColumns$1 as collectionColumns, columns, contentColumns$1 as contentColumns, createSDK, createSDKFromEnv, datasourceColumns, languageColumns, layoutColumns, metadataColumns, navigationColumns, projectColumns, sectionColumns, sectorColumns, storeColumns, unwrap, unwrapList, unwrapMeta, vendorColumns };
|
|
2420
|
+
export { type AdminAcceptInvitePayload, type AdminAcceptInviteResponse, type AdminCreateInvitePayload, type AdminCreateRegionPayload, type AdminCustomDataCreatePayload, type AdminCustomDataItem, type AdminCustomDataUpdatePayload, type AdminInvite, type AdminInviteDeleteResponse, type AdminInviteListResponse, type AdminInviteResponse, type AdminMediaCreateInput, type AdminRegion, type AdminRegionDeleteResponse, type AdminRegionListResponse, type AdminRegionResponse, index$5 as AdminResources, index$3 as AdminTypes, type AdminUpdateRegionPayload, type AnyColumn, ApiClient, type ApiKeyColumn, ApiKeyResource, type ApiResponse, AuthResource, BaseResource, CloudflareResource, type CollectionColumn, CollectionResource$1 as CollectionResource, index$1 as CommonTypes, type ContentColumn, ContentResource$1 as ContentResource, type CreateDatasourceInput, CrudResource, CustomDataResource, DatasetsResource, type DatasourceColumn, DatasourceResource, type FacebookBusinessSettings, index$4 as FrontstoreResources, index$2 as FrontstoreTypes, type GenericColumn, type GetParams, type GoogleAnalyticsSettings, type GoogleAnalyticsSettingsField, GoogleResource, type IntegrationCatalogItem, type IntegrationConnectionStatus, type IntegrationProviderId, type IntegrationSettingOption, type IntegrationSettingSchema, type IntegrationSettingType, type IntegrationSettingsData, IntegrationsResource, InviteResource, type KnownDatasetType, type LanguageColumn, LanguageResource$1 as LanguageResource, type LayoutColumn, LayoutResource, type ListMeta, type ListNotificationsParams, type ListParams, type MediaColumn, MediaResource$1 as MediaResource, type MetadataColumn, MetadataResource, type NavigationColumn, NavigationResource$1 as NavigationResource, NotificationResource, type NotificationType, type ProjectColumn, ProjectResource, PurchaseResource, QueryBuilder, type Region, type RegionCountry, RegionResource, type RequestOptions, type ReviewColumn, ReviewResource$1 as ReviewResource, type SDKConfig, SEOResource, SalefonyApiSdk, SalefonyAuthError, SalefonyError, SalefonyNotFoundError, SalefonyValidationError, index as SchemaTypes, type SectionColumn, SectionResource, type SectorColumn, SectorResource, SettingsResource, type SiteSettingsColumn, type StoreColumn, type StoreNotification, StoreResource$1 as StoreResource, SubscriptionResource, type ThemeItem, ThemeResource, type UpdateDatasourceInput, type VendorColumn, VendorResource, WebmailResource, apiKeyColumns, collectionColumns$1 as collectionColumns, columns, contentColumns$1 as contentColumns, createSDK, createSDKFromEnv, datasourceColumns, languageColumns, layoutColumns, metadataColumns, navigationColumns, projectColumns, sectionColumns, sectorColumns, storeColumns, unwrap, unwrapList, unwrapMeta, vendorColumns };
|
package/dist/index.js
CHANGED
|
@@ -33,18 +33,48 @@ __export(index_exports, {
|
|
|
33
33
|
AdminResources: () => admin_exports,
|
|
34
34
|
AdminTypes: () => admin_exports2,
|
|
35
35
|
ApiClient: () => ApiClient,
|
|
36
|
+
ApiKeyResource: () => ApiKeyResource,
|
|
37
|
+
AuthResource: () => AuthResource,
|
|
36
38
|
BaseResource: () => BaseResource,
|
|
39
|
+
CloudflareResource: () => CloudflareResource,
|
|
40
|
+
CollectionResource: () => CollectionResource,
|
|
37
41
|
CommonTypes: () => common_exports,
|
|
42
|
+
ContentResource: () => ContentResource,
|
|
38
43
|
CrudResource: () => CrudResource,
|
|
44
|
+
CustomDataResource: () => CustomDataResource,
|
|
45
|
+
DatasetsResource: () => DatasetsResource,
|
|
46
|
+
DatasourceResource: () => DatasourceResource,
|
|
39
47
|
FrontstoreResources: () => frontstore_exports,
|
|
40
48
|
FrontstoreTypes: () => frontstore_exports2,
|
|
49
|
+
GoogleResource: () => GoogleResource,
|
|
50
|
+
IntegrationsResource: () => IntegrationsResource,
|
|
51
|
+
InviteResource: () => InviteResource,
|
|
52
|
+
LanguageResource: () => LanguageResource,
|
|
53
|
+
LayoutResource: () => LayoutResource,
|
|
54
|
+
MediaResource: () => MediaResource,
|
|
55
|
+
MetadataResource: () => MetadataResource,
|
|
56
|
+
NavigationResource: () => NavigationResource,
|
|
57
|
+
NotificationResource: () => NotificationResource,
|
|
58
|
+
ProjectResource: () => ProjectResource,
|
|
59
|
+
PurchaseResource: () => PurchaseResource,
|
|
41
60
|
QueryBuilder: () => QueryBuilder,
|
|
61
|
+
RegionResource: () => RegionResource,
|
|
62
|
+
ReviewResource: () => ReviewResource,
|
|
63
|
+
SEOResource: () => SEOResource,
|
|
42
64
|
SalefonyApiSdk: () => SalefonyApiSdk,
|
|
43
65
|
SalefonyAuthError: () => SalefonyAuthError,
|
|
44
66
|
SalefonyError: () => SalefonyError,
|
|
45
67
|
SalefonyNotFoundError: () => SalefonyNotFoundError,
|
|
46
68
|
SalefonyValidationError: () => SalefonyValidationError,
|
|
47
69
|
SchemaTypes: () => schema_exports,
|
|
70
|
+
SectionResource: () => SectionResource,
|
|
71
|
+
SectorResource: () => SectorResource,
|
|
72
|
+
SettingsResource: () => SettingsResource,
|
|
73
|
+
StoreResource: () => StoreResource,
|
|
74
|
+
SubscriptionResource: () => SubscriptionResource,
|
|
75
|
+
ThemeResource: () => ThemeResource,
|
|
76
|
+
VendorResource: () => VendorResource,
|
|
77
|
+
WebmailResource: () => WebmailResource,
|
|
48
78
|
apiKeyColumns: () => apiKeyColumns,
|
|
49
79
|
collectionColumns: () => collectionColumns,
|
|
50
80
|
columns: () => columns,
|
|
@@ -235,6 +265,7 @@ __export(admin_exports, {
|
|
|
235
265
|
DatasourceResource: () => DatasourceResource,
|
|
236
266
|
GoogleResource: () => GoogleResource,
|
|
237
267
|
IntegrationsResource: () => IntegrationsResource,
|
|
268
|
+
InviteResource: () => InviteResource,
|
|
238
269
|
LanguageResource: () => LanguageResource,
|
|
239
270
|
LayoutResource: () => LayoutResource,
|
|
240
271
|
MediaResource: () => MediaResource,
|
|
@@ -243,6 +274,7 @@ __export(admin_exports, {
|
|
|
243
274
|
NotificationResource: () => NotificationResource,
|
|
244
275
|
ProjectResource: () => ProjectResource,
|
|
245
276
|
PurchaseResource: () => PurchaseResource,
|
|
277
|
+
RegionResource: () => RegionResource,
|
|
246
278
|
ReviewResource: () => ReviewResource,
|
|
247
279
|
SEOResource: () => SEOResource,
|
|
248
280
|
SectionResource: () => SectionResource,
|
|
@@ -1129,12 +1161,17 @@ var MediaResource = class extends BaseResource {
|
|
|
1129
1161
|
super(httpClient);
|
|
1130
1162
|
if (path) this.path = path;
|
|
1131
1163
|
}
|
|
1132
|
-
async getAll() {
|
|
1164
|
+
async getAll(params) {
|
|
1133
1165
|
return this.request({
|
|
1134
1166
|
method: "GET",
|
|
1135
|
-
url: this.path
|
|
1167
|
+
url: this.path,
|
|
1168
|
+
params: params ? { type: params.type } : void 0
|
|
1136
1169
|
});
|
|
1137
1170
|
}
|
|
1171
|
+
/** List only documents (media with type === 'document'). */
|
|
1172
|
+
async getDocuments() {
|
|
1173
|
+
return this.getAll({ type: "document" });
|
|
1174
|
+
}
|
|
1138
1175
|
async create(data) {
|
|
1139
1176
|
return this.request({
|
|
1140
1177
|
method: "POST",
|
|
@@ -1248,7 +1285,7 @@ var AuthResource = class extends BaseResource {
|
|
|
1248
1285
|
});
|
|
1249
1286
|
}
|
|
1250
1287
|
/**
|
|
1251
|
-
* Mevcut session bilgisini getirir
|
|
1288
|
+
* Mevcut session bilgisini getirir (Backend: GET /api/auth/session)
|
|
1252
1289
|
*/
|
|
1253
1290
|
async getSession() {
|
|
1254
1291
|
return this.request({
|
|
@@ -1257,16 +1294,16 @@ var AuthResource = class extends BaseResource {
|
|
|
1257
1294
|
});
|
|
1258
1295
|
}
|
|
1259
1296
|
/**
|
|
1260
|
-
* Çıkış yap (Backend: POST /api/auth/logout)
|
|
1297
|
+
* Çıkış yap – backend'deki logout endpoint'ini kullanır (Backend: POST /api/auth/logout)
|
|
1261
1298
|
*/
|
|
1262
1299
|
async signOut() {
|
|
1263
1300
|
return this.request({
|
|
1264
1301
|
method: "POST",
|
|
1265
|
-
url: `${this.path}/
|
|
1302
|
+
url: `${this.path}/logout`
|
|
1266
1303
|
});
|
|
1267
1304
|
}
|
|
1268
1305
|
/**
|
|
1269
|
-
* Logout
|
|
1306
|
+
* Logout – session'ı backend'de geçersiz kılar (Backend: POST /api/auth/logout)
|
|
1270
1307
|
*/
|
|
1271
1308
|
async logout() {
|
|
1272
1309
|
return this.request({
|
|
@@ -1422,6 +1459,19 @@ var IntegrationsResource = class extends BaseResource {
|
|
|
1422
1459
|
const params = redirectUri ? `?redirect_uri=${encodeURIComponent(redirectUri)}` : "";
|
|
1423
1460
|
return `${baseUrl}${path}${params}`;
|
|
1424
1461
|
}
|
|
1462
|
+
/**
|
|
1463
|
+
* Backend'den OAuth URL'ini alır (JWT ile). Dashboard gibi JWT kullanan client'lar
|
|
1464
|
+
* tam sayfa redirect'te token gönderemediği için bu endpoint ile URL alıp sonra
|
|
1465
|
+
* yönlendirmeli; böylece state içinde doğru storeId/userId olur ve bağlantı sonrası
|
|
1466
|
+
* getStatus doğru döner.
|
|
1467
|
+
*/
|
|
1468
|
+
async fetchAuthorizeUrl(provider, redirectUri) {
|
|
1469
|
+
const params = redirectUri ? `?redirect_uri=${encodeURIComponent(redirectUri)}` : "";
|
|
1470
|
+
return this.request({
|
|
1471
|
+
method: "GET",
|
|
1472
|
+
url: `/api/admin/integrations/authorize/${encodeURIComponent(provider)}/url${params}`
|
|
1473
|
+
});
|
|
1474
|
+
}
|
|
1425
1475
|
resolveRedirectUri(redirectUriOrPath) {
|
|
1426
1476
|
if (redirectUriOrPath) {
|
|
1427
1477
|
if (redirectUriOrPath.startsWith("http://") || redirectUriOrPath.startsWith("https://")) {
|
|
@@ -1897,6 +1947,125 @@ var NotificationResource = class extends BaseResource {
|
|
|
1897
1947
|
}
|
|
1898
1948
|
};
|
|
1899
1949
|
|
|
1950
|
+
// src/resources/admin/invite.ts
|
|
1951
|
+
var InviteResource = class extends BaseResource {
|
|
1952
|
+
constructor(httpClient, path = "/admin/invites") {
|
|
1953
|
+
super(httpClient);
|
|
1954
|
+
this.path = path;
|
|
1955
|
+
}
|
|
1956
|
+
get path() {
|
|
1957
|
+
return this.path;
|
|
1958
|
+
}
|
|
1959
|
+
/**
|
|
1960
|
+
* Davet listesi: GET /admin/invites?limit=&offset=&q=
|
|
1961
|
+
*/
|
|
1962
|
+
async list(query, options) {
|
|
1963
|
+
const params = {};
|
|
1964
|
+
if (query?.limit != null) params.limit = query.limit;
|
|
1965
|
+
if (query?.offset != null) params.offset = query.offset;
|
|
1966
|
+
if (query?.q != null) params.q = query.q;
|
|
1967
|
+
return this.request(
|
|
1968
|
+
{ method: "GET", url: this.path, params },
|
|
1969
|
+
options
|
|
1970
|
+
);
|
|
1971
|
+
}
|
|
1972
|
+
/**
|
|
1973
|
+
* Tek davet: GET /admin/invites/:id
|
|
1974
|
+
*/
|
|
1975
|
+
async retrieve(id, options) {
|
|
1976
|
+
return this.request(
|
|
1977
|
+
{ method: "GET", url: `${this.path}/${id}` },
|
|
1978
|
+
options
|
|
1979
|
+
);
|
|
1980
|
+
}
|
|
1981
|
+
/**
|
|
1982
|
+
* Yeni davet: POST /admin/invites body: { email }
|
|
1983
|
+
*/
|
|
1984
|
+
async create(payload, options) {
|
|
1985
|
+
return this.request(
|
|
1986
|
+
{ method: "POST", url: this.path, data: payload },
|
|
1987
|
+
options
|
|
1988
|
+
);
|
|
1989
|
+
}
|
|
1990
|
+
/**
|
|
1991
|
+
* Daveti yeniden gönder: POST /admin/invites/:id/resend
|
|
1992
|
+
*/
|
|
1993
|
+
async resend(id, options) {
|
|
1994
|
+
return this.request(
|
|
1995
|
+
{ method: "POST", url: `${this.path}/${id}/resend` },
|
|
1996
|
+
options
|
|
1997
|
+
);
|
|
1998
|
+
}
|
|
1999
|
+
/**
|
|
2000
|
+
* Daveti sil: DELETE /admin/invites/:id
|
|
2001
|
+
*/
|
|
2002
|
+
async delete(id, options) {
|
|
2003
|
+
return this.request(
|
|
2004
|
+
{ method: "DELETE", url: `${this.path}/${id}` },
|
|
2005
|
+
options
|
|
2006
|
+
);
|
|
2007
|
+
}
|
|
2008
|
+
/**
|
|
2009
|
+
* Daveti kabul et: POST /admin/invites/accept body: { invite_token, user }
|
|
2010
|
+
*/
|
|
2011
|
+
async accept(payload, _query, extraHeaders, options) {
|
|
2012
|
+
const config = {
|
|
2013
|
+
method: "POST",
|
|
2014
|
+
url: `${this.path}/accept`,
|
|
2015
|
+
data: payload
|
|
2016
|
+
};
|
|
2017
|
+
if (extraHeaders?.Authorization) {
|
|
2018
|
+
config.headers = { Authorization: extraHeaders.Authorization };
|
|
2019
|
+
}
|
|
2020
|
+
return this.request(config, options);
|
|
2021
|
+
}
|
|
2022
|
+
};
|
|
2023
|
+
|
|
2024
|
+
// src/resources/admin/region.ts
|
|
2025
|
+
var RegionResource = class extends BaseResource {
|
|
2026
|
+
constructor(httpClient, path = "/admin/regions") {
|
|
2027
|
+
super(httpClient);
|
|
2028
|
+
this.path = path;
|
|
2029
|
+
}
|
|
2030
|
+
get path() {
|
|
2031
|
+
return this.path;
|
|
2032
|
+
}
|
|
2033
|
+
async list(query, options) {
|
|
2034
|
+
const params = {};
|
|
2035
|
+
if (query?.limit != null) params.limit = query.limit;
|
|
2036
|
+
if (query?.offset != null) params.offset = query.offset;
|
|
2037
|
+
if (query?.q != null) params.q = query.q;
|
|
2038
|
+
return this.request(
|
|
2039
|
+
{ method: "GET", url: this.path, params },
|
|
2040
|
+
options
|
|
2041
|
+
);
|
|
2042
|
+
}
|
|
2043
|
+
async retrieve(id, _query, options) {
|
|
2044
|
+
return this.request(
|
|
2045
|
+
{ method: "GET", url: `${this.path}/${id}` },
|
|
2046
|
+
options
|
|
2047
|
+
);
|
|
2048
|
+
}
|
|
2049
|
+
async create(payload, options) {
|
|
2050
|
+
return this.request(
|
|
2051
|
+
{ method: "POST", url: this.path, data: payload },
|
|
2052
|
+
options
|
|
2053
|
+
);
|
|
2054
|
+
}
|
|
2055
|
+
async update(id, payload, options) {
|
|
2056
|
+
return this.request(
|
|
2057
|
+
{ method: "PATCH", url: `${this.path}/${id}`, data: payload },
|
|
2058
|
+
options
|
|
2059
|
+
);
|
|
2060
|
+
}
|
|
2061
|
+
async delete(id, options) {
|
|
2062
|
+
return this.request(
|
|
2063
|
+
{ method: "DELETE", url: `${this.path}/${id}` },
|
|
2064
|
+
options
|
|
2065
|
+
);
|
|
2066
|
+
}
|
|
2067
|
+
};
|
|
2068
|
+
|
|
1900
2069
|
// src/resources/frontstore/index.ts
|
|
1901
2070
|
var frontstore_exports = {};
|
|
1902
2071
|
__export(frontstore_exports, {
|
|
@@ -2394,6 +2563,8 @@ var AdminNamespace = class {
|
|
|
2394
2563
|
subscriptions;
|
|
2395
2564
|
purchases;
|
|
2396
2565
|
notifications;
|
|
2566
|
+
invite;
|
|
2567
|
+
region;
|
|
2397
2568
|
constructor(client) {
|
|
2398
2569
|
this.vendors = new VendorResource(client.instance);
|
|
2399
2570
|
this.contents = new ContentResource(client.instance);
|
|
@@ -2423,6 +2594,8 @@ var AdminNamespace = class {
|
|
|
2423
2594
|
this.subscriptions = new SubscriptionResource(client.instance);
|
|
2424
2595
|
this.purchases = new PurchaseResource(client.instance);
|
|
2425
2596
|
this.notifications = new NotificationResource(client.instance);
|
|
2597
|
+
this.invite = new InviteResource(client.instance);
|
|
2598
|
+
this.region = new RegionResource(client.instance);
|
|
2426
2599
|
}
|
|
2427
2600
|
};
|
|
2428
2601
|
var FrontstoreNamespace = class {
|
|
@@ -2557,18 +2730,48 @@ function createSDKFromEnv(config = {}) {
|
|
|
2557
2730
|
AdminResources,
|
|
2558
2731
|
AdminTypes,
|
|
2559
2732
|
ApiClient,
|
|
2733
|
+
ApiKeyResource,
|
|
2734
|
+
AuthResource,
|
|
2560
2735
|
BaseResource,
|
|
2736
|
+
CloudflareResource,
|
|
2737
|
+
CollectionResource,
|
|
2561
2738
|
CommonTypes,
|
|
2739
|
+
ContentResource,
|
|
2562
2740
|
CrudResource,
|
|
2741
|
+
CustomDataResource,
|
|
2742
|
+
DatasetsResource,
|
|
2743
|
+
DatasourceResource,
|
|
2563
2744
|
FrontstoreResources,
|
|
2564
2745
|
FrontstoreTypes,
|
|
2746
|
+
GoogleResource,
|
|
2747
|
+
IntegrationsResource,
|
|
2748
|
+
InviteResource,
|
|
2749
|
+
LanguageResource,
|
|
2750
|
+
LayoutResource,
|
|
2751
|
+
MediaResource,
|
|
2752
|
+
MetadataResource,
|
|
2753
|
+
NavigationResource,
|
|
2754
|
+
NotificationResource,
|
|
2755
|
+
ProjectResource,
|
|
2756
|
+
PurchaseResource,
|
|
2565
2757
|
QueryBuilder,
|
|
2758
|
+
RegionResource,
|
|
2759
|
+
ReviewResource,
|
|
2760
|
+
SEOResource,
|
|
2566
2761
|
SalefonyApiSdk,
|
|
2567
2762
|
SalefonyAuthError,
|
|
2568
2763
|
SalefonyError,
|
|
2569
2764
|
SalefonyNotFoundError,
|
|
2570
2765
|
SalefonyValidationError,
|
|
2571
2766
|
SchemaTypes,
|
|
2767
|
+
SectionResource,
|
|
2768
|
+
SectorResource,
|
|
2769
|
+
SettingsResource,
|
|
2770
|
+
StoreResource,
|
|
2771
|
+
SubscriptionResource,
|
|
2772
|
+
ThemeResource,
|
|
2773
|
+
VendorResource,
|
|
2774
|
+
WebmailResource,
|
|
2572
2775
|
apiKeyColumns,
|
|
2573
2776
|
collectionColumns,
|
|
2574
2777
|
columns,
|
package/dist/index.mjs
CHANGED
|
@@ -172,6 +172,7 @@ __export(admin_exports, {
|
|
|
172
172
|
DatasourceResource: () => DatasourceResource,
|
|
173
173
|
GoogleResource: () => GoogleResource,
|
|
174
174
|
IntegrationsResource: () => IntegrationsResource,
|
|
175
|
+
InviteResource: () => InviteResource,
|
|
175
176
|
LanguageResource: () => LanguageResource,
|
|
176
177
|
LayoutResource: () => LayoutResource,
|
|
177
178
|
MediaResource: () => MediaResource,
|
|
@@ -180,6 +181,7 @@ __export(admin_exports, {
|
|
|
180
181
|
NotificationResource: () => NotificationResource,
|
|
181
182
|
ProjectResource: () => ProjectResource,
|
|
182
183
|
PurchaseResource: () => PurchaseResource,
|
|
184
|
+
RegionResource: () => RegionResource,
|
|
183
185
|
ReviewResource: () => ReviewResource,
|
|
184
186
|
SEOResource: () => SEOResource,
|
|
185
187
|
SectionResource: () => SectionResource,
|
|
@@ -1066,12 +1068,17 @@ var MediaResource = class extends BaseResource {
|
|
|
1066
1068
|
super(httpClient);
|
|
1067
1069
|
if (path) this.path = path;
|
|
1068
1070
|
}
|
|
1069
|
-
async getAll() {
|
|
1071
|
+
async getAll(params) {
|
|
1070
1072
|
return this.request({
|
|
1071
1073
|
method: "GET",
|
|
1072
|
-
url: this.path
|
|
1074
|
+
url: this.path,
|
|
1075
|
+
params: params ? { type: params.type } : void 0
|
|
1073
1076
|
});
|
|
1074
1077
|
}
|
|
1078
|
+
/** List only documents (media with type === 'document'). */
|
|
1079
|
+
async getDocuments() {
|
|
1080
|
+
return this.getAll({ type: "document" });
|
|
1081
|
+
}
|
|
1075
1082
|
async create(data) {
|
|
1076
1083
|
return this.request({
|
|
1077
1084
|
method: "POST",
|
|
@@ -1185,7 +1192,7 @@ var AuthResource = class extends BaseResource {
|
|
|
1185
1192
|
});
|
|
1186
1193
|
}
|
|
1187
1194
|
/**
|
|
1188
|
-
* Mevcut session bilgisini getirir
|
|
1195
|
+
* Mevcut session bilgisini getirir (Backend: GET /api/auth/session)
|
|
1189
1196
|
*/
|
|
1190
1197
|
async getSession() {
|
|
1191
1198
|
return this.request({
|
|
@@ -1194,16 +1201,16 @@ var AuthResource = class extends BaseResource {
|
|
|
1194
1201
|
});
|
|
1195
1202
|
}
|
|
1196
1203
|
/**
|
|
1197
|
-
* Çıkış yap (Backend: POST /api/auth/logout)
|
|
1204
|
+
* Çıkış yap – backend'deki logout endpoint'ini kullanır (Backend: POST /api/auth/logout)
|
|
1198
1205
|
*/
|
|
1199
1206
|
async signOut() {
|
|
1200
1207
|
return this.request({
|
|
1201
1208
|
method: "POST",
|
|
1202
|
-
url: `${this.path}/
|
|
1209
|
+
url: `${this.path}/logout`
|
|
1203
1210
|
});
|
|
1204
1211
|
}
|
|
1205
1212
|
/**
|
|
1206
|
-
* Logout
|
|
1213
|
+
* Logout – session'ı backend'de geçersiz kılar (Backend: POST /api/auth/logout)
|
|
1207
1214
|
*/
|
|
1208
1215
|
async logout() {
|
|
1209
1216
|
return this.request({
|
|
@@ -1359,6 +1366,19 @@ var IntegrationsResource = class extends BaseResource {
|
|
|
1359
1366
|
const params = redirectUri ? `?redirect_uri=${encodeURIComponent(redirectUri)}` : "";
|
|
1360
1367
|
return `${baseUrl}${path}${params}`;
|
|
1361
1368
|
}
|
|
1369
|
+
/**
|
|
1370
|
+
* Backend'den OAuth URL'ini alır (JWT ile). Dashboard gibi JWT kullanan client'lar
|
|
1371
|
+
* tam sayfa redirect'te token gönderemediği için bu endpoint ile URL alıp sonra
|
|
1372
|
+
* yönlendirmeli; böylece state içinde doğru storeId/userId olur ve bağlantı sonrası
|
|
1373
|
+
* getStatus doğru döner.
|
|
1374
|
+
*/
|
|
1375
|
+
async fetchAuthorizeUrl(provider, redirectUri) {
|
|
1376
|
+
const params = redirectUri ? `?redirect_uri=${encodeURIComponent(redirectUri)}` : "";
|
|
1377
|
+
return this.request({
|
|
1378
|
+
method: "GET",
|
|
1379
|
+
url: `/api/admin/integrations/authorize/${encodeURIComponent(provider)}/url${params}`
|
|
1380
|
+
});
|
|
1381
|
+
}
|
|
1362
1382
|
resolveRedirectUri(redirectUriOrPath) {
|
|
1363
1383
|
if (redirectUriOrPath) {
|
|
1364
1384
|
if (redirectUriOrPath.startsWith("http://") || redirectUriOrPath.startsWith("https://")) {
|
|
@@ -1834,6 +1854,125 @@ var NotificationResource = class extends BaseResource {
|
|
|
1834
1854
|
}
|
|
1835
1855
|
};
|
|
1836
1856
|
|
|
1857
|
+
// src/resources/admin/invite.ts
|
|
1858
|
+
var InviteResource = class extends BaseResource {
|
|
1859
|
+
constructor(httpClient, path = "/admin/invites") {
|
|
1860
|
+
super(httpClient);
|
|
1861
|
+
this.path = path;
|
|
1862
|
+
}
|
|
1863
|
+
get path() {
|
|
1864
|
+
return this.path;
|
|
1865
|
+
}
|
|
1866
|
+
/**
|
|
1867
|
+
* Davet listesi: GET /admin/invites?limit=&offset=&q=
|
|
1868
|
+
*/
|
|
1869
|
+
async list(query, options) {
|
|
1870
|
+
const params = {};
|
|
1871
|
+
if (query?.limit != null) params.limit = query.limit;
|
|
1872
|
+
if (query?.offset != null) params.offset = query.offset;
|
|
1873
|
+
if (query?.q != null) params.q = query.q;
|
|
1874
|
+
return this.request(
|
|
1875
|
+
{ method: "GET", url: this.path, params },
|
|
1876
|
+
options
|
|
1877
|
+
);
|
|
1878
|
+
}
|
|
1879
|
+
/**
|
|
1880
|
+
* Tek davet: GET /admin/invites/:id
|
|
1881
|
+
*/
|
|
1882
|
+
async retrieve(id, options) {
|
|
1883
|
+
return this.request(
|
|
1884
|
+
{ method: "GET", url: `${this.path}/${id}` },
|
|
1885
|
+
options
|
|
1886
|
+
);
|
|
1887
|
+
}
|
|
1888
|
+
/**
|
|
1889
|
+
* Yeni davet: POST /admin/invites body: { email }
|
|
1890
|
+
*/
|
|
1891
|
+
async create(payload, options) {
|
|
1892
|
+
return this.request(
|
|
1893
|
+
{ method: "POST", url: this.path, data: payload },
|
|
1894
|
+
options
|
|
1895
|
+
);
|
|
1896
|
+
}
|
|
1897
|
+
/**
|
|
1898
|
+
* Daveti yeniden gönder: POST /admin/invites/:id/resend
|
|
1899
|
+
*/
|
|
1900
|
+
async resend(id, options) {
|
|
1901
|
+
return this.request(
|
|
1902
|
+
{ method: "POST", url: `${this.path}/${id}/resend` },
|
|
1903
|
+
options
|
|
1904
|
+
);
|
|
1905
|
+
}
|
|
1906
|
+
/**
|
|
1907
|
+
* Daveti sil: DELETE /admin/invites/:id
|
|
1908
|
+
*/
|
|
1909
|
+
async delete(id, options) {
|
|
1910
|
+
return this.request(
|
|
1911
|
+
{ method: "DELETE", url: `${this.path}/${id}` },
|
|
1912
|
+
options
|
|
1913
|
+
);
|
|
1914
|
+
}
|
|
1915
|
+
/**
|
|
1916
|
+
* Daveti kabul et: POST /admin/invites/accept body: { invite_token, user }
|
|
1917
|
+
*/
|
|
1918
|
+
async accept(payload, _query, extraHeaders, options) {
|
|
1919
|
+
const config = {
|
|
1920
|
+
method: "POST",
|
|
1921
|
+
url: `${this.path}/accept`,
|
|
1922
|
+
data: payload
|
|
1923
|
+
};
|
|
1924
|
+
if (extraHeaders?.Authorization) {
|
|
1925
|
+
config.headers = { Authorization: extraHeaders.Authorization };
|
|
1926
|
+
}
|
|
1927
|
+
return this.request(config, options);
|
|
1928
|
+
}
|
|
1929
|
+
};
|
|
1930
|
+
|
|
1931
|
+
// src/resources/admin/region.ts
|
|
1932
|
+
var RegionResource = class extends BaseResource {
|
|
1933
|
+
constructor(httpClient, path = "/admin/regions") {
|
|
1934
|
+
super(httpClient);
|
|
1935
|
+
this.path = path;
|
|
1936
|
+
}
|
|
1937
|
+
get path() {
|
|
1938
|
+
return this.path;
|
|
1939
|
+
}
|
|
1940
|
+
async list(query, options) {
|
|
1941
|
+
const params = {};
|
|
1942
|
+
if (query?.limit != null) params.limit = query.limit;
|
|
1943
|
+
if (query?.offset != null) params.offset = query.offset;
|
|
1944
|
+
if (query?.q != null) params.q = query.q;
|
|
1945
|
+
return this.request(
|
|
1946
|
+
{ method: "GET", url: this.path, params },
|
|
1947
|
+
options
|
|
1948
|
+
);
|
|
1949
|
+
}
|
|
1950
|
+
async retrieve(id, _query, options) {
|
|
1951
|
+
return this.request(
|
|
1952
|
+
{ method: "GET", url: `${this.path}/${id}` },
|
|
1953
|
+
options
|
|
1954
|
+
);
|
|
1955
|
+
}
|
|
1956
|
+
async create(payload, options) {
|
|
1957
|
+
return this.request(
|
|
1958
|
+
{ method: "POST", url: this.path, data: payload },
|
|
1959
|
+
options
|
|
1960
|
+
);
|
|
1961
|
+
}
|
|
1962
|
+
async update(id, payload, options) {
|
|
1963
|
+
return this.request(
|
|
1964
|
+
{ method: "PATCH", url: `${this.path}/${id}`, data: payload },
|
|
1965
|
+
options
|
|
1966
|
+
);
|
|
1967
|
+
}
|
|
1968
|
+
async delete(id, options) {
|
|
1969
|
+
return this.request(
|
|
1970
|
+
{ method: "DELETE", url: `${this.path}/${id}` },
|
|
1971
|
+
options
|
|
1972
|
+
);
|
|
1973
|
+
}
|
|
1974
|
+
};
|
|
1975
|
+
|
|
1837
1976
|
// src/resources/frontstore/index.ts
|
|
1838
1977
|
var frontstore_exports = {};
|
|
1839
1978
|
__export(frontstore_exports, {
|
|
@@ -2331,6 +2470,8 @@ var AdminNamespace = class {
|
|
|
2331
2470
|
subscriptions;
|
|
2332
2471
|
purchases;
|
|
2333
2472
|
notifications;
|
|
2473
|
+
invite;
|
|
2474
|
+
region;
|
|
2334
2475
|
constructor(client) {
|
|
2335
2476
|
this.vendors = new VendorResource(client.instance);
|
|
2336
2477
|
this.contents = new ContentResource(client.instance);
|
|
@@ -2360,6 +2501,8 @@ var AdminNamespace = class {
|
|
|
2360
2501
|
this.subscriptions = new SubscriptionResource(client.instance);
|
|
2361
2502
|
this.purchases = new PurchaseResource(client.instance);
|
|
2362
2503
|
this.notifications = new NotificationResource(client.instance);
|
|
2504
|
+
this.invite = new InviteResource(client.instance);
|
|
2505
|
+
this.region = new RegionResource(client.instance);
|
|
2363
2506
|
}
|
|
2364
2507
|
};
|
|
2365
2508
|
var FrontstoreNamespace = class {
|
|
@@ -2493,18 +2636,48 @@ export {
|
|
|
2493
2636
|
admin_exports as AdminResources,
|
|
2494
2637
|
admin_exports2 as AdminTypes,
|
|
2495
2638
|
ApiClient,
|
|
2639
|
+
ApiKeyResource,
|
|
2640
|
+
AuthResource,
|
|
2496
2641
|
BaseResource,
|
|
2642
|
+
CloudflareResource,
|
|
2643
|
+
CollectionResource,
|
|
2497
2644
|
common_exports as CommonTypes,
|
|
2645
|
+
ContentResource,
|
|
2498
2646
|
CrudResource,
|
|
2647
|
+
CustomDataResource,
|
|
2648
|
+
DatasetsResource,
|
|
2649
|
+
DatasourceResource,
|
|
2499
2650
|
frontstore_exports as FrontstoreResources,
|
|
2500
2651
|
frontstore_exports2 as FrontstoreTypes,
|
|
2652
|
+
GoogleResource,
|
|
2653
|
+
IntegrationsResource,
|
|
2654
|
+
InviteResource,
|
|
2655
|
+
LanguageResource,
|
|
2656
|
+
LayoutResource,
|
|
2657
|
+
MediaResource,
|
|
2658
|
+
MetadataResource,
|
|
2659
|
+
NavigationResource,
|
|
2660
|
+
NotificationResource,
|
|
2661
|
+
ProjectResource,
|
|
2662
|
+
PurchaseResource,
|
|
2501
2663
|
QueryBuilder,
|
|
2664
|
+
RegionResource,
|
|
2665
|
+
ReviewResource,
|
|
2666
|
+
SEOResource,
|
|
2502
2667
|
SalefonyApiSdk,
|
|
2503
2668
|
SalefonyAuthError,
|
|
2504
2669
|
SalefonyError,
|
|
2505
2670
|
SalefonyNotFoundError,
|
|
2506
2671
|
SalefonyValidationError,
|
|
2507
2672
|
schema_exports as SchemaTypes,
|
|
2673
|
+
SectionResource,
|
|
2674
|
+
SectorResource,
|
|
2675
|
+
SettingsResource,
|
|
2676
|
+
StoreResource,
|
|
2677
|
+
SubscriptionResource,
|
|
2678
|
+
ThemeResource,
|
|
2679
|
+
VendorResource,
|
|
2680
|
+
WebmailResource,
|
|
2508
2681
|
apiKeyColumns,
|
|
2509
2682
|
collectionColumns,
|
|
2510
2683
|
columns,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salefony/api-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
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",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dev": "tsup src/index.ts --format cjs,esm --watch --dts",
|
|
22
22
|
"lint": "eslint src",
|
|
23
23
|
"type-check": "tsc --noEmit",
|
|
24
|
-
"prepublishOnly": "
|
|
24
|
+
"prepublishOnly": "pnpm run build",
|
|
25
25
|
"version:patch": "node scripts/version-bump.js patch",
|
|
26
26
|
"version:minor": "node scripts/version-bump.js minor",
|
|
27
27
|
"version:major": "node scripts/version-bump.js major",
|