@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/dist/index.js CHANGED
@@ -272,7 +272,7 @@ var CaptchaService = class {
272
272
  async get() {
273
273
  const params = {};
274
274
  try {
275
- const result = await this.http.post(
275
+ return await this.http.post(
276
276
  "/api/core/captcha/get",
277
277
  void 0,
278
278
  {
@@ -284,15 +284,22 @@ var CaptchaService = class {
284
284
  }
285
285
  }
286
286
  );
287
- return {
288
- hasError: false,
289
- result
290
- };
291
287
  } catch (err) {
292
288
  return {
289
+ referenceNumber: 0,
293
290
  hasError: true,
294
- message: err.data?.message || err.message,
295
- errorCode: err.status
291
+ errorCode: err.status || 500,
292
+ refId: "",
293
+ message: [err.data?.message || err.message],
294
+ count: 0,
295
+ aggregations: 0,
296
+ result: {
297
+ hash: "",
298
+ expireTime: 0,
299
+ challenge: "",
300
+ url: ""
301
+ },
302
+ metaData: []
296
303
  };
297
304
  }
298
305
  }
@@ -301,7 +308,7 @@ var CaptchaService = class {
301
308
  */
302
309
  async check(options) {
303
310
  try {
304
- const result = await this.http.post(
311
+ return await this.http.post(
305
312
  `/api/core/captcha/check`,
306
313
  {
307
314
  value: options.value,
@@ -315,15 +322,13 @@ var CaptchaService = class {
315
322
  }
316
323
  }
317
324
  );
318
- return {
319
- hasError: false,
320
- result
321
- };
322
325
  } catch (err) {
323
326
  return {
324
327
  hasError: true,
325
- message: err.data?.message || err.message,
326
- errorCode: err.status
328
+ errorCode: err.status || 500,
329
+ message: [err.data?.message || err.message],
330
+ result: false,
331
+ metaData: []
327
332
  };
328
333
  }
329
334
  }
@@ -2677,8 +2682,37 @@ var CmsProductService = class {
2677
2682
  this.formatter = options.formatter || new CmsDataFormatter(options.podspaceUrl || "https://podspace.pod.ir");
2678
2683
  this.http = options.http || http.createNextHttp({
2679
2684
  baseUrl: options.baseUrl || "https://api.pod.ir/srv/cms-server",
2680
- serviceName: "POD-CMS-PRODUCT"
2681
- });
2685
+ serviceName: "POD-CMS-PRODUCT",
2686
+ queryArrayFormat: "brackets"
2687
+ });
2688
+ }
2689
+ normalizeParams(params) {
2690
+ const arrayFields = [
2691
+ "fieldCode",
2692
+ "fieldValue",
2693
+ "excludeFieldCode",
2694
+ "excludeFieldValue",
2695
+ "tags",
2696
+ "excludeTags",
2697
+ "tagTrees",
2698
+ "tagTreesCode",
2699
+ "entityIds",
2700
+ "postIds",
2701
+ "notPostIds",
2702
+ "productTypeUniqueIds",
2703
+ "relatedContentId",
2704
+ "relatedProductId",
2705
+ "operationValuesArray",
2706
+ "orderBy",
2707
+ "sortBy"
2708
+ ];
2709
+ const result = { ...params };
2710
+ for (const field of arrayFields) {
2711
+ if (result[field] !== void 0 && result[field] !== null && !Array.isArray(result[field])) {
2712
+ result[field] = [result[field]];
2713
+ }
2714
+ }
2715
+ return result;
2682
2716
  }
2683
2717
  get commonHeaders() {
2684
2718
  return {
@@ -2697,15 +2731,16 @@ var CmsProductService = class {
2697
2731
  * Swagger: GET /api/core/products/enable
2698
2732
  */
2699
2733
  async getProducts(params = {}, options = {}) {
2700
- const transferParams = {
2734
+ const transferParams = this.normalizeParams({
2701
2735
  size: 50,
2702
2736
  offset: 0,
2703
2737
  showDetail: true,
2704
2738
  ...params
2705
- };
2739
+ });
2706
2740
  try {
2707
2741
  const res = await this.http.get("/api/core/products/enable", {
2708
2742
  params: transferParams,
2743
+ queryArrayFormat: options.queryArrayFormat,
2709
2744
  headers: {
2710
2745
  ...this.commonHeaders,
2711
2746
  ...options.headers
@@ -2726,15 +2761,16 @@ var CmsProductService = class {
2726
2761
  * Swagger: GET /api/core/products
2727
2762
  */
2728
2763
  async getAllProducts(params = {}, options = {}) {
2729
- const transferParams = {
2764
+ const transferParams = this.normalizeParams({
2730
2765
  size: 50,
2731
2766
  offset: 0,
2732
2767
  showDetail: true,
2733
2768
  ...params
2734
- };
2769
+ });
2735
2770
  try {
2736
2771
  const res = await this.http.get("/api/core/products", {
2737
2772
  params: transferParams,
2773
+ queryArrayFormat: options.queryArrayFormat,
2738
2774
  headers: {
2739
2775
  ...this.managingHeaders,
2740
2776
  ...options.headers
@@ -2755,15 +2791,16 @@ var CmsProductService = class {
2755
2791
  * Swagger: GET /api/core/products/manage
2756
2792
  */
2757
2793
  async getManageProducts(params = {}, options = {}) {
2758
- const transferParams = {
2794
+ const transferParams = this.normalizeParams({
2759
2795
  size: 50,
2760
2796
  offset: 0,
2761
2797
  showDetail: true,
2762
2798
  ...params
2763
- };
2799
+ });
2764
2800
  try {
2765
2801
  const res = await this.http.get("/api/core/products/manage", {
2766
2802
  params: transferParams,
2803
+ queryArrayFormat: options.queryArrayFormat,
2767
2804
  headers: {
2768
2805
  ...this.managingHeaders,
2769
2806
  ...options.headers
@@ -2784,17 +2821,18 @@ var CmsProductService = class {
2784
2821
  * Swagger: GET /api/core/products/{productTypeUniqueId}
2785
2822
  */
2786
2823
  async getProductsByType(productTypeUniqueId, params = {}, options = {}) {
2787
- const transferParams = {
2824
+ const transferParams = this.normalizeParams({
2788
2825
  size: 50,
2789
2826
  offset: 0,
2790
2827
  showDetail: true,
2791
2828
  ...params
2792
- };
2829
+ });
2793
2830
  try {
2794
2831
  const res = await this.http.get(
2795
2832
  `/api/core/products/${productTypeUniqueId}`,
2796
2833
  {
2797
2834
  params: transferParams,
2835
+ queryArrayFormat: options.queryArrayFormat,
2798
2836
  headers: {
2799
2837
  ...this.managingHeaders,
2800
2838
  ...options.headers
@@ -2894,7 +2932,8 @@ var CmsProductService = class {
2894
2932
  const res = await this.http.get(
2895
2933
  "/api/core/products/enable/search",
2896
2934
  {
2897
- params,
2935
+ params: this.normalizeParams(params),
2936
+ queryArrayFormat: options.queryArrayFormat,
2898
2937
  headers: {
2899
2938
  ...this.commonHeaders,
2900
2939
  ...options.headers
@@ -3100,7 +3139,8 @@ var CmsTagService = class {
3100
3139
  this.revalidate = Number(options.revalidate) || 0;
3101
3140
  this.http = options.http || http.createNextHttp({
3102
3141
  baseUrl: options.baseUrl || "https://api.pod.ir/srv/cms-server",
3103
- serviceName: "POD-CMS-TAGS"
3142
+ serviceName: "POD-CMS-TAGS",
3143
+ queryArrayFormat: "brackets"
3104
3144
  });
3105
3145
  }
3106
3146
  get commonHeaders() {
@@ -3481,6 +3521,577 @@ var CmsTagService = class {
3481
3521
  );
3482
3522
  }
3483
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
+ };
3484
4095
 
3485
4096
  // src/services/cms/index.ts
3486
4097
  var CmsService = class {
@@ -3499,6 +4110,11 @@ var CmsService = class {
3499
4110
  * Swagger: tag=tags
3500
4111
  */
3501
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;
3502
4118
  constructor(options) {
3503
4119
  this.clientId = options.clientId || "";
3504
4120
  this.apiToken = options.apiToken || "";
@@ -3506,7 +4122,8 @@ var CmsService = class {
3506
4122
  this.formatter = new CmsDataFormatter(options.podspaceUrl || "https://podspace.pod.ir");
3507
4123
  this.http = http.createNextHttp({
3508
4124
  baseUrl: options.baseUrl,
3509
- serviceName: "POD-CMS"
4125
+ serviceName: "POD-CMS",
4126
+ queryArrayFormat: "brackets"
3510
4127
  });
3511
4128
  this.products = new CmsProductService({
3512
4129
  http: this.http,
@@ -3521,6 +4138,35 @@ var CmsService = class {
3521
4138
  apiToken: this.apiToken,
3522
4139
  revalidate: this.revalidate
3523
4140
  });
4141
+ this.contentTypes = new CmsContentTypeService({
4142
+ http: this.http,
4143
+ clientId: this.clientId,
4144
+ apiToken: this.apiToken,
4145
+ revalidate: this.revalidate
4146
+ });
4147
+ }
4148
+ normalizeParams(params) {
4149
+ const arrayFields = [
4150
+ "fieldCode",
4151
+ "fieldValue",
4152
+ "excludeFieldCode",
4153
+ "excludeFieldValue",
4154
+ "tags",
4155
+ "tagTrees",
4156
+ "tagTreesCode",
4157
+ "entityIds",
4158
+ "postIds",
4159
+ "notPostIds",
4160
+ "operationValuesArray",
4161
+ "orderBy"
4162
+ ];
4163
+ const result = { ...params };
4164
+ for (const field of arrayFields) {
4165
+ if (result[field] !== void 0 && result[field] !== null && !Array.isArray(result[field])) {
4166
+ result[field] = [result[field]];
4167
+ }
4168
+ }
4169
+ return result;
3524
4170
  }
3525
4171
  get commonHeaders() {
3526
4172
  return {
@@ -3542,15 +4188,16 @@ var CmsService = class {
3542
4188
  * Swagger: GET /api/core/contents/enable
3543
4189
  */
3544
4190
  async getContent(params = {}, options = {}) {
3545
- const transferParams = {
4191
+ const transferParams = this.normalizeParams({
3546
4192
  size: 50,
3547
4193
  offset: 0,
3548
4194
  showDetail: true,
3549
4195
  ...params
3550
- };
4196
+ });
3551
4197
  try {
3552
4198
  const res = await this.http.get("/api/core/contents/enable", {
3553
4199
  params: transferParams,
4200
+ queryArrayFormat: options.queryArrayFormat,
3554
4201
  headers: {
3555
4202
  ...this.commonHeaders,
3556
4203
  ...options.headers
@@ -3571,15 +4218,16 @@ var CmsService = class {
3571
4218
  * Swagger: GET /api/core/contents
3572
4219
  */
3573
4220
  async getAllContents(params = {}, options = {}) {
3574
- const transferParams = {
4221
+ const transferParams = this.normalizeParams({
3575
4222
  size: 50,
3576
4223
  offset: 0,
3577
4224
  showDetail: true,
3578
4225
  ...params
3579
- };
4226
+ });
3580
4227
  try {
3581
4228
  const res = await this.http.get("/api/core/contents", {
3582
4229
  params: transferParams,
4230
+ queryArrayFormat: options.queryArrayFormat,
3583
4231
  headers: {
3584
4232
  ...this.managingHeaders,
3585
4233
  ...options.headers
@@ -3600,15 +4248,16 @@ var CmsService = class {
3600
4248
  * Swagger: GET /api/core/contents/my
3601
4249
  */
3602
4250
  async getMyContents(params = {}, options = {}) {
3603
- const transferParams = {
4251
+ const transferParams = this.normalizeParams({
3604
4252
  size: 50,
3605
4253
  offset: 0,
3606
4254
  showDetail: true,
3607
4255
  ...params
3608
- };
4256
+ });
3609
4257
  try {
3610
4258
  const res = await this.http.get("/api/core/contents/my", {
3611
4259
  params: transferParams,
4260
+ queryArrayFormat: options.queryArrayFormat,
3612
4261
  headers: {
3613
4262
  ...this.managingHeaders,
3614
4263
  ...options.headers
@@ -3629,17 +4278,18 @@ var CmsService = class {
3629
4278
  * Swagger: GET /api/core/contents/{contentTypeUniqueId}
3630
4279
  */
3631
4280
  async getContentsByType(contentTypeUniqueId, params = {}, options = {}) {
3632
- const transferParams = {
4281
+ const transferParams = this.normalizeParams({
3633
4282
  size: 50,
3634
4283
  offset: 0,
3635
4284
  showDetail: true,
3636
4285
  ...params
3637
- };
4286
+ });
3638
4287
  try {
3639
4288
  const res = await this.http.get(
3640
4289
  `/api/core/contents/${contentTypeUniqueId}`,
3641
4290
  {
3642
4291
  params: transferParams,
4292
+ queryArrayFormat: options.queryArrayFormat,
3643
4293
  headers: {
3644
4294
  ...this.managingHeaders,
3645
4295
  ...options.headers
@@ -3717,7 +4367,8 @@ var CmsService = class {
3717
4367
  async searchContent(params = {}, options = {}) {
3718
4368
  try {
3719
4369
  const res = await this.http.get("/api/core/contents/search", {
3720
- params,
4370
+ params: this.normalizeParams(params),
4371
+ queryArrayFormat: options.queryArrayFormat,
3721
4372
  headers: {
3722
4373
  ...this.commonHeaders,
3723
4374
  ...options.headers
@@ -4013,13 +4664,7 @@ var CmsService = class {
4013
4664
  * Swagger: GET /api/core/content-types/{contentTypeUniqueId}
4014
4665
  */
4015
4666
  async getContentTypeDetail(contentTypeUniqueId) {
4016
- try {
4017
- return await this.http.get(`/api/core/content-types/${contentTypeUniqueId}`, {
4018
- headers: this.managingHeaders
4019
- });
4020
- } catch {
4021
- return {};
4022
- }
4667
+ return this.contentTypes.getContentType(contentTypeUniqueId);
4023
4668
  }
4024
4669
  /**
4025
4670
  * Performs advanced AI timeline search on content.
@@ -4222,6 +4867,8 @@ var PodSdk = class {
4222
4867
  cms;
4223
4868
  product;
4224
4869
  tags;
4870
+ contentType;
4871
+ contentTypes;
4225
4872
  iums;
4226
4873
  urls;
4227
4874
  constructor(config = {}) {
@@ -4241,8 +4888,12 @@ var PodSdk = class {
4241
4888
  websiteUrl: urls.website,
4242
4889
  revalidate
4243
4890
  });
4891
+ const cmsUrl = (urls.cms || "https://api.pod.ir/srv/cms-server").replace(
4892
+ /^http:\/\//i,
4893
+ "https://"
4894
+ );
4244
4895
  this.captcha = new CaptchaService({
4245
- baseUrl: urls.apiPod,
4896
+ baseUrl: cmsUrl,
4246
4897
  clientId,
4247
4898
  accessToken: apiToken
4248
4899
  });
@@ -4279,6 +4930,8 @@ var PodSdk = class {
4279
4930
  });
4280
4931
  this.product = this.cms.products;
4281
4932
  this.tags = this.cms.tags;
4933
+ this.contentType = this.cms.contentTypes;
4934
+ this.contentTypes = this.cms.contentTypes;
4282
4935
  this.iums = new IumsService({
4283
4936
  baseUrl: urls.iums,
4284
4937
  clientId,
@@ -4297,7 +4950,516 @@ function createPodSdk(config) {
4297
4950
  }
4298
4951
  var client_default = PodSdk;
4299
4952
 
4953
+ // src/openapi.ts
4954
+ var e = (tag, method, path, operationId, summary, extras = {}) => ({ tag, method, path, operationId, summary, ...extras });
4955
+ var POD_OPENAPI_ENDPOINTS = [
4956
+ // SSO
4957
+ e("SSO", "post", "/oauth2/clients/handshake/{clientId}", "ssoHandshake", "Create an SSO handshake", {
4958
+ query: ["device_type!", "algorithm!", "device_uid!", "device_client_ip!"],
4959
+ security: "bearer"
4960
+ }),
4961
+ e("SSO", "post", "/oauth2/otp/authorize/{phoneNumber}", "ssoSendOtpCode", "Send an OTP code", {
4962
+ query: ["identityType", "response_type", "referrerType", "linkDeliveryType", "scope", "redirect_uri"],
4963
+ security: "signature"
4964
+ }),
4965
+ e("SSO", "post", "/oauth2/otp/verify/{phoneNumber}", "ssoVerifyOtpCode", "Verify an OTP code", {
4966
+ query: ["otp!", "redirect_uri!"],
4967
+ security: "signature"
4968
+ }),
4969
+ e("SSO", "post", "/oauth2/token", "ssoGenerateToken", "Exchange an authorization code or refresh token", {
4970
+ query: ["grant_type!", "code", "redirect_uri", "refresh_token"],
4971
+ security: "basic",
4972
+ sdkMethods: ["generateToken", "refreshToken"]
4973
+ }),
4974
+ e("SSO", "get", "/users", "ssoGetUserProfile", "Get the authenticated SSO user profile", { security: "bearer" }),
4975
+ // Captcha
4976
+ e("Captcha", "post", "/api/core/captcha/get", "captchaGet", "Generate a captcha challenge", { security: "clientId" }),
4977
+ e("Captcha", "post", "/api/core/captcha/check", "captchaCheck", "Validate a captcha challenge", { security: "clientId", body: "json", bodyRequired: true }),
4978
+ // Custom Post
4979
+ e("Custom Post", "get", "/srv/core/nzh/biz/searchTimelineByMetadata", "customPostSearchTimelineByMetadata", "Search timeline entries by metadata", {
4980
+ query: ["metadata", "metaQuery", "offset", "size"],
4981
+ security: "apiToken"
4982
+ }),
4983
+ e("Custom Post", "get", "/srv/core/nzh/biz/customPostList", "customPostGet", "List custom posts or get one post", {
4984
+ query: ["entityId", "id", "uniqueId", "offset", "size"],
4985
+ security: "apiToken",
4986
+ sdkMethods: ["getCustomPost", "createCrud.getAll", "createCrud.getById"]
4987
+ }),
4988
+ e("Custom Post", "post", "/srv/core/nzh/biz/addCustomPost", "customPostCreate", "Create a custom post", {
4989
+ body: "form",
4990
+ bodyRequired: true,
4991
+ security: "apiToken",
4992
+ sdkMethods: ["addCustomPost", "addCustomPostList", "createCrud.create", "createCrud.createMultiple", "createCrud.createAndBindEntityId"]
4993
+ }),
4994
+ e("Custom Post", "post", "/srv/core/nzh/biz/updateCustomPost", "customPostUpdate", "Update a custom post", {
4995
+ body: "form",
4996
+ bodyRequired: true,
4997
+ security: "apiToken",
4998
+ sdkMethods: ["updateCustomPost", "createCrud.update", "createCrud.archive"]
4999
+ }),
5000
+ e("Custom Post", "post", "/srv/core/nzh/biz/deleteCustomPost", "customPostDelete", "Delete a custom post", {
5001
+ query: ["entityId!"],
5002
+ security: "apiToken",
5003
+ sdkMethods: ["deleteCustomPost", "createCrud.delete"]
5004
+ }),
5005
+ // Notification and Social
5006
+ e("Notification", "post", "/service/sms", "notificationSendSms", "Send an SMS notification", { body: "json", bodyRequired: true, security: "apiToken" }),
5007
+ e("Social", "get", "/srv/core/nzh/commentList", "socialGetCommentList", "List comments for a subject", { query: ["postId", "subjectId", "offset", "size"], security: "apiToken" }),
5008
+ e("Social", "get", "/srv/core/nzh/comment", "socialAddComment", "Add a comment to a subject", { query: ["postId", "subjectId", "content!"], security: "apiToken" }),
5009
+ e("Social", "get", "/srv/core/nzh/likeComment", "socialLikeComment", "Like or dislike a comment", { query: ["commentId!", "dislike"], security: "apiToken" }),
5010
+ e("Social", "get", "/srv/core/nzh/like", "socialLikePost", "Like or dislike a post", { query: ["postId!", "dislike"], security: "apiToken" }),
5011
+ // IUMS exposes several SDK methods through one RPC-style HTTP endpoint.
5012
+ e("IUMS", "get", "/", "iumsInvokeService", "Invoke an IUMS ExternalFacade method", {
5013
+ query: ["data!"],
5014
+ security: "clientId",
5015
+ sdkMethods: ["getInfOfGraduatedByGraduateDate", "getSessionClassInCurrentDay", "getDetailsOfTermExam", "getStudentInformationByNumber", "getStudentInformationByNationalCode"]
5016
+ }),
5017
+ // PodForm
5018
+ e("PodForm", "get", "/forms/{formId}", "podFormGetForm", "Get a form", { query: ["lockForEdit"], security: "podFormToken", sdkMethods: ["getForm", "getPodformById"] }),
5019
+ e("PodForm", "get", "/forms/all", "podFormGetForms", "List forms", { query: ["page", "size", "folderId", "status", "search"], security: "podFormToken" }),
5020
+ e("PodForm", "post", "/forms", "podFormCreateForm", "Create a form", { body: "json", bodyRequired: true, security: "podFormToken" }),
5021
+ e("PodForm", "patch", "/forms/{formId}", "podFormUpdateForm", "Update a form", { body: "json", bodyRequired: true, security: "podFormToken" }),
5022
+ e("PodForm", "delete", "/forms/{formId}", "podFormDeleteForm", "Delete a form", { query: ["removeFromTrash"], security: "podFormToken" }),
5023
+ e("PodForm", "get", "/forms/{formId}/settings", "podFormGetSettings", "Get form settings", { query: ["password"], security: "podFormToken" }),
5024
+ e("PodForm", "patch", "/forms/{formId}/settings", "podFormUpdateSettings", "Update form settings", { query: ["password"], body: "json", bodyRequired: true, security: "podFormToken" }),
5025
+ e("PodForm", "post", "/forms/{formId}/fields", "podFormAddField", "Add a field to a form", { body: "json", bodyRequired: true, security: "podFormToken" }),
5026
+ e("PodForm", "post", "/forms/{formId}/fields/batch", "podFormAddFields", "Add multiple fields to a form", { body: "json", bodyRequired: true, security: "podFormToken" }),
5027
+ e("PodForm", "patch", "/forms/{formId}/fields", "podFormUpdateFields", "Update form fields", { body: "json", bodyRequired: true, security: "podFormToken" }),
5028
+ e("PodForm", "delete", "/forms/{formId}/fields", "podFormDeleteFields", "Delete form fields", { query: ["fieldIds!"], security: "podFormToken" }),
5029
+ e("PodForm", "get", "/forms/{formId}/preview", "podFormGetPreview", "Preview a form", { query: ["password", "language"], security: "podFormToken" }),
5030
+ e("PodForm", "get", "/forms/{formHash}/previewByHash", "podFormGetPreviewByHash", "Preview a public form by hash", { query: ["password", "language"], security: "none" }),
5031
+ e("PodForm", "get", "/forms/{formHash}/generateCaptcha", "podFormGenerateCaptcha", "Generate a public form captcha", { security: "none" }),
5032
+ e("PodForm", "post", "/responses/{formHash}", "podFormSaveResponse", "Submit a form response", { query: ["password", "captchaValue", "captchaHash"], body: "json", bodyRequired: true, security: "none", sdkMethods: ["saveResponse", "sendForm"] }),
5033
+ e("PodForm", "post", "/responses/{formId}/initiate", "podFormInitiateResponse", "Initiate a form response", { body: "json", bodyRequired: true, security: "podFormToken" }),
5034
+ e("PodForm", "get", "/responses/all/{formId}", "podFormGetResponses", "List form responses", { query: ["page", "size", "from", "to", "status"], security: "podFormToken" }),
5035
+ e("PodForm", "get", "/responses/all/byFormHash/{formHash}", "podFormGetResponsesByHash", "List responses by form hash", { query: ["page", "size", "from", "to", "status"], security: "podFormToken" }),
5036
+ e("PodForm", "get", "/responses/{responseId}", "podFormGetResponse", "Get a form response", { query: ["formId"], security: "podFormToken" }),
5037
+ e("PodForm", "patch", "/responses/{responseId}", "podFormUpdateResponse", "Update response fields", { body: "json", bodyRequired: true, security: "podFormToken" }),
5038
+ e("PodForm", "delete", "/responses/{formId}", "podFormDeleteResponsesByQuery", "Delete responses by IDs in the query string", { query: ["responseIds!"], security: "podFormToken" }),
5039
+ e("PodForm", "put", "/responses/{formId}", "podFormDeleteResponses", "Delete responses", { body: "json", bodyRequired: true, security: "podFormToken" }),
5040
+ e("PodForm", "get", "/templates", "podFormGetTemplates", "List form templates", { query: ["page", "size", "templateOwnership"], security: "podFormToken" }),
5041
+ e("PodForm", "post", "/templates", "podFormCreateTemplate", "Create a form template", { query: ["templateOwnership"], body: "json", bodyRequired: true, security: "podFormToken" }),
5042
+ e("PodForm", "patch", "/templates/{templateId}", "podFormUpdateTemplate", "Update a form template", { body: "json", bodyRequired: true, security: "podFormToken" }),
5043
+ e("PodForm", "delete", "/templates/{templateId}", "podFormDeleteTemplate", "Delete a form template", { security: "podFormToken" }),
5044
+ e("PodForm", "get", "/folders", "podFormGetFolders", "List form folders", { query: ["page", "size", "trash"], security: "podFormToken" }),
5045
+ e("PodForm", "post", "/folders", "podFormCreateFolder", "Create a form folder", { body: "json", bodyRequired: true, security: "podFormToken" }),
5046
+ e("PodForm", "patch", "/folders/{folderId}", "podFormUpdateFolder", "Update a form folder", { body: "json", bodyRequired: true, security: "podFormToken" }),
5047
+ e("PodForm", "delete", "/folders/{folderId}", "podFormDeleteFolder", "Delete a form folder", { query: ["removeFromTrash"], security: "podFormToken" }),
5048
+ e("PodForm", "get", "/otp/{formHash}/send", "podFormSendOtp", "Send form OTP", { query: ["phoneNumber!", "email"], security: "none" }),
5049
+ e("PodForm", "get", "/otp/{formHash}/validate", "podFormValidateOtp", "Validate form OTP", { query: ["phoneNumber!", "email", "code!"], security: "none" }),
5050
+ e("PodForm", "get", "/user", "podFormGetUser", "Get the PodForm user", { security: "podFormToken" }),
5051
+ e("PodForm", "get", "/user/getUploadLink", "podFormGetUploadLink", "Get a PodForm upload link", { security: "podFormToken" }),
5052
+ e("PodForm", "get", "/user/getDownloadLink", "podFormGetDownloadLink", "Get a PodForm download link", { query: ["hash!", "fileName"], security: "podFormToken" }),
5053
+ e("PodForm", "get", "/plans/all", "podFormGetPlans", "List PodForm plans", { query: ["page", "size"], security: "podFormToken" }),
5054
+ e("PodForm", "get", "/plans", "podFormGetUserPlan", "Get the current PodForm plan", { security: "podFormToken" }),
5055
+ e("PodForm", "get", "/responses/{formId}/export", "podFormExportResponses", "Export form responses", { query: ["type", "from", "to"], security: "podFormToken", response: "binary" }),
5056
+ e("PodForm", "get", "/forms/{formId}/reports", "podFormGetReport", "Get a form report", { security: "podFormToken" }),
5057
+ // CMS content
5058
+ e("CMS Content", "get", "/api/core/contents/enable", "cmsGetContent", "List enabled content", { query: ["offset", "size", "showDetail", "contentTypeUniqueId", "tags"], security: "cmsPublic" }),
5059
+ e("CMS Content", "get", "/api/core/contents", "cmsGetAllContents", "List all content", { query: ["offset", "size", "showDetail", "enable"], security: "cmsManage" }),
5060
+ e("CMS Content", "get", "/api/core/contents/my", "cmsGetMyContents", "List content owned by the current client", { query: ["offset", "size", "showDetail", "enable"], security: "cmsManage" }),
5061
+ e("CMS Content", "get", "/api/core/contents/{contentTypeUniqueId}", "cmsGetContentsByType", "List content by type", { query: ["offset", "size", "showDetail", "enable"], security: "cmsManage" }),
5062
+ e("CMS Content", "get", "/api/core/contents/enable/{entityId}", "cmsGetContentByEntityId", "Get enabled content by entity ID", { security: "cmsPublic" }),
5063
+ e("CMS Content", "get", "/api/core/contents/{contentTypeUniqueId}/enable/{entityId}", "cmsGetTypedContentByEntityId", "Get enabled typed content by entity ID", { security: "cmsPublic", sdkMethods: ["getContentByEntityId"] }),
5064
+ e("CMS Content", "get", "/api/core/contents/{contentUniqueId}/byContentUniqueId/enable", "cmsGetContentByUniqueId", "Get enabled content by unique ID", { security: "cmsPublic" }),
5065
+ e("CMS Content", "get", "/api/core/contents/search", "cmsSearchContent", "Search enabled content", { query: ["query", "name", "offset", "size"], security: "cmsPublic" }),
5066
+ e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}/add-publish", "cmsAddContent", "Create and publish content", { body: "json", bodyRequired: true, security: "cmsManage" }),
5067
+ e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}", "cmsCreateContent", "Create unpublished content", { body: "json", bodyRequired: true, security: "cmsManage" }),
5068
+ e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}/{entityId}/edit-publish", "cmsEditContent", "Update and publish content", { body: "json", bodyRequired: true, security: "cmsManage" }),
5069
+ e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}/{entityId}", "cmsUpdateContent", "Replace content", { body: "json", bodyRequired: true, security: "cmsManage" }),
5070
+ e("CMS Content", "patch", "/api/core/contents/{contentTypeUniqueId}/{entityId}", "cmsPatchContent", "Partially update content", { body: "json", bodyRequired: true, security: "cmsManage" }),
5071
+ e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}/publish/{entityId}", "cmsPublishContent", "Publish content", { security: "cmsManage" }),
5072
+ e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}/unpublish/{entityId}", "cmsUnpublishContent", "Unpublish content", { security: "cmsManage" }),
5073
+ e("CMS Content", "put", "/api/core/contents/publish", "cmsBatchPublishAllTypes", "Batch publish content", { body: "json", bodyRequired: true, security: "cmsManage" }),
5074
+ e("CMS Content", "put", "/api/core/contents/{contentTypeUniqueId}/publish", "cmsBatchPublish", "Batch publish typed content", { body: "json", bodyRequired: true, security: "cmsManage" }),
5075
+ e("CMS Content", "put", "/api/core/contents/unpublish", "cmsBatchUnpublishAllTypes", "Batch unpublish content", { body: "json", bodyRequired: true, security: "cmsManage" }),
5076
+ e("CMS Content", "put", "/api/core/contents/{contentTypeUniqueId}/unpublish", "cmsBatchUnpublish", "Batch unpublish typed content", { body: "json", bodyRequired: true, security: "cmsManage" }),
5077
+ e("CMS Content", "post", "/api/core/contents/archive", "cmsArchiveAllTypes", "Archive content", { body: "json", bodyRequired: true, security: "cmsManage" }),
5078
+ e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}/archive", "cmsArchiveContent", "Archive typed content", { body: "json", bodyRequired: true, security: "cmsManage" }),
5079
+ e("CMS Content", "post", "/api/core/contents/unarchive", "cmsUnarchiveAllTypes", "Unarchive content", { body: "json", bodyRequired: true, security: "cmsManage" }),
5080
+ e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}/unarchive", "cmsUnarchiveContent", "Unarchive typed content", { body: "json", bodyRequired: true, security: "cmsManage" }),
5081
+ e("CMS Content", "get", "/api/core/contents/archive", "cmsGetArchivedContents", "List archived content", { query: ["offset", "size"], security: "cmsManage" }),
5082
+ e("CMS Content", "get", "/api/core/contents/{contentTypeUniqueId}/archive", "cmsGetArchivedContentsByType", "List archived content by type", { query: ["offset", "size"], security: "cmsManage" }),
5083
+ e("CMS Content", "get", "/api/core/contents/draft", "cmsGetDrafts", "List drafts", { query: ["offset", "size"], security: "cmsManage" }),
5084
+ e("CMS Content", "get", "/api/core/contents/{contentTypeUniqueId}/draft", "cmsGetDraftsByType", "List drafts by content type", { query: ["offset", "size"], security: "cmsManage" }),
5085
+ e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}/draft", "cmsCreateDraft", "Create a draft", { body: "json", bodyRequired: true, security: "cmsManage" }),
5086
+ e("CMS Content", "get", "/api/core/contents/{contentTypeUniqueId}/draft/{entityId}", "cmsGetDraftById", "Get a draft", { security: "cmsManage" }),
5087
+ e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}/draft/{entityId}", "cmsUpdateDraft", "Update a draft", { body: "json", bodyRequired: true, security: "cmsManage" }),
5088
+ e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}/undraft/{entityId}", "cmsUndraftContent", "Convert a draft to regular content", { security: "cmsManage" }),
5089
+ e("CMS Content", "get", "/api/core/contents/{contentTypeUniqueId}/comments/{entityId}", "cmsGetComments", "List content comments", { query: ["offset", "size"], security: "cmsPublic" }),
5090
+ e("CMS Content", "get", "/api/core/contents/{contentUniqueId}/like/{entityId}", "cmsGetLikes", "List content likes", { query: ["offset", "size"], security: "cmsPublic" }),
5091
+ e("CMS Content", "get", "/api/core/contents/{contentUniqueId}/dislike/{entityId}", "cmsGetDislikes", "List content dislikes", { query: ["offset", "size"], security: "cmsPublic" }),
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" }),
5093
+ // CMS products
5094
+ e("CMS Products", "get", "/api/core/products/enable", "cmsGetProducts", "List enabled products", { query: ["offset", "size", "showDetail", "productTypeUniqueId", "tags"], security: "cmsPublic" }),
5095
+ e("CMS Products", "get", "/api/core/products", "cmsGetAllProducts", "List all products", { query: ["offset", "size", "showDetail", "enable"], security: "cmsManage" }),
5096
+ e("CMS Products", "get", "/api/core/products/manage", "cmsGetManageProducts", "List products for management", { query: ["offset", "size", "showDetail", "enable"], security: "cmsManage" }),
5097
+ e("CMS Products", "get", "/api/core/products/{productTypeUniqueId}", "cmsGetProductsByType", "List products by type", { query: ["offset", "size", "showDetail", "enable"], security: "cmsManage" }),
5098
+ e("CMS Products", "get", "/api/core/products/enable/{entityId}", "cmsGetProductByEntityId", "Get enabled product by entity ID", { security: "cmsPublic" }),
5099
+ e("CMS Products", "get", "/api/core/products/{productTypeUniqueId}/enable/{entityId}", "cmsGetTypedProductByEntityId", "Get enabled typed product by entity ID", { security: "cmsPublic", sdkMethods: ["getProductByEntityId"] }),
5100
+ e("CMS Products", "get", "/api/core/products/{productUniqueId}/byProductUniqueId/enable", "cmsGetProductByUniqueId", "Get product by unique ID", { security: "cmsPublic" }),
5101
+ e("CMS Products", "get", "/api/core/products/barcode/enable", "cmsGetProductByBarcode", "Get product by barcode", { query: ["barcode!"], security: "cmsPublic" }),
5102
+ e("CMS Products", "get", "/api/core/products/enable/search", "cmsSearchProducts", "Search enabled products", { query: ["query", "name", "offset", "size"], security: "cmsPublic" }),
5103
+ e("CMS Products", "post", "/api/core/products/{productTypeUniqueId}/add-publish", "cmsAddProduct", "Create and publish a product", { body: "json", bodyRequired: true, security: "cmsManage" }),
5104
+ e("CMS Products", "post", "/api/core/products/{productTypeUniqueId}", "cmsCreateProduct", "Create an unpublished product", { body: "json", bodyRequired: true, security: "cmsManage" }),
5105
+ e("CMS Products", "post", "/api/core/products/{productTypeUniqueId}/{entityId}/edit-publish", "cmsEditProduct", "Update and publish a product", { body: "json", bodyRequired: true, security: "cmsManage" }),
5106
+ e("CMS Products", "post", "/api/core/products/{productTypeUniqueId}/{entityId}", "cmsUpdateProduct", "Replace a product", { body: "json", bodyRequired: true, security: "cmsManage" }),
5107
+ e("CMS Products", "patch", "/api/core/products/{productTypeUniqueId}/{entityId}", "cmsPatchProduct", "Partially update a product", { body: "json", bodyRequired: true, security: "cmsManage" }),
5108
+ e("CMS Products", "post", "/api/core/products/{productTypeUniqueId}/publish/{entityId}", "cmsPublishProduct", "Publish a product", { security: "cmsManage" }),
5109
+ e("CMS Products", "post", "/api/core/products/{productTypeUniqueId}/unpublish/{entityId}", "cmsUnpublishProduct", "Unpublish a product", { security: "cmsManage" }),
5110
+ e("CMS Products", "put", "/api/core/products/publish", "cmsBatchPublishAllProductTypes", "Batch publish products", { body: "json", bodyRequired: true, security: "cmsManage" }),
5111
+ e("CMS Products", "put", "/api/core/products/{productTypeUniqueId}/publish", "cmsBatchPublishProducts", "Batch publish typed products", { body: "json", bodyRequired: true, security: "cmsManage" }),
5112
+ e("CMS Products", "put", "/api/core/products/unpublish", "cmsBatchUnpublishAllProductTypes", "Batch unpublish products", { body: "json", bodyRequired: true, security: "cmsManage" }),
5113
+ e("CMS Products", "put", "/api/core/products/{productTypeUniqueId}/unpublish", "cmsBatchUnpublishProducts", "Batch unpublish typed products", { body: "json", bodyRequired: true, security: "cmsManage" }),
5114
+ e("CMS Products", "post", "/api/core/products/archive", "cmsArchiveAllProductTypes", "Archive products", { body: "json", bodyRequired: true, security: "cmsManage" }),
5115
+ e("CMS Products", "post", "/api/core/products/{productTypeUniqueId}/archive", "cmsArchiveProducts", "Archive typed products", { body: "json", bodyRequired: true, security: "cmsManage" }),
5116
+ e("CMS Products", "post", "/api/core/products/unarchive", "cmsUnarchiveAllProductTypes", "Unarchive products", { body: "json", bodyRequired: true, security: "cmsManage" }),
5117
+ e("CMS Products", "post", "/api/core/products/{productTypeUniqueId}/unarchive", "cmsUnarchiveProducts", "Unarchive typed products", { body: "json", bodyRequired: true, security: "cmsManage" }),
5118
+ e("CMS Products", "get", "/api/core/products/archive", "cmsGetArchivedProducts", "List archived products", { query: ["offset", "size"], security: "cmsManage" }),
5119
+ e("CMS Products", "get", "/api/core/products/{productTypeUniqueId}/archive", "cmsGetArchivedProductsByType", "List archived products by type", { query: ["offset", "size"], security: "cmsManage" }),
5120
+ e("CMS Products", "get", "/api/core/products/ai/timeline-search/enable", "cmsProductTimelineSearch", "Run advanced product timeline search", { query: ["advance", "newVersion", "offset", "size"], security: "cmsPublic" }),
5121
+ // CMS tags
5122
+ e("CMS Tags", "get", "/api/core/tags/category", "cmsGetTagCategories", "List tag categories", { query: ["offset", "size", "enable"], security: "cmsPublic" }),
5123
+ e("CMS Tags", "post", "/api/core/tags/category", "cmsCreateTagCategory", "Create a tag category", { body: "json", bodyRequired: true, security: "cmsManage" }),
5124
+ e("CMS Tags", "get", "/api/core/tags/category/{id}", "cmsGetTagCategory", "Get a tag category", { security: "cmsManage" }),
5125
+ e("CMS Tags", "put", "/api/core/tags/category/{id}", "cmsUpdateTagCategory", "Update a tag category", { body: "json", bodyRequired: true, security: "cmsManage" }),
5126
+ e("CMS Tags", "put", "/api/core/tags/category/{id}/publish", "cmsPublishTagCategory", "Publish a tag category", { security: "cmsManage" }),
5127
+ e("CMS Tags", "put", "/api/core/tags/category/{id}/unpublish", "cmsUnpublishTagCategory", "Unpublish a tag category", { security: "cmsManage" }),
5128
+ e("CMS Tags", "get", "/api/core/tags/{categoryId}/tree/enable", "cmsGetTagTree", "Get the enabled tag tree", { query: ["offset", "size", "parentId", "level"], security: "cmsPublic", sdkMethods: ["getTagTree", "getCategories"] }),
5129
+ e("CMS Tags", "get", "/api/core/tags/{categoryId}/tree/manage", "cmsGetManageTagTree", "Get the tag tree for management", { query: ["offset", "size", "parentId", "level"], security: "cmsManage" }),
5130
+ e("CMS Tags", "post", "/api/core/tags/{categoryId}/tree", "cmsCreateTagTreeItem", "Create a tag tree item", { body: "json", bodyRequired: true, security: "cmsManage" }),
5131
+ e("CMS Tags", "get", "/api/core/tags/{categoryId}/tree/{id}/enable", "cmsGetTagTreeItem", "Get an enabled tag tree item", { security: "cmsPublic" }),
5132
+ e("CMS Tags", "get", "/api/core/tags/{categoryId}/tree/{id}/manage", "cmsGetManageTagTreeItem", "Get a tag tree item for management", { security: "cmsManage" }),
5133
+ e("CMS Tags", "put", "/api/core/tags/{categoryId}/tree/{id}", "cmsUpdateTagTreeItem", "Update a tag tree item", { body: "json", bodyRequired: true, security: "cmsManage" }),
5134
+ e("CMS Tags", "put", "/api/core/tags/{categoryId}/tree/publish/{id}", "cmsPublishTagTreeItem", "Publish a tag tree item", { security: "cmsManage" }),
5135
+ e("CMS Tags", "put", "/api/core/tags/{categoryId}/tree/unpublish/{id}", "cmsUnpublishTagTreeItem", "Unpublish a tag tree item", { security: "cmsManage" }),
5136
+ e("CMS Tags", "put", "/api/core/tags/{categoryId}/tree/parent/{id}", "cmsUpdateTagTreeParent", "Move a tag tree item", { body: "json", bodyRequired: true, security: "cmsManage" }),
5137
+ e("CMS Tags", "get", "/api/core/tags/{categoryId}/tree/parent/{id}/enable", "cmsGetTagTreeAncestors", "Get enabled tag ancestors", { query: ["includeCurrent"], security: "cmsPublic" }),
5138
+ e("CMS Tags", "get", "/api/core/tags/{categoryId}/tree/parent/{id}/manage", "cmsGetManageTagTreeAncestors", "Get tag ancestors for management", { query: ["includeCurrent"], security: "cmsManage" }),
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" }),
5164
+ // Podspace upload, download and file operations
5165
+ e("Podspace Files", "post", "/api/files", "podspaceUploadFile", "Upload a file", { query: ["path", "isPublic", "fileName", "parentHash"], body: "multipart", bodyRequired: true, security: "bearer" }),
5166
+ e("Podspace Files", "post", "/api/files/multiple", "podspaceUploadMultipleFiles", "Upload multiple files", { query: ["path", "isPublic", "parentHash"], body: "multipart", bodyRequired: true, security: "bearer" }),
5167
+ e("Podspace Files", "post", "/api/images/base64", "podspaceUploadImageBase64", "Upload a base64 image", { query: ["base64!", "fileName", "path", "isPublic"], security: "bearer" }),
5168
+ e("Podspace Files", "put", "/api/files/{hash}", "podspaceReplaceFile", "Replace file contents", { query: ["fileName"], body: "multipart", bodyRequired: true, security: "bearer" }),
5169
+ e("Podspace Files", "post", "/api/files/{hash}", "podspaceUploadByLink", "Upload file contents using an upload hash", { body: "multipart", bodyRequired: true, security: "bearer" }),
5170
+ e("Podspace Files", "get", "/api/files/{hash}", "podspaceDownloadFile", "Download a file", { query: ["download", "password", "shareHash"], security: "bearer", response: "binary" }),
5171
+ e("Podspace Files", "get", "/api/v2/images/{hash}", "podspaceDownloadImage", "Download or transform an image", { query: ["width", "height", "crop", "quality", "format", "download"], security: "bearer", response: "binary" }),
5172
+ e("Podspace Files", "get", "/api/files/{hash}/thumbnail", "podspaceDownloadThumbnail", "Download a file thumbnail", { query: ["width", "height", "quality"], security: "bearer", response: "binary" }),
5173
+ e("Podspace Files", "get", "/api/files", "podspaceDownloadFilesAsZip", "Download entities as a ZIP archive", { query: ["hashes!", "fileName"], security: "bearer", response: "binary" }),
5174
+ e("Podspace Files", "get", "/api/files/link", "podspaceGetUploadLink", "Get a pre-signed upload link", { query: ["fileName!", "path", "size", "parentHash"], security: "bearer" }),
5175
+ e("Podspace Files", "get", "/api/files/{hash}/detail", "podspaceGetFileDetail", "Get file or folder details", { query: ["password", "breadcrumb", "shareHash", "nativeMetadata", "includeSizeAndCount"], security: "bearer" }),
5176
+ e("Podspace Files", "get", "/api/files/details", "podspaceGetFileDetailByPath", "Get file details by path", { query: ["path!", "parentHash", "password", "entityType"], security: "bearer" }),
5177
+ e("Podspace Files", "get", "/api/files/{hash}/exist", "podspaceCheckEntityExist", "Check whether an entity exists", { query: ["fileName!", "uniqueName", "type"], security: "bearer" }),
5178
+ e("Podspace Files", "put", "/api/files/{hash}/rename", "podspaceRenameEntity", "Rename a file or folder", { query: ["name!", "uniqueName"], security: "bearer" }),
5179
+ e("Podspace Files", "put", "/api/files/{hash}/move", "podspaceMoveEntity", "Move a file or folder", { query: ["destFolderHash!", "policy", "uniqueName"], security: "bearer" }),
5180
+ e("Podspace Files", "put", "/api/files/{hash}/copy", "podspaceCopyEntity", "Copy a file or folder", { query: ["destFolderHash!", "policy", "uniqueName", "copyType"], security: "bearer" }),
5181
+ e("Podspace Files", "delete", "/api/files/{hash}", "podspaceTrashEntity", "Move a file or folder to trash", { security: "bearer", sdkMethods: ["trashEntity", "deleteFile"] }),
5182
+ e("Podspace Files", "patch", "/api/files/{hash}", "podspaceUpdateFile", "Update file properties", { body: "json", bodyRequired: true, security: "bearer" }),
5183
+ e("Podspace Files", "get", "/api/files/search", "podspaceSearchFiles", "Search files and folders", { query: ["query", "name", "type", "start", "size", "parentHash"], security: "bearer" }),
5184
+ e("Podspace Files", "get", "/api/v2/files/recent", "podspaceGetRecentFiles", "List recent files", { query: ["start", "size"], security: "bearer" }),
5185
+ e("Podspace Files", "get", "/api/files/v2/{hash}/versions", "podspaceGetFileVersions", "List file versions", { security: "bearer" }),
5186
+ e("Podspace Files", "patch", "/api/files/versions/{hash}", "podspaceRestoreFileVersion", "Restore a file version", { security: "bearer" }),
5187
+ e("Podspace Files", "get", "/api/v2/files/{hash}/native/metadata", "podspaceGetNativeMetadata", "Get native file metadata", { security: "bearer" }),
5188
+ e("Podspace Files", "get", "/api/files/{hash}/convert", "podspaceConvertFile", "Convert and download a file", { query: ["format!", "password"], security: "bearer", response: "binary" }),
5189
+ e("Podspace Files", "get", "/api/files/{hash}/breadcrumb", "podspaceGetBreadcrumb", "Get file breadcrumbs", { security: "bearer" }),
5190
+ e("Podspace Files", "post", "/api/files/compress", "podspaceCompressFiles", "Compress files", { query: ["hashes!", "fileName", "parentHash"], security: "bearer" }),
5191
+ e("Podspace Files", "put", "/api/files/{hash}/extract", "podspaceExtractArchive", "Extract an archive", { query: ["destinationHash", "password", "overwrite"], security: "bearer" }),
5192
+ e("Podspace Files", "put", "/api/files/{hash}/cachePolicy", "podspaceSetCachePolicy", "Set file cache policy", { query: ["cachePolicy!"], security: "bearer" }),
5193
+ e("Podspace Files", "get", "/api/files/{hash}/activities", "podspaceGetActivities", "List file activities", { query: ["start", "size"], security: "bearer" }),
5194
+ e("Podspace Files", "get", "/api/files/{hash}/activities/{activity}", "podspaceGetActivityUsers", "List users for a file activity", { query: ["start", "size"], security: "bearer" }),
5195
+ e("Podspace Files", "get", "/api/files/{hash}/activities/{activity}/count", "podspaceGetActivityCount", "Count a file activity", { security: "bearer" }),
5196
+ // Podspace folders
5197
+ e("Podspace Folders", "post", "/api/folders", "podspaceCreateFolder", "Create a folder", { query: ["name!", "parentHash", "isPublic", "description"], security: "bearer" }),
5198
+ e("Podspace Folders", "post", "/api/folders/{hash}/directories", "podspaceCreateDirectories", "Create nested directories", { query: ["directories!"], security: "bearer" }),
5199
+ e("Podspace Folders", "get", "/api/folders/{hash}/children", "podspaceGetFolderChildren", "List folder children", { query: ["start", "size", "sort", "order", "type"], security: "bearer" }),
5200
+ e("Podspace Folders", "get", "/api/v2/folders/recent", "podspaceGetRecentFolders", "List recent folders", { query: ["start", "size"], security: "bearer" }),
5201
+ e("Podspace Folders", "get", "/api/folders/{hash}/check/upload", "podspaceCheckFolderUpload", "Check folder upload permission", { query: ["size"], security: "bearer" }),
5202
+ e("Podspace Folders", "get", "/api/folders/{folderHash}/actions", "podspaceGetFolderActions", "List allowed folder actions", { security: "bearer" }),
5203
+ // Podspace resumable uploads
5204
+ e("Podspace Resumable", "post", "/api/files/resumable", "podspaceCreateResumableUpload", "Create a resumable upload", { query: ["fileName!", "fileSize!", "parentHash", "contentType"], security: "bearer" }),
5205
+ e("Podspace Resumable", "patch", "/api/files/resumable/{id}", "podspaceAppendResumableChunk", "Append a resumable upload chunk", { query: ["offset!"], body: "binary", bodyRequired: true, security: "bearer" }),
5206
+ e("Podspace Resumable", "head", "/api/files/resumable/{id}", "podspaceGetResumableStatus", "Get resumable upload status", { security: "bearer", response: "empty" }),
5207
+ e("Podspace Resumable", "post", "/api/files/resumable/{id}/finalize", "podspaceFinalizeResumableUpload", "Finalize a resumable upload", { query: ["fileName", "parentHash", "isPublic"], security: "bearer" }),
5208
+ // Podspace links and shares
5209
+ e("Podspace Links", "get", "/api/links/files/{hash}", "podspaceCreateLink", "Create a public file link", { query: ["expireTime", "download", "password"], security: "bearer" }),
5210
+ e("Podspace Links", "get", "/api/links", "podspaceGetUserLinks", "List user links", { query: ["start", "size", "status"], security: "bearer" }),
5211
+ e("Podspace Links", "get", "/api/links/{link}/detail", "podspaceGetLinkDetail", "Get link details", { security: "bearer" }),
5212
+ e("Podspace Links", "patch", "/api/links/{link}", "podspaceUpdateLink", "Update a public link", { query: ["expireTime", "password", "download"], security: "bearer" }),
5213
+ e("Podspace Links", "delete", "/api/links/{link}", "podspaceRevokeLink", "Revoke a public link", { security: "bearer" }),
5214
+ e("Podspace Links", "get", "/api/links/{hash}", "podspaceDownloadFileByLink", "Download a file via public link", { query: ["password", "download"], security: "none", response: "binary" }),
5215
+ e("Podspace Shares", "post", "/api/files/{hash}/shares/users/{identity}", "podspaceShareWithUser", "Share an entity with a user", { query: ["permission!", "expireTime", "notify"], security: "bearer" }),
5216
+ e("Podspace Shares", "delete", "/api/files/{hash}/shares/users/{identity}", "podspaceRemoveShareWithUser", "Remove a user share", { security: "bearer" }),
5217
+ e("Podspace Shares", "post", "/api/files/{hash}/public", "podspaceMakePublic", "Make an entity public", { query: ["isPublic!", "password", "expireTime"], security: "bearer" }),
5218
+ e("Podspace Shares", "get", "/api/shares", "podspaceGetSharedWithMe", "List entities shared with the current user", { query: ["start", "size", "status"], security: "bearer" }),
5219
+ e("Podspace Shares", "get", "/api/shares/{shareHash}", "podspaceGetShareDetail", "Get share details", { security: "bearer" }),
5220
+ e("Podspace Shares", "delete", "/api/shares/{shareHash}", "podspaceRevokeShare", "Revoke a share", { security: "bearer" }),
5221
+ e("Podspace Shares", "get", "/api/files/{hash}/shares", "podspaceGetFileShares", "List shares for an entity", { query: ["start", "size"], security: "bearer" }),
5222
+ e("Podspace Shares", "put", "/api/shares/{shareHash}/password", "podspaceSetSharePassword", "Set a share password", { query: ["password!"], security: "bearer" }),
5223
+ e("Podspace Shares", "put", "/api/files/{entityHash}/shares/password", "podspaceSetEntityPassword", "Set an entity share password", { query: ["password!"], security: "bearer" }),
5224
+ // Podspace trash, tags, bookmarks and metadata
5225
+ e("Podspace Trash", "get", "/api/trashes", "podspaceGetTrashList", "List trash entries", { query: ["start", "size", "sort", "order"], security: "bearer" }),
5226
+ e("Podspace Trash", "put", "/api/trashes/{hash}/restore", "podspaceRestoreTrash", "Restore a trash entry", { security: "bearer" }),
5227
+ e("Podspace Trash", "post", "/api/trashes/restore", "podspaceRestoreAllTrash", "Restore all trash entries", { security: "bearer" }),
5228
+ e("Podspace Trash", "delete", "/api/trashes/{hash}", "podspaceDeletePermanently", "Permanently delete a trash entry", { security: "bearer" }),
5229
+ e("Podspace Trash", "delete", "/api/trashes", "podspaceEmptyTrash", "Empty trash", { security: "bearer" }),
5230
+ e("Podspace Trash", "post", "/api/trashes/periods/{period}", "podspaceSetAutoCleanupPeriod", "Set the trash auto-cleanup period", { security: "bearer" }),
5231
+ e("Podspace Tags", "post", "/api/tags", "podspaceAddTags", "Add tags to entities", { query: ["hashes!", "tags!"], security: "bearer" }),
5232
+ e("Podspace Tags", "delete", "/api/tags", "podspaceDeleteTags", "Remove tags from entities", { query: ["hashes!", "tags!"], security: "bearer" }),
5233
+ e("Podspace Tags", "get", "/api/tags/entities/{hash}", "podspaceGetEntityTags", "List tags for an entity", { security: "bearer" }),
5234
+ e("Podspace Tags", "get", "/api/tags/search/{tagName}", "podspaceSearchTags", "Search tags", { query: ["start", "size"], security: "bearer" }),
5235
+ e("Podspace Tags", "get", "/api/tags/{tagName}", "podspaceGetEntitiesByTag", "List entities by tag", { query: ["start", "size"], security: "bearer" }),
5236
+ e("Podspace Bookmarks", "get", "/api/bookmarks", "podspaceGetBookmarks", "List bookmarks", { query: ["start", "size", "sort", "order"], security: "bearer" }),
5237
+ e("Podspace Bookmarks", "post", "/api/bookmarks", "podspaceAddBookmark", "Add a bookmark", { query: ["hash!"], security: "bearer" }),
5238
+ e("Podspace Bookmarks", "delete", "/api/bookmarks", "podspaceRemoveBookmark", "Remove a bookmark", { query: ["hash!"], security: "bearer" }),
5239
+ e("Podspace Metadata", "get", "/api/files/{hash}/metadata", "podspaceGetMetadata", "Get custom metadata", { query: ["key"], security: "bearer" }),
5240
+ e("Podspace Metadata", "put", "/api/files/{hash}/metadata", "podspaceSetMetadata", "Set custom metadata", { body: "json", bodyRequired: true, security: "bearer" }),
5241
+ e("Podspace Metadata", "delete", "/api/files/{hash}/metadata", "podspaceDeleteMetadata", "Delete custom metadata", { query: ["keys"], security: "bearer" }),
5242
+ e("Podspace Metadata", "post", "/api/files/metadata/search", "podspaceSearchMetadata", "Search custom metadata", { body: "json", bodyRequired: true, security: "bearer" }),
5243
+ e("Podspace Metadata", "get", "/api/files/description", "podspaceGetDescription", "Get an entity description", { query: ["hash!"], security: "bearer" }),
5244
+ e("Podspace Metadata", "put", "/api/files/description", "podspaceSetDescription", "Set an entity description", { query: ["hash!", "description!"], security: "bearer" }),
5245
+ e("Podspace Metadata", "delete", "/api/files/description", "podspaceDeleteDescription", "Delete an entity description", { query: ["hash!"], security: "bearer" }),
5246
+ // Podspace user groups, workspaces and account
5247
+ e("Podspace User Groups", "post", "/api/usergroups", "podspaceCreateUserGroup", "Create a user group", { query: ["name!", "description"], security: "bearer" }),
5248
+ e("Podspace User Groups", "get", "/api/usergroups/{userGroupHash}", "podspaceGetUserGroup", "Get a user group", { security: "bearer" }),
5249
+ e("Podspace User Groups", "delete", "/api/usergroups/{userGroupHash}", "podspaceDeleteUserGroup", "Delete a user group", { security: "bearer" }),
5250
+ e("Podspace User Groups", "get", "/api/usergroups/{userGroupHash}/users", "podspaceGetUserGroupUsers", "List user group members", { query: ["start", "size"], security: "bearer" }),
5251
+ e("Podspace User Groups", "post", "/api/usergroups/{userGroupHash}/users", "podspaceAddUserToGroup", "Add a user to a group", { query: ["identity!", "role"], security: "bearer" }),
5252
+ e("Podspace User Groups", "delete", "/api/usergroups/{userGroupHash}/users", "podspaceRemoveUserFromGroup", "Remove a user from a group", { query: ["identity!"], security: "bearer" }),
5253
+ e("Podspace User Groups", "get", "/api/usergroups/{userGroupHash}/files", "podspaceGetUserGroupFiles", "List user group files", { query: ["start", "size"], security: "bearer" }),
5254
+ e("Podspace User Groups", "post", "/api/usergroups/{userGroupHash}/files", "podspaceUploadToUserGroup", "Upload a file to a user group", { body: "multipart", bodyRequired: true, security: "bearer" }),
5255
+ e("Podspace User Groups", "post", "/api/usergroups/{userGroupHash}/images", "podspaceUploadImageToUserGroup", "Upload an image to a user group", { body: "multipart", bodyRequired: true, security: "bearer" }),
5256
+ e("Podspace User Groups", "get", "/api/usergroups/{userGroupHash}/usage", "podspaceGetUserGroupUsage", "Get user group storage usage", { security: "bearer" }),
5257
+ e("Podspace Workspaces", "post", "/api/workspaces", "podspaceCreateWorkspace", "Create a workspace", { query: ["name!", "description"], security: "bearer" }),
5258
+ e("Podspace Workspaces", "get", "/api/workspaces/{identity}", "podspaceGetWorkspace", "Get a workspace", { query: ["identityType"], security: "bearer" }),
5259
+ e("Podspace Workspaces", "patch", "/api/workspaces/{identity}", "podspaceUpdateWorkspace", "Update a workspace", { query: ["name", "description"], security: "bearer" }),
5260
+ e("Podspace Workspaces", "get", "/api/workspaces/{identity}/members", "podspaceGetWorkspaceMembers", "List workspace members", { query: ["start", "size"], security: "bearer" }),
5261
+ e("Podspace Workspaces", "put", "/api/workspaces/{identity}/members/{userIdentity}", "podspaceUpdateWorkspaceMember", "Update a workspace member", { query: ["role!", "identityType"], security: "bearer" }),
5262
+ e("Podspace Workspaces", "delete", "/api/workspaces/{identity}/members/{userIdentity}", "podspaceRemoveWorkspaceMember", "Remove a workspace member", { query: ["identityType"], security: "bearer" }),
5263
+ e("Podspace Account", "get", "/api/me", "podspaceGetUser", "Get the current Podspace user", { security: "bearer" }),
5264
+ e("Podspace Account", "get", "/api/me/workspaces", "podspaceGetUserWorkspaces", "List current user workspaces", { query: ["start", "size"], security: "bearer" }),
5265
+ e("Podspace Account", "get", "/api/me/status", "podspaceGetUserStatus", "Get current user status", { security: "bearer" }),
5266
+ e("Podspace Account", "get", "/api/me/scope", "podspaceGetUserScope", "Get current user scopes", { security: "bearer" }),
5267
+ e("Podspace Account", "get", "/api/me/reports/usage", "podspaceGetUserUsageReport", "Get current user usage report", { query: ["from", "to"], security: "bearer" }),
5268
+ e("Podspace Account", "get", "/api/me/plans", "podspaceGetUserPlans", "List current user plans", { security: "bearer" }),
5269
+ e("Podspace Account", "get", "/api/me/folder", "podspaceGetPersonalFolder", "Get the personal folder", { security: "bearer" }),
5270
+ e("Podspace Account", "get", "/api/me/folders/chat", "podspaceGetOrCreateChatFolder", "Get or create the chat folder", { security: "bearer" }),
5271
+ e("Podspace Account", "get", "/api/me/avatar", "podspaceGetUserAvatar", "Download the current user avatar", { security: "bearer", response: "binary" })
5272
+ ];
5273
+ var TAG_DESCRIPTIONS = {
5274
+ SSO: "Authentication, OTP, token and user-profile operations.",
5275
+ Captcha: "POD captcha generation and validation.",
5276
+ "Custom Post": "Custom post and metadata timeline operations.",
5277
+ Notification: "Notification delivery operations.",
5278
+ Social: "Comments and reactions.",
5279
+ IUMS: "IUMS RPC-style academic information operations.",
5280
+ PodForm: "Forms, fields, responses, templates, folders, OTP and plans.",
5281
+ "CMS Content": "CMS content lifecycle and discovery.",
5282
+ "CMS Products": "CMS product lifecycle and discovery.",
5283
+ "CMS Tags": "CMS tag categories and tag trees.",
5284
+ "Podspace Files": "File upload, download and management.",
5285
+ "Podspace Folders": "Folder hierarchy operations.",
5286
+ "Podspace Resumable": "Resumable file uploads.",
5287
+ "Podspace Links": "Public download links.",
5288
+ "Podspace Shares": "Sharing and permissions.",
5289
+ "Podspace Trash": "Trash and recovery.",
5290
+ "Podspace Tags": "File and folder tags.",
5291
+ "Podspace Bookmarks": "File and folder bookmarks.",
5292
+ "Podspace Metadata": "Custom metadata and descriptions.",
5293
+ "Podspace User Groups": "Team user groups and their files.",
5294
+ "Podspace Workspaces": "Workspace and membership operations.",
5295
+ "Podspace Account": "Current user, plan and quota operations."
5296
+ };
5297
+ var SERVICE_URL = {
5298
+ SSO: "accounts",
5299
+ Captcha: "cms",
5300
+ "Custom Post": "apiPod",
5301
+ Notification: "notification",
5302
+ Social: "apiPod",
5303
+ IUMS: "iums",
5304
+ PodForm: "podform",
5305
+ "CMS Content": "cms",
5306
+ "CMS Products": "cms",
5307
+ "CMS Tags": "cms",
5308
+ "Podspace Files": "podspace",
5309
+ "Podspace Folders": "podspace",
5310
+ "Podspace Resumable": "podspace",
5311
+ "Podspace Links": "podspace",
5312
+ "Podspace Shares": "podspace",
5313
+ "Podspace Trash": "podspace",
5314
+ "Podspace Tags": "podspace",
5315
+ "Podspace Bookmarks": "podspace",
5316
+ "Podspace Metadata": "podspace",
5317
+ "Podspace User Groups": "podspace",
5318
+ "Podspace Workspaces": "podspace",
5319
+ "Podspace Account": "podspace"
5320
+ };
5321
+ function securityRequirement(kind = "apiToken") {
5322
+ switch (kind) {
5323
+ case "none":
5324
+ return [];
5325
+ case "bearer":
5326
+ return [{ BearerAuth: [] }];
5327
+ case "basic":
5328
+ return [{ BasicAuth: [] }];
5329
+ case "clientId":
5330
+ return [{ ClientId: [] }];
5331
+ case "podFormToken":
5332
+ return [{ PodFormToken: [] }];
5333
+ case "cmsPublic":
5334
+ return [{ ClientId: [] }];
5335
+ case "cmsManage":
5336
+ return [{ ClientId: [], CmsAccessToken: [] }];
5337
+ case "signature":
5338
+ return [{ SignatureAuth: [] }];
5339
+ default:
5340
+ return [{ PodApiToken: [] }];
5341
+ }
5342
+ }
5343
+ function pathParameters(path) {
5344
+ return Array.from(path.matchAll(/\{([^}]+)\}/g), ([, name]) => ({
5345
+ name,
5346
+ in: "path",
5347
+ required: true,
5348
+ schema: /(^id$|Id$|entityId$|period$)/.test(name) ? { type: "integer" } : { type: "string" }
5349
+ }));
5350
+ }
5351
+ function queryParameters(query = []) {
5352
+ return query.map((rawName) => {
5353
+ const required = rawName.endsWith("!");
5354
+ const name = required ? rawName.slice(0, -1) : rawName;
5355
+ const arrayLike = /^(hashes|tags|keys|fieldIds|responseIds|directories)$/.test(name);
5356
+ const booleanLike = /^(enable|showDetail|lockForEdit|removeFromTrash|isPublic|uniqueName|download|breadcrumb|nativeMetadata|includeSizeAndCount|notify|overwrite|dislike|newVersion|includeCurrent)$/.test(name);
5357
+ const integerLike = /^(offset|start|size|page|width|height|quality|period|fileSize)$/.test(name);
5358
+ return {
5359
+ name,
5360
+ in: "query",
5361
+ required,
5362
+ schema: arrayLike ? { type: "array", items: { type: "string" } } : booleanLike ? { type: "boolean" } : integerLike ? { type: "integer" } : { type: "string" }
5363
+ };
5364
+ });
5365
+ }
5366
+ function requestBody(kind, required = false) {
5367
+ if (!kind) return void 0;
5368
+ const contentType = kind === "form" ? "application/x-www-form-urlencoded" : kind === "multipart" ? "multipart/form-data" : kind === "binary" ? "application/octet-stream" : "application/json";
5369
+ const schema = kind === "binary" ? { type: "string", format: "binary" } : kind === "multipart" ? { $ref: "#/components/schemas/MultipartUpload" } : { $ref: "#/components/schemas/GenericObject" };
5370
+ return { required, content: { [contentType]: { schema } } };
5371
+ }
5372
+ function responses(kind = "json") {
5373
+ const success = kind === "binary" ? { description: "Binary response", content: { "application/octet-stream": { schema: { type: "string", format: "binary" } } } } : kind === "empty" ? { description: "Successful response" } : { description: "Successful response", content: { "application/json": { schema: { $ref: "#/components/schemas/ApiResponse" } } } };
5374
+ return {
5375
+ "200": success,
5376
+ "400": { $ref: "#/components/responses/BadRequest" },
5377
+ "401": { $ref: "#/components/responses/Unauthorized" },
5378
+ "500": { $ref: "#/components/responses/ServerError" }
5379
+ };
5380
+ }
5381
+ function createPodOpenApiDocument(options = {}) {
5382
+ const urls = resolvePodUrls(options.urls, options.sandbox);
5383
+ const paths = {};
5384
+ for (const endpoint of POD_OPENAPI_ENDPOINTS) {
5385
+ const parameters = [...pathParameters(endpoint.path), ...queryParameters(endpoint.query)];
5386
+ const operation = {
5387
+ tags: [endpoint.tag],
5388
+ summary: endpoint.summary,
5389
+ operationId: endpoint.operationId,
5390
+ security: securityRequirement(endpoint.security),
5391
+ servers: [{ url: urls[SERVICE_URL[endpoint.tag]] }],
5392
+ responses: responses(endpoint.response),
5393
+ "x-sdk-methods": endpoint.sdkMethods || [endpoint.operationId.replace(/^[a-z]+/, (value) => value)]
5394
+ };
5395
+ if (parameters.length) operation.parameters = parameters;
5396
+ const body = requestBody(endpoint.body, endpoint.bodyRequired);
5397
+ if (body) operation.requestBody = body;
5398
+ if (endpoint.deprecated) operation.deprecated = true;
5399
+ paths[endpoint.path] ||= {};
5400
+ if (paths[endpoint.path][endpoint.method]) {
5401
+ throw new Error(`Duplicate OpenAPI operation: ${endpoint.method.toUpperCase()} ${endpoint.path}`);
5402
+ }
5403
+ paths[endpoint.path][endpoint.method] = operation;
5404
+ }
5405
+ return {
5406
+ openapi: "3.0.3",
5407
+ info: {
5408
+ title: options.title || "POD SDK Services API",
5409
+ version: options.version || "1.0.10",
5410
+ description: "Swagger/OpenAPI documentation for every remote HTTP operation exposed by @rezamirzapour/pod-sdk.",
5411
+ license: { name: "MIT", url: "https://opensource.org/licenses/MIT" }
5412
+ },
5413
+ tags: Object.entries(TAG_DESCRIPTIONS).map(([name, description]) => ({ name, description })),
5414
+ paths,
5415
+ components: {
5416
+ securitySchemes: {
5417
+ PodApiToken: { type: "apiKey", in: "header", name: "_token_", description: "POD API token." },
5418
+ BearerAuth: { type: "http", scheme: "bearer", bearerFormat: "POD token" },
5419
+ BasicAuth: { type: "http", scheme: "basic" },
5420
+ SignatureAuth: { type: "apiKey", in: "header", name: "Authorization", description: "Signature generated by the SSO handshake key." },
5421
+ ClientId: { type: "apiKey", in: "header", name: "Client-Id" },
5422
+ CmsAccessToken: { type: "apiKey", in: "header", name: "Access-Token" },
5423
+ PodFormToken: { type: "apiKey", in: "header", name: "token" }
5424
+ },
5425
+ schemas: {
5426
+ GenericObject: { type: "object", additionalProperties: true },
5427
+ MultipartUpload: {
5428
+ type: "object",
5429
+ properties: { file: { type: "string", format: "binary" }, files: { type: "array", items: { type: "string", format: "binary" } } },
5430
+ additionalProperties: true
5431
+ },
5432
+ ApiResponse: {
5433
+ type: "object",
5434
+ properties: {
5435
+ hasError: { type: "boolean" },
5436
+ result: {},
5437
+ message: { type: "string" },
5438
+ errorCode: { type: "integer" },
5439
+ count: { type: "integer" },
5440
+ referenceNumber: { type: "string" }
5441
+ },
5442
+ additionalProperties: true
5443
+ },
5444
+ ErrorResponse: {
5445
+ type: "object",
5446
+ properties: { hasError: { type: "boolean", example: true }, message: { type: "string" }, errorCode: { type: "integer" } },
5447
+ additionalProperties: true
5448
+ }
5449
+ },
5450
+ responses: {
5451
+ BadRequest: { description: "Invalid request", content: { "application/json": { schema: { $ref: "#/components/schemas/ErrorResponse" } } } },
5452
+ Unauthorized: { description: "Authentication failed", content: { "application/json": { schema: { $ref: "#/components/schemas/ErrorResponse" } } } },
5453
+ ServerError: { description: "Remote service error", content: { "application/json": { schema: { $ref: "#/components/schemas/ErrorResponse" } } } }
5454
+ }
5455
+ }
5456
+ };
5457
+ }
5458
+ var POD_OPENAPI_DOCUMENT = createPodOpenApiDocument();
5459
+ var podSwaggerDocument = POD_OPENAPI_DOCUMENT;
5460
+
4300
5461
  exports.CaptchaService = CaptchaService;
5462
+ exports.CmsContentTypeService = CmsContentTypeService;
4301
5463
  exports.CmsDataFormatter = CmsDataFormatter;
4302
5464
  exports.CmsProductService = CmsProductService;
4303
5465
  exports.CmsService = CmsService;
@@ -4307,6 +5469,8 @@ exports.CustomPostService = CustomPostService;
4307
5469
  exports.DEFAULT_POD_URLS = DEFAULT_POD_URLS;
4308
5470
  exports.IumsService = IumsService;
4309
5471
  exports.NotificationService = NotificationService;
5472
+ exports.POD_OPENAPI_DOCUMENT = POD_OPENAPI_DOCUMENT;
5473
+ exports.POD_OPENAPI_ENDPOINTS = POD_OPENAPI_ENDPOINTS;
4310
5474
  exports.PodFormService = PodFormService;
4311
5475
  exports.PodSdk = PodSdk;
4312
5476
  exports.PodspaceBookmarksService = PodspaceBookmarksService;
@@ -4326,10 +5490,12 @@ exports.PodspaceWorkspacesService = PodspaceWorkspacesService;
4326
5490
  exports.SANDBOX_POD_URLS = SANDBOX_POD_URLS;
4327
5491
  exports.SocialService = SocialService;
4328
5492
  exports.SsoService = SsoService;
5493
+ exports.createPodOpenApiDocument = createPodOpenApiDocument;
4329
5494
  exports.createPodSdk = createPodSdk;
4330
5495
  exports.default = client_default;
4331
5496
  exports.encodeBase64 = encodeBase64;
4332
5497
  exports.generatePodSignatureHeader = generatePodSignatureHeader;
5498
+ exports.podSwaggerDocument = podSwaggerDocument;
4333
5499
  exports.resolvePodUrls = resolvePodUrls;
4334
5500
  //# sourceMappingURL=index.js.map
4335
5501
  //# sourceMappingURL=index.js.map