shopline-mcp 1.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/LICENSE +21 -0
- package/README.md +87 -0
- package/README.zh-TW.md +87 -0
- package/dist/client.d.ts +26 -0
- package/dist/client.js +144 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +8 -0
- package/dist/config.js +37 -0
- package/dist/config.js.map +1 -0
- package/dist/generated/endpoints.d.ts +137 -0
- package/dist/generated/endpoints.js +139 -0
- package/dist/generated/endpoints.js.map +1 -0
- package/dist/generated/toolSpecs.d.ts +4607 -0
- package/dist/generated/toolSpecs.js +5733 -0
- package/dist/generated/toolSpecs.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas.d.ts +3 -0
- package/dist/schemas.js +53 -0
- package/dist/schemas.js.map +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +11 -0
- package/dist/server.js.map +1 -0
- package/dist/shared/helpers.d.ts +19 -0
- package/dist/shared/helpers.js +83 -0
- package/dist/shared/helpers.js.map +1 -0
- package/dist/tools/custom.d.ts +4 -0
- package/dist/tools/custom.js +741 -0
- package/dist/tools/custom.js.map +1 -0
- package/dist/tools/generic.d.ts +2 -0
- package/dist/tools/generic.js +150 -0
- package/dist/tools/generic.js.map +1 -0
- package/dist/tools/register.d.ts +4 -0
- package/dist/tools/register.js +43 -0
- package/dist/tools/register.js.map +1 -0
- package/dist/types.d.ts +40 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +57 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Asgard AI Platform
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Shopline MCP Server
|
|
2
|
+
|
|
3
|
+
An MCP server for the Shopline Open API, published as `shopline-mcp`.
|
|
4
|
+
|
|
5
|
+
It exposes 143 AI-callable tools for Shopline store analysis and operations:
|
|
6
|
+
|
|
7
|
+
- 75 read tools for orders, products, inventory, customers, promotions, analytics, reviews, conversations, and store settings
|
|
8
|
+
- 68 write tools for creating, updating, and deleting Shopline resources
|
|
9
|
+
- stdio transport for Claude Code, Claude Desktop, Codex, and other MCP-compatible clients
|
|
10
|
+
|
|
11
|
+
## Links
|
|
12
|
+
|
|
13
|
+
- Repository: [slinedev/shopline-mcp](https://github.com/slinedev/shopline-mcp)
|
|
14
|
+
- Official website: [https://sline.dev/shopline-mcp/](https://sline.dev/shopline-mcp/)
|
|
15
|
+
|
|
16
|
+
## Requirements
|
|
17
|
+
|
|
18
|
+
- Node.js 24 or newer
|
|
19
|
+
- A Shopline Open API access token
|
|
20
|
+
|
|
21
|
+
Set your token before running the server:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
export SHOPLINE_API_TOKEN=your_token_here
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install shopline-mcp
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Or run it directly:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx shopline-mcp
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The executable command is:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
shopline-mcp
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Claude Code
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
claude mcp add --transport stdio shopline -e SHOPLINE_API_TOKEN=your_token_here -- npx shopline-mcp
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Claude Desktop
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"mcpServers": {
|
|
56
|
+
"shopline": {
|
|
57
|
+
"command": "npx",
|
|
58
|
+
"args": ["shopline-mcp"],
|
|
59
|
+
"env": {
|
|
60
|
+
"SHOPLINE_API_TOKEN": "your_token_here"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Write Tools
|
|
68
|
+
|
|
69
|
+
This server includes write tools that can create, update, or delete data in your Shopline store.
|
|
70
|
+
|
|
71
|
+
Write tools are marked with `[WRITE]` in their descriptions and include a side-effect section. Use a token with the narrowest permissions needed.
|
|
72
|
+
|
|
73
|
+
## API Notes
|
|
74
|
+
|
|
75
|
+
- Base URL: `https://open.shopline.io`
|
|
76
|
+
- Auth: `Authorization: Bearer <SHOPLINE_API_TOKEN>`
|
|
77
|
+
- Pagination: `page` + `per_page`, max `per_page` 50
|
|
78
|
+
- Large order searches are paginated internally
|
|
79
|
+
- Online revenue orders use `confirmed`; POS revenue orders use `completed`
|
|
80
|
+
- Channel source: `created_from = "shop"` for online and `"pos"` for POS
|
|
81
|
+
- Money values are returned as TWD numbers by extracting Shopline money object `dollars`
|
|
82
|
+
|
|
83
|
+
## Package Name
|
|
84
|
+
|
|
85
|
+
Use `shopline-mcp` for npm registry installs.
|
|
86
|
+
|
|
87
|
+
`shopline/mcp` without `@` is not an npm package name. npm treats that form as a GitHub repository shorthand.
|
package/README.zh-TW.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Shopline MCP Server
|
|
2
|
+
|
|
3
|
+
Shopline Open API 的 MCP server,npm 套件名稱為 `shopline-mcp`。
|
|
4
|
+
|
|
5
|
+
此 server 提供 143 個可供 AI Agent 呼叫的 Shopline 工具:
|
|
6
|
+
|
|
7
|
+
- 75 個讀取工具:訂單、商品、庫存、客戶、促銷、分析、評論、對話、商店設定
|
|
8
|
+
- 68 個寫入工具:建立、更新、刪除 Shopline 資源
|
|
9
|
+
- 使用 stdio transport,可接 Claude Code、Claude Desktop、Codex 與其他 MCP client
|
|
10
|
+
|
|
11
|
+
## 連結
|
|
12
|
+
|
|
13
|
+
- 倉庫地址:[slinedev/shopline-mcp](https://github.com/slinedev/shopline-mcp)
|
|
14
|
+
- 官方網站:[https://sline.dev/shopline-mcp/](https://sline.dev/shopline-mcp/)
|
|
15
|
+
|
|
16
|
+
## 環境需求
|
|
17
|
+
|
|
18
|
+
- Node.js 24 或更新版本
|
|
19
|
+
- Shopline Open API access token
|
|
20
|
+
|
|
21
|
+
執行前先設定 token:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
export SHOPLINE_API_TOKEN=your_token_here
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 安裝
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install shopline-mcp
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
或直接執行:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx shopline-mcp
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
安裝後的命令為:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
shopline-mcp
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Claude Code
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
claude mcp add --transport stdio shopline -e SHOPLINE_API_TOKEN=your_token_here -- npx shopline-mcp
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Claude Desktop
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"mcpServers": {
|
|
56
|
+
"shopline": {
|
|
57
|
+
"command": "npx",
|
|
58
|
+
"args": ["shopline-mcp"],
|
|
59
|
+
"env": {
|
|
60
|
+
"SHOPLINE_API_TOKEN": "your_token_here"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## 寫入工具
|
|
68
|
+
|
|
69
|
+
此 server 包含會建立、更新或刪除 Shopline 資料的寫入工具。
|
|
70
|
+
|
|
71
|
+
寫入工具的描述都以 `[WRITE]` 開頭,並包含副作用說明。請使用權限最小化的 API token。
|
|
72
|
+
|
|
73
|
+
## API 注意事項
|
|
74
|
+
|
|
75
|
+
- Base URL:`https://open.shopline.io`
|
|
76
|
+
- 認證:`Authorization: Bearer <SHOPLINE_API_TOKEN>`
|
|
77
|
+
- 分頁:`page` + `per_page`,`per_page` 上限 50
|
|
78
|
+
- 大量訂單查詢會在工具內部分頁處理
|
|
79
|
+
- 線上有效營收訂單狀態為 `confirmed`,POS 有效營收訂單狀態為 `completed`
|
|
80
|
+
- 通路來源:`created_from = "shop"` 表示線上,`"pos"` 表示 POS
|
|
81
|
+
- 金額以 TWD 數字回傳,來源是 Shopline money object 的 `dollars`
|
|
82
|
+
|
|
83
|
+
## 套件名稱
|
|
84
|
+
|
|
85
|
+
npm registry 安裝請使用 `shopline-mcp`。
|
|
86
|
+
|
|
87
|
+
沒有 `@` 的 `shopline/mcp` 不是 npm 套件名稱,npm 會把它當成 GitHub repository shorthand。
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
2
|
+
export interface ApiRequestOptions {
|
|
3
|
+
readonly jsonBody?: unknown;
|
|
4
|
+
readonly params?: Record<string, unknown>;
|
|
5
|
+
readonly pathParams?: Record<string, unknown>;
|
|
6
|
+
readonly retries?: number;
|
|
7
|
+
readonly retryOnClientError?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare class ShoplineAPIError extends Error {
|
|
10
|
+
readonly statusCode: number;
|
|
11
|
+
readonly messageText: string;
|
|
12
|
+
readonly endpoint: string;
|
|
13
|
+
constructor(statusCode: number, messageText: string, endpoint: string);
|
|
14
|
+
}
|
|
15
|
+
type FetchLike = typeof fetch;
|
|
16
|
+
export declare function setFetchImplementation(fetchLike: FetchLike): void;
|
|
17
|
+
export declare function resetFetchImplementation(): void;
|
|
18
|
+
export declare function apiRequest(method: HttpMethod, endpointKey: string, options?: ApiRequestOptions): Promise<Record<string, unknown>>;
|
|
19
|
+
export declare function apiGet(endpointKey: string, params?: Record<string, unknown>, pathParams?: Record<string, unknown>, retries?: number): Promise<Record<string, unknown>>;
|
|
20
|
+
export declare function apiPost(endpointKey: string, jsonBody?: unknown, params?: Record<string, unknown>, pathParams?: Record<string, unknown>, retries?: number): Promise<Record<string, unknown>>;
|
|
21
|
+
export declare function apiPut(endpointKey: string, jsonBody?: unknown, params?: Record<string, unknown>, pathParams?: Record<string, unknown>, retries?: number): Promise<Record<string, unknown>>;
|
|
22
|
+
export declare function apiPatch(endpointKey: string, jsonBody?: unknown, params?: Record<string, unknown>, pathParams?: Record<string, unknown>, retries?: number): Promise<Record<string, unknown>>;
|
|
23
|
+
export declare function apiDelete(endpointKey: string, params?: Record<string, unknown>, pathParams?: Record<string, unknown>, jsonBody?: unknown, retries?: number): Promise<Record<string, unknown>>;
|
|
24
|
+
export declare function fetchAllPages(endpointKey: string, params?: Record<string, unknown>, pathParams?: Record<string, unknown>, maxPages?: number): Promise<Record<string, unknown>[]>;
|
|
25
|
+
export declare function fetchAllPagesByDateSegments(endpointKey: string, startDate: string, endDate: string, params?: Record<string, unknown>): Promise<Record<string, unknown>[]>;
|
|
26
|
+
export {};
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { DEFAULT_PER_PAGE, DEFAULT_SORT, getHeaders, getUrl } from "./config.js";
|
|
2
|
+
import { sleep } from "./shared/helpers.js";
|
|
3
|
+
export class ShoplineAPIError extends Error {
|
|
4
|
+
statusCode;
|
|
5
|
+
messageText;
|
|
6
|
+
endpoint;
|
|
7
|
+
constructor(statusCode, messageText, endpoint) {
|
|
8
|
+
super(`[${statusCode}] ${endpoint}: ${messageText}`);
|
|
9
|
+
this.statusCode = statusCode;
|
|
10
|
+
this.messageText = messageText;
|
|
11
|
+
this.endpoint = endpoint;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
let fetchImplementation = (...args) => globalThis.fetch(...args);
|
|
15
|
+
export function setFetchImplementation(fetchLike) {
|
|
16
|
+
fetchImplementation = fetchLike;
|
|
17
|
+
}
|
|
18
|
+
export function resetFetchImplementation() {
|
|
19
|
+
fetchImplementation = (...args) => globalThis.fetch(...args);
|
|
20
|
+
}
|
|
21
|
+
function appendParams(url, params) {
|
|
22
|
+
if (!params)
|
|
23
|
+
return;
|
|
24
|
+
for (const [key, value] of Object.entries(params)) {
|
|
25
|
+
if (value === undefined || value === null || value === "")
|
|
26
|
+
continue;
|
|
27
|
+
if (Array.isArray(value)) {
|
|
28
|
+
for (const item of value)
|
|
29
|
+
url.searchParams.append(key, String(item));
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
url.searchParams.set(key, String(value));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async function readJsonOrText(response) {
|
|
37
|
+
const text = await response.text();
|
|
38
|
+
if (!text)
|
|
39
|
+
return {};
|
|
40
|
+
try {
|
|
41
|
+
return JSON.parse(text);
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return text;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export async function apiRequest(method, endpointKey, options = {}) {
|
|
48
|
+
const retries = options.retries ?? 3;
|
|
49
|
+
const retryOnClientError = options.retryOnClientError ?? method === "GET";
|
|
50
|
+
const url = new URL(getUrl(endpointKey, options.pathParams));
|
|
51
|
+
appendParams(url, options.params);
|
|
52
|
+
for (let attempt = 0; attempt < retries; attempt += 1) {
|
|
53
|
+
try {
|
|
54
|
+
const response = await fetchImplementation(url, {
|
|
55
|
+
method,
|
|
56
|
+
headers: getHeaders(),
|
|
57
|
+
body: options.jsonBody === undefined ? undefined : JSON.stringify(options.jsonBody),
|
|
58
|
+
signal: AbortSignal.timeout(60_000),
|
|
59
|
+
});
|
|
60
|
+
if (response.status === 204)
|
|
61
|
+
return {};
|
|
62
|
+
if (response.status === 200 || response.status === 201) {
|
|
63
|
+
const data = await readJsonOrText(response);
|
|
64
|
+
return data && typeof data === "object" && !Array.isArray(data) ? data : { result: data };
|
|
65
|
+
}
|
|
66
|
+
const text = String(await readJsonOrText(response)).slice(0, 500);
|
|
67
|
+
const isClientError = response.status >= 400 && response.status < 500;
|
|
68
|
+
const isServerError = response.status >= 500;
|
|
69
|
+
if (isClientError && !retryOnClientError) {
|
|
70
|
+
throw new ShoplineAPIError(response.status, text, url.toString());
|
|
71
|
+
}
|
|
72
|
+
if ((isServerError || (isClientError && retryOnClientError)) && attempt < retries - 1) {
|
|
73
|
+
await sleep(2 ** attempt * 1000);
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
throw new ShoplineAPIError(response.status, text, url.toString());
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
if (error instanceof ShoplineAPIError)
|
|
80
|
+
throw error;
|
|
81
|
+
if (attempt < retries - 1) {
|
|
82
|
+
await sleep(2 ** attempt * 1000);
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
throw new Error(`Shopline request failed after ${retries} retries`);
|
|
89
|
+
}
|
|
90
|
+
export function apiGet(endpointKey, params, pathParams, retries = 3) {
|
|
91
|
+
return apiRequest("GET", endpointKey, { params, pathParams, retries, retryOnClientError: true });
|
|
92
|
+
}
|
|
93
|
+
export function apiPost(endpointKey, jsonBody, params, pathParams, retries = 3) {
|
|
94
|
+
return apiRequest("POST", endpointKey, { jsonBody, params, pathParams, retries, retryOnClientError: false });
|
|
95
|
+
}
|
|
96
|
+
export function apiPut(endpointKey, jsonBody, params, pathParams, retries = 3) {
|
|
97
|
+
return apiRequest("PUT", endpointKey, { jsonBody, params, pathParams, retries, retryOnClientError: false });
|
|
98
|
+
}
|
|
99
|
+
export function apiPatch(endpointKey, jsonBody, params, pathParams, retries = 3) {
|
|
100
|
+
return apiRequest("PATCH", endpointKey, { jsonBody, params, pathParams, retries, retryOnClientError: false });
|
|
101
|
+
}
|
|
102
|
+
export function apiDelete(endpointKey, params, pathParams, jsonBody, retries = 3) {
|
|
103
|
+
return apiRequest("DELETE", endpointKey, { jsonBody, params, pathParams, retries, retryOnClientError: false });
|
|
104
|
+
}
|
|
105
|
+
export async function fetchAllPages(endpointKey, params = {}, pathParams, maxPages) {
|
|
106
|
+
const requestParams = { ...params };
|
|
107
|
+
requestParams.per_page ??= DEFAULT_PER_PAGE;
|
|
108
|
+
if (!endpointKey.includes("search"))
|
|
109
|
+
requestParams.sort_by ??= DEFAULT_SORT;
|
|
110
|
+
const allItems = [];
|
|
111
|
+
let page = 1;
|
|
112
|
+
while (true) {
|
|
113
|
+
if (maxPages && page > maxPages)
|
|
114
|
+
break;
|
|
115
|
+
requestParams.page = page;
|
|
116
|
+
const data = await apiGet(endpointKey, requestParams, pathParams);
|
|
117
|
+
const items = Array.isArray(data.items) ? data.items : [];
|
|
118
|
+
allItems.push(...items);
|
|
119
|
+
const pagination = data.pagination && typeof data.pagination === "object" ? data.pagination : {};
|
|
120
|
+
const totalPages = Number(pagination.total_pages ?? 1);
|
|
121
|
+
if (page >= totalPages)
|
|
122
|
+
break;
|
|
123
|
+
page += 1;
|
|
124
|
+
await sleep(200);
|
|
125
|
+
}
|
|
126
|
+
return allItems;
|
|
127
|
+
}
|
|
128
|
+
export async function fetchAllPagesByDateSegments(endpointKey, startDate, endDate, params = {}) {
|
|
129
|
+
const allItems = [];
|
|
130
|
+
const start = new Date(startDate.replace("Z", "+00:00"));
|
|
131
|
+
const end = new Date(endDate.replace("Z", "+00:00"));
|
|
132
|
+
const segmentMs = 30 * 86_400_000;
|
|
133
|
+
for (let current = start.getTime(); current < end.getTime(); current += segmentMs) {
|
|
134
|
+
const segmentEnd = Math.min(current + segmentMs, end.getTime());
|
|
135
|
+
const segmentParams = {
|
|
136
|
+
...params,
|
|
137
|
+
created_after: new Date(current).toISOString().replace(".000Z", "Z"),
|
|
138
|
+
created_before: new Date(segmentEnd).toISOString().replace(".000Z", "Z"),
|
|
139
|
+
};
|
|
140
|
+
allItems.push(...(await fetchAllPages(endpointKey, segmentParams)));
|
|
141
|
+
}
|
|
142
|
+
return allItems;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAY5C,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAE9B;IACA;IAC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://open.shopline.io";
|
|
2
|
+
export declare const DEFAULT_PER_PAGE = 50;
|
|
3
|
+
export declare const DEFAULT_SORT = "desc";
|
|
4
|
+
export declare const ENDPOINTS: Record<string, string>;
|
|
5
|
+
export declare function getAccessToken(): string;
|
|
6
|
+
export declare function getHeaders(): Record<string, string>;
|
|
7
|
+
export declare function getUrl(endpointKey: string, pathParams?: Record<string, unknown>): string;
|
|
8
|
+
export declare function endpointPathParams(endpointKey: string): string[];
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { endpoints } from "./generated/endpoints.js";
|
|
2
|
+
export const BASE_URL = "https://open.shopline.io";
|
|
3
|
+
export const DEFAULT_PER_PAGE = 50;
|
|
4
|
+
export const DEFAULT_SORT = "desc";
|
|
5
|
+
export const ENDPOINTS = { ...endpoints };
|
|
6
|
+
export function getAccessToken() {
|
|
7
|
+
const token = process.env.SHOPLINE_API_TOKEN ?? "";
|
|
8
|
+
if (!token) {
|
|
9
|
+
throw new Error("SHOPLINE_API_TOKEN environment variable is not set. Run: export SHOPLINE_API_TOKEN=your_token_here");
|
|
10
|
+
}
|
|
11
|
+
return token;
|
|
12
|
+
}
|
|
13
|
+
export function getHeaders() {
|
|
14
|
+
return {
|
|
15
|
+
Authorization: `Bearer ${getAccessToken()}`,
|
|
16
|
+
"Content-Type": "application/json",
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export function getUrl(endpointKey, pathParams = {}) {
|
|
20
|
+
const template = ENDPOINTS[endpointKey];
|
|
21
|
+
if (!template) {
|
|
22
|
+
throw new Error(`Unknown Shopline endpoint key: ${endpointKey}`);
|
|
23
|
+
}
|
|
24
|
+
const path = template.replace(/\{(\w+)\}/g, (_, key) => {
|
|
25
|
+
const value = pathParams[key];
|
|
26
|
+
if (value === undefined || value === null || value === "") {
|
|
27
|
+
throw new Error(`Missing path parameter "${key}" for endpoint "${endpointKey}"`);
|
|
28
|
+
}
|
|
29
|
+
return encodeURIComponent(String(value));
|
|
30
|
+
});
|
|
31
|
+
return `${BASE_URL}${path}`;
|
|
32
|
+
}
|
|
33
|
+
export function endpointPathParams(endpointKey) {
|
|
34
|
+
const template = ENDPOINTS[endpointKey] ?? "";
|
|
35
|
+
return [...template.matchAll(/\{(\w+)\}/g)].map((match) => match[1] ?? "");
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,MAAM,CAAC,MAAM,QAAQ,GAAG,0BAA0B,CAAC;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AACnC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC;AAEnC,MAAM,CAAC,MAAM,SAAS,GAA2B,EAAE,GAAG,SAAS,EAAE,CAAC;AAElE,MAAM,UAAU,cAAc;IAC5B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,EAAE,CAAC;IACnD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,oGAAoG,CACrG,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,OAAO;QACL,aAAa,EAAE,UAAU,cAAc,EAAE,EAAE;QAC3C,cAAc,EAAE,kBAAkB;KACnC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,WAAmB,EAAE,aAAsC,EAAE;IAClF,MAAM,QAAQ,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;IACxC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,kCAAkC,WAAW,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,GAAW,EAAE,EAAE;QAC7D,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;YAC1D,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,mBAAmB,WAAW,GAAG,CAAC,CAAC;QACnF,CAAC;QACD,OAAO,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,QAAQ,GAAG,IAAI,EAAE,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,WAAmB;IACpD,MAAM,QAAQ,GAAG,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IAC9C,OAAO,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAC7E,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
export declare const endpoints: {
|
|
2
|
+
readonly orders: "/v1/orders";
|
|
3
|
+
readonly orders_search: "/v1/orders/search";
|
|
4
|
+
readonly order_detail: "/v1/orders/{order_id}";
|
|
5
|
+
readonly order_labels: "/v1/orders/{order_id}/labels";
|
|
6
|
+
readonly order_tags: "/v1/orders/{order_id}/tags";
|
|
7
|
+
readonly order_action_logs: "/v1/orders/{order_id}/action-logs";
|
|
8
|
+
readonly order_transactions: "/v1/orders/{order_id}/transactions";
|
|
9
|
+
readonly orders_archived: "/v1/orders/archived";
|
|
10
|
+
readonly order_create: "/v1/orders";
|
|
11
|
+
readonly order_update: "/v1/orders/{order_id}";
|
|
12
|
+
readonly order_shipment: "/v1/orders/{order_id}/shipment";
|
|
13
|
+
readonly orders_shipment_bulk: "/v1/orders/shipment/bulk";
|
|
14
|
+
readonly order_split: "/v1/orders/{order_id}/split";
|
|
15
|
+
readonly order_cancel: "/v1/orders/{order_id}/cancel";
|
|
16
|
+
readonly order_status: "/v1/orders/{order_id}/status";
|
|
17
|
+
readonly order_delivery_status: "/v1/orders/{order_id}/delivery-status";
|
|
18
|
+
readonly order_payment_status: "/v1/orders/{order_id}/payment-status";
|
|
19
|
+
readonly order_tags_update: "/v1/orders/{order_id}/tags";
|
|
20
|
+
readonly customers: "/v1/customers";
|
|
21
|
+
readonly customers_search: "/v1/customers/search";
|
|
22
|
+
readonly customer_detail: "/v1/customers/{customer_id}";
|
|
23
|
+
readonly customer_store_credit_history: "/v1/customers/{customer_id}/store-credit-history";
|
|
24
|
+
readonly customer_member_points: "/v1/customers/{customer_id}/member-points";
|
|
25
|
+
readonly customer_promotions: "/v1/customers/{customer_id}/promotions";
|
|
26
|
+
readonly customer_create: "/v1/customers";
|
|
27
|
+
readonly customer_update: "/v1/customers/{customer_id}";
|
|
28
|
+
readonly customer_delete: "/v1/customers/{customer_id}";
|
|
29
|
+
readonly customer_tags: "/v1/customers/{customer_id}/tags";
|
|
30
|
+
readonly customer_store_credits_update: "/v1/customers/{customer_id}/store-credits";
|
|
31
|
+
readonly customer_member_points_update: "/v1/customers/{customer_id}/member-points";
|
|
32
|
+
readonly customer_groups: "/v1/customer-groups";
|
|
33
|
+
readonly customer_groups_search: "/v1/customer-groups/search";
|
|
34
|
+
readonly customer_group_customers: "/v1/customer-groups/{group_id}/customers";
|
|
35
|
+
readonly user_credits: "/v1/user_credits";
|
|
36
|
+
readonly custom_fields: "/v1/custom_fields";
|
|
37
|
+
readonly membership_tiers: "/v1/membership_tiers";
|
|
38
|
+
readonly customer_membership_tier_history: "/v1/customers/{customer_id}/membership-tier-history";
|
|
39
|
+
readonly member_point_rules: "/v1/member_point_rules";
|
|
40
|
+
readonly products: "/v1/products";
|
|
41
|
+
readonly products_search: "/v1/products/search";
|
|
42
|
+
readonly product_detail: "/v1/products/{product_id}";
|
|
43
|
+
readonly product_stocks: "/v1/products/{product_id}/stocks";
|
|
44
|
+
readonly products_locked_inventory: "/v1/products/locked-inventory";
|
|
45
|
+
readonly product_create: "/v1/products";
|
|
46
|
+
readonly product_update: "/v1/products/{product_id}";
|
|
47
|
+
readonly product_delete: "/v1/products/{product_id}";
|
|
48
|
+
readonly product_images: "/v1/products/{product_id}/images";
|
|
49
|
+
readonly product_variations_create: "/v1/products/{product_id}/variations";
|
|
50
|
+
readonly product_variation_update: "/v1/products/{product_id}/variations/{variation_id}";
|
|
51
|
+
readonly product_variation_delete: "/v1/products/{product_id}/variations/{variation_id}";
|
|
52
|
+
readonly product_variation_quantity: "/v1/products/{product_id}/variations/{variation_id}/quantity";
|
|
53
|
+
readonly product_variation_price: "/v1/products/{product_id}/variations/{variation_id}/price";
|
|
54
|
+
readonly product_quantity: "/v1/products/{product_id}/quantity";
|
|
55
|
+
readonly product_price: "/v1/products/{product_id}/price";
|
|
56
|
+
readonly product_tags: "/v1/products/{product_id}/tags";
|
|
57
|
+
readonly products_bulk_quantities: "/v1/products/bulk-update-quantities";
|
|
58
|
+
readonly products_bulk_categories: "/v1/products/bulk-assign-categories";
|
|
59
|
+
readonly categories: "/v1/categories";
|
|
60
|
+
readonly category_detail: "/v1/categories/{category_id}";
|
|
61
|
+
readonly category_create: "/v1/categories";
|
|
62
|
+
readonly category_update: "/v1/categories/{category_id}";
|
|
63
|
+
readonly category_delete: "/v1/categories/{category_id}";
|
|
64
|
+
readonly promotions: "/v1/promotions";
|
|
65
|
+
readonly promotion_detail: "/v1/promotions/{promotion_id}";
|
|
66
|
+
readonly promotions_search: "/v1/promotions/search";
|
|
67
|
+
readonly promotion_create: "/v1/promotions";
|
|
68
|
+
readonly promotion_update: "/v1/promotions/{promotion_id}";
|
|
69
|
+
readonly promotion_delete: "/v1/promotions/{promotion_id}";
|
|
70
|
+
readonly coupon_send: "/v1/coupons/send";
|
|
71
|
+
readonly coupon_redeem: "/v1/coupons/redeem";
|
|
72
|
+
readonly coupon_claim: "/v1/coupons/claim";
|
|
73
|
+
readonly warehouses: "/v1/warehouses";
|
|
74
|
+
readonly return_orders: "/v1/return_orders";
|
|
75
|
+
readonly return_order_detail: "/v1/return_orders/{return_order_id}";
|
|
76
|
+
readonly return_order_create: "/v1/return_orders";
|
|
77
|
+
readonly return_order_update: "/v1/return_orders/{return_order_id}";
|
|
78
|
+
readonly channels: "/v1/channels";
|
|
79
|
+
readonly channel_detail: "/v1/channels/{channel_id}";
|
|
80
|
+
readonly token_info: "/v1/token/info";
|
|
81
|
+
readonly conversations: "/v1/conversations";
|
|
82
|
+
readonly conversation_messages: "/v1/conversations/{conversation_id}/messages";
|
|
83
|
+
readonly conversation_order_message: "/v1/conversations/order-messages";
|
|
84
|
+
readonly conversation_shop_message: "/v1/conversations/shop-messages";
|
|
85
|
+
readonly gifts: "/v1/gifts";
|
|
86
|
+
readonly gifts_search: "/v1/gifts/search";
|
|
87
|
+
readonly gift_create: "/v1/gifts";
|
|
88
|
+
readonly gift_update: "/v1/gifts/{gift_id}";
|
|
89
|
+
readonly gift_quantity_by_sku: "/v1/gifts/quantity-by-sku";
|
|
90
|
+
readonly addon_products: "/v1/addon_products";
|
|
91
|
+
readonly addon_products_search: "/v1/addon_products/search";
|
|
92
|
+
readonly addon_product_create: "/v1/addon_products";
|
|
93
|
+
readonly addon_product_update: "/v1/addon_products/{addon_product_id}";
|
|
94
|
+
readonly addon_product_quantity: "/v1/addon_products/{addon_product_id}/quantity";
|
|
95
|
+
readonly addon_product_sku_quantity: "/v1/addon_products/sku/quantity";
|
|
96
|
+
readonly settings_app: "/v1/settings/app";
|
|
97
|
+
readonly payments: "/v1/payments";
|
|
98
|
+
readonly delivery_options: "/v1/delivery_options";
|
|
99
|
+
readonly delivery_option_detail: "/v1/delivery_options/{delivery_option_id}";
|
|
100
|
+
readonly delivery_option_time_slots: "/v1/delivery_options/{delivery_option_id}/time_slots";
|
|
101
|
+
readonly delivery_option_pickup_store: "/v1/delivery_options/{delivery_option_id}/pickup_store";
|
|
102
|
+
readonly merchants: "/v1/merchants";
|
|
103
|
+
readonly merchant_detail: "/v1/merchants/{merchant_id}";
|
|
104
|
+
readonly merchant_update: "/v1/merchants/{merchant_id}";
|
|
105
|
+
readonly staff_permissions: "/v1/staffs/{staff_id}/permissions";
|
|
106
|
+
readonly taxes: "/v1/taxes";
|
|
107
|
+
readonly product_review_comments: "/v1/product_review_comments";
|
|
108
|
+
readonly product_review_comment_detail: "/v1/product_review_comments/{comment_id}";
|
|
109
|
+
readonly product_review_comment_create: "/v1/product_review_comments";
|
|
110
|
+
readonly product_review_comments_bulk_create: "/v1/product_review_comments/bulk";
|
|
111
|
+
readonly product_review_comment_update: "/v1/product_review_comments/{comment_id}";
|
|
112
|
+
readonly product_review_comments_bulk_update: "/v1/product_review_comments";
|
|
113
|
+
readonly product_review_comment_delete: "/v1/product_review_comments/{comment_id}";
|
|
114
|
+
readonly product_review_comments_bulk_delete: "/v1/product_review_comments";
|
|
115
|
+
readonly agents: "/v1/agents";
|
|
116
|
+
readonly product_subscriptions: "/v1/product_subscriptions";
|
|
117
|
+
readonly product_subscription_detail: "/v1/product_subscriptions/{subscription_id}";
|
|
118
|
+
readonly media_create: "/v1/media";
|
|
119
|
+
readonly order_delivery_detail: "/v1/order_deliveries/{delivery_id}";
|
|
120
|
+
readonly order_delivery_update: "/v1/order_deliveries/{delivery_id}";
|
|
121
|
+
readonly flash_price_campaigns: "/v1/flash_price_campaigns";
|
|
122
|
+
readonly flash_price_campaign_detail: "/v1/flash_price_campaigns/{campaign_id}";
|
|
123
|
+
readonly flash_price_campaign_create: "/v1/flash_price_campaigns";
|
|
124
|
+
readonly flash_price_campaign_update: "/v1/flash_price_campaigns/{campaign_id}";
|
|
125
|
+
readonly flash_price_campaign_delete: "/v1/flash_price_campaigns/{campaign_id}";
|
|
126
|
+
readonly affiliate_campaigns: "/v1/affiliate_campaigns";
|
|
127
|
+
readonly affiliate_campaign_detail: "/v1/affiliate_campaigns/{campaign_id}";
|
|
128
|
+
readonly affiliate_campaign_order_usage: "/v1/affiliate_campaigns/{campaign_id}/order_usage";
|
|
129
|
+
readonly affiliate_campaign_create: "/v1/affiliate_campaigns";
|
|
130
|
+
readonly affiliate_campaign_update: "/v1/affiliate_campaigns/{campaign_id}";
|
|
131
|
+
readonly affiliate_campaign_delete: "/v1/affiliate_campaigns/{campaign_id}";
|
|
132
|
+
readonly metafield_create: "/merchants/current/app-metafields";
|
|
133
|
+
readonly purchase_orders: "/v1/pos/purchase_orders";
|
|
134
|
+
readonly purchase_order_detail: "/v1/pos/purchase_orders/{purchase_order_id}";
|
|
135
|
+
readonly purchase_order_create: "/v1/pos/purchase_orders";
|
|
136
|
+
readonly purchase_order_delete: "/v1/pos/purchase_orders";
|
|
137
|
+
};
|