@rezamirzapour/pod-sdk 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +58 -4
- package/dist/index.d.ts +58 -4
- package/dist/index.js +599 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +596 -38
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -272,7 +272,7 @@ var CaptchaService = class {
|
|
|
272
272
|
async get() {
|
|
273
273
|
const params = {};
|
|
274
274
|
try {
|
|
275
|
-
|
|
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
|
-
|
|
295
|
-
|
|
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
|
-
|
|
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
|
-
|
|
326
|
-
|
|
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() {
|
|
@@ -3506,7 +3546,8 @@ var CmsService = class {
|
|
|
3506
3546
|
this.formatter = new CmsDataFormatter(options.podspaceUrl || "https://podspace.pod.ir");
|
|
3507
3547
|
this.http = http.createNextHttp({
|
|
3508
3548
|
baseUrl: options.baseUrl,
|
|
3509
|
-
serviceName: "POD-CMS"
|
|
3549
|
+
serviceName: "POD-CMS",
|
|
3550
|
+
queryArrayFormat: "brackets"
|
|
3510
3551
|
});
|
|
3511
3552
|
this.products = new CmsProductService({
|
|
3512
3553
|
http: this.http,
|
|
@@ -3522,6 +3563,29 @@ var CmsService = class {
|
|
|
3522
3563
|
revalidate: this.revalidate
|
|
3523
3564
|
});
|
|
3524
3565
|
}
|
|
3566
|
+
normalizeParams(params) {
|
|
3567
|
+
const arrayFields = [
|
|
3568
|
+
"fieldCode",
|
|
3569
|
+
"fieldValue",
|
|
3570
|
+
"excludeFieldCode",
|
|
3571
|
+
"excludeFieldValue",
|
|
3572
|
+
"tags",
|
|
3573
|
+
"tagTrees",
|
|
3574
|
+
"tagTreesCode",
|
|
3575
|
+
"entityIds",
|
|
3576
|
+
"postIds",
|
|
3577
|
+
"notPostIds",
|
|
3578
|
+
"operationValuesArray",
|
|
3579
|
+
"orderBy"
|
|
3580
|
+
];
|
|
3581
|
+
const result = { ...params };
|
|
3582
|
+
for (const field of arrayFields) {
|
|
3583
|
+
if (result[field] !== void 0 && result[field] !== null && !Array.isArray(result[field])) {
|
|
3584
|
+
result[field] = [result[field]];
|
|
3585
|
+
}
|
|
3586
|
+
}
|
|
3587
|
+
return result;
|
|
3588
|
+
}
|
|
3525
3589
|
get commonHeaders() {
|
|
3526
3590
|
return {
|
|
3527
3591
|
"Client-Id": this.clientId,
|
|
@@ -3542,15 +3606,16 @@ var CmsService = class {
|
|
|
3542
3606
|
* Swagger: GET /api/core/contents/enable
|
|
3543
3607
|
*/
|
|
3544
3608
|
async getContent(params = {}, options = {}) {
|
|
3545
|
-
const transferParams = {
|
|
3609
|
+
const transferParams = this.normalizeParams({
|
|
3546
3610
|
size: 50,
|
|
3547
3611
|
offset: 0,
|
|
3548
3612
|
showDetail: true,
|
|
3549
3613
|
...params
|
|
3550
|
-
};
|
|
3614
|
+
});
|
|
3551
3615
|
try {
|
|
3552
3616
|
const res = await this.http.get("/api/core/contents/enable", {
|
|
3553
3617
|
params: transferParams,
|
|
3618
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3554
3619
|
headers: {
|
|
3555
3620
|
...this.commonHeaders,
|
|
3556
3621
|
...options.headers
|
|
@@ -3571,15 +3636,16 @@ var CmsService = class {
|
|
|
3571
3636
|
* Swagger: GET /api/core/contents
|
|
3572
3637
|
*/
|
|
3573
3638
|
async getAllContents(params = {}, options = {}) {
|
|
3574
|
-
const transferParams = {
|
|
3639
|
+
const transferParams = this.normalizeParams({
|
|
3575
3640
|
size: 50,
|
|
3576
3641
|
offset: 0,
|
|
3577
3642
|
showDetail: true,
|
|
3578
3643
|
...params
|
|
3579
|
-
};
|
|
3644
|
+
});
|
|
3580
3645
|
try {
|
|
3581
3646
|
const res = await this.http.get("/api/core/contents", {
|
|
3582
3647
|
params: transferParams,
|
|
3648
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3583
3649
|
headers: {
|
|
3584
3650
|
...this.managingHeaders,
|
|
3585
3651
|
...options.headers
|
|
@@ -3600,15 +3666,16 @@ var CmsService = class {
|
|
|
3600
3666
|
* Swagger: GET /api/core/contents/my
|
|
3601
3667
|
*/
|
|
3602
3668
|
async getMyContents(params = {}, options = {}) {
|
|
3603
|
-
const transferParams = {
|
|
3669
|
+
const transferParams = this.normalizeParams({
|
|
3604
3670
|
size: 50,
|
|
3605
3671
|
offset: 0,
|
|
3606
3672
|
showDetail: true,
|
|
3607
3673
|
...params
|
|
3608
|
-
};
|
|
3674
|
+
});
|
|
3609
3675
|
try {
|
|
3610
3676
|
const res = await this.http.get("/api/core/contents/my", {
|
|
3611
3677
|
params: transferParams,
|
|
3678
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3612
3679
|
headers: {
|
|
3613
3680
|
...this.managingHeaders,
|
|
3614
3681
|
...options.headers
|
|
@@ -3629,17 +3696,18 @@ var CmsService = class {
|
|
|
3629
3696
|
* Swagger: GET /api/core/contents/{contentTypeUniqueId}
|
|
3630
3697
|
*/
|
|
3631
3698
|
async getContentsByType(contentTypeUniqueId, params = {}, options = {}) {
|
|
3632
|
-
const transferParams = {
|
|
3699
|
+
const transferParams = this.normalizeParams({
|
|
3633
3700
|
size: 50,
|
|
3634
3701
|
offset: 0,
|
|
3635
3702
|
showDetail: true,
|
|
3636
3703
|
...params
|
|
3637
|
-
};
|
|
3704
|
+
});
|
|
3638
3705
|
try {
|
|
3639
3706
|
const res = await this.http.get(
|
|
3640
3707
|
`/api/core/contents/${contentTypeUniqueId}`,
|
|
3641
3708
|
{
|
|
3642
3709
|
params: transferParams,
|
|
3710
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3643
3711
|
headers: {
|
|
3644
3712
|
...this.managingHeaders,
|
|
3645
3713
|
...options.headers
|
|
@@ -3717,7 +3785,8 @@ var CmsService = class {
|
|
|
3717
3785
|
async searchContent(params = {}, options = {}) {
|
|
3718
3786
|
try {
|
|
3719
3787
|
const res = await this.http.get("/api/core/contents/search", {
|
|
3720
|
-
params,
|
|
3788
|
+
params: this.normalizeParams(params),
|
|
3789
|
+
queryArrayFormat: options.queryArrayFormat,
|
|
3721
3790
|
headers: {
|
|
3722
3791
|
...this.commonHeaders,
|
|
3723
3792
|
...options.headers
|
|
@@ -4241,8 +4310,12 @@ var PodSdk = class {
|
|
|
4241
4310
|
websiteUrl: urls.website,
|
|
4242
4311
|
revalidate
|
|
4243
4312
|
});
|
|
4313
|
+
const cmsUrl = (urls.cms || "https://api.pod.ir/srv/cms-server").replace(
|
|
4314
|
+
/^http:\/\//i,
|
|
4315
|
+
"https://"
|
|
4316
|
+
);
|
|
4244
4317
|
this.captcha = new CaptchaService({
|
|
4245
|
-
baseUrl:
|
|
4318
|
+
baseUrl: cmsUrl,
|
|
4246
4319
|
clientId,
|
|
4247
4320
|
accessToken: apiToken
|
|
4248
4321
|
});
|
|
@@ -4297,6 +4370,491 @@ function createPodSdk(config) {
|
|
|
4297
4370
|
}
|
|
4298
4371
|
var client_default = PodSdk;
|
|
4299
4372
|
|
|
4373
|
+
// src/openapi.ts
|
|
4374
|
+
var e = (tag, method, path, operationId, summary, extras = {}) => ({ tag, method, path, operationId, summary, ...extras });
|
|
4375
|
+
var POD_OPENAPI_ENDPOINTS = [
|
|
4376
|
+
// SSO
|
|
4377
|
+
e("SSO", "post", "/oauth2/clients/handshake/{clientId}", "ssoHandshake", "Create an SSO handshake", {
|
|
4378
|
+
query: ["device_type!", "algorithm!", "device_uid!", "device_client_ip!"],
|
|
4379
|
+
security: "bearer"
|
|
4380
|
+
}),
|
|
4381
|
+
e("SSO", "post", "/oauth2/otp/authorize/{phoneNumber}", "ssoSendOtpCode", "Send an OTP code", {
|
|
4382
|
+
query: ["identityType", "response_type", "referrerType", "linkDeliveryType", "scope", "redirect_uri"],
|
|
4383
|
+
security: "signature"
|
|
4384
|
+
}),
|
|
4385
|
+
e("SSO", "post", "/oauth2/otp/verify/{phoneNumber}", "ssoVerifyOtpCode", "Verify an OTP code", {
|
|
4386
|
+
query: ["otp!", "redirect_uri!"],
|
|
4387
|
+
security: "signature"
|
|
4388
|
+
}),
|
|
4389
|
+
e("SSO", "post", "/oauth2/token", "ssoGenerateToken", "Exchange an authorization code or refresh token", {
|
|
4390
|
+
query: ["grant_type!", "code", "redirect_uri", "refresh_token"],
|
|
4391
|
+
security: "basic",
|
|
4392
|
+
sdkMethods: ["generateToken", "refreshToken"]
|
|
4393
|
+
}),
|
|
4394
|
+
e("SSO", "get", "/users", "ssoGetUserProfile", "Get the authenticated SSO user profile", { security: "bearer" }),
|
|
4395
|
+
// Captcha
|
|
4396
|
+
e("Captcha", "post", "/api/core/captcha/get", "captchaGet", "Generate a captcha challenge", { security: "clientId" }),
|
|
4397
|
+
e("Captcha", "post", "/api/core/captcha/check", "captchaCheck", "Validate a captcha challenge", { security: "clientId", body: "json", bodyRequired: true }),
|
|
4398
|
+
// Custom Post
|
|
4399
|
+
e("Custom Post", "get", "/srv/core/nzh/biz/searchTimelineByMetadata", "customPostSearchTimelineByMetadata", "Search timeline entries by metadata", {
|
|
4400
|
+
query: ["metadata", "metaQuery", "offset", "size"],
|
|
4401
|
+
security: "apiToken"
|
|
4402
|
+
}),
|
|
4403
|
+
e("Custom Post", "get", "/srv/core/nzh/biz/customPostList", "customPostGet", "List custom posts or get one post", {
|
|
4404
|
+
query: ["entityId", "id", "uniqueId", "offset", "size"],
|
|
4405
|
+
security: "apiToken",
|
|
4406
|
+
sdkMethods: ["getCustomPost", "createCrud.getAll", "createCrud.getById"]
|
|
4407
|
+
}),
|
|
4408
|
+
e("Custom Post", "post", "/srv/core/nzh/biz/addCustomPost", "customPostCreate", "Create a custom post", {
|
|
4409
|
+
body: "form",
|
|
4410
|
+
bodyRequired: true,
|
|
4411
|
+
security: "apiToken",
|
|
4412
|
+
sdkMethods: ["addCustomPost", "addCustomPostList", "createCrud.create", "createCrud.createMultiple", "createCrud.createAndBindEntityId"]
|
|
4413
|
+
}),
|
|
4414
|
+
e("Custom Post", "post", "/srv/core/nzh/biz/updateCustomPost", "customPostUpdate", "Update a custom post", {
|
|
4415
|
+
body: "form",
|
|
4416
|
+
bodyRequired: true,
|
|
4417
|
+
security: "apiToken",
|
|
4418
|
+
sdkMethods: ["updateCustomPost", "createCrud.update", "createCrud.archive"]
|
|
4419
|
+
}),
|
|
4420
|
+
e("Custom Post", "post", "/srv/core/nzh/biz/deleteCustomPost", "customPostDelete", "Delete a custom post", {
|
|
4421
|
+
query: ["entityId!"],
|
|
4422
|
+
security: "apiToken",
|
|
4423
|
+
sdkMethods: ["deleteCustomPost", "createCrud.delete"]
|
|
4424
|
+
}),
|
|
4425
|
+
// Notification and Social
|
|
4426
|
+
e("Notification", "post", "/service/sms", "notificationSendSms", "Send an SMS notification", { body: "json", bodyRequired: true, security: "apiToken" }),
|
|
4427
|
+
e("Social", "get", "/srv/core/nzh/commentList", "socialGetCommentList", "List comments for a subject", { query: ["postId", "subjectId", "offset", "size"], security: "apiToken" }),
|
|
4428
|
+
e("Social", "get", "/srv/core/nzh/comment", "socialAddComment", "Add a comment to a subject", { query: ["postId", "subjectId", "content!"], security: "apiToken" }),
|
|
4429
|
+
e("Social", "get", "/srv/core/nzh/likeComment", "socialLikeComment", "Like or dislike a comment", { query: ["commentId!", "dislike"], security: "apiToken" }),
|
|
4430
|
+
e("Social", "get", "/srv/core/nzh/like", "socialLikePost", "Like or dislike a post", { query: ["postId!", "dislike"], security: "apiToken" }),
|
|
4431
|
+
// IUMS exposes several SDK methods through one RPC-style HTTP endpoint.
|
|
4432
|
+
e("IUMS", "get", "/", "iumsInvokeService", "Invoke an IUMS ExternalFacade method", {
|
|
4433
|
+
query: ["data!"],
|
|
4434
|
+
security: "clientId",
|
|
4435
|
+
sdkMethods: ["getInfOfGraduatedByGraduateDate", "getSessionClassInCurrentDay", "getDetailsOfTermExam", "getStudentInformationByNumber", "getStudentInformationByNationalCode"]
|
|
4436
|
+
}),
|
|
4437
|
+
// PodForm
|
|
4438
|
+
e("PodForm", "get", "/forms/{formId}", "podFormGetForm", "Get a form", { query: ["lockForEdit"], security: "podFormToken", sdkMethods: ["getForm", "getPodformById"] }),
|
|
4439
|
+
e("PodForm", "get", "/forms/all", "podFormGetForms", "List forms", { query: ["page", "size", "folderId", "status", "search"], security: "podFormToken" }),
|
|
4440
|
+
e("PodForm", "post", "/forms", "podFormCreateForm", "Create a form", { body: "json", bodyRequired: true, security: "podFormToken" }),
|
|
4441
|
+
e("PodForm", "patch", "/forms/{formId}", "podFormUpdateForm", "Update a form", { body: "json", bodyRequired: true, security: "podFormToken" }),
|
|
4442
|
+
e("PodForm", "delete", "/forms/{formId}", "podFormDeleteForm", "Delete a form", { query: ["removeFromTrash"], security: "podFormToken" }),
|
|
4443
|
+
e("PodForm", "get", "/forms/{formId}/settings", "podFormGetSettings", "Get form settings", { query: ["password"], security: "podFormToken" }),
|
|
4444
|
+
e("PodForm", "patch", "/forms/{formId}/settings", "podFormUpdateSettings", "Update form settings", { query: ["password"], body: "json", bodyRequired: true, security: "podFormToken" }),
|
|
4445
|
+
e("PodForm", "post", "/forms/{formId}/fields", "podFormAddField", "Add a field to a form", { body: "json", bodyRequired: true, security: "podFormToken" }),
|
|
4446
|
+
e("PodForm", "post", "/forms/{formId}/fields/batch", "podFormAddFields", "Add multiple fields to a form", { body: "json", bodyRequired: true, security: "podFormToken" }),
|
|
4447
|
+
e("PodForm", "patch", "/forms/{formId}/fields", "podFormUpdateFields", "Update form fields", { body: "json", bodyRequired: true, security: "podFormToken" }),
|
|
4448
|
+
e("PodForm", "delete", "/forms/{formId}/fields", "podFormDeleteFields", "Delete form fields", { query: ["fieldIds!"], security: "podFormToken" }),
|
|
4449
|
+
e("PodForm", "get", "/forms/{formId}/preview", "podFormGetPreview", "Preview a form", { query: ["password", "language"], security: "podFormToken" }),
|
|
4450
|
+
e("PodForm", "get", "/forms/{formHash}/previewByHash", "podFormGetPreviewByHash", "Preview a public form by hash", { query: ["password", "language"], security: "none" }),
|
|
4451
|
+
e("PodForm", "get", "/forms/{formHash}/generateCaptcha", "podFormGenerateCaptcha", "Generate a public form captcha", { security: "none" }),
|
|
4452
|
+
e("PodForm", "post", "/responses/{formHash}", "podFormSaveResponse", "Submit a form response", { query: ["password", "captchaValue", "captchaHash"], body: "json", bodyRequired: true, security: "none", sdkMethods: ["saveResponse", "sendForm"] }),
|
|
4453
|
+
e("PodForm", "post", "/responses/{formId}/initiate", "podFormInitiateResponse", "Initiate a form response", { body: "json", bodyRequired: true, security: "podFormToken" }),
|
|
4454
|
+
e("PodForm", "get", "/responses/all/{formId}", "podFormGetResponses", "List form responses", { query: ["page", "size", "from", "to", "status"], security: "podFormToken" }),
|
|
4455
|
+
e("PodForm", "get", "/responses/all/byFormHash/{formHash}", "podFormGetResponsesByHash", "List responses by form hash", { query: ["page", "size", "from", "to", "status"], security: "podFormToken" }),
|
|
4456
|
+
e("PodForm", "get", "/responses/{responseId}", "podFormGetResponse", "Get a form response", { query: ["formId"], security: "podFormToken" }),
|
|
4457
|
+
e("PodForm", "patch", "/responses/{responseId}", "podFormUpdateResponse", "Update response fields", { body: "json", bodyRequired: true, security: "podFormToken" }),
|
|
4458
|
+
e("PodForm", "delete", "/responses/{formId}", "podFormDeleteResponsesByQuery", "Delete responses by IDs in the query string", { query: ["responseIds!"], security: "podFormToken" }),
|
|
4459
|
+
e("PodForm", "put", "/responses/{formId}", "podFormDeleteResponses", "Delete responses", { body: "json", bodyRequired: true, security: "podFormToken" }),
|
|
4460
|
+
e("PodForm", "get", "/templates", "podFormGetTemplates", "List form templates", { query: ["page", "size", "templateOwnership"], security: "podFormToken" }),
|
|
4461
|
+
e("PodForm", "post", "/templates", "podFormCreateTemplate", "Create a form template", { query: ["templateOwnership"], body: "json", bodyRequired: true, security: "podFormToken" }),
|
|
4462
|
+
e("PodForm", "patch", "/templates/{templateId}", "podFormUpdateTemplate", "Update a form template", { body: "json", bodyRequired: true, security: "podFormToken" }),
|
|
4463
|
+
e("PodForm", "delete", "/templates/{templateId}", "podFormDeleteTemplate", "Delete a form template", { security: "podFormToken" }),
|
|
4464
|
+
e("PodForm", "get", "/folders", "podFormGetFolders", "List form folders", { query: ["page", "size", "trash"], security: "podFormToken" }),
|
|
4465
|
+
e("PodForm", "post", "/folders", "podFormCreateFolder", "Create a form folder", { body: "json", bodyRequired: true, security: "podFormToken" }),
|
|
4466
|
+
e("PodForm", "patch", "/folders/{folderId}", "podFormUpdateFolder", "Update a form folder", { body: "json", bodyRequired: true, security: "podFormToken" }),
|
|
4467
|
+
e("PodForm", "delete", "/folders/{folderId}", "podFormDeleteFolder", "Delete a form folder", { query: ["removeFromTrash"], security: "podFormToken" }),
|
|
4468
|
+
e("PodForm", "get", "/otp/{formHash}/send", "podFormSendOtp", "Send form OTP", { query: ["phoneNumber!", "email"], security: "none" }),
|
|
4469
|
+
e("PodForm", "get", "/otp/{formHash}/validate", "podFormValidateOtp", "Validate form OTP", { query: ["phoneNumber!", "email", "code!"], security: "none" }),
|
|
4470
|
+
e("PodForm", "get", "/user", "podFormGetUser", "Get the PodForm user", { security: "podFormToken" }),
|
|
4471
|
+
e("PodForm", "get", "/user/getUploadLink", "podFormGetUploadLink", "Get a PodForm upload link", { security: "podFormToken" }),
|
|
4472
|
+
e("PodForm", "get", "/user/getDownloadLink", "podFormGetDownloadLink", "Get a PodForm download link", { query: ["hash!", "fileName"], security: "podFormToken" }),
|
|
4473
|
+
e("PodForm", "get", "/plans/all", "podFormGetPlans", "List PodForm plans", { query: ["page", "size"], security: "podFormToken" }),
|
|
4474
|
+
e("PodForm", "get", "/plans", "podFormGetUserPlan", "Get the current PodForm plan", { security: "podFormToken" }),
|
|
4475
|
+
e("PodForm", "get", "/responses/{formId}/export", "podFormExportResponses", "Export form responses", { query: ["type", "from", "to"], security: "podFormToken", response: "binary" }),
|
|
4476
|
+
e("PodForm", "get", "/forms/{formId}/reports", "podFormGetReport", "Get a form report", { security: "podFormToken" }),
|
|
4477
|
+
// CMS content
|
|
4478
|
+
e("CMS Content", "get", "/api/core/contents/enable", "cmsGetContent", "List enabled content", { query: ["offset", "size", "showDetail", "contentTypeUniqueId", "tags"], security: "cmsPublic" }),
|
|
4479
|
+
e("CMS Content", "get", "/api/core/contents", "cmsGetAllContents", "List all content", { query: ["offset", "size", "showDetail", "enable"], security: "cmsManage" }),
|
|
4480
|
+
e("CMS Content", "get", "/api/core/contents/my", "cmsGetMyContents", "List content owned by the current client", { query: ["offset", "size", "showDetail", "enable"], security: "cmsManage" }),
|
|
4481
|
+
e("CMS Content", "get", "/api/core/contents/{contentTypeUniqueId}", "cmsGetContentsByType", "List content by type", { query: ["offset", "size", "showDetail", "enable"], security: "cmsManage" }),
|
|
4482
|
+
e("CMS Content", "get", "/api/core/contents/enable/{entityId}", "cmsGetContentByEntityId", "Get enabled content by entity ID", { security: "cmsPublic" }),
|
|
4483
|
+
e("CMS Content", "get", "/api/core/contents/{contentTypeUniqueId}/enable/{entityId}", "cmsGetTypedContentByEntityId", "Get enabled typed content by entity ID", { security: "cmsPublic", sdkMethods: ["getContentByEntityId"] }),
|
|
4484
|
+
e("CMS Content", "get", "/api/core/contents/{contentUniqueId}/byContentUniqueId/enable", "cmsGetContentByUniqueId", "Get enabled content by unique ID", { security: "cmsPublic" }),
|
|
4485
|
+
e("CMS Content", "get", "/api/core/contents/search", "cmsSearchContent", "Search enabled content", { query: ["query", "name", "offset", "size"], security: "cmsPublic" }),
|
|
4486
|
+
e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}/add-publish", "cmsAddContent", "Create and publish content", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4487
|
+
e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}", "cmsCreateContent", "Create unpublished content", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4488
|
+
e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}/{entityId}/edit-publish", "cmsEditContent", "Update and publish content", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4489
|
+
e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}/{entityId}", "cmsUpdateContent", "Replace content", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4490
|
+
e("CMS Content", "patch", "/api/core/contents/{contentTypeUniqueId}/{entityId}", "cmsPatchContent", "Partially update content", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4491
|
+
e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}/publish/{entityId}", "cmsPublishContent", "Publish content", { security: "cmsManage" }),
|
|
4492
|
+
e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}/unpublish/{entityId}", "cmsUnpublishContent", "Unpublish content", { security: "cmsManage" }),
|
|
4493
|
+
e("CMS Content", "put", "/api/core/contents/publish", "cmsBatchPublishAllTypes", "Batch publish content", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4494
|
+
e("CMS Content", "put", "/api/core/contents/{contentTypeUniqueId}/publish", "cmsBatchPublish", "Batch publish typed content", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4495
|
+
e("CMS Content", "put", "/api/core/contents/unpublish", "cmsBatchUnpublishAllTypes", "Batch unpublish content", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4496
|
+
e("CMS Content", "put", "/api/core/contents/{contentTypeUniqueId}/unpublish", "cmsBatchUnpublish", "Batch unpublish typed content", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4497
|
+
e("CMS Content", "post", "/api/core/contents/archive", "cmsArchiveAllTypes", "Archive content", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4498
|
+
e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}/archive", "cmsArchiveContent", "Archive typed content", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4499
|
+
e("CMS Content", "post", "/api/core/contents/unarchive", "cmsUnarchiveAllTypes", "Unarchive content", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4500
|
+
e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}/unarchive", "cmsUnarchiveContent", "Unarchive typed content", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4501
|
+
e("CMS Content", "get", "/api/core/contents/archive", "cmsGetArchivedContents", "List archived content", { query: ["offset", "size"], security: "cmsManage" }),
|
|
4502
|
+
e("CMS Content", "get", "/api/core/contents/{contentTypeUniqueId}/archive", "cmsGetArchivedContentsByType", "List archived content by type", { query: ["offset", "size"], security: "cmsManage" }),
|
|
4503
|
+
e("CMS Content", "get", "/api/core/contents/draft", "cmsGetDrafts", "List drafts", { query: ["offset", "size"], security: "cmsManage" }),
|
|
4504
|
+
e("CMS Content", "get", "/api/core/contents/{contentTypeUniqueId}/draft", "cmsGetDraftsByType", "List drafts by content type", { query: ["offset", "size"], security: "cmsManage" }),
|
|
4505
|
+
e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}/draft", "cmsCreateDraft", "Create a draft", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4506
|
+
e("CMS Content", "get", "/api/core/contents/{contentTypeUniqueId}/draft/{entityId}", "cmsGetDraftById", "Get a draft", { security: "cmsManage" }),
|
|
4507
|
+
e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}/draft/{entityId}", "cmsUpdateDraft", "Update a draft", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4508
|
+
e("CMS Content", "post", "/api/core/contents/{contentTypeUniqueId}/undraft/{entityId}", "cmsUndraftContent", "Convert a draft to regular content", { security: "cmsManage" }),
|
|
4509
|
+
e("CMS Content", "get", "/api/core/contents/{contentTypeUniqueId}/comments/{entityId}", "cmsGetComments", "List content comments", { query: ["offset", "size"], security: "cmsPublic" }),
|
|
4510
|
+
e("CMS Content", "get", "/api/core/contents/{contentUniqueId}/like/{entityId}", "cmsGetLikes", "List content likes", { query: ["offset", "size"], security: "cmsPublic" }),
|
|
4511
|
+
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
|
+
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
|
+
// CMS products
|
|
4515
|
+
e("CMS Products", "get", "/api/core/products/enable", "cmsGetProducts", "List enabled products", { query: ["offset", "size", "showDetail", "productTypeUniqueId", "tags"], security: "cmsPublic" }),
|
|
4516
|
+
e("CMS Products", "get", "/api/core/products", "cmsGetAllProducts", "List all products", { query: ["offset", "size", "showDetail", "enable"], security: "cmsManage" }),
|
|
4517
|
+
e("CMS Products", "get", "/api/core/products/manage", "cmsGetManageProducts", "List products for management", { query: ["offset", "size", "showDetail", "enable"], security: "cmsManage" }),
|
|
4518
|
+
e("CMS Products", "get", "/api/core/products/{productTypeUniqueId}", "cmsGetProductsByType", "List products by type", { query: ["offset", "size", "showDetail", "enable"], security: "cmsManage" }),
|
|
4519
|
+
e("CMS Products", "get", "/api/core/products/enable/{entityId}", "cmsGetProductByEntityId", "Get enabled product by entity ID", { security: "cmsPublic" }),
|
|
4520
|
+
e("CMS Products", "get", "/api/core/products/{productTypeUniqueId}/enable/{entityId}", "cmsGetTypedProductByEntityId", "Get enabled typed product by entity ID", { security: "cmsPublic", sdkMethods: ["getProductByEntityId"] }),
|
|
4521
|
+
e("CMS Products", "get", "/api/core/products/{productUniqueId}/byProductUniqueId/enable", "cmsGetProductByUniqueId", "Get product by unique ID", { security: "cmsPublic" }),
|
|
4522
|
+
e("CMS Products", "get", "/api/core/products/barcode/enable", "cmsGetProductByBarcode", "Get product by barcode", { query: ["barcode!"], security: "cmsPublic" }),
|
|
4523
|
+
e("CMS Products", "get", "/api/core/products/enable/search", "cmsSearchProducts", "Search enabled products", { query: ["query", "name", "offset", "size"], security: "cmsPublic" }),
|
|
4524
|
+
e("CMS Products", "post", "/api/core/products/{productTypeUniqueId}/add-publish", "cmsAddProduct", "Create and publish a product", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4525
|
+
e("CMS Products", "post", "/api/core/products/{productTypeUniqueId}", "cmsCreateProduct", "Create an unpublished product", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4526
|
+
e("CMS Products", "post", "/api/core/products/{productTypeUniqueId}/{entityId}/edit-publish", "cmsEditProduct", "Update and publish a product", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4527
|
+
e("CMS Products", "post", "/api/core/products/{productTypeUniqueId}/{entityId}", "cmsUpdateProduct", "Replace a product", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4528
|
+
e("CMS Products", "patch", "/api/core/products/{productTypeUniqueId}/{entityId}", "cmsPatchProduct", "Partially update a product", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4529
|
+
e("CMS Products", "post", "/api/core/products/{productTypeUniqueId}/publish/{entityId}", "cmsPublishProduct", "Publish a product", { security: "cmsManage" }),
|
|
4530
|
+
e("CMS Products", "post", "/api/core/products/{productTypeUniqueId}/unpublish/{entityId}", "cmsUnpublishProduct", "Unpublish a product", { security: "cmsManage" }),
|
|
4531
|
+
e("CMS Products", "put", "/api/core/products/publish", "cmsBatchPublishAllProductTypes", "Batch publish products", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4532
|
+
e("CMS Products", "put", "/api/core/products/{productTypeUniqueId}/publish", "cmsBatchPublishProducts", "Batch publish typed products", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4533
|
+
e("CMS Products", "put", "/api/core/products/unpublish", "cmsBatchUnpublishAllProductTypes", "Batch unpublish products", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4534
|
+
e("CMS Products", "put", "/api/core/products/{productTypeUniqueId}/unpublish", "cmsBatchUnpublishProducts", "Batch unpublish typed products", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4535
|
+
e("CMS Products", "post", "/api/core/products/archive", "cmsArchiveAllProductTypes", "Archive products", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4536
|
+
e("CMS Products", "post", "/api/core/products/{productTypeUniqueId}/archive", "cmsArchiveProducts", "Archive typed products", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4537
|
+
e("CMS Products", "post", "/api/core/products/unarchive", "cmsUnarchiveAllProductTypes", "Unarchive products", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4538
|
+
e("CMS Products", "post", "/api/core/products/{productTypeUniqueId}/unarchive", "cmsUnarchiveProducts", "Unarchive typed products", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4539
|
+
e("CMS Products", "get", "/api/core/products/archive", "cmsGetArchivedProducts", "List archived products", { query: ["offset", "size"], security: "cmsManage" }),
|
|
4540
|
+
e("CMS Products", "get", "/api/core/products/{productTypeUniqueId}/archive", "cmsGetArchivedProductsByType", "List archived products by type", { query: ["offset", "size"], security: "cmsManage" }),
|
|
4541
|
+
e("CMS Products", "get", "/api/core/products/ai/timeline-search/enable", "cmsProductTimelineSearch", "Run advanced product timeline search", { query: ["advance", "newVersion", "offset", "size"], security: "cmsPublic" }),
|
|
4542
|
+
// CMS tags
|
|
4543
|
+
e("CMS Tags", "get", "/api/core/tags/category", "cmsGetTagCategories", "List tag categories", { query: ["offset", "size", "enable"], security: "cmsPublic" }),
|
|
4544
|
+
e("CMS Tags", "post", "/api/core/tags/category", "cmsCreateTagCategory", "Create a tag category", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4545
|
+
e("CMS Tags", "get", "/api/core/tags/category/{id}", "cmsGetTagCategory", "Get a tag category", { security: "cmsManage" }),
|
|
4546
|
+
e("CMS Tags", "put", "/api/core/tags/category/{id}", "cmsUpdateTagCategory", "Update a tag category", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4547
|
+
e("CMS Tags", "put", "/api/core/tags/category/{id}/publish", "cmsPublishTagCategory", "Publish a tag category", { security: "cmsManage" }),
|
|
4548
|
+
e("CMS Tags", "put", "/api/core/tags/category/{id}/unpublish", "cmsUnpublishTagCategory", "Unpublish a tag category", { security: "cmsManage" }),
|
|
4549
|
+
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"] }),
|
|
4550
|
+
e("CMS Tags", "get", "/api/core/tags/{categoryId}/tree/manage", "cmsGetManageTagTree", "Get the tag tree for management", { query: ["offset", "size", "parentId", "level"], security: "cmsManage" }),
|
|
4551
|
+
e("CMS Tags", "post", "/api/core/tags/{categoryId}/tree", "cmsCreateTagTreeItem", "Create a tag tree item", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4552
|
+
e("CMS Tags", "get", "/api/core/tags/{categoryId}/tree/{id}/enable", "cmsGetTagTreeItem", "Get an enabled tag tree item", { security: "cmsPublic" }),
|
|
4553
|
+
e("CMS Tags", "get", "/api/core/tags/{categoryId}/tree/{id}/manage", "cmsGetManageTagTreeItem", "Get a tag tree item for management", { security: "cmsManage" }),
|
|
4554
|
+
e("CMS Tags", "put", "/api/core/tags/{categoryId}/tree/{id}", "cmsUpdateTagTreeItem", "Update a tag tree item", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4555
|
+
e("CMS Tags", "put", "/api/core/tags/{categoryId}/tree/publish/{id}", "cmsPublishTagTreeItem", "Publish a tag tree item", { security: "cmsManage" }),
|
|
4556
|
+
e("CMS Tags", "put", "/api/core/tags/{categoryId}/tree/unpublish/{id}", "cmsUnpublishTagTreeItem", "Unpublish a tag tree item", { security: "cmsManage" }),
|
|
4557
|
+
e("CMS Tags", "put", "/api/core/tags/{categoryId}/tree/parent/{id}", "cmsUpdateTagTreeParent", "Move a tag tree item", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4558
|
+
e("CMS Tags", "get", "/api/core/tags/{categoryId}/tree/parent/{id}/enable", "cmsGetTagTreeAncestors", "Get enabled tag ancestors", { query: ["includeCurrent"], security: "cmsPublic" }),
|
|
4559
|
+
e("CMS Tags", "get", "/api/core/tags/{categoryId}/tree/parent/{id}/manage", "cmsGetManageTagTreeAncestors", "Get tag ancestors for management", { query: ["includeCurrent"], security: "cmsManage" }),
|
|
4560
|
+
e("CMS Tags", "put", "/api/core/tags/{categoryId}/tree/code/{id}", "cmsUpdateTagTreeCode", "Update a tag tree code", { body: "json", bodyRequired: true, security: "cmsManage" }),
|
|
4561
|
+
// Podspace upload, download and file operations
|
|
4562
|
+
e("Podspace Files", "post", "/api/files", "podspaceUploadFile", "Upload a file", { query: ["path", "isPublic", "fileName", "parentHash"], body: "multipart", bodyRequired: true, security: "bearer" }),
|
|
4563
|
+
e("Podspace Files", "post", "/api/files/multiple", "podspaceUploadMultipleFiles", "Upload multiple files", { query: ["path", "isPublic", "parentHash"], body: "multipart", bodyRequired: true, security: "bearer" }),
|
|
4564
|
+
e("Podspace Files", "post", "/api/images/base64", "podspaceUploadImageBase64", "Upload a base64 image", { query: ["base64!", "fileName", "path", "isPublic"], security: "bearer" }),
|
|
4565
|
+
e("Podspace Files", "put", "/api/files/{hash}", "podspaceReplaceFile", "Replace file contents", { query: ["fileName"], body: "multipart", bodyRequired: true, security: "bearer" }),
|
|
4566
|
+
e("Podspace Files", "post", "/api/files/{hash}", "podspaceUploadByLink", "Upload file contents using an upload hash", { body: "multipart", bodyRequired: true, security: "bearer" }),
|
|
4567
|
+
e("Podspace Files", "get", "/api/files/{hash}", "podspaceDownloadFile", "Download a file", { query: ["download", "password", "shareHash"], security: "bearer", response: "binary" }),
|
|
4568
|
+
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" }),
|
|
4569
|
+
e("Podspace Files", "get", "/api/files/{hash}/thumbnail", "podspaceDownloadThumbnail", "Download a file thumbnail", { query: ["width", "height", "quality"], security: "bearer", response: "binary" }),
|
|
4570
|
+
e("Podspace Files", "get", "/api/files", "podspaceDownloadFilesAsZip", "Download entities as a ZIP archive", { query: ["hashes!", "fileName"], security: "bearer", response: "binary" }),
|
|
4571
|
+
e("Podspace Files", "get", "/api/files/link", "podspaceGetUploadLink", "Get a pre-signed upload link", { query: ["fileName!", "path", "size", "parentHash"], security: "bearer" }),
|
|
4572
|
+
e("Podspace Files", "get", "/api/files/{hash}/detail", "podspaceGetFileDetail", "Get file or folder details", { query: ["password", "breadcrumb", "shareHash", "nativeMetadata", "includeSizeAndCount"], security: "bearer" }),
|
|
4573
|
+
e("Podspace Files", "get", "/api/files/details", "podspaceGetFileDetailByPath", "Get file details by path", { query: ["path!", "parentHash", "password", "entityType"], security: "bearer" }),
|
|
4574
|
+
e("Podspace Files", "get", "/api/files/{hash}/exist", "podspaceCheckEntityExist", "Check whether an entity exists", { query: ["fileName!", "uniqueName", "type"], security: "bearer" }),
|
|
4575
|
+
e("Podspace Files", "put", "/api/files/{hash}/rename", "podspaceRenameEntity", "Rename a file or folder", { query: ["name!", "uniqueName"], security: "bearer" }),
|
|
4576
|
+
e("Podspace Files", "put", "/api/files/{hash}/move", "podspaceMoveEntity", "Move a file or folder", { query: ["destFolderHash!", "policy", "uniqueName"], security: "bearer" }),
|
|
4577
|
+
e("Podspace Files", "put", "/api/files/{hash}/copy", "podspaceCopyEntity", "Copy a file or folder", { query: ["destFolderHash!", "policy", "uniqueName", "copyType"], security: "bearer" }),
|
|
4578
|
+
e("Podspace Files", "delete", "/api/files/{hash}", "podspaceTrashEntity", "Move a file or folder to trash", { security: "bearer", sdkMethods: ["trashEntity", "deleteFile"] }),
|
|
4579
|
+
e("Podspace Files", "patch", "/api/files/{hash}", "podspaceUpdateFile", "Update file properties", { body: "json", bodyRequired: true, security: "bearer" }),
|
|
4580
|
+
e("Podspace Files", "get", "/api/files/search", "podspaceSearchFiles", "Search files and folders", { query: ["query", "name", "type", "start", "size", "parentHash"], security: "bearer" }),
|
|
4581
|
+
e("Podspace Files", "get", "/api/v2/files/recent", "podspaceGetRecentFiles", "List recent files", { query: ["start", "size"], security: "bearer" }),
|
|
4582
|
+
e("Podspace Files", "get", "/api/files/v2/{hash}/versions", "podspaceGetFileVersions", "List file versions", { security: "bearer" }),
|
|
4583
|
+
e("Podspace Files", "patch", "/api/files/versions/{hash}", "podspaceRestoreFileVersion", "Restore a file version", { security: "bearer" }),
|
|
4584
|
+
e("Podspace Files", "get", "/api/v2/files/{hash}/native/metadata", "podspaceGetNativeMetadata", "Get native file metadata", { security: "bearer" }),
|
|
4585
|
+
e("Podspace Files", "get", "/api/files/{hash}/convert", "podspaceConvertFile", "Convert and download a file", { query: ["format!", "password"], security: "bearer", response: "binary" }),
|
|
4586
|
+
e("Podspace Files", "get", "/api/files/{hash}/breadcrumb", "podspaceGetBreadcrumb", "Get file breadcrumbs", { security: "bearer" }),
|
|
4587
|
+
e("Podspace Files", "post", "/api/files/compress", "podspaceCompressFiles", "Compress files", { query: ["hashes!", "fileName", "parentHash"], security: "bearer" }),
|
|
4588
|
+
e("Podspace Files", "put", "/api/files/{hash}/extract", "podspaceExtractArchive", "Extract an archive", { query: ["destinationHash", "password", "overwrite"], security: "bearer" }),
|
|
4589
|
+
e("Podspace Files", "put", "/api/files/{hash}/cachePolicy", "podspaceSetCachePolicy", "Set file cache policy", { query: ["cachePolicy!"], security: "bearer" }),
|
|
4590
|
+
e("Podspace Files", "get", "/api/files/{hash}/activities", "podspaceGetActivities", "List file activities", { query: ["start", "size"], security: "bearer" }),
|
|
4591
|
+
e("Podspace Files", "get", "/api/files/{hash}/activities/{activity}", "podspaceGetActivityUsers", "List users for a file activity", { query: ["start", "size"], security: "bearer" }),
|
|
4592
|
+
e("Podspace Files", "get", "/api/files/{hash}/activities/{activity}/count", "podspaceGetActivityCount", "Count a file activity", { security: "bearer" }),
|
|
4593
|
+
// Podspace folders
|
|
4594
|
+
e("Podspace Folders", "post", "/api/folders", "podspaceCreateFolder", "Create a folder", { query: ["name!", "parentHash", "isPublic", "description"], security: "bearer" }),
|
|
4595
|
+
e("Podspace Folders", "post", "/api/folders/{hash}/directories", "podspaceCreateDirectories", "Create nested directories", { query: ["directories!"], security: "bearer" }),
|
|
4596
|
+
e("Podspace Folders", "get", "/api/folders/{hash}/children", "podspaceGetFolderChildren", "List folder children", { query: ["start", "size", "sort", "order", "type"], security: "bearer" }),
|
|
4597
|
+
e("Podspace Folders", "get", "/api/v2/folders/recent", "podspaceGetRecentFolders", "List recent folders", { query: ["start", "size"], security: "bearer" }),
|
|
4598
|
+
e("Podspace Folders", "get", "/api/folders/{hash}/check/upload", "podspaceCheckFolderUpload", "Check folder upload permission", { query: ["size"], security: "bearer" }),
|
|
4599
|
+
e("Podspace Folders", "get", "/api/folders/{folderHash}/actions", "podspaceGetFolderActions", "List allowed folder actions", { security: "bearer" }),
|
|
4600
|
+
// Podspace resumable uploads
|
|
4601
|
+
e("Podspace Resumable", "post", "/api/files/resumable", "podspaceCreateResumableUpload", "Create a resumable upload", { query: ["fileName!", "fileSize!", "parentHash", "contentType"], security: "bearer" }),
|
|
4602
|
+
e("Podspace Resumable", "patch", "/api/files/resumable/{id}", "podspaceAppendResumableChunk", "Append a resumable upload chunk", { query: ["offset!"], body: "binary", bodyRequired: true, security: "bearer" }),
|
|
4603
|
+
e("Podspace Resumable", "head", "/api/files/resumable/{id}", "podspaceGetResumableStatus", "Get resumable upload status", { security: "bearer", response: "empty" }),
|
|
4604
|
+
e("Podspace Resumable", "post", "/api/files/resumable/{id}/finalize", "podspaceFinalizeResumableUpload", "Finalize a resumable upload", { query: ["fileName", "parentHash", "isPublic"], security: "bearer" }),
|
|
4605
|
+
// Podspace links and shares
|
|
4606
|
+
e("Podspace Links", "get", "/api/links/files/{hash}", "podspaceCreateLink", "Create a public file link", { query: ["expireTime", "download", "password"], security: "bearer" }),
|
|
4607
|
+
e("Podspace Links", "get", "/api/links", "podspaceGetUserLinks", "List user links", { query: ["start", "size", "status"], security: "bearer" }),
|
|
4608
|
+
e("Podspace Links", "get", "/api/links/{link}/detail", "podspaceGetLinkDetail", "Get link details", { security: "bearer" }),
|
|
4609
|
+
e("Podspace Links", "patch", "/api/links/{link}", "podspaceUpdateLink", "Update a public link", { query: ["expireTime", "password", "download"], security: "bearer" }),
|
|
4610
|
+
e("Podspace Links", "delete", "/api/links/{link}", "podspaceRevokeLink", "Revoke a public link", { security: "bearer" }),
|
|
4611
|
+
e("Podspace Links", "get", "/api/links/{hash}", "podspaceDownloadFileByLink", "Download a file via public link", { query: ["password", "download"], security: "none", response: "binary" }),
|
|
4612
|
+
e("Podspace Shares", "post", "/api/files/{hash}/shares/users/{identity}", "podspaceShareWithUser", "Share an entity with a user", { query: ["permission!", "expireTime", "notify"], security: "bearer" }),
|
|
4613
|
+
e("Podspace Shares", "delete", "/api/files/{hash}/shares/users/{identity}", "podspaceRemoveShareWithUser", "Remove a user share", { security: "bearer" }),
|
|
4614
|
+
e("Podspace Shares", "post", "/api/files/{hash}/public", "podspaceMakePublic", "Make an entity public", { query: ["isPublic!", "password", "expireTime"], security: "bearer" }),
|
|
4615
|
+
e("Podspace Shares", "get", "/api/shares", "podspaceGetSharedWithMe", "List entities shared with the current user", { query: ["start", "size", "status"], security: "bearer" }),
|
|
4616
|
+
e("Podspace Shares", "get", "/api/shares/{shareHash}", "podspaceGetShareDetail", "Get share details", { security: "bearer" }),
|
|
4617
|
+
e("Podspace Shares", "delete", "/api/shares/{shareHash}", "podspaceRevokeShare", "Revoke a share", { security: "bearer" }),
|
|
4618
|
+
e("Podspace Shares", "get", "/api/files/{hash}/shares", "podspaceGetFileShares", "List shares for an entity", { query: ["start", "size"], security: "bearer" }),
|
|
4619
|
+
e("Podspace Shares", "put", "/api/shares/{shareHash}/password", "podspaceSetSharePassword", "Set a share password", { query: ["password!"], security: "bearer" }),
|
|
4620
|
+
e("Podspace Shares", "put", "/api/files/{entityHash}/shares/password", "podspaceSetEntityPassword", "Set an entity share password", { query: ["password!"], security: "bearer" }),
|
|
4621
|
+
// Podspace trash, tags, bookmarks and metadata
|
|
4622
|
+
e("Podspace Trash", "get", "/api/trashes", "podspaceGetTrashList", "List trash entries", { query: ["start", "size", "sort", "order"], security: "bearer" }),
|
|
4623
|
+
e("Podspace Trash", "put", "/api/trashes/{hash}/restore", "podspaceRestoreTrash", "Restore a trash entry", { security: "bearer" }),
|
|
4624
|
+
e("Podspace Trash", "post", "/api/trashes/restore", "podspaceRestoreAllTrash", "Restore all trash entries", { security: "bearer" }),
|
|
4625
|
+
e("Podspace Trash", "delete", "/api/trashes/{hash}", "podspaceDeletePermanently", "Permanently delete a trash entry", { security: "bearer" }),
|
|
4626
|
+
e("Podspace Trash", "delete", "/api/trashes", "podspaceEmptyTrash", "Empty trash", { security: "bearer" }),
|
|
4627
|
+
e("Podspace Trash", "post", "/api/trashes/periods/{period}", "podspaceSetAutoCleanupPeriod", "Set the trash auto-cleanup period", { security: "bearer" }),
|
|
4628
|
+
e("Podspace Tags", "post", "/api/tags", "podspaceAddTags", "Add tags to entities", { query: ["hashes!", "tags!"], security: "bearer" }),
|
|
4629
|
+
e("Podspace Tags", "delete", "/api/tags", "podspaceDeleteTags", "Remove tags from entities", { query: ["hashes!", "tags!"], security: "bearer" }),
|
|
4630
|
+
e("Podspace Tags", "get", "/api/tags/entities/{hash}", "podspaceGetEntityTags", "List tags for an entity", { security: "bearer" }),
|
|
4631
|
+
e("Podspace Tags", "get", "/api/tags/search/{tagName}", "podspaceSearchTags", "Search tags", { query: ["start", "size"], security: "bearer" }),
|
|
4632
|
+
e("Podspace Tags", "get", "/api/tags/{tagName}", "podspaceGetEntitiesByTag", "List entities by tag", { query: ["start", "size"], security: "bearer" }),
|
|
4633
|
+
e("Podspace Bookmarks", "get", "/api/bookmarks", "podspaceGetBookmarks", "List bookmarks", { query: ["start", "size", "sort", "order"], security: "bearer" }),
|
|
4634
|
+
e("Podspace Bookmarks", "post", "/api/bookmarks", "podspaceAddBookmark", "Add a bookmark", { query: ["hash!"], security: "bearer" }),
|
|
4635
|
+
e("Podspace Bookmarks", "delete", "/api/bookmarks", "podspaceRemoveBookmark", "Remove a bookmark", { query: ["hash!"], security: "bearer" }),
|
|
4636
|
+
e("Podspace Metadata", "get", "/api/files/{hash}/metadata", "podspaceGetMetadata", "Get custom metadata", { query: ["key"], security: "bearer" }),
|
|
4637
|
+
e("Podspace Metadata", "put", "/api/files/{hash}/metadata", "podspaceSetMetadata", "Set custom metadata", { body: "json", bodyRequired: true, security: "bearer" }),
|
|
4638
|
+
e("Podspace Metadata", "delete", "/api/files/{hash}/metadata", "podspaceDeleteMetadata", "Delete custom metadata", { query: ["keys"], security: "bearer" }),
|
|
4639
|
+
e("Podspace Metadata", "post", "/api/files/metadata/search", "podspaceSearchMetadata", "Search custom metadata", { body: "json", bodyRequired: true, security: "bearer" }),
|
|
4640
|
+
e("Podspace Metadata", "get", "/api/files/description", "podspaceGetDescription", "Get an entity description", { query: ["hash!"], security: "bearer" }),
|
|
4641
|
+
e("Podspace Metadata", "put", "/api/files/description", "podspaceSetDescription", "Set an entity description", { query: ["hash!", "description!"], security: "bearer" }),
|
|
4642
|
+
e("Podspace Metadata", "delete", "/api/files/description", "podspaceDeleteDescription", "Delete an entity description", { query: ["hash!"], security: "bearer" }),
|
|
4643
|
+
// Podspace user groups, workspaces and account
|
|
4644
|
+
e("Podspace User Groups", "post", "/api/usergroups", "podspaceCreateUserGroup", "Create a user group", { query: ["name!", "description"], security: "bearer" }),
|
|
4645
|
+
e("Podspace User Groups", "get", "/api/usergroups/{userGroupHash}", "podspaceGetUserGroup", "Get a user group", { security: "bearer" }),
|
|
4646
|
+
e("Podspace User Groups", "delete", "/api/usergroups/{userGroupHash}", "podspaceDeleteUserGroup", "Delete a user group", { security: "bearer" }),
|
|
4647
|
+
e("Podspace User Groups", "get", "/api/usergroups/{userGroupHash}/users", "podspaceGetUserGroupUsers", "List user group members", { query: ["start", "size"], security: "bearer" }),
|
|
4648
|
+
e("Podspace User Groups", "post", "/api/usergroups/{userGroupHash}/users", "podspaceAddUserToGroup", "Add a user to a group", { query: ["identity!", "role"], security: "bearer" }),
|
|
4649
|
+
e("Podspace User Groups", "delete", "/api/usergroups/{userGroupHash}/users", "podspaceRemoveUserFromGroup", "Remove a user from a group", { query: ["identity!"], security: "bearer" }),
|
|
4650
|
+
e("Podspace User Groups", "get", "/api/usergroups/{userGroupHash}/files", "podspaceGetUserGroupFiles", "List user group files", { query: ["start", "size"], security: "bearer" }),
|
|
4651
|
+
e("Podspace User Groups", "post", "/api/usergroups/{userGroupHash}/files", "podspaceUploadToUserGroup", "Upload a file to a user group", { body: "multipart", bodyRequired: true, security: "bearer" }),
|
|
4652
|
+
e("Podspace User Groups", "post", "/api/usergroups/{userGroupHash}/images", "podspaceUploadImageToUserGroup", "Upload an image to a user group", { body: "multipart", bodyRequired: true, security: "bearer" }),
|
|
4653
|
+
e("Podspace User Groups", "get", "/api/usergroups/{userGroupHash}/usage", "podspaceGetUserGroupUsage", "Get user group storage usage", { security: "bearer" }),
|
|
4654
|
+
e("Podspace Workspaces", "post", "/api/workspaces", "podspaceCreateWorkspace", "Create a workspace", { query: ["name!", "description"], security: "bearer" }),
|
|
4655
|
+
e("Podspace Workspaces", "get", "/api/workspaces/{identity}", "podspaceGetWorkspace", "Get a workspace", { query: ["identityType"], security: "bearer" }),
|
|
4656
|
+
e("Podspace Workspaces", "patch", "/api/workspaces/{identity}", "podspaceUpdateWorkspace", "Update a workspace", { query: ["name", "description"], security: "bearer" }),
|
|
4657
|
+
e("Podspace Workspaces", "get", "/api/workspaces/{identity}/members", "podspaceGetWorkspaceMembers", "List workspace members", { query: ["start", "size"], security: "bearer" }),
|
|
4658
|
+
e("Podspace Workspaces", "put", "/api/workspaces/{identity}/members/{userIdentity}", "podspaceUpdateWorkspaceMember", "Update a workspace member", { query: ["role!", "identityType"], security: "bearer" }),
|
|
4659
|
+
e("Podspace Workspaces", "delete", "/api/workspaces/{identity}/members/{userIdentity}", "podspaceRemoveWorkspaceMember", "Remove a workspace member", { query: ["identityType"], security: "bearer" }),
|
|
4660
|
+
e("Podspace Account", "get", "/api/me", "podspaceGetUser", "Get the current Podspace user", { security: "bearer" }),
|
|
4661
|
+
e("Podspace Account", "get", "/api/me/workspaces", "podspaceGetUserWorkspaces", "List current user workspaces", { query: ["start", "size"], security: "bearer" }),
|
|
4662
|
+
e("Podspace Account", "get", "/api/me/status", "podspaceGetUserStatus", "Get current user status", { security: "bearer" }),
|
|
4663
|
+
e("Podspace Account", "get", "/api/me/scope", "podspaceGetUserScope", "Get current user scopes", { security: "bearer" }),
|
|
4664
|
+
e("Podspace Account", "get", "/api/me/reports/usage", "podspaceGetUserUsageReport", "Get current user usage report", { query: ["from", "to"], security: "bearer" }),
|
|
4665
|
+
e("Podspace Account", "get", "/api/me/plans", "podspaceGetUserPlans", "List current user plans", { security: "bearer" }),
|
|
4666
|
+
e("Podspace Account", "get", "/api/me/folder", "podspaceGetPersonalFolder", "Get the personal folder", { security: "bearer" }),
|
|
4667
|
+
e("Podspace Account", "get", "/api/me/folders/chat", "podspaceGetOrCreateChatFolder", "Get or create the chat folder", { security: "bearer" }),
|
|
4668
|
+
e("Podspace Account", "get", "/api/me/avatar", "podspaceGetUserAvatar", "Download the current user avatar", { security: "bearer", response: "binary" })
|
|
4669
|
+
];
|
|
4670
|
+
var TAG_DESCRIPTIONS = {
|
|
4671
|
+
SSO: "Authentication, OTP, token and user-profile operations.",
|
|
4672
|
+
Captcha: "POD captcha generation and validation.",
|
|
4673
|
+
"Custom Post": "Custom post and metadata timeline operations.",
|
|
4674
|
+
Notification: "Notification delivery operations.",
|
|
4675
|
+
Social: "Comments and reactions.",
|
|
4676
|
+
IUMS: "IUMS RPC-style academic information operations.",
|
|
4677
|
+
PodForm: "Forms, fields, responses, templates, folders, OTP and plans.",
|
|
4678
|
+
"CMS Content": "CMS content lifecycle and discovery.",
|
|
4679
|
+
"CMS Products": "CMS product lifecycle and discovery.",
|
|
4680
|
+
"CMS Tags": "CMS tag categories and tag trees.",
|
|
4681
|
+
"Podspace Files": "File upload, download and management.",
|
|
4682
|
+
"Podspace Folders": "Folder hierarchy operations.",
|
|
4683
|
+
"Podspace Resumable": "Resumable file uploads.",
|
|
4684
|
+
"Podspace Links": "Public download links.",
|
|
4685
|
+
"Podspace Shares": "Sharing and permissions.",
|
|
4686
|
+
"Podspace Trash": "Trash and recovery.",
|
|
4687
|
+
"Podspace Tags": "File and folder tags.",
|
|
4688
|
+
"Podspace Bookmarks": "File and folder bookmarks.",
|
|
4689
|
+
"Podspace Metadata": "Custom metadata and descriptions.",
|
|
4690
|
+
"Podspace User Groups": "Team user groups and their files.",
|
|
4691
|
+
"Podspace Workspaces": "Workspace and membership operations.",
|
|
4692
|
+
"Podspace Account": "Current user, plan and quota operations."
|
|
4693
|
+
};
|
|
4694
|
+
var SERVICE_URL = {
|
|
4695
|
+
SSO: "accounts",
|
|
4696
|
+
Captcha: "cms",
|
|
4697
|
+
"Custom Post": "apiPod",
|
|
4698
|
+
Notification: "notification",
|
|
4699
|
+
Social: "apiPod",
|
|
4700
|
+
IUMS: "iums",
|
|
4701
|
+
PodForm: "podform",
|
|
4702
|
+
"CMS Content": "cms",
|
|
4703
|
+
"CMS Products": "cms",
|
|
4704
|
+
"CMS Tags": "cms",
|
|
4705
|
+
"Podspace Files": "podspace",
|
|
4706
|
+
"Podspace Folders": "podspace",
|
|
4707
|
+
"Podspace Resumable": "podspace",
|
|
4708
|
+
"Podspace Links": "podspace",
|
|
4709
|
+
"Podspace Shares": "podspace",
|
|
4710
|
+
"Podspace Trash": "podspace",
|
|
4711
|
+
"Podspace Tags": "podspace",
|
|
4712
|
+
"Podspace Bookmarks": "podspace",
|
|
4713
|
+
"Podspace Metadata": "podspace",
|
|
4714
|
+
"Podspace User Groups": "podspace",
|
|
4715
|
+
"Podspace Workspaces": "podspace",
|
|
4716
|
+
"Podspace Account": "podspace"
|
|
4717
|
+
};
|
|
4718
|
+
function securityRequirement(kind = "apiToken") {
|
|
4719
|
+
switch (kind) {
|
|
4720
|
+
case "none":
|
|
4721
|
+
return [];
|
|
4722
|
+
case "bearer":
|
|
4723
|
+
return [{ BearerAuth: [] }];
|
|
4724
|
+
case "basic":
|
|
4725
|
+
return [{ BasicAuth: [] }];
|
|
4726
|
+
case "clientId":
|
|
4727
|
+
return [{ ClientId: [] }];
|
|
4728
|
+
case "podFormToken":
|
|
4729
|
+
return [{ PodFormToken: [] }];
|
|
4730
|
+
case "cmsPublic":
|
|
4731
|
+
return [{ ClientId: [] }];
|
|
4732
|
+
case "cmsManage":
|
|
4733
|
+
return [{ ClientId: [], CmsAccessToken: [] }];
|
|
4734
|
+
case "signature":
|
|
4735
|
+
return [{ SignatureAuth: [] }];
|
|
4736
|
+
default:
|
|
4737
|
+
return [{ PodApiToken: [] }];
|
|
4738
|
+
}
|
|
4739
|
+
}
|
|
4740
|
+
function pathParameters(path) {
|
|
4741
|
+
return Array.from(path.matchAll(/\{([^}]+)\}/g), ([, name]) => ({
|
|
4742
|
+
name,
|
|
4743
|
+
in: "path",
|
|
4744
|
+
required: true,
|
|
4745
|
+
schema: /(^id$|Id$|entityId$|period$)/.test(name) ? { type: "integer" } : { type: "string" }
|
|
4746
|
+
}));
|
|
4747
|
+
}
|
|
4748
|
+
function queryParameters(query = []) {
|
|
4749
|
+
return query.map((rawName) => {
|
|
4750
|
+
const required = rawName.endsWith("!");
|
|
4751
|
+
const name = required ? rawName.slice(0, -1) : rawName;
|
|
4752
|
+
const arrayLike = /^(hashes|tags|keys|fieldIds|responseIds|directories)$/.test(name);
|
|
4753
|
+
const booleanLike = /^(enable|showDetail|lockForEdit|removeFromTrash|isPublic|uniqueName|download|breadcrumb|nativeMetadata|includeSizeAndCount|notify|overwrite|dislike|newVersion|includeCurrent)$/.test(name);
|
|
4754
|
+
const integerLike = /^(offset|start|size|page|width|height|quality|period|fileSize)$/.test(name);
|
|
4755
|
+
return {
|
|
4756
|
+
name,
|
|
4757
|
+
in: "query",
|
|
4758
|
+
required,
|
|
4759
|
+
schema: arrayLike ? { type: "array", items: { type: "string" } } : booleanLike ? { type: "boolean" } : integerLike ? { type: "integer" } : { type: "string" }
|
|
4760
|
+
};
|
|
4761
|
+
});
|
|
4762
|
+
}
|
|
4763
|
+
function requestBody(kind, required = false) {
|
|
4764
|
+
if (!kind) return void 0;
|
|
4765
|
+
const contentType = kind === "form" ? "application/x-www-form-urlencoded" : kind === "multipart" ? "multipart/form-data" : kind === "binary" ? "application/octet-stream" : "application/json";
|
|
4766
|
+
const schema = kind === "binary" ? { type: "string", format: "binary" } : kind === "multipart" ? { $ref: "#/components/schemas/MultipartUpload" } : { $ref: "#/components/schemas/GenericObject" };
|
|
4767
|
+
return { required, content: { [contentType]: { schema } } };
|
|
4768
|
+
}
|
|
4769
|
+
function responses(kind = "json") {
|
|
4770
|
+
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" } } } };
|
|
4771
|
+
return {
|
|
4772
|
+
"200": success,
|
|
4773
|
+
"400": { $ref: "#/components/responses/BadRequest" },
|
|
4774
|
+
"401": { $ref: "#/components/responses/Unauthorized" },
|
|
4775
|
+
"500": { $ref: "#/components/responses/ServerError" }
|
|
4776
|
+
};
|
|
4777
|
+
}
|
|
4778
|
+
function createPodOpenApiDocument(options = {}) {
|
|
4779
|
+
const urls = resolvePodUrls(options.urls, options.sandbox);
|
|
4780
|
+
const paths = {};
|
|
4781
|
+
for (const endpoint of POD_OPENAPI_ENDPOINTS) {
|
|
4782
|
+
const parameters = [...pathParameters(endpoint.path), ...queryParameters(endpoint.query)];
|
|
4783
|
+
const operation = {
|
|
4784
|
+
tags: [endpoint.tag],
|
|
4785
|
+
summary: endpoint.summary,
|
|
4786
|
+
operationId: endpoint.operationId,
|
|
4787
|
+
security: securityRequirement(endpoint.security),
|
|
4788
|
+
servers: [{ url: urls[SERVICE_URL[endpoint.tag]] }],
|
|
4789
|
+
responses: responses(endpoint.response),
|
|
4790
|
+
"x-sdk-methods": endpoint.sdkMethods || [endpoint.operationId.replace(/^[a-z]+/, (value) => value)]
|
|
4791
|
+
};
|
|
4792
|
+
if (parameters.length) operation.parameters = parameters;
|
|
4793
|
+
const body = requestBody(endpoint.body, endpoint.bodyRequired);
|
|
4794
|
+
if (body) operation.requestBody = body;
|
|
4795
|
+
if (endpoint.deprecated) operation.deprecated = true;
|
|
4796
|
+
paths[endpoint.path] ||= {};
|
|
4797
|
+
if (paths[endpoint.path][endpoint.method]) {
|
|
4798
|
+
throw new Error(`Duplicate OpenAPI operation: ${endpoint.method.toUpperCase()} ${endpoint.path}`);
|
|
4799
|
+
}
|
|
4800
|
+
paths[endpoint.path][endpoint.method] = operation;
|
|
4801
|
+
}
|
|
4802
|
+
return {
|
|
4803
|
+
openapi: "3.0.3",
|
|
4804
|
+
info: {
|
|
4805
|
+
title: options.title || "POD SDK Services API",
|
|
4806
|
+
version: options.version || "1.0.10",
|
|
4807
|
+
description: "Swagger/OpenAPI documentation for every remote HTTP operation exposed by @rezamirzapour/pod-sdk.",
|
|
4808
|
+
license: { name: "MIT", url: "https://opensource.org/licenses/MIT" }
|
|
4809
|
+
},
|
|
4810
|
+
tags: Object.entries(TAG_DESCRIPTIONS).map(([name, description]) => ({ name, description })),
|
|
4811
|
+
paths,
|
|
4812
|
+
components: {
|
|
4813
|
+
securitySchemes: {
|
|
4814
|
+
PodApiToken: { type: "apiKey", in: "header", name: "_token_", description: "POD API token." },
|
|
4815
|
+
BearerAuth: { type: "http", scheme: "bearer", bearerFormat: "POD token" },
|
|
4816
|
+
BasicAuth: { type: "http", scheme: "basic" },
|
|
4817
|
+
SignatureAuth: { type: "apiKey", in: "header", name: "Authorization", description: "Signature generated by the SSO handshake key." },
|
|
4818
|
+
ClientId: { type: "apiKey", in: "header", name: "Client-Id" },
|
|
4819
|
+
CmsAccessToken: { type: "apiKey", in: "header", name: "Access-Token" },
|
|
4820
|
+
PodFormToken: { type: "apiKey", in: "header", name: "token" }
|
|
4821
|
+
},
|
|
4822
|
+
schemas: {
|
|
4823
|
+
GenericObject: { type: "object", additionalProperties: true },
|
|
4824
|
+
MultipartUpload: {
|
|
4825
|
+
type: "object",
|
|
4826
|
+
properties: { file: { type: "string", format: "binary" }, files: { type: "array", items: { type: "string", format: "binary" } } },
|
|
4827
|
+
additionalProperties: true
|
|
4828
|
+
},
|
|
4829
|
+
ApiResponse: {
|
|
4830
|
+
type: "object",
|
|
4831
|
+
properties: {
|
|
4832
|
+
hasError: { type: "boolean" },
|
|
4833
|
+
result: {},
|
|
4834
|
+
message: { type: "string" },
|
|
4835
|
+
errorCode: { type: "integer" },
|
|
4836
|
+
count: { type: "integer" },
|
|
4837
|
+
referenceNumber: { type: "string" }
|
|
4838
|
+
},
|
|
4839
|
+
additionalProperties: true
|
|
4840
|
+
},
|
|
4841
|
+
ErrorResponse: {
|
|
4842
|
+
type: "object",
|
|
4843
|
+
properties: { hasError: { type: "boolean", example: true }, message: { type: "string" }, errorCode: { type: "integer" } },
|
|
4844
|
+
additionalProperties: true
|
|
4845
|
+
}
|
|
4846
|
+
},
|
|
4847
|
+
responses: {
|
|
4848
|
+
BadRequest: { description: "Invalid request", content: { "application/json": { schema: { $ref: "#/components/schemas/ErrorResponse" } } } },
|
|
4849
|
+
Unauthorized: { description: "Authentication failed", content: { "application/json": { schema: { $ref: "#/components/schemas/ErrorResponse" } } } },
|
|
4850
|
+
ServerError: { description: "Remote service error", content: { "application/json": { schema: { $ref: "#/components/schemas/ErrorResponse" } } } }
|
|
4851
|
+
}
|
|
4852
|
+
}
|
|
4853
|
+
};
|
|
4854
|
+
}
|
|
4855
|
+
var POD_OPENAPI_DOCUMENT = createPodOpenApiDocument();
|
|
4856
|
+
var podSwaggerDocument = POD_OPENAPI_DOCUMENT;
|
|
4857
|
+
|
|
4300
4858
|
exports.CaptchaService = CaptchaService;
|
|
4301
4859
|
exports.CmsDataFormatter = CmsDataFormatter;
|
|
4302
4860
|
exports.CmsProductService = CmsProductService;
|
|
@@ -4307,6 +4865,8 @@ exports.CustomPostService = CustomPostService;
|
|
|
4307
4865
|
exports.DEFAULT_POD_URLS = DEFAULT_POD_URLS;
|
|
4308
4866
|
exports.IumsService = IumsService;
|
|
4309
4867
|
exports.NotificationService = NotificationService;
|
|
4868
|
+
exports.POD_OPENAPI_DOCUMENT = POD_OPENAPI_DOCUMENT;
|
|
4869
|
+
exports.POD_OPENAPI_ENDPOINTS = POD_OPENAPI_ENDPOINTS;
|
|
4310
4870
|
exports.PodFormService = PodFormService;
|
|
4311
4871
|
exports.PodSdk = PodSdk;
|
|
4312
4872
|
exports.PodspaceBookmarksService = PodspaceBookmarksService;
|
|
@@ -4326,10 +4886,12 @@ exports.PodspaceWorkspacesService = PodspaceWorkspacesService;
|
|
|
4326
4886
|
exports.SANDBOX_POD_URLS = SANDBOX_POD_URLS;
|
|
4327
4887
|
exports.SocialService = SocialService;
|
|
4328
4888
|
exports.SsoService = SsoService;
|
|
4889
|
+
exports.createPodOpenApiDocument = createPodOpenApiDocument;
|
|
4329
4890
|
exports.createPodSdk = createPodSdk;
|
|
4330
4891
|
exports.default = client_default;
|
|
4331
4892
|
exports.encodeBase64 = encodeBase64;
|
|
4332
4893
|
exports.generatePodSignatureHeader = generatePodSignatureHeader;
|
|
4894
|
+
exports.podSwaggerDocument = podSwaggerDocument;
|
|
4333
4895
|
exports.resolvePodUrls = resolvePodUrls;
|
|
4334
4896
|
//# sourceMappingURL=index.js.map
|
|
4335
4897
|
//# sourceMappingURL=index.js.map
|