@tool-bridge/server 0.21.1 → 0.23.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/dist/admin.js +170 -0
- package/dist/airtable-VMQVXLHK.js +790 -0
- package/dist/{alt_text_generator_ai-W7O34SNG.js → alt_text_generator_ai-FTWY4RU4.js} +12 -11
- package/dist/{amap-VOX4T2AW.js → amap-OK5VBHYC.js} +221 -220
- package/dist/anthropic-S67AZFZ3.js +203 -0
- package/dist/apify-ZE6MYQI3.js +248 -0
- package/dist/brave_search-TG2M2KOD.js +302 -0
- package/dist/chunk-2JNAI4OC.js +161 -0
- package/dist/{chunk-KMTT3I6D.js → chunk-4XJPN3DY.js} +19392 -26136
- package/dist/chunk-5ICRY3VU.js +8432 -0
- package/dist/chunk-7CTWGTDU.js +302 -0
- package/dist/chunk-BADVCN6K.js +378 -0
- package/dist/{chunk-XYBU3WZH.js → chunk-TDAWLMDE.js} +3 -3
- package/dist/chunk-U7PTOA3U.js +7320 -0
- package/dist/{chunk-E6JCVKW6.js → chunk-VWRUGUSU.js} +3 -3
- package/dist/{chunk-ATK45BXV.js → chunk-WJHG6OK7.js} +4 -2
- package/dist/circleci-3L3WJVSK.js +389 -0
- package/dist/clerk-EZPF2V7T.js +1019 -0
- package/dist/cohere-U27DPO64.js +185 -0
- package/dist/{confluence-B3EWPZVE.js → confluence-G2KL6ERH.js} +105 -104
- package/dist/{convertapi-EUWSQYPF.js → convertapi-L4CLJ2M3.js} +32 -31
- package/dist/{currencyapi-KVTIK3GL.js → currencyapi-YPYXG7YY.js} +71 -71
- package/dist/deepseek-6HT6WF3M.js +210 -0
- package/dist/docker_hub-LPE3PCVB.js +933 -0
- package/dist/dropbox-V56ABHTA.js +1305 -0
- package/dist/dub-6OKQ7MHT.js +680 -0
- package/dist/e2b-JS2U2QFU.js +278 -0
- package/dist/exa-DPWVYXSP.js +332 -0
- package/dist/{fal_ai-23E7JPNT.js → fal_ai-DK6Y27ZF.js} +81 -80
- package/dist/{feishu-7QRIDUV6.js → feishu-K7EGSRF3.js} +528 -572
- package/dist/{feishu_custom_bot-TJ4K7QNJ.js → feishu_custom_bot-2JUGFYNG.js} +57 -53
- package/dist/figma-FT5I7ITD.js +777 -0
- package/dist/firehydrant-EIKLKHX2.js +563 -0
- package/dist/{fixer-BWON27UO.js → fixer-U5QXIAKD.js} +34 -33
- package/dist/fly-T3JYFZ2M.js +469 -0
- package/dist/{front-QCGXYEDJ.js → front-D72MGVOR.js} +104 -104
- package/dist/geocodio-BOTD5TI5.js +213 -0
- package/dist/ghost-KYP7SZGB.js +338 -0
- package/dist/github-AGMZT3VY.js +5421 -0
- package/dist/gmail-BLJNJOBG.js +1887 -0
- package/dist/googlecalendar-GTHWNCF6.js +2524 -0
- package/dist/{googledocs-BUHL4J2H.js → googledocs-6EEDMEBQ.js} +341 -340
- package/dist/{grafana-GLU2DWF2.js → grafana-GMW6EKSQ.js} +221 -220
- package/dist/graphhopper-6OLGBDGB.js +325 -0
- package/dist/index.d.ts +1132 -332
- package/dist/index.js +31 -14
- package/dist/{ip2proxy-EZ64Y4ZH.js → ip2proxy-4QN42E6T.js} +28 -27
- package/dist/ipgeolocation_io-SK4XKDA2.js +315 -0
- package/dist/ipqualityscore-6ANBPXKT.js +279 -0
- package/dist/{jina_ai-EFBHTBXL.js → jina_ai-IHPSVRM5.js} +23 -23
- package/dist/{jira-HQSHAA5K.js → jira-46KKM4LC.js} +118 -117
- package/dist/langsmith-JZA345I5.js +593 -0
- package/dist/lemlist-43IV7DK6.js +289 -0
- package/dist/{linear-K7RYFYAD.js → linear-5LFH7XNL.js} +327 -326
- package/dist/logsnag-5RMYAHIL.js +150 -0
- package/dist/main.js +57 -280
- package/dist/{mattermost-S2BRCWLQ.js → mattermost-XFL6SHGG.js} +59 -58
- package/dist/mem0-NYO4DTP6.js +544 -0
- package/dist/memos-37MPQOLV.js +744 -0
- package/dist/{metabase-MMSEPCOF.js → metabase-KYBKZFMG.js} +90 -89
- package/dist/mistral_ai-6PL3K4PM.js +1196 -0
- package/dist/{mother_duck-H7PCQNZ2.js → mother_duck-2NH7W5M5.js} +94 -93
- package/dist/ngrok-UO6CDYCA.js +356 -0
- package/dist/{notes-PFMKRO33.js → notes-I3P32WP4.js} +11 -9
- package/dist/notion-BEAJFUOE.js +940 -0
- package/dist/open_exchange_rates-CMF62JB4.js +215 -0
- package/dist/openai-IHOMKVND.js +800 -0
- package/dist/opengraph_io-ZQ2FGLHX.js +362 -0
- package/dist/openrouter-HXLW3NR5.js +441 -0
- package/dist/outline-ELCP4NEU.js +599 -0
- package/dist/paddle-O77LALVN.js +454 -0
- package/dist/perplexity-JCU654QV.js +220 -0
- package/dist/pinecone-W5W4LRKL.js +571 -0
- package/dist/{pipedrive-Y2O7QGFF.js → pipedrive-ITMJLLPZ.js} +99 -98
- package/dist/polar-R33XU4L3.js +395 -0
- package/dist/posthog-JVNTOLTV.js +3464 -0
- package/dist/postmark-6SBG7HWV.js +427 -0
- package/dist/{prerender-MENYM2TY.js → prerender-GPNKTNFC.js} +31 -30
- package/dist/{pubmed-GOXUVVH5.js → pubmed-UP6ZEEIH.js} +239 -238
- package/dist/{railway-V2SID4WV.js → railway-KWEWXHTY.js} +118 -117
- package/dist/readwise-BLATSMC3.js +470 -0
- package/dist/render-QYRVIXII.js +461 -0
- package/dist/{replicate-756MXPYX.js → replicate-JYTWH4NF.js} +81 -80
- package/dist/{resend-ZKH3BTBI.js → resend-L5N75SZM.js} +20 -16
- package/dist/rootly-MHCPEQ26.js +336 -0
- package/dist/{scrapfly-NSRHFDIQ.js → scrapfly-PTPGYSJM.js} +62 -61
- package/dist/{scrapingbee-OQHLAVEY.js → scrapingbee-JN6UH5PY.js} +56 -56
- package/dist/{screenshot_fyi-DVWG3AXC.js → screenshot_fyi-4QRVSV55.js} +16 -16
- package/dist/semantic_scholar-LRSWA2GE.js +611 -0
- package/dist/{sentry-546MNDJG.js → sentry-2G6PF5W6.js} +208 -207
- package/dist/{shodan-C3OON3Z3.js → shodan-WKKPP5C6.js} +62 -61
- package/dist/shopify-64YDK5T2.js +610 -0
- package/dist/stripe-QAIGGOTF.js +585 -0
- package/dist/{supabase-U2SL4D63.js → supabase-WHTGR6ND.js} +245 -244
- package/dist/tavily-QIXCDDWO.js +326 -0
- package/dist/telegram-E6G7CWI6.js +1767 -0
- package/dist/{telnyx-CXQ4EZUX.js → telnyx-ZDVVS7PK.js} +57 -56
- package/dist/todoist-DMYF3G7J.js +664 -0
- package/dist/trello-HY2RYIRP.js +1080 -0
- package/dist/turso-HAQWMGRP.js +416 -0
- package/dist/{twilio-4PDBJKWX.js → twilio-MLXYPHJE.js} +70 -69
- package/dist/umami-DZHBLPVG.js +389 -0
- package/dist/unsplash-GS2OPXKE.js +351 -0
- package/dist/{upstash_redis-G4LQBYHA.js → upstash_redis-XMXWTNAJ.js} +51 -50
- package/dist/uptimerobot-TF5WRZ4G.js +483 -0
- package/dist/v2ex-2BVXAPDF.js +667 -0
- package/dist/vercel-YMJGQYJE.js +1076 -0
- package/dist/{wolfram_alpha_api-3G4PUJWB.js → wolfram_alpha_api-I56SXWFZ.js} +36 -35
- package/dist/wordpress-R7TDFZ2P.js +812 -0
- package/dist/workos-HDNHWVMS.js +664 -0
- package/dist/zhihu-LX6AGGDS.js +254 -0
- package/package.json +18 -9
- package/dist/airtable-LLZDFN7M.js +0 -789
- package/dist/anthropic-G23NN3X5.js +0 -202
- package/dist/apify-Y3SS734K.js +0 -247
- package/dist/brave_search-ZC7OAPSZ.js +0 -301
- package/dist/chunk-R6P4XAE5.js +0 -248
- package/dist/chunk-U7B6DS2O.js +0 -977
- package/dist/chunk-UZM2RXZH.js +0 -23436
- package/dist/circleci-3BAX5FCG.js +0 -388
- package/dist/clerk-6LEM6TNU.js +0 -1019
- package/dist/cloudflare_dns-KINYTJUD.js +0 -588
- package/dist/cohere-XCJ5AJ6B.js +0 -185
- package/dist/deepseek-PC5YGNC5.js +0 -209
- package/dist/docker_hub-C3MA5FU6.js +0 -932
- package/dist/dropbox-XBV7Z2IR.js +0 -1304
- package/dist/dub-LDOFG3HC.js +0 -679
- package/dist/e2b-JMCPSVBW.js +0 -277
- package/dist/exa-RAK7O7RD.js +0 -331
- package/dist/figma-E6IX5DTH.js +0 -773
- package/dist/firehydrant-ZBLPQREE.js +0 -562
- package/dist/fly-ZH3HFCZJ.js +0 -468
- package/dist/geocodio-YGNI7DA4.js +0 -212
- package/dist/ghost-EVSGKH2Q.js +0 -337
- package/dist/github-MA2BGRCJ.js +0 -5420
- package/dist/gmail-E5E6AADE.js +0 -1886
- package/dist/googlecalendar-BTLFPXTD.js +0 -2523
- package/dist/graphhopper-WSMB3TCD.js +0 -324
- package/dist/ipgeolocation_io-AA7HAS22.js +0 -315
- package/dist/ipqualityscore-BHJXVTJT.js +0 -277
- package/dist/langsmith-5W6SCT6F.js +0 -592
- package/dist/lemlist-HJWH6UMK.js +0 -288
- package/dist/logsnag-4KFOHL37.js +0 -150
- package/dist/mem0-CAW43CIC.js +0 -543
- package/dist/memos-TWEGPKFM.js +0 -740
- package/dist/mistral_ai-64BGZQHP.js +0 -1195
- package/dist/ngrok-GQCUGZKJ.js +0 -356
- package/dist/notion-DQWZWP4N.js +0 -936
- package/dist/open_exchange_rates-QMMD735E.js +0 -214
- package/dist/openai-W6PX32NZ.js +0 -799
- package/dist/opengraph_io-HNDBXYNW.js +0 -361
- package/dist/openrouter-JJYMEAUL.js +0 -437
- package/dist/outline-MCBNQZYY.js +0 -595
- package/dist/paddle-D2SKLUDN.js +0 -453
- package/dist/perplexity-XIFMKUAE.js +0 -219
- package/dist/pinecone-HUFTALV2.js +0 -570
- package/dist/polar-TYTOMOSR.js +0 -394
- package/dist/posthog-43JAR3VW.js +0 -3463
- package/dist/postmark-KL2QJYSG.js +0 -426
- package/dist/readwise-CI4GIMMJ.js +0 -469
- package/dist/render-SUBJ6YRZ.js +0 -460
- package/dist/rootly-CD2LJHPI.js +0 -336
- package/dist/semantic_scholar-T4A252KW.js +0 -610
- package/dist/shopify-Y2HN2MCQ.js +0 -609
- package/dist/stripe-VE3CD3AY.js +0 -584
- package/dist/tavily-KCZHK6HE.js +0 -326
- package/dist/telegram-3URFBCMY.js +0 -1766
- package/dist/todoist-HNPWNYTD.js +0 -663
- package/dist/trello-3W2MIXRP.js +0 -1079
- package/dist/turso-2EQF7C2Z.js +0 -415
- package/dist/umami-5REN7TGP.js +0 -388
- package/dist/unsplash-EIXL424F.js +0 -350
- package/dist/uptimerobot-KNJ3EYLY.js +0 -482
- package/dist/v2ex-RHJ234PZ.js +0 -666
- package/dist/vercel-AS6NCIC7.js +0 -1075
- package/dist/wordpress-KNDAAUV7.js +0 -811
- package/dist/workos-R6UITSJ7.js +0 -663
- package/dist/zhihu-AGK4HILK.js +0 -253
package/dist/shopify-Y2HN2MCQ.js
DELETED
|
@@ -1,609 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createAuthedClient
|
|
3
|
-
} from "./chunk-XYBU3WZH.js";
|
|
4
|
-
import "./chunk-E6JCVKW6.js";
|
|
5
|
-
import {
|
|
6
|
-
asJsonObject,
|
|
7
|
-
trimmedText
|
|
8
|
-
} from "./chunk-JXHMDBAY.js";
|
|
9
|
-
import {
|
|
10
|
-
createProviderPlugin,
|
|
11
|
-
requireCredential,
|
|
12
|
-
upstreamError
|
|
13
|
-
} from "./chunk-ATK45BXV.js";
|
|
14
|
-
import "./chunk-U7B6DS2O.js";
|
|
15
|
-
import {
|
|
16
|
-
TBError,
|
|
17
|
-
external_exports
|
|
18
|
-
} from "./chunk-UZM2RXZH.js";
|
|
19
|
-
import "./chunk-U67V476Y.js";
|
|
20
|
-
|
|
21
|
-
// ../plugins/src/shopify/api.ts
|
|
22
|
-
var SERVICE = "shopify";
|
|
23
|
-
var REST_API_VERSION = "2026-04";
|
|
24
|
-
var MYSHOPIFY_SUFFIX = ".myshopify.com";
|
|
25
|
-
function requireRecord(value, label) {
|
|
26
|
-
const result = asJsonObject(value);
|
|
27
|
-
if (result === void 0) throw new TBError("unavailable", `Shopify \u54CD\u5E94\u7F3A\u5C11 ${label}`, { retryable: true });
|
|
28
|
-
return result;
|
|
29
|
-
}
|
|
30
|
-
function requireRecordArray(value, label) {
|
|
31
|
-
if (!Array.isArray(value)) {
|
|
32
|
-
throw new TBError("unavailable", `Shopify \u54CD\u5E94\u7F3A\u5C11 ${label} \u6570\u7EC4`, { retryable: true });
|
|
33
|
-
}
|
|
34
|
-
return value.map((item) => requireRecord(item, label));
|
|
35
|
-
}
|
|
36
|
-
function requireStringArray(value, label) {
|
|
37
|
-
if (!Array.isArray(value)) {
|
|
38
|
-
throw new TBError("unavailable", `Shopify \u54CD\u5E94\u7F3A\u5C11 ${label} \u6570\u7EC4`, { retryable: true });
|
|
39
|
-
}
|
|
40
|
-
return value.map((item) => String(item));
|
|
41
|
-
}
|
|
42
|
-
function isDnsLabel(value) {
|
|
43
|
-
if (value === "" || value.startsWith("-") || value.endsWith("-") || value.length > 63) return false;
|
|
44
|
-
for (const char of value) {
|
|
45
|
-
const code = char.charCodeAt(0);
|
|
46
|
-
const isDigit = code >= 48 && code <= 57;
|
|
47
|
-
const isLowercaseLetter = code >= 97 && code <= 122;
|
|
48
|
-
if (!isDigit && !isLowercaseLetter && char !== "-") return false;
|
|
49
|
-
}
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
function isMyshopifyDomain(host) {
|
|
53
|
-
if (!host.endsWith(MYSHOPIFY_SUFFIX) || host.length <= MYSHOPIFY_SUFFIX.length) return false;
|
|
54
|
-
return host.slice(0, -MYSHOPIFY_SUFFIX.length).split(".").every((segment) => isDnsLabel(segment));
|
|
55
|
-
}
|
|
56
|
-
function shopHost(ctx) {
|
|
57
|
-
const raw = requireCredential(ctx, SERVICE, "shopDomain").trim();
|
|
58
|
-
let host = raw;
|
|
59
|
-
if (raw.includes("://")) {
|
|
60
|
-
try {
|
|
61
|
-
host = new URL(raw).hostname;
|
|
62
|
-
} catch {
|
|
63
|
-
throw new TBError("invalid_argument", "shopDomain \u5FC5\u987B\u662F myshopify.com \u57DF\u540D\u6216\u5176\u5730\u5740");
|
|
64
|
-
}
|
|
65
|
-
} else {
|
|
66
|
-
host = raw.split("/")[0] ?? "";
|
|
67
|
-
}
|
|
68
|
-
const normalized = host.toLowerCase();
|
|
69
|
-
if (!isMyshopifyDomain(normalized)) {
|
|
70
|
-
throw new TBError("invalid_argument", "shopDomain \u5FC5\u987B\u662F myshopify.com \u57DF\u540D\u6216\u5176\u5730\u5740");
|
|
71
|
-
}
|
|
72
|
-
return normalized;
|
|
73
|
-
}
|
|
74
|
-
function errorDetail(payload) {
|
|
75
|
-
if (typeof payload === "string") return trimmedText(payload);
|
|
76
|
-
const body = asJsonObject(payload);
|
|
77
|
-
if (body === void 0) return void 0;
|
|
78
|
-
const errors = body.errors;
|
|
79
|
-
if (typeof errors === "string") return errors;
|
|
80
|
-
if (Array.isArray(errors)) return errors.map((item) => String(item)).join("; ");
|
|
81
|
-
const errorRecord = asJsonObject(errors);
|
|
82
|
-
if (errorRecord !== void 0) {
|
|
83
|
-
return Object.entries(errorRecord).map(([key, value]) => `${key}: ${Array.isArray(value) ? value.join(", ") : String(value)}`).join("; ");
|
|
84
|
-
}
|
|
85
|
-
return trimmedText(body.error) ?? trimmedText(body.message);
|
|
86
|
-
}
|
|
87
|
-
function pageInfoForRel(linkHeader, rel) {
|
|
88
|
-
if (linkHeader === null || linkHeader === "") return null;
|
|
89
|
-
for (const item of linkHeader.split(",")) {
|
|
90
|
-
const [urlPart, ...parameterParts] = item.trim().split(";");
|
|
91
|
-
if (urlPart === void 0 || !urlPart.startsWith("<") || !urlPart.endsWith(">")) continue;
|
|
92
|
-
const hasRel = parameterParts.some((part) => {
|
|
93
|
-
const normalized = part.trim().toLowerCase();
|
|
94
|
-
return normalized === `rel="${rel}"` || normalized === `rel=${rel}`;
|
|
95
|
-
});
|
|
96
|
-
if (!hasRel) continue;
|
|
97
|
-
try {
|
|
98
|
-
return new URL(urlPart.slice(1, -1)).searchParams.get("page_info");
|
|
99
|
-
} catch {
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
var http = createAuthedClient({
|
|
106
|
-
service: SERVICE,
|
|
107
|
-
auth: {
|
|
108
|
-
kind: "custom",
|
|
109
|
-
headers: (ctx) => ({ "x-shopify-access-token": requireCredential(ctx, SERVICE, "apiKey") })
|
|
110
|
-
},
|
|
111
|
-
headers: { accept: "application/json" },
|
|
112
|
-
mapError: ({ data, status }) => {
|
|
113
|
-
const detail = errorDetail(data);
|
|
114
|
-
return upstreamError(
|
|
115
|
-
status,
|
|
116
|
-
detail === void 0 ? `Shopify REST \u8FD4\u56DE HTTP ${status}` : `Shopify REST \u8FD4\u56DE HTTP ${status}: ${detail}`
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
async function request(ctx, path, query) {
|
|
121
|
-
const result = await http.request(ctx, {
|
|
122
|
-
baseUrl: `https://${shopHost(ctx)}/admin/api/${REST_API_VERSION}/`,
|
|
123
|
-
path,
|
|
124
|
-
query: Object.entries(query ?? {}),
|
|
125
|
-
invalidJsonMessage: "Shopify REST \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94"
|
|
126
|
-
});
|
|
127
|
-
return {
|
|
128
|
-
payload: result.data === void 0 ? null : result.data,
|
|
129
|
-
pagination: {
|
|
130
|
-
nextPageInfo: pageInfoForRel(result.headers.get("link"), "next"),
|
|
131
|
-
previousPageInfo: pageInfoForRel(result.headers.get("link"), "previous")
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
function requireId(value, field) {
|
|
136
|
-
if (typeof value !== "number" || !Number.isInteger(value) || value <= 0) {
|
|
137
|
-
throw new TBError("invalid_argument", `${field} \u5FC5\u987B\u662F\u6B63\u6574\u6570`);
|
|
138
|
-
}
|
|
139
|
-
return String(value);
|
|
140
|
-
}
|
|
141
|
-
function queryValue(value) {
|
|
142
|
-
if (value === void 0 || value === null || value === "") return void 0;
|
|
143
|
-
if (typeof value === "boolean" || typeof value === "number" || typeof value === "string") return String(value);
|
|
144
|
-
return void 0;
|
|
145
|
-
}
|
|
146
|
-
function pickQuery(input, keys) {
|
|
147
|
-
const query = {};
|
|
148
|
-
for (const key of keys) {
|
|
149
|
-
const value = queryValue(input[key]);
|
|
150
|
-
if (value !== void 0) query[key] = value;
|
|
151
|
-
}
|
|
152
|
-
return query;
|
|
153
|
-
}
|
|
154
|
-
function assertPageInfoBoundary(input) {
|
|
155
|
-
if (input.page_info === void 0) return;
|
|
156
|
-
for (const key of Object.keys(input)) {
|
|
157
|
-
if (key !== "page_info" && key !== "limit" && key !== "blog_id") {
|
|
158
|
-
throw new TBError("invalid_argument", "page_info \u4E0D\u80FD\u4E0E\u5176\u4ED6\u7B5B\u9009\u53C2\u6570\u540C\u7528,\u53EA\u5141\u8BB8\u518D\u5E26 limit");
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
async function getResource(ctx, path, key) {
|
|
163
|
-
const { payload } = await request(ctx, path);
|
|
164
|
-
return requireRecord(requireRecord(payload, `${key} \u54CD\u5E94`)[key], key);
|
|
165
|
-
}
|
|
166
|
-
async function listResources(input, ctx, options) {
|
|
167
|
-
assertPageInfoBoundary(input);
|
|
168
|
-
const { payload, pagination } = await request(ctx, options.path, pickQuery(input, options.keys));
|
|
169
|
-
const body = requireRecord(payload, `${options.resultKey} \u54CD\u5E94`);
|
|
170
|
-
return {
|
|
171
|
-
[options.resultKey]: requireRecordArray(body[options.resultKey], options.resultKey),
|
|
172
|
-
pagination,
|
|
173
|
-
raw: body
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
async function countResources(input, ctx, options) {
|
|
177
|
-
const { payload } = await request(ctx, options.path, pickQuery(input, options.keys));
|
|
178
|
-
const count = requireRecord(payload, "count \u54CD\u5E94").count;
|
|
179
|
-
if (typeof count !== "number" || !Number.isInteger(count) || count < 0) {
|
|
180
|
-
throw new TBError("unavailable", "Shopify \u8FD4\u56DE\u7684 count \u4E0D\u662F\u975E\u8D1F\u6574\u6570", { retryable: true });
|
|
181
|
-
}
|
|
182
|
-
return { count };
|
|
183
|
-
}
|
|
184
|
-
function articleTagQuery(input) {
|
|
185
|
-
const query = {};
|
|
186
|
-
const limit = queryValue(input.limit);
|
|
187
|
-
if (limit !== void 0) query.limit = limit;
|
|
188
|
-
if (input.popular === true) query.popular = "1";
|
|
189
|
-
return query;
|
|
190
|
-
}
|
|
191
|
-
var PAGE_FILTER_KEYS = [
|
|
192
|
-
"created_at_min",
|
|
193
|
-
"created_at_max",
|
|
194
|
-
"updated_at_min",
|
|
195
|
-
"updated_at_max",
|
|
196
|
-
"published_at_min",
|
|
197
|
-
"published_at_max"
|
|
198
|
-
];
|
|
199
|
-
async function getShop(_input, ctx) {
|
|
200
|
-
return { shop: await getResource(ctx, "/shop.json", "shop") };
|
|
201
|
-
}
|
|
202
|
-
function listBlogs(input, ctx) {
|
|
203
|
-
return listResources(input, ctx, {
|
|
204
|
-
path: "/blogs.json",
|
|
205
|
-
resultKey: "blogs",
|
|
206
|
-
keys: ["handle", "since_id", "limit", "page_info"]
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
async function getBlog(input, ctx) {
|
|
210
|
-
return { blog: await getResource(ctx, `/blogs/${requireId(input.blog_id, "blog_id")}.json`, "blog") };
|
|
211
|
-
}
|
|
212
|
-
function countBlogs(input, ctx) {
|
|
213
|
-
return countResources(input, ctx, { path: "/blogs/count.json", keys: [] });
|
|
214
|
-
}
|
|
215
|
-
function listPages(input, ctx) {
|
|
216
|
-
return listResources(input, ctx, {
|
|
217
|
-
path: "/pages.json",
|
|
218
|
-
resultKey: "pages",
|
|
219
|
-
keys: ["title", "handle", "published_status", "since_id", ...PAGE_FILTER_KEYS, "limit", "page_info"]
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
async function getPage(input, ctx) {
|
|
223
|
-
return { page: await getResource(ctx, `/pages/${requireId(input.page_id, "page_id")}.json`, "page") };
|
|
224
|
-
}
|
|
225
|
-
function countPages(input, ctx) {
|
|
226
|
-
return countResources(input, ctx, {
|
|
227
|
-
path: "/pages/count.json",
|
|
228
|
-
keys: ["title", "published_status", ...PAGE_FILTER_KEYS]
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
function listArticles(input, ctx) {
|
|
232
|
-
return listResources(input, ctx, {
|
|
233
|
-
path: `/blogs/${requireId(input.blog_id, "blog_id")}/articles.json`,
|
|
234
|
-
resultKey: "articles",
|
|
235
|
-
keys: [
|
|
236
|
-
"author",
|
|
237
|
-
"handle",
|
|
238
|
-
"tag",
|
|
239
|
-
"published_status",
|
|
240
|
-
"since_id",
|
|
241
|
-
...PAGE_FILTER_KEYS,
|
|
242
|
-
"limit",
|
|
243
|
-
"page_info"
|
|
244
|
-
]
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
async function getArticle(input, ctx) {
|
|
248
|
-
const blogId = requireId(input.blog_id, "blog_id");
|
|
249
|
-
const articleId = requireId(input.article_id, "article_id");
|
|
250
|
-
return { article: await getResource(ctx, `/blogs/${blogId}/articles/${articleId}.json`, "article") };
|
|
251
|
-
}
|
|
252
|
-
function countArticles(input, ctx) {
|
|
253
|
-
return countResources(input, ctx, {
|
|
254
|
-
path: `/blogs/${requireId(input.blog_id, "blog_id")}/articles/count.json`,
|
|
255
|
-
keys: ["published_status", ...PAGE_FILTER_KEYS]
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
async function listArticleTags(input, ctx) {
|
|
259
|
-
const { payload } = await request(ctx, "/articles/tags.json", articleTagQuery(input));
|
|
260
|
-
return { tags: requireStringArray(requireRecord(payload, "article tags \u54CD\u5E94").tags, "tags") };
|
|
261
|
-
}
|
|
262
|
-
async function listBlogArticleTags(input, ctx) {
|
|
263
|
-
const path = `/blogs/${requireId(input.blog_id, "blog_id")}/articles/tags.json`;
|
|
264
|
-
const { payload } = await request(ctx, path, articleTagQuery(input));
|
|
265
|
-
return { tags: requireStringArray(requireRecord(payload, "blog article tags \u54CD\u5E94").tags, "tags") };
|
|
266
|
-
}
|
|
267
|
-
async function listArticleAuthors(_input, ctx) {
|
|
268
|
-
const { payload } = await request(ctx, "/articles/authors.json");
|
|
269
|
-
return { authors: requireStringArray(requireRecord(payload, "article authors \u54CD\u5E94").authors, "authors") };
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
// ../plugins/src/shopify/schema.ts
|
|
273
|
-
var getShopInput = external_exports.strictObject({}).describe("No input is required to retrieve the Shopify shop.");
|
|
274
|
-
var getShopOutput = external_exports.strictObject({
|
|
275
|
-
shop: external_exports.looseObject({
|
|
276
|
-
id: external_exports.int().min(1).describe("The Shopify shop ID."),
|
|
277
|
-
name: external_exports.string().describe("The shop display name."),
|
|
278
|
-
myshopify_domain: external_exports.string().describe("The canonical myshopify.com domain for the shop.")
|
|
279
|
-
}).describe("A Shopify REST shop object.").optional()
|
|
280
|
-
}).describe("The Shopify REST shop response.");
|
|
281
|
-
var listBlogsInput = external_exports.strictObject({
|
|
282
|
-
handle: external_exports.string().min(1).describe("Filter blogs by Shopify blog handle.").optional(),
|
|
283
|
-
since_id: external_exports.int().min(1).describe("Return records with Shopify numeric IDs greater than this value.").optional(),
|
|
284
|
-
limit: external_exports.int().min(1).max(250).describe("The maximum number of records to return. Shopify REST supports values from 1 to 250.").optional(),
|
|
285
|
-
page_info: external_exports.string().min(1).describe("The opaque Shopify REST page_info cursor from a previous response pagination value.").optional()
|
|
286
|
-
}).describe("The input payload for listing Shopify REST blogs.");
|
|
287
|
-
var listBlogsOutput = external_exports.strictObject({
|
|
288
|
-
blogs: external_exports.array(external_exports.looseObject({
|
|
289
|
-
id: external_exports.int().min(1).describe("The Shopify blog ID."),
|
|
290
|
-
title: external_exports.string().describe("The blog title."),
|
|
291
|
-
handle: external_exports.string().describe("The blog handle."),
|
|
292
|
-
commentable: external_exports.string().describe("The blog comment policy returned by Shopify.").nullable(),
|
|
293
|
-
tags: external_exports.string().describe("The comma-separated tags from the 200 most recent articles.").nullable(),
|
|
294
|
-
template_suffix: external_exports.string().describe("The Liquid template suffix used by the blog.").nullable(),
|
|
295
|
-
feedburner: external_exports.string().describe("The FeedBurner identifier when configured.").nullable(),
|
|
296
|
-
feedburner_location: external_exports.string().describe("The FeedBurner URL when configured.").nullable(),
|
|
297
|
-
created_at: external_exports.string().describe("The blog creation timestamp returned by Shopify.").nullable(),
|
|
298
|
-
updated_at: external_exports.string().describe("The blog update timestamp returned by Shopify.").nullable(),
|
|
299
|
-
admin_graphql_api_id: external_exports.string().describe("The Shopify Admin GraphQL ID for the blog.").nullable()
|
|
300
|
-
}).describe("A Shopify REST blog object.")).describe("Blogs returned by Shopify.").optional(),
|
|
301
|
-
pagination: external_exports.strictObject({
|
|
302
|
-
nextPageInfo: external_exports.string().describe("The page_info cursor for the next page when Shopify returned one.").nullable().optional(),
|
|
303
|
-
previousPageInfo: external_exports.string().describe("The page_info cursor for the previous page when Shopify returned one.").nullable().optional()
|
|
304
|
-
}).describe("Shopify REST Link-header pagination cursors.").optional(),
|
|
305
|
-
raw: external_exports.looseObject({}).describe("The raw object returned by Shopify REST Admin.").optional()
|
|
306
|
-
}).describe("The Shopify REST blog list response.");
|
|
307
|
-
var getBlogInput = external_exports.strictObject({
|
|
308
|
-
blog_id: external_exports.int().min(1).describe("The Shopify blog ID.").optional()
|
|
309
|
-
}).describe("The input payload for retrieving one Shopify REST blog.");
|
|
310
|
-
var getBlogOutput = external_exports.strictObject({
|
|
311
|
-
blog: external_exports.looseObject({
|
|
312
|
-
id: external_exports.int().min(1).describe("The Shopify blog ID."),
|
|
313
|
-
title: external_exports.string().describe("The blog title."),
|
|
314
|
-
handle: external_exports.string().describe("The blog handle."),
|
|
315
|
-
commentable: external_exports.string().describe("The blog comment policy returned by Shopify.").nullable(),
|
|
316
|
-
tags: external_exports.string().describe("The comma-separated tags from the 200 most recent articles.").nullable(),
|
|
317
|
-
template_suffix: external_exports.string().describe("The Liquid template suffix used by the blog.").nullable(),
|
|
318
|
-
feedburner: external_exports.string().describe("The FeedBurner identifier when configured.").nullable(),
|
|
319
|
-
feedburner_location: external_exports.string().describe("The FeedBurner URL when configured.").nullable(),
|
|
320
|
-
created_at: external_exports.string().describe("The blog creation timestamp returned by Shopify.").nullable(),
|
|
321
|
-
updated_at: external_exports.string().describe("The blog update timestamp returned by Shopify.").nullable(),
|
|
322
|
-
admin_graphql_api_id: external_exports.string().describe("The Shopify Admin GraphQL ID for the blog.").nullable()
|
|
323
|
-
}).describe("A Shopify REST blog object.").optional()
|
|
324
|
-
}).describe("The Shopify REST blog response.");
|
|
325
|
-
var countBlogsInput = external_exports.strictObject({}).describe("No input is required to count Shopify REST blogs.");
|
|
326
|
-
var countBlogsOutput = external_exports.strictObject({
|
|
327
|
-
count: external_exports.int().min(0).describe("The count returned by Shopify REST Admin.").optional()
|
|
328
|
-
}).describe("The Shopify REST blog count response.");
|
|
329
|
-
var listPagesInput = external_exports.strictObject({
|
|
330
|
-
title: external_exports.string().min(1).describe("Retrieve pages with this exact Shopify page title.").optional(),
|
|
331
|
-
handle: external_exports.string().min(1).describe("Retrieve pages with this Shopify page handle.").optional(),
|
|
332
|
-
published_status: external_exports.enum(["published", "unpublished", "any"]).describe("The Shopify publication status filter.").optional(),
|
|
333
|
-
since_id: external_exports.int().min(1).describe("Return records with Shopify numeric IDs greater than this value.").optional(),
|
|
334
|
-
created_at_min: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
335
|
-
created_at_max: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
336
|
-
updated_at_min: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
337
|
-
updated_at_max: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
338
|
-
published_at_min: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
339
|
-
published_at_max: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
340
|
-
limit: external_exports.int().min(1).max(250).describe("The maximum number of records to return. Shopify REST supports values from 1 to 250.").optional(),
|
|
341
|
-
page_info: external_exports.string().min(1).describe("The opaque Shopify REST page_info cursor from a previous response pagination value.").optional()
|
|
342
|
-
}).describe("The input payload for listing Shopify REST pages.");
|
|
343
|
-
var listPagesOutput = external_exports.strictObject({
|
|
344
|
-
pages: external_exports.array(external_exports.looseObject({
|
|
345
|
-
id: external_exports.int().min(1).describe("The Shopify page ID."),
|
|
346
|
-
title: external_exports.string().describe("The page title."),
|
|
347
|
-
handle: external_exports.string().describe("The page handle."),
|
|
348
|
-
body_html: external_exports.string().describe("The page body HTML returned by Shopify.").nullable(),
|
|
349
|
-
author: external_exports.string().describe("The page author returned by Shopify.").nullable(),
|
|
350
|
-
published_at: external_exports.string().describe("The page publication timestamp, or null when hidden.").nullable(),
|
|
351
|
-
template_suffix: external_exports.string().describe("The Liquid template suffix used by the page.").nullable(),
|
|
352
|
-
created_at: external_exports.string().describe("The page creation timestamp returned by Shopify.").nullable(),
|
|
353
|
-
updated_at: external_exports.string().describe("The page update timestamp returned by Shopify.").nullable(),
|
|
354
|
-
admin_graphql_api_id: external_exports.string().describe("The Shopify Admin GraphQL ID for the page.").nullable()
|
|
355
|
-
}).describe("A Shopify REST page object.")).describe("Pages returned by Shopify.").optional(),
|
|
356
|
-
pagination: external_exports.strictObject({
|
|
357
|
-
nextPageInfo: external_exports.string().describe("The page_info cursor for the next page when Shopify returned one.").nullable().optional(),
|
|
358
|
-
previousPageInfo: external_exports.string().describe("The page_info cursor for the previous page when Shopify returned one.").nullable().optional()
|
|
359
|
-
}).describe("Shopify REST Link-header pagination cursors.").optional(),
|
|
360
|
-
raw: external_exports.looseObject({}).describe("The raw object returned by Shopify REST Admin.").optional()
|
|
361
|
-
}).describe("The Shopify REST page list response.");
|
|
362
|
-
var getPageInput = external_exports.strictObject({
|
|
363
|
-
page_id: external_exports.int().min(1).describe("The Shopify page ID.").optional()
|
|
364
|
-
}).describe("The input payload for retrieving one Shopify REST page.");
|
|
365
|
-
var getPageOutput = external_exports.strictObject({
|
|
366
|
-
page: external_exports.looseObject({
|
|
367
|
-
id: external_exports.int().min(1).describe("The Shopify page ID."),
|
|
368
|
-
title: external_exports.string().describe("The page title."),
|
|
369
|
-
handle: external_exports.string().describe("The page handle."),
|
|
370
|
-
body_html: external_exports.string().describe("The page body HTML returned by Shopify.").nullable(),
|
|
371
|
-
author: external_exports.string().describe("The page author returned by Shopify.").nullable(),
|
|
372
|
-
published_at: external_exports.string().describe("The page publication timestamp, or null when hidden.").nullable(),
|
|
373
|
-
template_suffix: external_exports.string().describe("The Liquid template suffix used by the page.").nullable(),
|
|
374
|
-
created_at: external_exports.string().describe("The page creation timestamp returned by Shopify.").nullable(),
|
|
375
|
-
updated_at: external_exports.string().describe("The page update timestamp returned by Shopify.").nullable(),
|
|
376
|
-
admin_graphql_api_id: external_exports.string().describe("The Shopify Admin GraphQL ID for the page.").nullable()
|
|
377
|
-
}).describe("A Shopify REST page object.").optional()
|
|
378
|
-
}).describe("The Shopify REST page response.");
|
|
379
|
-
var countPagesInput = external_exports.strictObject({
|
|
380
|
-
title: external_exports.string().min(1).describe("Count pages with this exact Shopify page title.").optional(),
|
|
381
|
-
published_status: external_exports.enum(["published", "unpublished", "any"]).describe("The Shopify publication status filter.").optional(),
|
|
382
|
-
created_at_min: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
383
|
-
created_at_max: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
384
|
-
updated_at_min: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
385
|
-
updated_at_max: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
386
|
-
published_at_min: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
387
|
-
published_at_max: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional()
|
|
388
|
-
}).describe("The input payload for counting Shopify REST pages.");
|
|
389
|
-
var countPagesOutput = external_exports.strictObject({
|
|
390
|
-
count: external_exports.int().min(0).describe("The count returned by Shopify REST Admin.").optional()
|
|
391
|
-
}).describe("The Shopify REST page count response.");
|
|
392
|
-
var listArticlesInput = external_exports.strictObject({
|
|
393
|
-
blog_id: external_exports.int().min(1).describe("The Shopify blog ID."),
|
|
394
|
-
author: external_exports.string().min(1).describe("Filter articles by author.").optional(),
|
|
395
|
-
handle: external_exports.string().min(1).describe("Retrieve an article with this Shopify article handle.").optional(),
|
|
396
|
-
tag: external_exports.string().min(1).describe("Filter articles by tag.").optional(),
|
|
397
|
-
published_status: external_exports.enum(["published", "unpublished", "any"]).describe("The Shopify publication status filter.").optional(),
|
|
398
|
-
since_id: external_exports.int().min(1).describe("Return records with Shopify numeric IDs greater than this value.").optional(),
|
|
399
|
-
created_at_min: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
400
|
-
created_at_max: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
401
|
-
updated_at_min: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
402
|
-
updated_at_max: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
403
|
-
published_at_min: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
404
|
-
published_at_max: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
405
|
-
limit: external_exports.int().min(1).max(250).describe("The maximum number of records to return. Shopify REST supports values from 1 to 250.").optional(),
|
|
406
|
-
page_info: external_exports.string().min(1).describe("The opaque Shopify REST page_info cursor from a previous response pagination value.").optional()
|
|
407
|
-
}).describe("The input payload for listing Shopify REST articles.");
|
|
408
|
-
var listArticlesOutput = external_exports.strictObject({
|
|
409
|
-
articles: external_exports.array(external_exports.looseObject({
|
|
410
|
-
id: external_exports.int().min(1).describe("The Shopify article ID."),
|
|
411
|
-
blog_id: external_exports.int().min(1).describe("The Shopify blog ID that owns the article."),
|
|
412
|
-
title: external_exports.string().describe("The article title."),
|
|
413
|
-
handle: external_exports.string().describe("The article handle."),
|
|
414
|
-
body_html: external_exports.string().describe("The article body HTML returned by Shopify.").nullable(),
|
|
415
|
-
summary_html: external_exports.string().describe("The article summary HTML returned by Shopify.").nullable(),
|
|
416
|
-
author: external_exports.string().describe("The article author returned by Shopify.").nullable(),
|
|
417
|
-
tags: external_exports.string().describe("The comma-separated article tags returned by Shopify.").nullable(),
|
|
418
|
-
published_at: external_exports.string().describe("The article publication timestamp, or null when hidden.").nullable(),
|
|
419
|
-
template_suffix: external_exports.string().describe("The Liquid template suffix used by the article.").nullable(),
|
|
420
|
-
created_at: external_exports.string().describe("The article creation timestamp returned by Shopify.").nullable(),
|
|
421
|
-
updated_at: external_exports.string().describe("The article update timestamp returned by Shopify.").nullable(),
|
|
422
|
-
image: external_exports.looseObject({}).describe("The article image object returned by Shopify.").nullable().optional(),
|
|
423
|
-
admin_graphql_api_id: external_exports.string().describe("The Shopify Admin GraphQL ID for the article.").nullable()
|
|
424
|
-
}).describe("A Shopify REST article object.")).describe("Articles returned by Shopify.").optional(),
|
|
425
|
-
pagination: external_exports.strictObject({
|
|
426
|
-
nextPageInfo: external_exports.string().describe("The page_info cursor for the next page when Shopify returned one.").nullable().optional(),
|
|
427
|
-
previousPageInfo: external_exports.string().describe("The page_info cursor for the previous page when Shopify returned one.").nullable().optional()
|
|
428
|
-
}).describe("Shopify REST Link-header pagination cursors.").optional(),
|
|
429
|
-
raw: external_exports.looseObject({}).describe("The raw object returned by Shopify REST Admin.").optional()
|
|
430
|
-
}).describe("The Shopify REST article list response.");
|
|
431
|
-
var getArticleInput = external_exports.strictObject({
|
|
432
|
-
blog_id: external_exports.int().min(1).describe("The Shopify blog ID.").optional(),
|
|
433
|
-
article_id: external_exports.int().min(1).describe("The Shopify article ID.").optional()
|
|
434
|
-
}).describe("The input payload for retrieving one Shopify REST article.");
|
|
435
|
-
var getArticleOutput = external_exports.strictObject({
|
|
436
|
-
article: external_exports.looseObject({
|
|
437
|
-
id: external_exports.int().min(1).describe("The Shopify article ID."),
|
|
438
|
-
blog_id: external_exports.int().min(1).describe("The Shopify blog ID that owns the article."),
|
|
439
|
-
title: external_exports.string().describe("The article title."),
|
|
440
|
-
handle: external_exports.string().describe("The article handle."),
|
|
441
|
-
body_html: external_exports.string().describe("The article body HTML returned by Shopify.").nullable(),
|
|
442
|
-
summary_html: external_exports.string().describe("The article summary HTML returned by Shopify.").nullable(),
|
|
443
|
-
author: external_exports.string().describe("The article author returned by Shopify.").nullable(),
|
|
444
|
-
tags: external_exports.string().describe("The comma-separated article tags returned by Shopify.").nullable(),
|
|
445
|
-
published_at: external_exports.string().describe("The article publication timestamp, or null when hidden.").nullable(),
|
|
446
|
-
template_suffix: external_exports.string().describe("The Liquid template suffix used by the article.").nullable(),
|
|
447
|
-
created_at: external_exports.string().describe("The article creation timestamp returned by Shopify.").nullable(),
|
|
448
|
-
updated_at: external_exports.string().describe("The article update timestamp returned by Shopify.").nullable(),
|
|
449
|
-
image: external_exports.looseObject({}).describe("The article image object returned by Shopify.").nullable().optional(),
|
|
450
|
-
admin_graphql_api_id: external_exports.string().describe("The Shopify Admin GraphQL ID for the article.").nullable()
|
|
451
|
-
}).describe("A Shopify REST article object.").optional()
|
|
452
|
-
}).describe("The Shopify REST article response.");
|
|
453
|
-
var countArticlesInput = external_exports.strictObject({
|
|
454
|
-
blog_id: external_exports.int().min(1).describe("The Shopify blog ID."),
|
|
455
|
-
published_status: external_exports.enum(["published", "unpublished", "any"]).describe("The Shopify publication status filter.").optional(),
|
|
456
|
-
created_at_min: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
457
|
-
created_at_max: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
458
|
-
updated_at_min: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
459
|
-
updated_at_max: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
460
|
-
published_at_min: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional(),
|
|
461
|
-
published_at_max: external_exports.string().min(1).describe("An ISO 8601 date-time filter accepted by Shopify REST Admin.").optional()
|
|
462
|
-
}).describe("The input payload for counting Shopify REST articles.");
|
|
463
|
-
var countArticlesOutput = external_exports.strictObject({
|
|
464
|
-
count: external_exports.int().min(0).describe("The count returned by Shopify REST Admin.").optional()
|
|
465
|
-
}).describe("The Shopify REST article count response.");
|
|
466
|
-
var listArticleTagsInput = external_exports.strictObject({
|
|
467
|
-
limit: external_exports.int().min(1).max(250).describe("The maximum number of records to return. Shopify REST supports values from 1 to 250.").optional(),
|
|
468
|
-
popular: external_exports.boolean().describe("Whether Shopify should order tags by popularity.").optional()
|
|
469
|
-
}).describe("The input payload for listing Shopify REST article tags.");
|
|
470
|
-
var listArticleTagsOutput = external_exports.strictObject({
|
|
471
|
-
tags: external_exports.array(external_exports.string().describe("One article tag.")).describe("Article tags returned by Shopify.").optional()
|
|
472
|
-
}).describe("The Shopify REST article tags response.");
|
|
473
|
-
var listBlogArticleTagsInput = external_exports.strictObject({
|
|
474
|
-
blog_id: external_exports.int().min(1).describe("The Shopify blog ID."),
|
|
475
|
-
limit: external_exports.int().min(1).max(250).describe("The maximum number of records to return. Shopify REST supports values from 1 to 250.").optional(),
|
|
476
|
-
popular: external_exports.boolean().describe("Whether Shopify should order tags by popularity.").optional()
|
|
477
|
-
}).describe("The input payload for listing Shopify REST article tags in one blog.");
|
|
478
|
-
var listBlogArticleTagsOutput = external_exports.strictObject({
|
|
479
|
-
tags: external_exports.array(external_exports.string().describe("One article tag.")).describe("Article tags returned by Shopify.").optional()
|
|
480
|
-
}).describe("The Shopify REST blog article tags response.");
|
|
481
|
-
var listArticleAuthorsInput = external_exports.strictObject({}).describe("No input is required to list Shopify REST article authors.");
|
|
482
|
-
var listArticleAuthorsOutput = external_exports.strictObject({
|
|
483
|
-
authors: external_exports.array(external_exports.string().describe("One article author.")).describe("Article authors returned by Shopify.").optional()
|
|
484
|
-
}).describe("The Shopify REST article authors response.");
|
|
485
|
-
var shopifyActions = {
|
|
486
|
-
get_shop: {
|
|
487
|
-
description: "Retrieve the connected Shopify REST Admin shop configuration.",
|
|
488
|
-
effect: "read",
|
|
489
|
-
inputSchema: getShopInput,
|
|
490
|
-
outputSchema: external_exports.toJSONSchema(getShopOutput, { io: "output", unrepresentable: "any" })
|
|
491
|
-
},
|
|
492
|
-
list_blogs: {
|
|
493
|
-
description: "List Shopify REST blogs with optional handle filtering and pagination.",
|
|
494
|
-
effect: "read",
|
|
495
|
-
inputSchema: listBlogsInput,
|
|
496
|
-
outputSchema: external_exports.toJSONSchema(listBlogsOutput, { io: "output", unrepresentable: "any" })
|
|
497
|
-
},
|
|
498
|
-
get_blog: {
|
|
499
|
-
description: "Retrieve one Shopify REST blog by numeric ID.",
|
|
500
|
-
effect: "read",
|
|
501
|
-
inputSchema: getBlogInput,
|
|
502
|
-
outputSchema: external_exports.toJSONSchema(getBlogOutput, { io: "output", unrepresentable: "any" })
|
|
503
|
-
},
|
|
504
|
-
count_blogs: {
|
|
505
|
-
description: "Count Shopify REST blogs in the connected shop.",
|
|
506
|
-
effect: "read",
|
|
507
|
-
inputSchema: countBlogsInput,
|
|
508
|
-
outputSchema: external_exports.toJSONSchema(countBlogsOutput, { io: "output", unrepresentable: "any" })
|
|
509
|
-
},
|
|
510
|
-
list_pages: {
|
|
511
|
-
description: "List Shopify REST pages with optional filters and pagination.",
|
|
512
|
-
effect: "read",
|
|
513
|
-
inputSchema: listPagesInput,
|
|
514
|
-
outputSchema: external_exports.toJSONSchema(listPagesOutput, { io: "output", unrepresentable: "any" })
|
|
515
|
-
},
|
|
516
|
-
get_page: {
|
|
517
|
-
description: "Retrieve one Shopify REST page by numeric ID.",
|
|
518
|
-
effect: "read",
|
|
519
|
-
inputSchema: getPageInput,
|
|
520
|
-
outputSchema: external_exports.toJSONSchema(getPageOutput, { io: "output", unrepresentable: "any" })
|
|
521
|
-
},
|
|
522
|
-
count_pages: {
|
|
523
|
-
description: "Count Shopify REST pages with optional filters.",
|
|
524
|
-
effect: "read",
|
|
525
|
-
inputSchema: countPagesInput,
|
|
526
|
-
outputSchema: external_exports.toJSONSchema(countPagesOutput, { io: "output", unrepresentable: "any" })
|
|
527
|
-
},
|
|
528
|
-
list_articles: {
|
|
529
|
-
description: "List Shopify REST articles in a blog with optional filters and pagination.",
|
|
530
|
-
effect: "read",
|
|
531
|
-
inputSchema: listArticlesInput,
|
|
532
|
-
outputSchema: external_exports.toJSONSchema(listArticlesOutput, { io: "output", unrepresentable: "any" })
|
|
533
|
-
},
|
|
534
|
-
get_article: {
|
|
535
|
-
description: "Retrieve one Shopify REST article by blog ID and article ID.",
|
|
536
|
-
effect: "read",
|
|
537
|
-
inputSchema: getArticleInput,
|
|
538
|
-
outputSchema: external_exports.toJSONSchema(getArticleOutput, { io: "output", unrepresentable: "any" })
|
|
539
|
-
},
|
|
540
|
-
count_articles: {
|
|
541
|
-
description: "Count Shopify REST articles in a blog with optional filters.",
|
|
542
|
-
effect: "read",
|
|
543
|
-
inputSchema: countArticlesInput,
|
|
544
|
-
outputSchema: external_exports.toJSONSchema(countArticlesOutput, { io: "output", unrepresentable: "any" })
|
|
545
|
-
},
|
|
546
|
-
list_article_tags: {
|
|
547
|
-
description: "List Shopify REST article tags across all articles in the connected shop.",
|
|
548
|
-
effect: "read",
|
|
549
|
-
inputSchema: listArticleTagsInput,
|
|
550
|
-
outputSchema: external_exports.toJSONSchema(listArticleTagsOutput, { io: "output", unrepresentable: "any" })
|
|
551
|
-
},
|
|
552
|
-
list_blog_article_tags: {
|
|
553
|
-
description: "List Shopify REST article tags for one blog.",
|
|
554
|
-
effect: "read",
|
|
555
|
-
inputSchema: listBlogArticleTagsInput,
|
|
556
|
-
outputSchema: external_exports.toJSONSchema(listBlogArticleTagsOutput, { io: "output", unrepresentable: "any" })
|
|
557
|
-
},
|
|
558
|
-
list_article_authors: {
|
|
559
|
-
description: "List Shopify REST article authors across the connected shop.",
|
|
560
|
-
effect: "read",
|
|
561
|
-
inputSchema: listArticleAuthorsInput,
|
|
562
|
-
outputSchema: external_exports.toJSONSchema(listArticleAuthorsOutput, { io: "output", unrepresentable: "any" })
|
|
563
|
-
}
|
|
564
|
-
};
|
|
565
|
-
|
|
566
|
-
// ../plugins/src/shopify/index.ts
|
|
567
|
-
function createShopifyPlugin() {
|
|
568
|
-
return createProviderPlugin({
|
|
569
|
-
description: "Shopify REST Admin (Legacy)",
|
|
570
|
-
actions: shopifyActions,
|
|
571
|
-
credentialFields: [
|
|
572
|
-
{
|
|
573
|
-
key: "apiKey",
|
|
574
|
-
label: "Admin API access token",
|
|
575
|
-
required: true,
|
|
576
|
-
secret: true,
|
|
577
|
-
description: "Shopify Admin API access token(shpat_...),\u8D70 X-Shopify-Access-Token \u5934;\u5728\u81EA\u5EFA\u5E94\u7528\u7684 API \u51ED\u636E\u9875\u83B7\u53D6"
|
|
578
|
-
},
|
|
579
|
-
{
|
|
580
|
-
key: "shopDomain",
|
|
581
|
-
label: "Shop domain",
|
|
582
|
-
required: true,
|
|
583
|
-
secret: false,
|
|
584
|
-
description: "\u5E97\u94FA\u7684 myshopify.com \u57DF\u540D(\u5982 acme.myshopify.com);\u540E\u53F0\u5730\u5740\u4E5F\u63A5\u53D7,\u4F1A\u53D6\u5176\u4E3B\u673A\u540D"
|
|
585
|
-
}
|
|
586
|
-
],
|
|
587
|
-
credentialProbe: "get_shop",
|
|
588
|
-
handlers: {
|
|
589
|
-
get_shop: getShop,
|
|
590
|
-
list_blogs: listBlogs,
|
|
591
|
-
get_blog: getBlog,
|
|
592
|
-
count_blogs: countBlogs,
|
|
593
|
-
list_pages: listPages,
|
|
594
|
-
get_page: getPage,
|
|
595
|
-
count_pages: countPages,
|
|
596
|
-
list_articles: listArticles,
|
|
597
|
-
get_article: getArticle,
|
|
598
|
-
count_articles: countArticles,
|
|
599
|
-
list_article_tags: listArticleTags,
|
|
600
|
-
list_blog_article_tags: listBlogArticleTags,
|
|
601
|
-
list_article_authors: listArticleAuthors
|
|
602
|
-
}
|
|
603
|
-
});
|
|
604
|
-
}
|
|
605
|
-
var shopify_default = createShopifyPlugin();
|
|
606
|
-
export {
|
|
607
|
-
createShopifyPlugin,
|
|
608
|
-
shopify_default as default
|
|
609
|
-
};
|