@rezamirzapour/pod-sdk 1.0.11 → 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 +498 -1
- package/dist/index.d.ts +498 -1
- package/dist/index.js +612 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +612 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3521,6 +3521,577 @@ var CmsTagService = class {
|
|
|
3521
3521
|
);
|
|
3522
3522
|
}
|
|
3523
3523
|
};
|
|
3524
|
+
var CmsContentTypeService = class {
|
|
3525
|
+
http;
|
|
3526
|
+
clientId;
|
|
3527
|
+
apiToken;
|
|
3528
|
+
revalidate;
|
|
3529
|
+
constructor(options) {
|
|
3530
|
+
this.clientId = options.clientId || "";
|
|
3531
|
+
this.apiToken = options.apiToken || "";
|
|
3532
|
+
this.revalidate = Number(options.revalidate) || 0;
|
|
3533
|
+
this.http = options.http || http.createNextHttp({
|
|
3534
|
+
baseUrl: options.baseUrl || "https://api.pod.ir/srv/cms-server",
|
|
3535
|
+
serviceName: "POD-CMS-CONTENT-TYPE",
|
|
3536
|
+
queryArrayFormat: "brackets"
|
|
3537
|
+
});
|
|
3538
|
+
}
|
|
3539
|
+
normalizeParams(params) {
|
|
3540
|
+
const arrayFields = [
|
|
3541
|
+
"excludeItems",
|
|
3542
|
+
"tagTreeCategoryIds",
|
|
3543
|
+
"tags",
|
|
3544
|
+
"tagTrees",
|
|
3545
|
+
"webhookServices",
|
|
3546
|
+
"webhookUrls",
|
|
3547
|
+
"webhookDurations",
|
|
3548
|
+
"webhookEnables",
|
|
3549
|
+
"webhookHeaders",
|
|
3550
|
+
"excludeFields",
|
|
3551
|
+
"postIds",
|
|
3552
|
+
"dealerBusinessId",
|
|
3553
|
+
"dealerBusinessShareType",
|
|
3554
|
+
"dealerBusinessShare"
|
|
3555
|
+
];
|
|
3556
|
+
const result = { ...params };
|
|
3557
|
+
for (const field of arrayFields) {
|
|
3558
|
+
if (result[field] !== void 0 && result[field] !== null && !Array.isArray(result[field])) {
|
|
3559
|
+
result[field] = [result[field]];
|
|
3560
|
+
}
|
|
3561
|
+
}
|
|
3562
|
+
return result;
|
|
3563
|
+
}
|
|
3564
|
+
get commonHeaders() {
|
|
3565
|
+
return {
|
|
3566
|
+
"Client-Id": this.clientId,
|
|
3567
|
+
"Content-Type": "application/json"
|
|
3568
|
+
};
|
|
3569
|
+
}
|
|
3570
|
+
get managingHeaders() {
|
|
3571
|
+
return {
|
|
3572
|
+
...this.commonHeaders,
|
|
3573
|
+
"Access-Token": this.apiToken
|
|
3574
|
+
};
|
|
3575
|
+
}
|
|
3576
|
+
// =========================================================================
|
|
3577
|
+
// 1. TEMPLATES & CLASSIFICATIONS (Swagger: tag=content-type)
|
|
3578
|
+
// =========================================================================
|
|
3579
|
+
/**
|
|
3580
|
+
* Retrieves list of all attribute templates.
|
|
3581
|
+
* Swagger: GET /api/core/content-types/templates
|
|
3582
|
+
*/
|
|
3583
|
+
async getTemplates(params = {}, options = {}) {
|
|
3584
|
+
try {
|
|
3585
|
+
return await this.http.get(
|
|
3586
|
+
"/api/core/content-types/templates",
|
|
3587
|
+
{
|
|
3588
|
+
params: this.normalizeParams(params),
|
|
3589
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3590
|
+
headers: {
|
|
3591
|
+
...this.managingHeaders,
|
|
3592
|
+
...options.headers
|
|
3593
|
+
},
|
|
3594
|
+
cache: options.cache,
|
|
3595
|
+
signal: options.signal,
|
|
3596
|
+
next: {
|
|
3597
|
+
revalidate: options.revalidate !== void 0 ? options.revalidate === false ? 0 : options.revalidate : this.revalidate
|
|
3598
|
+
}
|
|
3599
|
+
}
|
|
3600
|
+
);
|
|
3601
|
+
} catch {
|
|
3602
|
+
return { hasError: true, result: [] };
|
|
3603
|
+
}
|
|
3604
|
+
}
|
|
3605
|
+
/**
|
|
3606
|
+
* Retrieves classification IG lists (end user).
|
|
3607
|
+
* Swagger: GET /api/core/content-types/template-igs
|
|
3608
|
+
*/
|
|
3609
|
+
async getTemplateIgs(params = {}, options = {}) {
|
|
3610
|
+
try {
|
|
3611
|
+
return await this.http.get(
|
|
3612
|
+
"/api/core/content-types/template-igs",
|
|
3613
|
+
{
|
|
3614
|
+
params: this.normalizeParams(params),
|
|
3615
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3616
|
+
headers: {
|
|
3617
|
+
...this.commonHeaders,
|
|
3618
|
+
...options.headers
|
|
3619
|
+
},
|
|
3620
|
+
cache: options.cache,
|
|
3621
|
+
signal: options.signal,
|
|
3622
|
+
next: {
|
|
3623
|
+
revalidate: options.revalidate !== void 0 ? options.revalidate === false ? 0 : options.revalidate : this.revalidate
|
|
3624
|
+
}
|
|
3625
|
+
}
|
|
3626
|
+
);
|
|
3627
|
+
} catch {
|
|
3628
|
+
return { hasError: true, result: [] };
|
|
3629
|
+
}
|
|
3630
|
+
}
|
|
3631
|
+
/**
|
|
3632
|
+
* Retrieves template category lists (end user).
|
|
3633
|
+
* Swagger: GET /api/core/content-types/template-categories
|
|
3634
|
+
*/
|
|
3635
|
+
async getTemplateCategories(params = {}, options = {}) {
|
|
3636
|
+
try {
|
|
3637
|
+
return await this.http.get(
|
|
3638
|
+
"/api/core/content-types/template-categories",
|
|
3639
|
+
{
|
|
3640
|
+
params: this.normalizeParams(params),
|
|
3641
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3642
|
+
headers: {
|
|
3643
|
+
...this.commonHeaders,
|
|
3644
|
+
...options.headers
|
|
3645
|
+
},
|
|
3646
|
+
cache: options.cache,
|
|
3647
|
+
signal: options.signal,
|
|
3648
|
+
next: {
|
|
3649
|
+
revalidate: options.revalidate !== void 0 ? options.revalidate === false ? 0 : options.revalidate : this.revalidate
|
|
3650
|
+
}
|
|
3651
|
+
}
|
|
3652
|
+
);
|
|
3653
|
+
} catch {
|
|
3654
|
+
return { hasError: true, result: [] };
|
|
3655
|
+
}
|
|
3656
|
+
}
|
|
3657
|
+
// =========================================================================
|
|
3658
|
+
// 2. CONTENT TYPES CRUD & LISTING (Swagger: tag=content-type)
|
|
3659
|
+
// =========================================================================
|
|
3660
|
+
/**
|
|
3661
|
+
* Retrieves list of all content types.
|
|
3662
|
+
* Swagger: GET /api/core/content-types
|
|
3663
|
+
*/
|
|
3664
|
+
async getContentTypes(params = {}, options = {}) {
|
|
3665
|
+
try {
|
|
3666
|
+
return await this.http.get(
|
|
3667
|
+
"/api/core/content-types",
|
|
3668
|
+
{
|
|
3669
|
+
params: this.normalizeParams(params),
|
|
3670
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3671
|
+
headers: {
|
|
3672
|
+
...this.managingHeaders,
|
|
3673
|
+
...options.headers
|
|
3674
|
+
},
|
|
3675
|
+
cache: options.cache,
|
|
3676
|
+
signal: options.signal,
|
|
3677
|
+
next: {
|
|
3678
|
+
revalidate: options.revalidate !== void 0 ? options.revalidate === false ? 0 : options.revalidate : this.revalidate
|
|
3679
|
+
}
|
|
3680
|
+
}
|
|
3681
|
+
);
|
|
3682
|
+
} catch {
|
|
3683
|
+
return { hasError: true, result: [] };
|
|
3684
|
+
}
|
|
3685
|
+
}
|
|
3686
|
+
/**
|
|
3687
|
+
* Retrieves list of current client's content types.
|
|
3688
|
+
* Swagger: GET /api/core/content-types/my
|
|
3689
|
+
*/
|
|
3690
|
+
async getMyContentTypes(params = {}, options = {}) {
|
|
3691
|
+
try {
|
|
3692
|
+
return await this.http.get(
|
|
3693
|
+
"/api/core/content-types/my",
|
|
3694
|
+
{
|
|
3695
|
+
params: this.normalizeParams(params),
|
|
3696
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3697
|
+
headers: {
|
|
3698
|
+
...this.managingHeaders,
|
|
3699
|
+
...options.headers
|
|
3700
|
+
},
|
|
3701
|
+
cache: options.cache,
|
|
3702
|
+
signal: options.signal,
|
|
3703
|
+
next: {
|
|
3704
|
+
revalidate: options.revalidate !== void 0 ? options.revalidate === false ? 0 : options.revalidate : this.revalidate
|
|
3705
|
+
}
|
|
3706
|
+
}
|
|
3707
|
+
);
|
|
3708
|
+
} catch {
|
|
3709
|
+
return { hasError: true, result: [] };
|
|
3710
|
+
}
|
|
3711
|
+
}
|
|
3712
|
+
/**
|
|
3713
|
+
* Retrieves a single content type by unique ID.
|
|
3714
|
+
* Swagger: GET /api/core/content-types/{contentTypeUniqueId}
|
|
3715
|
+
*/
|
|
3716
|
+
async getContentType(contentTypeUniqueId, params = {}, options = {}) {
|
|
3717
|
+
try {
|
|
3718
|
+
return await this.http.get(
|
|
3719
|
+
`/api/core/content-types/${contentTypeUniqueId}`,
|
|
3720
|
+
{
|
|
3721
|
+
params: this.normalizeParams(params),
|
|
3722
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3723
|
+
headers: {
|
|
3724
|
+
...this.managingHeaders,
|
|
3725
|
+
...options.headers
|
|
3726
|
+
},
|
|
3727
|
+
cache: options.cache,
|
|
3728
|
+
signal: options.signal,
|
|
3729
|
+
next: {
|
|
3730
|
+
revalidate: options.revalidate !== void 0 ? options.revalidate === false ? 0 : options.revalidate : this.revalidate
|
|
3731
|
+
}
|
|
3732
|
+
}
|
|
3733
|
+
);
|
|
3734
|
+
} catch {
|
|
3735
|
+
return { hasError: true, result: {} };
|
|
3736
|
+
}
|
|
3737
|
+
}
|
|
3738
|
+
/**
|
|
3739
|
+
* Retrieves an enabled content type by unique ID.
|
|
3740
|
+
* Swagger: GET /api/core/content-types/{contentTypeUniqueId}/enable
|
|
3741
|
+
*/
|
|
3742
|
+
async getEnabledContentType(contentTypeUniqueId, params = {}, options = {}) {
|
|
3743
|
+
try {
|
|
3744
|
+
return await this.http.get(
|
|
3745
|
+
`/api/core/content-types/${contentTypeUniqueId}/enable`,
|
|
3746
|
+
{
|
|
3747
|
+
params: this.normalizeParams(params),
|
|
3748
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3749
|
+
headers: {
|
|
3750
|
+
...this.managingHeaders,
|
|
3751
|
+
...options.headers
|
|
3752
|
+
},
|
|
3753
|
+
cache: options.cache,
|
|
3754
|
+
signal: options.signal,
|
|
3755
|
+
next: {
|
|
3756
|
+
revalidate: options.revalidate !== void 0 ? options.revalidate === false ? 0 : options.revalidate : this.revalidate
|
|
3757
|
+
}
|
|
3758
|
+
}
|
|
3759
|
+
);
|
|
3760
|
+
} catch {
|
|
3761
|
+
return { hasError: true, result: {} };
|
|
3762
|
+
}
|
|
3763
|
+
}
|
|
3764
|
+
/**
|
|
3765
|
+
* Retrieves all fields (self and related) of a content type.
|
|
3766
|
+
* Swagger: GET /api/core/content-types/{contentTypeUniqueId}/fields
|
|
3767
|
+
*/
|
|
3768
|
+
async getContentTypeFields(contentTypeUniqueId, options = {}) {
|
|
3769
|
+
try {
|
|
3770
|
+
return await this.http.get(
|
|
3771
|
+
`/api/core/content-types/${contentTypeUniqueId}/fields`,
|
|
3772
|
+
{
|
|
3773
|
+
headers: {
|
|
3774
|
+
...this.managingHeaders,
|
|
3775
|
+
...options.headers
|
|
3776
|
+
},
|
|
3777
|
+
cache: options.cache,
|
|
3778
|
+
signal: options.signal,
|
|
3779
|
+
next: {
|
|
3780
|
+
revalidate: options.revalidate !== void 0 ? options.revalidate === false ? 0 : options.revalidate : this.revalidate
|
|
3781
|
+
}
|
|
3782
|
+
}
|
|
3783
|
+
);
|
|
3784
|
+
} catch {
|
|
3785
|
+
return { hasError: true, result: [] };
|
|
3786
|
+
}
|
|
3787
|
+
}
|
|
3788
|
+
/**
|
|
3789
|
+
* Retrieves brief list of content types.
|
|
3790
|
+
* Swagger: GET /api/core/content-types/brief
|
|
3791
|
+
*/
|
|
3792
|
+
async getBrief(params = {}, options = {}) {
|
|
3793
|
+
try {
|
|
3794
|
+
return await this.http.get(
|
|
3795
|
+
"/api/core/content-types/brief",
|
|
3796
|
+
{
|
|
3797
|
+
params,
|
|
3798
|
+
headers: {
|
|
3799
|
+
...this.managingHeaders,
|
|
3800
|
+
...options.headers
|
|
3801
|
+
},
|
|
3802
|
+
cache: options.cache,
|
|
3803
|
+
signal: options.signal,
|
|
3804
|
+
next: {
|
|
3805
|
+
revalidate: options.revalidate !== void 0 ? options.revalidate === false ? 0 : options.revalidate : this.revalidate
|
|
3806
|
+
}
|
|
3807
|
+
}
|
|
3808
|
+
);
|
|
3809
|
+
} catch {
|
|
3810
|
+
return { hasError: true, result: [] };
|
|
3811
|
+
}
|
|
3812
|
+
}
|
|
3813
|
+
/**
|
|
3814
|
+
* Creates a new content type.
|
|
3815
|
+
* Swagger: POST /api/core/content-types
|
|
3816
|
+
*/
|
|
3817
|
+
async createContentType(params, options = {}) {
|
|
3818
|
+
return this.http.post(
|
|
3819
|
+
"/api/core/content-types",
|
|
3820
|
+
{},
|
|
3821
|
+
{
|
|
3822
|
+
params: this.normalizeParams(params),
|
|
3823
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3824
|
+
headers: {
|
|
3825
|
+
...this.managingHeaders,
|
|
3826
|
+
...options.headers
|
|
3827
|
+
}
|
|
3828
|
+
}
|
|
3829
|
+
);
|
|
3830
|
+
}
|
|
3831
|
+
/**
|
|
3832
|
+
* Updates an existing content type.
|
|
3833
|
+
* Swagger: POST /api/core/content-types/{unique_id}
|
|
3834
|
+
*/
|
|
3835
|
+
async updateContentType(uniqueId, params, options = {}) {
|
|
3836
|
+
return this.http.post(
|
|
3837
|
+
`/api/core/content-types/${uniqueId}`,
|
|
3838
|
+
{},
|
|
3839
|
+
{
|
|
3840
|
+
params: this.normalizeParams(params),
|
|
3841
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3842
|
+
headers: {
|
|
3843
|
+
...this.managingHeaders,
|
|
3844
|
+
...options.headers
|
|
3845
|
+
}
|
|
3846
|
+
}
|
|
3847
|
+
);
|
|
3848
|
+
}
|
|
3849
|
+
/**
|
|
3850
|
+
* Updates current client's content type.
|
|
3851
|
+
* Swagger: POST /api/core/content-types/my/{unique_id}
|
|
3852
|
+
*/
|
|
3853
|
+
async updateMyContentType(uniqueId, params, options = {}) {
|
|
3854
|
+
return this.http.post(
|
|
3855
|
+
`/api/core/content-types/my/${uniqueId}`,
|
|
3856
|
+
{},
|
|
3857
|
+
{
|
|
3858
|
+
params: this.normalizeParams(params),
|
|
3859
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3860
|
+
headers: {
|
|
3861
|
+
...this.managingHeaders,
|
|
3862
|
+
...options.headers
|
|
3863
|
+
}
|
|
3864
|
+
}
|
|
3865
|
+
);
|
|
3866
|
+
}
|
|
3867
|
+
// =========================================================================
|
|
3868
|
+
// 3. ARCHIVE / UNARCHIVE (Swagger: tag=content-type)
|
|
3869
|
+
// =========================================================================
|
|
3870
|
+
/**
|
|
3871
|
+
* Retrieves all archived content types.
|
|
3872
|
+
* Swagger: GET /api/core/content-types/archive
|
|
3873
|
+
*/
|
|
3874
|
+
async getArchivedContentTypes(params = {}, options = {}) {
|
|
3875
|
+
try {
|
|
3876
|
+
return await this.http.get(
|
|
3877
|
+
"/api/core/content-types/archive",
|
|
3878
|
+
{
|
|
3879
|
+
params: this.normalizeParams(params),
|
|
3880
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3881
|
+
headers: {
|
|
3882
|
+
...this.managingHeaders,
|
|
3883
|
+
...options.headers
|
|
3884
|
+
},
|
|
3885
|
+
cache: options.cache,
|
|
3886
|
+
signal: options.signal,
|
|
3887
|
+
next: {
|
|
3888
|
+
revalidate: options.revalidate !== void 0 ? options.revalidate === false ? 0 : options.revalidate : this.revalidate
|
|
3889
|
+
}
|
|
3890
|
+
}
|
|
3891
|
+
);
|
|
3892
|
+
} catch {
|
|
3893
|
+
return { hasError: true, result: [] };
|
|
3894
|
+
}
|
|
3895
|
+
}
|
|
3896
|
+
/**
|
|
3897
|
+
* Archives content types by postIds.
|
|
3898
|
+
* Swagger: POST /api/core/content-types/archive
|
|
3899
|
+
*/
|
|
3900
|
+
async archiveContentTypes(postIdsOrParams, options = {}) {
|
|
3901
|
+
const rawParams = Array.isArray(postIdsOrParams) ? { postIds: postIdsOrParams } : postIdsOrParams;
|
|
3902
|
+
return this.http.post(
|
|
3903
|
+
"/api/core/content-types/archive",
|
|
3904
|
+
{},
|
|
3905
|
+
{
|
|
3906
|
+
params: this.normalizeParams(rawParams),
|
|
3907
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3908
|
+
headers: {
|
|
3909
|
+
...this.managingHeaders,
|
|
3910
|
+
...options.headers
|
|
3911
|
+
}
|
|
3912
|
+
}
|
|
3913
|
+
);
|
|
3914
|
+
}
|
|
3915
|
+
/**
|
|
3916
|
+
* Unarchives content types by postIds.
|
|
3917
|
+
* Swagger: POST /api/core/content-types/unarchive
|
|
3918
|
+
*/
|
|
3919
|
+
async unarchiveContentTypes(postIdsOrParams, options = {}) {
|
|
3920
|
+
const rawParams = Array.isArray(postIdsOrParams) ? { postIds: postIdsOrParams } : postIdsOrParams;
|
|
3921
|
+
return this.http.post(
|
|
3922
|
+
"/api/core/content-types/unarchive",
|
|
3923
|
+
{},
|
|
3924
|
+
{
|
|
3925
|
+
params: this.normalizeParams(rawParams),
|
|
3926
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3927
|
+
headers: {
|
|
3928
|
+
...this.managingHeaders,
|
|
3929
|
+
...options.headers
|
|
3930
|
+
}
|
|
3931
|
+
}
|
|
3932
|
+
);
|
|
3933
|
+
}
|
|
3934
|
+
// =========================================================================
|
|
3935
|
+
// 4. MULTI-INVOICE PERCENT & SHARE (Swagger: tag=content-type)
|
|
3936
|
+
// =========================================================================
|
|
3937
|
+
/**
|
|
3938
|
+
* Retrieves list of multi invoice shares for a content type.
|
|
3939
|
+
* Swagger: GET /api/core/content-types/{contentTypeUniqueId}/multi-invoice-share
|
|
3940
|
+
*/
|
|
3941
|
+
async getMultiInvoiceShares(contentTypeUniqueId, params = {}, options = {}) {
|
|
3942
|
+
try {
|
|
3943
|
+
return await this.http.get(
|
|
3944
|
+
`/api/core/content-types/${contentTypeUniqueId}/multi-invoice-share`,
|
|
3945
|
+
{
|
|
3946
|
+
params: this.normalizeParams(params),
|
|
3947
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3948
|
+
headers: {
|
|
3949
|
+
...this.managingHeaders,
|
|
3950
|
+
...options.headers
|
|
3951
|
+
},
|
|
3952
|
+
cache: options.cache,
|
|
3953
|
+
signal: options.signal,
|
|
3954
|
+
next: {
|
|
3955
|
+
revalidate: options.revalidate !== void 0 ? options.revalidate === false ? 0 : options.revalidate : this.revalidate
|
|
3956
|
+
}
|
|
3957
|
+
}
|
|
3958
|
+
);
|
|
3959
|
+
} catch {
|
|
3960
|
+
return { hasError: true, result: [] };
|
|
3961
|
+
}
|
|
3962
|
+
}
|
|
3963
|
+
/**
|
|
3964
|
+
* Adds multi invoice percent configuration.
|
|
3965
|
+
* Swagger: POST /api/core/content-types/{contentTypeUniqueId}/multi-invoice-percent
|
|
3966
|
+
*/
|
|
3967
|
+
async addMultiInvoicePercent(contentTypeUniqueId, params, options = {}) {
|
|
3968
|
+
return this.http.post(
|
|
3969
|
+
`/api/core/content-types/${contentTypeUniqueId}/multi-invoice-percent`,
|
|
3970
|
+
{},
|
|
3971
|
+
{
|
|
3972
|
+
params: this.normalizeParams(params),
|
|
3973
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3974
|
+
headers: {
|
|
3975
|
+
...this.managingHeaders,
|
|
3976
|
+
...options.headers
|
|
3977
|
+
}
|
|
3978
|
+
}
|
|
3979
|
+
);
|
|
3980
|
+
}
|
|
3981
|
+
/**
|
|
3982
|
+
* Updates multi invoice percent configuration.
|
|
3983
|
+
* Swagger: PUT /api/core/content-types/{contentTypeUniqueId}/multi-invoice-percent
|
|
3984
|
+
*/
|
|
3985
|
+
async updateMultiInvoicePercent(contentTypeUniqueId, params, options = {}) {
|
|
3986
|
+
return this.http.put(
|
|
3987
|
+
`/api/core/content-types/${contentTypeUniqueId}/multi-invoice-percent`,
|
|
3988
|
+
{},
|
|
3989
|
+
{
|
|
3990
|
+
params: this.normalizeParams(params),
|
|
3991
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3992
|
+
headers: {
|
|
3993
|
+
...this.managingHeaders,
|
|
3994
|
+
...options.headers
|
|
3995
|
+
}
|
|
3996
|
+
}
|
|
3997
|
+
);
|
|
3998
|
+
}
|
|
3999
|
+
/**
|
|
4000
|
+
* Deletes multi invoice percent configuration.
|
|
4001
|
+
* Swagger: DELETE /api/core/content-types/{contentTypeUniqueId}/multi-invoice-percent
|
|
4002
|
+
*/
|
|
4003
|
+
async deleteMultiInvoicePercent(contentTypeUniqueId, params = {}, options = {}) {
|
|
4004
|
+
return this.http.delete(
|
|
4005
|
+
`/api/core/content-types/${contentTypeUniqueId}/multi-invoice-percent`,
|
|
4006
|
+
{
|
|
4007
|
+
params,
|
|
4008
|
+
headers: {
|
|
4009
|
+
...this.managingHeaders,
|
|
4010
|
+
...options.headers
|
|
4011
|
+
}
|
|
4012
|
+
}
|
|
4013
|
+
);
|
|
4014
|
+
}
|
|
4015
|
+
// =========================================================================
|
|
4016
|
+
// 5. RELATED CONTENT TYPES (Swagger: tag=related-content-type)
|
|
4017
|
+
// =========================================================================
|
|
4018
|
+
/**
|
|
4019
|
+
* Retrieves related content type fields.
|
|
4020
|
+
* Swagger: GET /api/core/related-content-types/{contentTypeUniqueId}
|
|
4021
|
+
*/
|
|
4022
|
+
async getRelatedContentTypes(contentTypeUniqueId, options = {}) {
|
|
4023
|
+
try {
|
|
4024
|
+
return await this.http.get(
|
|
4025
|
+
`/api/core/related-content-types/${contentTypeUniqueId}`,
|
|
4026
|
+
{
|
|
4027
|
+
headers: {
|
|
4028
|
+
...this.managingHeaders,
|
|
4029
|
+
...options.headers
|
|
4030
|
+
},
|
|
4031
|
+
cache: options.cache,
|
|
4032
|
+
signal: options.signal,
|
|
4033
|
+
next: {
|
|
4034
|
+
revalidate: options.revalidate !== void 0 ? options.revalidate === false ? 0 : options.revalidate : this.revalidate
|
|
4035
|
+
}
|
|
4036
|
+
}
|
|
4037
|
+
);
|
|
4038
|
+
} catch {
|
|
4039
|
+
return { hasError: true, result: [] };
|
|
4040
|
+
}
|
|
4041
|
+
}
|
|
4042
|
+
/**
|
|
4043
|
+
* Adds new related-content-type fields.
|
|
4044
|
+
* Swagger: POST /api/core/related-content-types/{contentTypeUniqueId}
|
|
4045
|
+
*/
|
|
4046
|
+
async addRelatedContentTypes(contentTypeUniqueId, body, options = {}) {
|
|
4047
|
+
const payload = Array.isArray(body) ? { fields: body } : body;
|
|
4048
|
+
return this.http.post(
|
|
4049
|
+
`/api/core/related-content-types/${contentTypeUniqueId}`,
|
|
4050
|
+
payload,
|
|
4051
|
+
{
|
|
4052
|
+
headers: {
|
|
4053
|
+
...this.managingHeaders,
|
|
4054
|
+
...options.headers
|
|
4055
|
+
}
|
|
4056
|
+
}
|
|
4057
|
+
);
|
|
4058
|
+
}
|
|
4059
|
+
/**
|
|
4060
|
+
* Deletes a related-content-type field.
|
|
4061
|
+
* Swagger: POST /api/core/related-content-types/delete/{contentTypeUniqueId}
|
|
4062
|
+
*/
|
|
4063
|
+
async deleteRelatedContentType(contentTypeUniqueId, codeOrParams, options = {}) {
|
|
4064
|
+
const params = typeof codeOrParams === "string" ? { code: codeOrParams } : codeOrParams;
|
|
4065
|
+
return this.http.post(
|
|
4066
|
+
`/api/core/related-content-types/delete/${contentTypeUniqueId}`,
|
|
4067
|
+
{},
|
|
4068
|
+
{
|
|
4069
|
+
params,
|
|
4070
|
+
headers: {
|
|
4071
|
+
...this.managingHeaders,
|
|
4072
|
+
...options.headers
|
|
4073
|
+
}
|
|
4074
|
+
}
|
|
4075
|
+
);
|
|
4076
|
+
}
|
|
4077
|
+
/**
|
|
4078
|
+
* Updates related-content-type fields.
|
|
4079
|
+
* Swagger: POST /api/core/related-content-types/update/{contentTypeUniqueId}
|
|
4080
|
+
*/
|
|
4081
|
+
async updateRelatedContentTypes(contentTypeUniqueId, body, options = {}) {
|
|
4082
|
+
const payload = Array.isArray(body) ? { fields: body } : body;
|
|
4083
|
+
return this.http.post(
|
|
4084
|
+
`/api/core/related-content-types/update/${contentTypeUniqueId}`,
|
|
4085
|
+
payload,
|
|
4086
|
+
{
|
|
4087
|
+
headers: {
|
|
4088
|
+
...this.managingHeaders,
|
|
4089
|
+
...options.headers
|
|
4090
|
+
}
|
|
4091
|
+
}
|
|
4092
|
+
);
|
|
4093
|
+
}
|
|
4094
|
+
};
|
|
3524
4095
|
|
|
3525
4096
|
// src/services/cms/index.ts
|
|
3526
4097
|
var CmsService = class {
|
|
@@ -3539,6 +4110,11 @@ var CmsService = class {
|
|
|
3539
4110
|
* Swagger: tag=tags
|
|
3540
4111
|
*/
|
|
3541
4112
|
tags;
|
|
4113
|
+
/**
|
|
4114
|
+
* Dedicated CMS Content Type & Related Content Type sub-service.
|
|
4115
|
+
* Swagger: tag=content-type, tag=related-content-type
|
|
4116
|
+
*/
|
|
4117
|
+
contentTypes;
|
|
3542
4118
|
constructor(options) {
|
|
3543
4119
|
this.clientId = options.clientId || "";
|
|
3544
4120
|
this.apiToken = options.apiToken || "";
|
|
@@ -3562,6 +4138,12 @@ var CmsService = class {
|
|
|
3562
4138
|
apiToken: this.apiToken,
|
|
3563
4139
|
revalidate: this.revalidate
|
|
3564
4140
|
});
|
|
4141
|
+
this.contentTypes = new CmsContentTypeService({
|
|
4142
|
+
http: this.http,
|
|
4143
|
+
clientId: this.clientId,
|
|
4144
|
+
apiToken: this.apiToken,
|
|
4145
|
+
revalidate: this.revalidate
|
|
4146
|
+
});
|
|
3565
4147
|
}
|
|
3566
4148
|
normalizeParams(params) {
|
|
3567
4149
|
const arrayFields = [
|
|
@@ -4082,13 +4664,7 @@ var CmsService = class {
|
|
|
4082
4664
|
* Swagger: GET /api/core/content-types/{contentTypeUniqueId}
|
|
4083
4665
|
*/
|
|
4084
4666
|
async getContentTypeDetail(contentTypeUniqueId) {
|
|
4085
|
-
|
|
4086
|
-
return await this.http.get(`/api/core/content-types/${contentTypeUniqueId}`, {
|
|
4087
|
-
headers: this.managingHeaders
|
|
4088
|
-
});
|
|
4089
|
-
} catch {
|
|
4090
|
-
return {};
|
|
4091
|
-
}
|
|
4667
|
+
return this.contentTypes.getContentType(contentTypeUniqueId);
|
|
4092
4668
|
}
|
|
4093
4669
|
/**
|
|
4094
4670
|
* Performs advanced AI timeline search on content.
|
|
@@ -4291,6 +4867,8 @@ var PodSdk = class {
|
|
|
4291
4867
|
cms;
|
|
4292
4868
|
product;
|
|
4293
4869
|
tags;
|
|
4870
|
+
contentType;
|
|
4871
|
+
contentTypes;
|
|
4294
4872
|
iums;
|
|
4295
4873
|
urls;
|
|
4296
4874
|
constructor(config = {}) {
|
|
@@ -4352,6 +4930,8 @@ var PodSdk = class {
|
|
|
4352
4930
|
});
|
|
4353
4931
|
this.product = this.cms.products;
|
|
4354
4932
|
this.tags = this.cms.tags;
|
|
4933
|
+
this.contentType = this.cms.contentTypes;
|
|
4934
|
+
this.contentTypes = this.cms.contentTypes;
|
|
4355
4935
|
this.iums = new IumsService({
|
|
4356
4936
|
baseUrl: urls.iums,
|
|
4357
4937
|
clientId,
|
|
@@ -4509,7 +5089,6 @@ var POD_OPENAPI_ENDPOINTS = [
|
|
|
4509
5089
|
e("CMS Content", "get", "/api/core/contents/{contentTypeUniqueId}/comments/{entityId}", "cmsGetComments", "List content comments", { query: ["offset", "size"], security: "cmsPublic" }),
|
|
4510
5090
|
e("CMS Content", "get", "/api/core/contents/{contentUniqueId}/like/{entityId}", "cmsGetLikes", "List content likes", { query: ["offset", "size"], security: "cmsPublic" }),
|
|
4511
5091
|
e("CMS Content", "get", "/api/core/contents/{contentUniqueId}/dislike/{entityId}", "cmsGetDislikes", "List content dislikes", { query: ["offset", "size"], security: "cmsPublic" }),
|
|
4512
|
-
e("CMS Content", "get", "/api/core/content-types/{contentTypeUniqueId}", "cmsGetContentTypeDetail", "Get content type details", { security: "cmsManage" }),
|
|
4513
5092
|
e("CMS Content", "get", "/api/core/contents/ai/timeline-search/enable", "cmsTimelineSearch", "Run advanced content timeline search", { query: ["advance", "newVersion", "offset", "size"], security: "cmsPublic" }),
|
|
4514
5093
|
// CMS products
|
|
4515
5094
|
e("CMS Products", "get", "/api/core/products/enable", "cmsGetProducts", "List enabled products", { query: ["offset", "size", "showDetail", "productTypeUniqueId", "tags"], security: "cmsPublic" }),
|
|
@@ -4558,6 +5137,30 @@ var POD_OPENAPI_ENDPOINTS = [
|
|
|
4558
5137
|
e("CMS Tags", "get", "/api/core/tags/{categoryId}/tree/parent/{id}/enable", "cmsGetTagTreeAncestors", "Get enabled tag ancestors", { query: ["includeCurrent"], security: "cmsPublic" }),
|
|
4559
5138
|
e("CMS Tags", "get", "/api/core/tags/{categoryId}/tree/parent/{id}/manage", "cmsGetManageTagTreeAncestors", "Get tag ancestors for management", { query: ["includeCurrent"], security: "cmsManage" }),
|
|
4560
5139
|
e("CMS Tags", "put", "/api/core/tags/{categoryId}/tree/code/{id}", "cmsUpdateTagTreeCode", "Update a tag tree code", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
5140
|
+
// CMS Content Types
|
|
5141
|
+
e("CMS Content Types", "get", "/api/core/content-types/templates", "cmsGetContentTypeTemplates", "List content type attribute templates", { query: ["offset", "size", "guildCode", "attributeTemplateCode", "attributeTemplateName", "firstId", "lastId"], security: "cmsManage" }),
|
|
5142
|
+
e("CMS Content Types", "get", "/api/core/content-types/template-igs", "cmsGetTemplateIgs", "List template IG classifications", { query: ["baseNodeId", "igCode", "query", "showLatestVersion"], security: "cmsPublic" }),
|
|
5143
|
+
e("CMS Content Types", "get", "/api/core/content-types/template-categories", "cmsGetTemplateCategories", "List template category nodes", { query: ["baseNodeId", "maxLevel", "includeBaseNode"], security: "cmsPublic" }),
|
|
5144
|
+
e("CMS Content Types", "get", "/api/core/content-types", "cmsGetContentTypes", "List all content types", { query: ["offset", "size", "type", "name", "uniqueId", "ig", "isCustom", "excludeItems", "permissionType"], security: "cmsManage" }),
|
|
5145
|
+
e("CMS Content Types", "get", "/api/core/content-types/my", "cmsGetMyContentTypes", "List current client content types", { query: ["offset", "size", "type", "name", "uniqueId", "ig", "isCustom", "permissionType"], security: "cmsManage" }),
|
|
5146
|
+
e("CMS Content Types", "get", "/api/core/content-types/{contentTypeUniqueId}", "cmsGetContentType", "Get content type details by unique ID", { query: ["excludeItems"], security: "cmsManage", sdkMethods: ["getContentType", "getContentTypeDetail"] }),
|
|
5147
|
+
e("CMS Content Types", "get", "/api/core/content-types/{contentTypeUniqueId}/enable", "cmsGetEnabledContentType", "Get enabled content type details", { query: ["excludeItems"], security: "cmsManage" }),
|
|
5148
|
+
e("CMS Content Types", "get", "/api/core/content-types/{contentTypeUniqueId}/fields", "cmsGetContentTypeFields", "Get all fields of a content type", { security: "cmsManage" }),
|
|
5149
|
+
e("CMS Content Types", "get", "/api/core/content-types/brief", "cmsGetBriefContentTypes", "List brief content types", { query: ["search"], security: "cmsManage" }),
|
|
5150
|
+
e("CMS Content Types", "post", "/api/core/content-types", "cmsCreateContentType", "Create a new content type", { query: ["name!", "code!", "type!", "description!", "ig", "tagTreeCategoryId", "tagTreeCategoryIds", "tags", "tagTrees", "webhookServices", "webhookUrls", "webhookDurations", "webhookEnables", "webhookHeaders", "ownerId", "allFields", "excludeFields", "requiredTag", "requiredTagTree", "icon", "image", "permissionType", "isPublic", "isGuest", "uploadFolder", "activityInfo", "showFileMetadataDetail", "folderForContentFiles", "isTokenIssuedByClient", "financialLevel"], security: "cmsManage" }),
|
|
5151
|
+
e("CMS Content Types", "post", "/api/core/content-types/{unique_id}", "cmsUpdateContentType", "Update a content type", { query: ["name!", "description!", "code", "ig", "tagTreeCategoryId", "tagTreeCategoryIds", "tags", "tagTrees", "webhookServices", "webhookUrls", "webhookDurations", "webhookEnables", "webhookHeaders", "ownerId", "requiredTag", "requiredTagTree", "icon", "image", "permissionType", "isPublic", "isGuest", "uploadFolder", "activityInfo", "showFileMetadataDetail", "folderForContentFiles", "isTokenIssuedByClient", "financialLevel"], security: "cmsManage" }),
|
|
5152
|
+
e("CMS Content Types", "post", "/api/core/content-types/my/{unique_id}", "cmsUpdateMyContentType", "Update current client content type", { query: ["name!", "description!", "code", "ig", "tagTreeCategoryId", "tagTreeCategoryIds", "tags", "tagTrees", "webhookServices", "webhookUrls", "webhookDurations", "webhookEnables", "webhookHeaders", "requiredTag", "requiredTagTree", "icon", "image", "permissionType", "isPublic", "isGuest", "activityInfo", "showFileMetadataDetail", "folderForContentFiles", "isTokenIssuedByClient", "financialLevel"], security: "cmsManage" }),
|
|
5153
|
+
e("CMS Content Types", "get", "/api/core/content-types/archive", "cmsGetArchivedContentTypes", "List archived content types", { query: ["offset", "size", "type", "uniqueId", "postIds", "permissionType"], security: "cmsManage" }),
|
|
5154
|
+
e("CMS Content Types", "post", "/api/core/content-types/archive", "cmsArchiveContentTypes", "Archive content types by postIds", { query: ["postIds!"], security: "cmsManage" }),
|
|
5155
|
+
e("CMS Content Types", "post", "/api/core/content-types/unarchive", "cmsUnarchiveContentTypes", "Unarchive content types by postIds", { query: ["postIds!"], security: "cmsManage" }),
|
|
5156
|
+
e("CMS Content Types", "get", "/api/core/content-types/{contentTypeUniqueId}/multi-invoice-share", "cmsGetMultiInvoiceShares", "List multi invoice percentage shares", { query: ["excludeItems"], security: "cmsManage" }),
|
|
5157
|
+
e("CMS Content Types", "post", "/api/core/content-types/{contentTypeUniqueId}/multi-invoice-percent", "cmsAddMultiInvoicePercent", "Add multi invoice percent configuration", { query: ["main!", "provider!", "seller!", "enable", "mainShareType", "providerShareType", "sellerShareType", "dealerBusinessId", "dealerBusinessShareType", "dealerBusinessShare", "clientMetadata", "uniqueId", "businessLevel"], security: "cmsManage" }),
|
|
5158
|
+
e("CMS Content Types", "put", "/api/core/content-types/{contentTypeUniqueId}/multi-invoice-percent", "cmsUpdateMultiInvoicePercent", "Update multi invoice percent configuration", { query: ["main!", "provider!", "seller!", "enable", "mainShareType", "providerShareType", "sellerShareType", "dealerBusinessId", "dealerBusinessShareType", "dealerBusinessShare", "clientMetadata", "uniqueId", "businessLevel"], security: "cmsManage" }),
|
|
5159
|
+
e("CMS Content Types", "delete", "/api/core/content-types/{contentTypeUniqueId}/multi-invoice-percent", "cmsDeleteMultiInvoicePercent", "Delete multi invoice percent configuration", { query: ["uniqueId"], security: "cmsManage" }),
|
|
5160
|
+
e("CMS Content Types", "get", "/api/core/related-content-types/{contentTypeUniqueId}", "cmsGetRelatedContentTypes", "Get related content type fields", { security: "cmsManage" }),
|
|
5161
|
+
e("CMS Content Types", "post", "/api/core/related-content-types/{contentTypeUniqueId}", "cmsAddRelatedContentTypes", "Add related content type fields", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
5162
|
+
e("CMS Content Types", "post", "/api/core/related-content-types/delete/{contentTypeUniqueId}", "cmsDeleteRelatedContentType", "Delete a related content type field", { query: ["code!"], security: "cmsManage" }),
|
|
5163
|
+
e("CMS Content Types", "post", "/api/core/related-content-types/update/{contentTypeUniqueId}", "cmsUpdateRelatedContentTypes", "Update related content type fields", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4561
5164
|
// Podspace upload, download and file operations
|
|
4562
5165
|
e("Podspace Files", "post", "/api/files", "podspaceUploadFile", "Upload a file", { query: ["path", "isPublic", "fileName", "parentHash"], body: "multipart", bodyRequired: true, security: "bearer" }),
|
|
4563
5166
|
e("Podspace Files", "post", "/api/files/multiple", "podspaceUploadMultipleFiles", "Upload multiple files", { query: ["path", "isPublic", "parentHash"], body: "multipart", bodyRequired: true, security: "bearer" }),
|
|
@@ -4856,6 +5459,7 @@ var POD_OPENAPI_DOCUMENT = createPodOpenApiDocument();
|
|
|
4856
5459
|
var podSwaggerDocument = POD_OPENAPI_DOCUMENT;
|
|
4857
5460
|
|
|
4858
5461
|
exports.CaptchaService = CaptchaService;
|
|
5462
|
+
exports.CmsContentTypeService = CmsContentTypeService;
|
|
4859
5463
|
exports.CmsDataFormatter = CmsDataFormatter;
|
|
4860
5464
|
exports.CmsProductService = CmsProductService;
|
|
4861
5465
|
exports.CmsService = CmsService;
|