@rezamirzapour/pod-sdk 1.0.3 → 1.0.5

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 CHANGED
@@ -43,18 +43,27 @@ interface SendOtpOptions {
43
43
  interface PodUrlsConfig {
44
44
  accounts?: string;
45
45
  apiPod?: string;
46
+ apiPodSandbox?: string;
46
47
  cms?: string;
48
+ iums?: string;
49
+ notification?: string;
50
+ podreport?: string;
47
51
  podspace?: string;
48
52
  podform?: string;
49
- notification?: string;
50
- iums?: string;
53
+ sandboxCms?: string;
54
+ sandboxCmsClient?: string;
55
+ sandboxPodspace?: string;
56
+ sandboxStream?: string;
57
+ stream?: string;
51
58
  website?: string;
59
+ [key: string]: string | undefined;
52
60
  }
53
61
  interface PodSdkConfig {
54
62
  apiToken?: string;
55
63
  clientId?: string;
56
64
  clientSecret?: string;
57
65
  privateKeyPem?: string;
66
+ sandbox?: boolean;
58
67
  urls?: PodUrlsConfig;
59
68
  revalidate?: number | string;
60
69
  timeout?: number;
@@ -434,7 +443,7 @@ interface SendSmsResponse {
434
443
  }
435
444
 
436
445
  interface NotificationServiceOptions {
437
- baseUrl: string;
446
+ baseUrl?: string;
438
447
  apiToken: string;
439
448
  }
440
449
  declare class NotificationService {
@@ -637,21 +646,50 @@ type MetaContent = {
637
646
  value: any;
638
647
  type: string;
639
648
  });
649
+ interface TagTreeMetadata {
650
+ icon?: string;
651
+ related_contents?: {
652
+ id: number;
653
+ }[];
654
+ longDescription?: string;
655
+ description?: string;
656
+ content?: string;
657
+ link?: string;
658
+ target?: string;
659
+ preview?: string;
660
+ displayName?: string;
661
+ englishName?: string;
662
+ created?: any[];
663
+ updated?: any[];
664
+ published?: any[];
665
+ unpublished?: any[];
666
+ parentModifier?: any[];
667
+ codeModifier?: any[];
668
+ enabled?: any[];
669
+ disabled?: any[];
670
+ [key: string]: any;
671
+ }
640
672
  interface TagtreesType {
641
673
  id: number;
642
674
  name: string;
643
675
  code: string;
644
676
  categoryName?: string;
645
677
  siblingOrder?: number;
646
- metadata?: {
647
- content?: string;
648
- created?: any;
649
- parentModifier?: any;
650
- updated?: any;
651
- displayName?: string;
652
- englishName?: string;
678
+ level?: number;
679
+ parent?: number;
680
+ orderInSiblings?: number;
681
+ enable?: boolean;
682
+ creationDate?: number;
683
+ category?: {
684
+ id: number;
685
+ name: string;
686
+ businessSoftSrv?: any;
687
+ creationDate?: number;
688
+ enable?: boolean;
653
689
  [key: string]: any;
654
690
  };
691
+ metadata?: TagTreeMetadata;
692
+ [key: string]: any;
655
693
  }
656
694
  interface CmsMetadata {
657
695
  content_type_id?: string;
@@ -1032,6 +1070,111 @@ interface CmsRequestOptions<TSubject = any> {
1032
1070
  headers?: HeadersInit;
1033
1071
  signal?: AbortSignal;
1034
1072
  }
1073
+ interface TagCategoryItem {
1074
+ id: number;
1075
+ name: string;
1076
+ businessSoftSrv?: any;
1077
+ creationDate?: string;
1078
+ enable?: boolean;
1079
+ desc?: string;
1080
+ [key: string]: any;
1081
+ }
1082
+ interface TagCategoryListParams {
1083
+ offset?: number;
1084
+ size?: number;
1085
+ id?: number | string;
1086
+ name?: string;
1087
+ query?: string;
1088
+ [key: string]: any;
1089
+ }
1090
+ interface CreateTagCategoryParams {
1091
+ name: string;
1092
+ desc?: string;
1093
+ [key: string]: any;
1094
+ }
1095
+ interface UpdateTagCategoryParams {
1096
+ name: string;
1097
+ desc?: string;
1098
+ enable?: boolean;
1099
+ [key: string]: any;
1100
+ }
1101
+ interface GetTagCategoriesResponse {
1102
+ referenceNumber?: string;
1103
+ hasError: boolean;
1104
+ errorCode?: number;
1105
+ refId?: string;
1106
+ message?: string | any[];
1107
+ count?: number;
1108
+ aggregations?: number;
1109
+ result: TagCategoryItem[];
1110
+ [key: string]: any;
1111
+ }
1112
+ interface GetTagTreeParams {
1113
+ parentId?: number | string;
1114
+ id?: string | number;
1115
+ parentCode?: string;
1116
+ includeParent?: boolean;
1117
+ excludeTree?: boolean;
1118
+ levelCount?: number;
1119
+ level?: number;
1120
+ name?: string;
1121
+ size?: number;
1122
+ offset?: number;
1123
+ siblingOrder?: string;
1124
+ enable?: boolean;
1125
+ [key: string]: any;
1126
+ }
1127
+ interface CreateTagTreeItemParams {
1128
+ name: string;
1129
+ parentId?: number | string;
1130
+ code?: string;
1131
+ relatedContentIds?: number[];
1132
+ icon?: string;
1133
+ description?: string;
1134
+ longDescription?: string;
1135
+ link?: string;
1136
+ target?: '_self' | '_blank' | '_parent' | '_top';
1137
+ content?: string;
1138
+ preview?: string;
1139
+ siblingOrder?: number;
1140
+ displayName?: string;
1141
+ englishName?: string;
1142
+ [key: string]: any;
1143
+ }
1144
+ interface UpdateTagTreeItemParams {
1145
+ name?: string;
1146
+ parentId?: number | string;
1147
+ code?: string;
1148
+ relatedContentIds?: number[];
1149
+ icon?: string;
1150
+ description?: string;
1151
+ longDescription?: string;
1152
+ link?: string;
1153
+ target?: '_self' | '_blank' | '_parent' | '_top';
1154
+ content?: string;
1155
+ preview?: string;
1156
+ siblingOrder?: number;
1157
+ displayName?: string;
1158
+ englishName?: string;
1159
+ [key: string]: any;
1160
+ }
1161
+ interface TagTreeAncestorsParams {
1162
+ levelCount?: number;
1163
+ level?: number;
1164
+ [key: string]: any;
1165
+ }
1166
+ interface GetTagTreeResponse {
1167
+ referenceNumber?: string;
1168
+ hasError: boolean;
1169
+ errorCode?: number;
1170
+ refId?: string;
1171
+ message?: string | any[];
1172
+ count?: number;
1173
+ aggregations?: number;
1174
+ result: TagtreesType[];
1175
+ metadata?: any[];
1176
+ [key: string]: any;
1177
+ }
1035
1178
 
1036
1179
  declare class CmsDataFormatter {
1037
1180
  private podspaceUrl;
@@ -1180,6 +1323,114 @@ declare class CmsProductService {
1180
1323
  timelineSearch(query?: TimelineSearchBody): Promise<TimelineResponse>;
1181
1324
  }
1182
1325
 
1326
+ interface CmsTagServiceOptions {
1327
+ baseUrl?: string;
1328
+ clientId: string;
1329
+ apiToken?: string;
1330
+ revalidate?: number | string;
1331
+ http?: NextHttp;
1332
+ }
1333
+ declare class CmsTagService {
1334
+ private http;
1335
+ private clientId;
1336
+ private apiToken;
1337
+ private revalidate;
1338
+ constructor(options: CmsTagServiceOptions);
1339
+ private get commonHeaders();
1340
+ private get managingHeaders();
1341
+ /**
1342
+ * Retrieves list of tag categories.
1343
+ * Swagger: GET /api/core/tags/category
1344
+ */
1345
+ getTagCategories(params?: TagCategoryListParams, options?: CmsRequestOptions): Promise<GetTagCategoriesResponse>;
1346
+ /**
1347
+ * Creates a new tag category.
1348
+ * Swagger: POST /api/core/tags/category
1349
+ */
1350
+ createTagCategory(params: CreateTagCategoryParams, options?: CmsRequestOptions): Promise<any>;
1351
+ /**
1352
+ * Retrieves single tag category by ID.
1353
+ * Swagger: GET /api/core/tags/category/{id}
1354
+ */
1355
+ getTagCategory(id: number | string, options?: CmsRequestOptions): Promise<any>;
1356
+ /**
1357
+ * Updates an existing tag category.
1358
+ * Swagger: PUT /api/core/tags/category/{id}
1359
+ */
1360
+ updateTagCategory(id: number | string, params: UpdateTagCategoryParams, options?: CmsRequestOptions): Promise<any>;
1361
+ /**
1362
+ * Publishes a tag category.
1363
+ * Swagger: PUT /api/core/tags/category/{id}/publish
1364
+ */
1365
+ publishTagCategory(id: number | string, options?: CmsRequestOptions): Promise<any>;
1366
+ /**
1367
+ * Unpublishes a tag category.
1368
+ * Swagger: PUT /api/core/tags/category/{id}/unpublish
1369
+ */
1370
+ unpublishTagCategory(id: number | string, options?: CmsRequestOptions): Promise<any>;
1371
+ /**
1372
+ * Retrieves enabled published tag tree for category (defaults to 'root').
1373
+ * End user call (without requiring Access-Token).
1374
+ * Swagger: GET /api/core/tags/{categoryId}/tree/enable
1375
+ */
1376
+ getTagTree(categoryId?: string | number, params?: GetTagTreeParams, options?: CmsRequestOptions): Promise<GetTagTreeResponse>;
1377
+ /**
1378
+ * Retrieves tag tree for category with management credentials.
1379
+ * Swagger: GET /api/core/tags/{categoryId}/tree/manage
1380
+ */
1381
+ getManageTagTree(categoryId: string | number, params?: GetTagTreeParams, options?: CmsRequestOptions): Promise<GetTagTreeResponse>;
1382
+ /**
1383
+ * Creates a new tag tree node for category.
1384
+ * Swagger: POST /api/core/tags/{categoryId}/tree
1385
+ */
1386
+ createTagTreeItem(categoryId: string | number, params: CreateTagTreeItemParams, options?: CmsRequestOptions): Promise<any>;
1387
+ /**
1388
+ * Shows a single enabled tag tree item for end users.
1389
+ * Swagger: GET /api/core/tags/{categoryId}/tree/{id}/enable
1390
+ */
1391
+ getTagTreeItem(categoryId: string | number, id: number | string, options?: CmsRequestOptions): Promise<any>;
1392
+ /**
1393
+ * Shows a single tag tree item for manager (with token).
1394
+ * Swagger: GET /api/core/tags/{categoryId}/tree/{id}/manage
1395
+ */
1396
+ getManageTagTreeItem(categoryId: string | number, id: number | string, options?: CmsRequestOptions): Promise<any>;
1397
+ /**
1398
+ * Updates an existing tag tree node.
1399
+ * Swagger: PUT /api/core/tags/{categoryId}/tree/{id}
1400
+ */
1401
+ updateTagTreeItem(categoryId: string | number, id: number | string, params: UpdateTagTreeItemParams, options?: CmsRequestOptions): Promise<any>;
1402
+ /**
1403
+ * Publishes a tag tree item.
1404
+ * Swagger: PUT /api/core/tags/{categoryId}/tree/publish/{id}
1405
+ */
1406
+ publishTagTreeItem(categoryId: string | number, id: number | string, options?: CmsRequestOptions): Promise<any>;
1407
+ /**
1408
+ * Unpublishes a tag tree item.
1409
+ * Swagger: PUT /api/core/tags/{categoryId}/tree/unpublish/{id}
1410
+ */
1411
+ unpublishTagTreeItem(categoryId: string | number, id: number | string, options?: CmsRequestOptions): Promise<any>;
1412
+ /**
1413
+ * Updates the parent of a tag tree item.
1414
+ * Swagger: PUT /api/core/tags/{categoryId}/tree/parent/{id}
1415
+ */
1416
+ updateTagTreeParent(categoryId: string | number, id: number | string, parentId?: number | string, options?: CmsRequestOptions): Promise<any>;
1417
+ /**
1418
+ * Retrieves tag tree ancestors for end user.
1419
+ * Swagger: GET /api/core/tags/{categoryId}/tree/parent/{id}/enable
1420
+ */
1421
+ getTagTreeAncestors(categoryId: string | number, id: number | string, params?: TagTreeAncestorsParams, options?: CmsRequestOptions): Promise<GetTagTreeResponse>;
1422
+ /**
1423
+ * Retrieves tag tree ancestors for manager (with token).
1424
+ * Swagger: GET /api/core/tags/{categoryId}/tree/parent/{id}/manage
1425
+ */
1426
+ getManageTagTreeAncestors(categoryId: string | number, id: number | string, params?: TagTreeAncestorsParams, options?: CmsRequestOptions): Promise<GetTagTreeResponse>;
1427
+ /**
1428
+ * Updates tag tree code for category.
1429
+ * Swagger: PUT /api/core/tags/{categoryId}/tree/code/{id}
1430
+ */
1431
+ updateTagTreeCode(categoryId: string | number, id: number | string, code: string, options?: CmsRequestOptions): Promise<any>;
1432
+ }
1433
+
1183
1434
  interface CmsServiceOptions {
1184
1435
  baseUrl: string;
1185
1436
  clientId: string;
@@ -1198,6 +1449,11 @@ declare class CmsService {
1198
1449
  * Swagger: tag=product
1199
1450
  */
1200
1451
  readonly products: CmsProductService;
1452
+ /**
1453
+ * Dedicated CMS Tags & Tag Categories sub-service.
1454
+ * Swagger: tag=tags
1455
+ */
1456
+ readonly tags: CmsTagService;
1201
1457
  constructor(options: CmsServiceOptions);
1202
1458
  private get commonHeaders();
1203
1459
  private get managingHeaders();
@@ -1358,7 +1614,8 @@ declare class CmsService {
1358
1614
  getDislikes(contentUniqueId: string, entityId: number | string, params?: GetReactionsParams): Promise<any>;
1359
1615
  /**
1360
1616
  * Retrieves tag/category tree.
1361
- * Swagger: GET /api/core/tags/root/tree/enable
1617
+ * Backward-compatible delegate pointing to `cms.tags.getTagTree('root', params, options)`.
1618
+ * Swagger: GET /api/core/tags/{categoryId}/tree/enable
1362
1619
  */
1363
1620
  getCategories(params?: GetCategoriesParams, options?: CmsRequestOptions): Promise<GetCategoryResponse>;
1364
1621
  /**
@@ -1401,12 +1658,13 @@ interface IumsResponse<T = any> {
1401
1658
  }
1402
1659
 
1403
1660
  interface IumsServiceOptions {
1404
- baseUrl: string;
1661
+ baseUrl?: string;
1405
1662
  clientId: string;
1406
1663
  revalidate?: number | string;
1407
1664
  }
1408
1665
  declare class IumsService {
1409
1666
  private http;
1667
+ private baseUrl;
1410
1668
  private clientId;
1411
1669
  private revalidate;
1412
1670
  constructor(options: IumsServiceOptions);
@@ -1429,8 +1687,10 @@ declare class PodSdk {
1429
1687
  readonly social: SocialService;
1430
1688
  readonly cms: CmsService;
1431
1689
  readonly product: CmsProductService;
1690
+ readonly tags: CmsTagService;
1432
1691
  readonly iums: IumsService;
1433
- constructor(config: PodSdkConfig);
1692
+ readonly urls: Required<PodUrlsConfig>;
1693
+ constructor(config?: PodSdkConfig);
1434
1694
  /**
1435
1695
  * Helper shortcut to instantiate a Generic CRUD repository for any entity type on POD CustomPost.
1436
1696
  */
@@ -1441,6 +1701,38 @@ declare class PodSdk {
1441
1701
  */
1442
1702
  declare function createPodSdk(config: PodSdkConfig): PodSdk;
1443
1703
 
1704
+ /**
1705
+ * Official POD Platform Production URLs.
1706
+ */
1707
+ declare const DEFAULT_POD_URLS: Required<PodUrlsConfig>;
1708
+ /**
1709
+ * Official POD Platform Sandbox URLs for development and testing.
1710
+ */
1711
+ declare const SANDBOX_POD_URLS: Required<PodUrlsConfig>;
1712
+ /**
1713
+ * Resolves full POD URL configuration with the following priority:
1714
+ * 1. Explicit user overrides in `config.urls`
1715
+ * 2. Next.js / Node environment variables (`process.env.NEXT_PUBLIC_*`)
1716
+ * 3. Default production / sandbox URLs
1717
+ *
1718
+ * Supported Environment Variables:
1719
+ * - `NEXT_PUBLIC_ACCOUNTS_URL`
1720
+ * - `NEXT_PUBLIC_API_POD_URL`
1721
+ * - `NEXT_PUBLIC_API_POD_SANDBOX_URL`
1722
+ * - `NEXT_PUBLIC_CMS_URL`
1723
+ * - `NEXT_PUBLIC_IUMS_URL`
1724
+ * - `NEXT_PUBLIC_NOTIFICATION_URL`
1725
+ * - `NEXT_PUBLIC_PODREPORT_URL`
1726
+ * - `NEXT_PUBLIC_PODSPACE_URL`
1727
+ * - `NEXT_PUBLIC_SANDBOX_CMS_URL`
1728
+ * - `NEXT_PUBLIC_SANDBOX_CMS_CLIENT_URL`
1729
+ * - `NEXT_PUBLIC_SANDBOX_PODSPACE_URL`
1730
+ * - `NEXT_PUBLIC_SANDBOX_STREAM_URL`
1731
+ * - `NEXT_PUBLIC_PODFORM_URL`
1732
+ * - `NEXT_PUBLIC_WEBSITE_URL`
1733
+ */
1734
+ declare function resolvePodUrls(urls?: PodUrlsConfig, sandbox?: boolean): Required<PodUrlsConfig>;
1735
+
1444
1736
  /**
1445
1737
  * Cryptographic and encoding utilities for POD Platform services.
1446
1738
  * Uses standard Web Crypto API (supported natively in Node.js 18+, Browsers, and Edge).
@@ -1448,4 +1740,4 @@ declare function createPodSdk(config: PodSdkConfig): PodSdk;
1448
1740
  declare function encodeBase64(str: string): string;
1449
1741
  declare function generatePodSignatureHeader(keyId: string, privateKeyPem?: string): Promise<string>;
1450
1742
 
1451
- export { type AddCommentParams, type AddContentParams, type AddCustomPostParams, type AddCustomPostResponse, type AddProductParams, type ArchiveParams, type ArchiveProductParams, type BatchPublishParams, type BatchPublishProductParams, type BatchUnpublishParams, type BatchUnpublishProductParams, type Business, CmsDataFormatter, type CmsMetadata, CmsProductService, type CmsProductServiceOptions, type CmsRequestOptions, CmsService, type CmsServiceOptions, type CommentItem, type ContentBody, type CustomPostCrudConfig, CustomPostCrudService, type CustomPostItem, CustomPostService, type CustomPostServiceOptions, type EditContentParams, type EditProductParams, type FormattedGetContentResponse, type FormattedGetProductResponse, type FormattedProductSubject, type FormattedSubject, type GetCategoriesParams, type GetCategoryResponse, type GetCommentListParams, type GetCommentsParams, type GetContentByEntityIdParams, type GetContentParams, type GetContentResponse, type GetCustomPostParams, type GetCustomPostResponse, type GetInfOfGraduatedByGraduateDateResponse, type GetProductByEntityIdParams, type GetProductParams, type GetProductResponse, type GetReactionsParams, type GetSessionClassInCurrentDayResponse, type HandshakeResponse, type IumsResponse, IumsService, type IumsServiceOptions, type LikeCommentParams, type LikePostParams, type MetaContent, type Metadata, NotificationService, type NotificationServiceOptions, type PodFormItem, type PodFormResponse, PodFormService, type PodFormServiceOptions, type PodResponse, PodSdk, type PodSdkConfig, type PodUrlsConfig, PodspaceService, type PodspaceServiceOptions, type PodspaceUploadResponse, type PodspaceUploadResult, type ProductBody, type ProductItem, type ProductItemWithFormatted, type Rate, type ResultItem, type ResultItemWithFormatted, type SearchTimelineByMetadataParam, type SearchTimelineParamMetaQuery, type SearchTimelineResponse, type SearchTimelineResultItem, type SendOtpOptions, type SendSmsParams, type SendSmsResponse, type SeoType, type SocialResponse, SocialService, type SocialServiceOptions, SsoService, type SsoServiceOptions, type SsoUserProfile, type Subject, type TagtreesType, type TimelineResponse, type TimelineSearchBody, type TokenResponse, type UpdateCustomPostParams, type UserPostInfo, type VerifyResponse, createPodSdk, PodSdk as default, encodeBase64, generatePodSignatureHeader };
1743
+ export { type AddCommentParams, type AddContentParams, type AddCustomPostParams, type AddCustomPostResponse, type AddProductParams, type ArchiveParams, type ArchiveProductParams, type BatchPublishParams, type BatchPublishProductParams, type BatchUnpublishParams, type BatchUnpublishProductParams, type Business, CmsDataFormatter, type CmsMetadata, CmsProductService, type CmsProductServiceOptions, type CmsRequestOptions, CmsService, type CmsServiceOptions, CmsTagService, type CmsTagServiceOptions, type CommentItem, type ContentBody, type CreateTagCategoryParams, type CreateTagTreeItemParams, type CustomPostCrudConfig, CustomPostCrudService, type CustomPostItem, CustomPostService, type CustomPostServiceOptions, DEFAULT_POD_URLS, type EditContentParams, type EditProductParams, type FormattedGetContentResponse, type FormattedGetProductResponse, type FormattedProductSubject, type FormattedSubject, type GetCategoriesParams, type GetCategoryResponse, type GetCommentListParams, type GetCommentsParams, type GetContentByEntityIdParams, type GetContentParams, type GetContentResponse, type GetCustomPostParams, type GetCustomPostResponse, type GetInfOfGraduatedByGraduateDateResponse, type GetProductByEntityIdParams, type GetProductParams, type GetProductResponse, type GetReactionsParams, type GetSessionClassInCurrentDayResponse, type GetTagCategoriesResponse, type GetTagTreeParams, type GetTagTreeResponse, type HandshakeResponse, type IumsResponse, IumsService, type IumsServiceOptions, type LikeCommentParams, type LikePostParams, type MetaContent, type Metadata, NotificationService, type NotificationServiceOptions, type PodFormItem, type PodFormResponse, PodFormService, type PodFormServiceOptions, type PodResponse, PodSdk, type PodSdkConfig, type PodUrlsConfig, PodspaceService, type PodspaceServiceOptions, type PodspaceUploadResponse, type PodspaceUploadResult, type ProductBody, type ProductItem, type ProductItemWithFormatted, type Rate, type ResultItem, type ResultItemWithFormatted, SANDBOX_POD_URLS, type SearchTimelineByMetadataParam, type SearchTimelineParamMetaQuery, type SearchTimelineResponse, type SearchTimelineResultItem, type SendOtpOptions, type SendSmsParams, type SendSmsResponse, type SeoType, type SocialResponse, SocialService, type SocialServiceOptions, SsoService, type SsoServiceOptions, type SsoUserProfile, type Subject, type TagCategoryItem, type TagCategoryListParams, type TagTreeAncestorsParams, type TagTreeMetadata, type TagtreesType, type TimelineResponse, type TimelineSearchBody, type TokenResponse, type UpdateCustomPostParams, type UpdateTagCategoryParams, type UpdateTagTreeItemParams, type UserPostInfo, type VerifyResponse, createPodSdk, PodSdk as default, encodeBase64, generatePodSignatureHeader, resolvePodUrls };