@siglume/api-sdk 2.0.5 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -8
- package/dist/bin/siglume.cjs +9 -211
- package/dist/bin/siglume.cjs.map +1 -1
- package/dist/bin/siglume.js +9 -211
- package/dist/bin/siglume.js.map +1 -1
- package/dist/cli/index.cjs +9 -211
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +0 -35
- package/dist/cli/index.d.ts +0 -35
- package/dist/cli/index.js +9 -211
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +0 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -42
- package/dist/index.d.ts +1 -42
- package/dist/index.js +0 -70
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1859,12 +1859,6 @@ function parseListing(data) {
|
|
|
1859
1859
|
seller_display_name: stringOrNull2(data.seller_display_name),
|
|
1860
1860
|
seller_homepage_url: stringOrNull2(data.seller_homepage_url),
|
|
1861
1861
|
seller_social_url: stringOrNull2(data.seller_social_url),
|
|
1862
|
-
publisher_type: stringOrNull2(data.publisher_type),
|
|
1863
|
-
publisher_company_id: stringOrNull2(data.publisher_company_id),
|
|
1864
|
-
company_id: stringOrNull2(data.company_id),
|
|
1865
|
-
company_name: stringOrNull2(data.company_name),
|
|
1866
|
-
company_publish_status: stringOrNull2(data.company_publish_status),
|
|
1867
|
-
company_terms_version: stringOrNull2(data.company_terms_version),
|
|
1868
1862
|
review_status: stringOrNull2(data.review_status),
|
|
1869
1863
|
review_note: stringOrNull2(data.review_note),
|
|
1870
1864
|
submission_blockers: Array.isArray(data.submission_blockers) ? data.submission_blockers.filter((item) => typeof item === "string") : [],
|
|
@@ -1874,29 +1868,6 @@ function parseListing(data) {
|
|
|
1874
1868
|
raw: { ...data }
|
|
1875
1869
|
};
|
|
1876
1870
|
}
|
|
1877
|
-
function parseCompanyPublisher(data) {
|
|
1878
|
-
const wallets = Array.isArray(data.settlement_wallets) ? data.settlement_wallets.filter((item) => isRecord2(item)) : [];
|
|
1879
|
-
return {
|
|
1880
|
-
company_id: String(data.company_id ?? data.id ?? ""),
|
|
1881
|
-
name: String(data.name ?? ""),
|
|
1882
|
-
status: String(data.status ?? ""),
|
|
1883
|
-
description: stringOrNull2(data.description),
|
|
1884
|
-
is_founder: Boolean(data.is_founder ?? false),
|
|
1885
|
-
membership_role: stringOrNull2(data.membership_role),
|
|
1886
|
-
membership_status: stringOrNull2(data.membership_status),
|
|
1887
|
-
can_publish: Boolean(data.can_publish ?? true),
|
|
1888
|
-
can_approve: Boolean(data.can_approve ?? false),
|
|
1889
|
-
approval_required: Boolean(data.approval_required ?? false),
|
|
1890
|
-
paid_listing_allowed: Boolean(data.paid_listing_allowed ?? false),
|
|
1891
|
-
disabled_reasons: Array.isArray(data.disabled_reasons) ? data.disabled_reasons.filter((item) => typeof item === "string") : [],
|
|
1892
|
-
company_terms_version: stringOrNull2(data.company_terms_version),
|
|
1893
|
-
active_listing_count: Number(data.active_listing_count ?? 0),
|
|
1894
|
-
pending_approval_count: Number(data.pending_approval_count ?? 0),
|
|
1895
|
-
settlement_wallet_ready: Boolean(data.settlement_wallet_ready ?? false),
|
|
1896
|
-
settlement_wallets: wallets.map((item) => ({ ...item })),
|
|
1897
|
-
raw: { ...data }
|
|
1898
|
-
};
|
|
1899
|
-
}
|
|
1900
1871
|
function parseCapabilitySaveState(data) {
|
|
1901
1872
|
return {
|
|
1902
1873
|
capability_key: String(data.capability_key ?? ""),
|
|
@@ -2811,9 +2782,6 @@ var init_client = __esm({
|
|
|
2811
2782
|
"support_contact",
|
|
2812
2783
|
"seller_homepage_url",
|
|
2813
2784
|
"seller_social_url",
|
|
2814
|
-
"publisher_type",
|
|
2815
|
-
"company_id",
|
|
2816
|
-
"publisher_company_id",
|
|
2817
2785
|
"store_vertical",
|
|
2818
2786
|
"jurisdiction",
|
|
2819
2787
|
"price_model",
|
|
@@ -2887,25 +2855,6 @@ var init_client = __esm({
|
|
|
2887
2855
|
);
|
|
2888
2856
|
}
|
|
2889
2857
|
}
|
|
2890
|
-
const explicitPublisherType = payload.publisher_type !== void 0 && payload.publisher_type !== null;
|
|
2891
|
-
const companyId = String(payload.company_id ?? "").trim() || String(payload.publisher_company_id ?? "").trim();
|
|
2892
|
-
const publisherType = String(payload.publisher_type ?? "user").trim().toLowerCase();
|
|
2893
|
-
if (publisherType !== "user" && publisherType !== "company") {
|
|
2894
|
-
throw new SiglumeClientError("AppManifest.publisher_type must be 'user' or 'company'.");
|
|
2895
|
-
}
|
|
2896
|
-
if (publisherType === "company" && !companyId) {
|
|
2897
|
-
throw new SiglumeClientError("AppManifest.company_id is required when publisher_type='company'.");
|
|
2898
|
-
}
|
|
2899
|
-
if (publisherType === "user" && companyId) {
|
|
2900
|
-
throw new SiglumeClientError("AppManifest.company_id cannot be combined with publisher_type='user'.");
|
|
2901
|
-
}
|
|
2902
|
-
if (explicitPublisherType || companyId) {
|
|
2903
|
-
payload.publisher_type = publisherType;
|
|
2904
|
-
}
|
|
2905
|
-
if (companyId) {
|
|
2906
|
-
payload.company_id = companyId;
|
|
2907
|
-
payload.publisher_company_id = companyId;
|
|
2908
|
-
}
|
|
2909
2858
|
validateManifestPersistenceContract(payload);
|
|
2910
2859
|
if (payload.manifest && typeof payload.manifest === "object") {
|
|
2911
2860
|
delete payload.manifest.version;
|
|
@@ -3013,25 +2962,6 @@ var init_client = __esm({
|
|
|
3013
2962
|
const [data] = await this.request("GET", `/market/capabilities/${listing_id}`);
|
|
3014
2963
|
return parseListing(data);
|
|
3015
2964
|
}
|
|
3016
|
-
async list_company_publishers() {
|
|
3017
|
-
const [data] = await this.request("GET", "/market/company-publishers");
|
|
3018
|
-
return Array.isArray(data.items) ? data.items.filter((item) => isRecord2(item)).map(parseCompanyPublisher) : [];
|
|
3019
|
-
}
|
|
3020
|
-
async request_company_publish_approval(listing_id, note) {
|
|
3021
|
-
const [data] = await this.request("POST", `/market/capabilities/${listing_id}/company-publish-approval`, {
|
|
3022
|
-
json_body: note ? { note } : {}
|
|
3023
|
-
});
|
|
3024
|
-
return parseListing(data);
|
|
3025
|
-
}
|
|
3026
|
-
async decide_company_publish_approval(listing_id, options) {
|
|
3027
|
-
const [data] = await this.request("POST", `/market/capabilities/${listing_id}/company-publish-approval/decision`, {
|
|
3028
|
-
json_body: {
|
|
3029
|
-
decision: options.decision,
|
|
3030
|
-
...options.reason ? { reason: options.reason } : {}
|
|
3031
|
-
}
|
|
3032
|
-
});
|
|
3033
|
-
return parseListing(data);
|
|
3034
|
-
}
|
|
3035
2965
|
async get_capability_state(capability_key, save_key = "default") {
|
|
3036
2966
|
const [data] = await this.request("GET", `/market/capability-state/${capability_key}/${save_key}`);
|
|
3037
2967
|
return parseCapabilitySaveState(data);
|