@rezamirzapour/pod-sdk 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +100 -9
- package/dist/index.d.mts +555 -4
- package/dist/index.d.ts +555 -4
- package/dist/index.js +1210 -44
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1206 -45
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -24,17 +24,18 @@
|
|
|
24
24
|
---
|
|
25
25
|
|
|
26
26
|
## Microservices Included
|
|
27
|
-
|
|
28
|
-
| Service | Accessor | Swagger Tag | Description |
|
|
29
|
-
| :--- | :--- | :--- | :--- |
|
|
30
|
-
| **CMS Content** | `sdk.cms` | `content` | Fetch, publish, edit, draft, archive, and categorize CMS articles with generic metadata `<T, P>`. |
|
|
31
|
-
| **CMS Product** | `sdk.product` / `sdk.cms.products` | `product` | Product catalog, price & discount range filters, barcode lookup, batch publish, and AI search. |
|
|
32
|
-
| **CMS Tags & Tree** | `sdk.tags` / `sdk.cms.tags` | `tags` | Manage tag categories and hierarchical tag trees (nodes, parent updates, ancestors, codes). |
|
|
27
|
+
|
|
28
|
+
| Service | Accessor | Swagger Tag | Description |
|
|
29
|
+
| :--- | :--- | :--- | :--- |
|
|
30
|
+
| **CMS Content** | `sdk.cms` | `content` | Fetch, publish, edit, draft, archive, and categorize CMS articles with generic metadata `<T, P>`. |
|
|
31
|
+
| **CMS Product** | `sdk.product` / `sdk.cms.products` | `product` | Product catalog, price & discount range filters, barcode lookup, batch publish, and AI search. |
|
|
32
|
+
| **CMS Tags & Tree** | `sdk.tags` / `sdk.cms.tags` | `tags` | Manage tag categories and hierarchical tag trees (nodes, parent updates, ancestors, codes). |
|
|
33
|
+
| **CMS Content Types** | `sdk.contentType` / `sdk.cms.contentTypes` | `content-type` / `related-content-type` | Content type schema management, attribute templates, IGs, multi-invoice percentages, and related content type fields. |
|
|
33
34
|
| **CustomPost** | `sdk.customPost` | - | Search timeline by metadata `<T>`, custom post CRUD, and high-level typed repository. |
|
|
34
35
|
| **SSO** | `sdk.sso` | - | OAuth2 handshake, OTP dispatch with digital RSA signature, OTP verify, token generation, and user profile. |
|
|
35
36
|
| **Captcha** | `sdk.captcha` | `captcha` | Generate SVG/PNG captcha images with configurable options and verify submitted values. |
|
|
36
37
|
| **Podspace** | `sdk.podspace` | `public-apis` | Complete Cloud Storage: file/image uploads, resumable chunked uploads, folders, versions, share links, workspaces, trash, tags, & metadata. |
|
|
37
|
-
| **Podform** | `sdk.podform` | - | Survey & form response submission, question/form structure retrieval. |
|
|
38
|
+
| **Podform** | `sdk.podform` | - | Survey & form response submission, question/form structure retrieval. |
|
|
38
39
|
| **Notification** | `sdk.notification` | - | SMS delivery and bulk messaging with tracking. |
|
|
39
40
|
| **Social** | `sdk.social` | - | User comments, reactions (likes/dislikes), rates, and social post interactions. |
|
|
40
41
|
| **IUMS** | `sdk.iums` | - | Student and user identity inspection by national code or student ID. |
|
|
@@ -576,7 +577,97 @@ const ancestors = await podSdk.tags.getTagTreeAncestors('technology', nodeId);
|
|
|
576
577
|
|
|
577
578
|
---
|
|
578
579
|
|
|
579
|
-
## Deep Dive 4:
|
|
580
|
+
## Deep Dive 4: CMS Content Types & Related Content Types (RAD API Swagger: tag=content-type, tag=related-content-type)
|
|
581
|
+
|
|
582
|
+
Manage CMS content type schemas, classification templates, multi-invoice percentages, and related content type field definitions ([Swagger documentation](https://rad-services.pod.ir/api/documentation?tag=content-type)).
|
|
583
|
+
|
|
584
|
+
### Accessing Content Type Services
|
|
585
|
+
|
|
586
|
+
Access via `podSdk.contentType`, `podSdk.contentTypes`, or `podSdk.cms.contentTypes`:
|
|
587
|
+
|
|
588
|
+
```typescript
|
|
589
|
+
// 1. List content types (with bracket query array format: excludeItems[]=drafts)
|
|
590
|
+
const contentTypes = await podSdk.contentType.getContentTypes({
|
|
591
|
+
excludeItems: ['drafts'],
|
|
592
|
+
});
|
|
593
|
+
|
|
594
|
+
// 2. Get single content type detail
|
|
595
|
+
const ct = await podSdk.contentType.getContentType('article');
|
|
596
|
+
|
|
597
|
+
// 3. Create a new content type
|
|
598
|
+
await podSdk.contentType.createContentType({
|
|
599
|
+
name: 'Magazine Article',
|
|
600
|
+
code: 'magazine_article',
|
|
601
|
+
type: 'ARTICLE',
|
|
602
|
+
description: 'Custom magazine articles schema',
|
|
603
|
+
tags: ['editorial'],
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
// 4. Update content type
|
|
607
|
+
await podSdk.contentType.updateContentType('magazine_article', {
|
|
608
|
+
name: 'Updated Magazine Article',
|
|
609
|
+
description: 'Updated description',
|
|
610
|
+
});
|
|
611
|
+
|
|
612
|
+
// 5. Templates & Category trees
|
|
613
|
+
const templates = await podSdk.contentType.getTemplates({ size: 10 });
|
|
614
|
+
const igs = await podSdk.contentType.getTemplateIgs({ showLatestVersion: true });
|
|
615
|
+
const categories = await podSdk.contentType.getTemplateCategories({ maxLevel: 3 });
|
|
616
|
+
|
|
617
|
+
// 6. Archive / Unarchive content types
|
|
618
|
+
await podSdk.contentType.archiveContentTypes([101, 102]);
|
|
619
|
+
await podSdk.contentType.unarchiveContentTypes([101]);
|
|
620
|
+
|
|
621
|
+
// 7. Multi-Invoice Percent Management
|
|
622
|
+
await podSdk.contentType.addMultiInvoicePercent('magazine_article', {
|
|
623
|
+
main: 10,
|
|
624
|
+
provider: 20,
|
|
625
|
+
seller: 70,
|
|
626
|
+
dealerBusinessId: [12345],
|
|
627
|
+
});
|
|
628
|
+
|
|
629
|
+
// 8. Related Content Types Fields
|
|
630
|
+
await podSdk.contentType.addRelatedContentTypes('magazine_article', [
|
|
631
|
+
{
|
|
632
|
+
code: 'author_profile',
|
|
633
|
+
title: 'Author Profile',
|
|
634
|
+
mandatory: true,
|
|
635
|
+
ui_type: 'DropdownList',
|
|
636
|
+
},
|
|
637
|
+
]);
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
### Content Type Methods Reference (`podSdk.contentType` / `podSdk.cms.contentTypes`)
|
|
641
|
+
|
|
642
|
+
| Method | HTTP | Path | Description |
|
|
643
|
+
| :--- | :--- | :--- | :--- |
|
|
644
|
+
| `getTemplates(params)` | `GET` | `/api/core/content-types/templates` | List all attribute templates. |
|
|
645
|
+
| `getTemplateIgs(params)` | `GET` | `/api/core/content-types/template-igs` | List template IG classifications. |
|
|
646
|
+
| `getTemplateCategories(params)` | `GET` | `/api/core/content-types/template-categories` | List template category nodes. |
|
|
647
|
+
| `getContentTypes(params)` | `GET` | `/api/core/content-types` | List all content types. |
|
|
648
|
+
| `getMyContentTypes(params)` | `GET` | `/api/core/content-types/my` | List current client's content types. |
|
|
649
|
+
| `getContentType(uniqueId, params)` | `GET` | `/api/core/content-types/{contentTypeUniqueId}` | Get single content type. |
|
|
650
|
+
| `getEnabledContentType(uniqueId, params)` | `GET` | `/api/core/content-types/{contentTypeUniqueId}/enable` | Get enabled content type. |
|
|
651
|
+
| `getContentTypeFields(uniqueId)` | `GET` | `/api/core/content-types/{contentTypeUniqueId}/fields` | Get all fields (self & related). |
|
|
652
|
+
| `getBrief(params)` | `GET` | `/api/core/content-types/brief` | List brief content types. |
|
|
653
|
+
| `createContentType(params)` | `POST` | `/api/core/content-types` | Create new content type. |
|
|
654
|
+
| `updateContentType(uniqueId, params)` | `POST` | `/api/core/content-types/{unique_id}` | Update content type. |
|
|
655
|
+
| `updateMyContentType(uniqueId, params)` | `POST` | `/api/core/content-types/my/{unique_id}` | Update client's content type. |
|
|
656
|
+
| `getArchivedContentTypes(params)` | `GET` | `/api/core/content-types/archive` | List archived content types. |
|
|
657
|
+
| `archiveContentTypes(postIds)` | `POST` | `/api/core/content-types/archive` | Archive content types by postIds. |
|
|
658
|
+
| `unarchiveContentTypes(postIds)` | `POST` | `/api/core/content-types/unarchive` | Unarchive content types by postIds. |
|
|
659
|
+
| `getMultiInvoiceShares(uniqueId, params)` | `GET` | `/api/core/content-types/{contentTypeUniqueId}/multi-invoice-share` | List multi-invoice percentage shares. |
|
|
660
|
+
| `addMultiInvoicePercent(uniqueId, params)` | `POST` | `/api/core/content-types/{contentTypeUniqueId}/multi-invoice-percent` | Add multi-invoice percent config. |
|
|
661
|
+
| `updateMultiInvoicePercent(uniqueId, params)` | `PUT` | `/api/core/content-types/{contentTypeUniqueId}/multi-invoice-percent` | Update multi-invoice percent config. |
|
|
662
|
+
| `deleteMultiInvoicePercent(uniqueId, params)` | `DELETE` | `/api/core/content-types/{contentTypeUniqueId}/multi-invoice-percent` | Delete multi-invoice percent config. |
|
|
663
|
+
| `getRelatedContentTypes(uniqueId)` | `GET` | `/api/core/related-content-types/{contentTypeUniqueId}` | Get related content type fields. |
|
|
664
|
+
| `addRelatedContentTypes(uniqueId, body)` | `POST` | `/api/core/related-content-types/{contentTypeUniqueId}` | Add related content type fields. |
|
|
665
|
+
| `deleteRelatedContentType(uniqueId, code)` | `POST` | `/api/core/related-content-types/delete/{contentTypeUniqueId}` | Delete related content type field. |
|
|
666
|
+
| `updateRelatedContentTypes(uniqueId, body)` | `POST` | `/api/core/related-content-types/update/{contentTypeUniqueId}` | Update related content type fields. |
|
|
667
|
+
|
|
668
|
+
---
|
|
669
|
+
|
|
670
|
+
## Deep Dive 5: CustomPost & Generic Typed Repositories
|
|
580
671
|
|
|
581
672
|
`CustomPost` allows persisting arbitrary JSON schemas on the POD Platform. `@rezamirzapour/pod-sdk` provides two complementary approaches:
|
|
582
673
|
|
|
@@ -609,7 +700,7 @@ export async function getPublishedPosts() {
|
|
|
609
700
|
|
|
610
701
|
---
|
|
611
702
|
|
|
612
|
-
## Deep Dive
|
|
703
|
+
## Deep Dive 6: Podspace Cloud Storage (Official Swagger API)
|
|
613
704
|
|
|
614
705
|
The **Podspace** module provides complete enterprise integration with the official POD Podspace Cloud Storage service ([Swagger documentation: `podspace.sandpod.ir/api/docs`](http://podspace.sandpod.ir/api/docs)). It supports standard and resumable uploads, public/private files, dynamic CDN image transformations, folder hierarchy, file versioning, public share links, trash recovery, team workspaces, user groups, and custom metadata.
|
|
615
706
|
|