@osva-ai/connector-shopify 0.0.0-stage → 0.1.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 +187 -2
- package/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +48 -0
- package/dist/config.js.map +1 -0
- package/dist/connector.d.ts +8 -0
- package/dist/connector.d.ts.map +1 -0
- package/dist/connector.js +200 -0
- package/dist/connector.js.map +1 -0
- package/dist/constants.d.ts +31 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +31 -0
- package/dist/constants.js.map +1 -0
- package/dist/gid.d.ts +9 -0
- package/dist/gid.d.ts.map +1 -0
- package/dist/gid.js +24 -0
- package/dist/gid.js.map +1 -0
- package/dist/graphql/queries.d.ts +10 -0
- package/dist/graphql/queries.d.ts.map +1 -0
- package/dist/graphql/queries.js +204 -0
- package/dist/graphql/queries.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/map-shopify-error.d.ts +6 -0
- package/dist/map-shopify-error.d.ts.map +1 -0
- package/dist/map-shopify-error.js +101 -0
- package/dist/map-shopify-error.js.map +1 -0
- package/dist/normalize-shopify.d.ts +30 -0
- package/dist/normalize-shopify.d.ts.map +1 -0
- package/dist/normalize-shopify.js +383 -0
- package/dist/normalize-shopify.js.map +1 -0
- package/dist/output-budget.d.ts +29 -0
- package/dist/output-budget.d.ts.map +1 -0
- package/dist/output-budget.js +75 -0
- package/dist/output-budget.js.map +1 -0
- package/dist/parse-shop-host.d.ts +11 -0
- package/dist/parse-shop-host.d.ts.map +1 -0
- package/dist/parse-shop-host.js +108 -0
- package/dist/parse-shop-host.js.map +1 -0
- package/dist/schemas.d.ts +14 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +24 -0
- package/dist/schemas.js.map +1 -0
- package/dist/shopify-client.d.ts +48 -0
- package/dist/shopify-client.d.ts.map +1 -0
- package/dist/shopify-client.js +2 -0
- package/dist/shopify-client.js.map +1 -0
- package/dist/shopify-graphql-client.d.ts +18 -0
- package/dist/shopify-graphql-client.d.ts.map +1 -0
- package/dist/shopify-graphql-client.js +295 -0
- package/dist/shopify-graphql-client.js.map +1 -0
- package/dist/stdio.d.ts +3 -0
- package/dist/stdio.d.ts.map +1 -0
- package/dist/stdio.js +17 -0
- package/dist/stdio.js.map +1 -0
- package/dist/tool-schemas.d.ts +162 -0
- package/dist/tool-schemas.d.ts.map +1 -0
- package/dist/tool-schemas.js +209 -0
- package/dist/tool-schemas.js.map +1 -0
- package/package.json +68 -4
package/README.md
CHANGED
|
@@ -1,3 +1,188 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @osva-ai/connector-shopify
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
OSVA Connector Profile V1 **read-only** MCP connector for Shopify Admin GraphQL.
|
|
4
|
+
|
|
5
|
+
This package is developed in the [osva-connectors](https://github.com/Osva-AI/osva-connectors) monorepo. It is **not** published to npm from this README alone.
|
|
6
|
+
|
|
7
|
+
## Capabilities
|
|
8
|
+
|
|
9
|
+
Seven MCP tools:
|
|
10
|
+
|
|
11
|
+
| Tool | Purpose |
|
|
12
|
+
| ------------------------------- | -------------------------------------------- |
|
|
13
|
+
| `shopify.shop.get` | Shop metadata |
|
|
14
|
+
| `shopify.product.list` | Product list with search + cursor pagination |
|
|
15
|
+
| `shopify.product.get` | Single product summary |
|
|
16
|
+
| `shopify.order.list` | Non-PII order list |
|
|
17
|
+
| `shopify.order.get` | Non-PII order detail |
|
|
18
|
+
| `shopify.inventory.levels.list` | Inventory levels (scoped) |
|
|
19
|
+
| `shopify.location.list` | Fulfillment locations (no addresses) |
|
|
20
|
+
|
|
21
|
+
Supported Admin API version default: **`2026-10`** (override with `OSVA_CONNECTOR_SHOPIFY_API_VERSION`).
|
|
22
|
+
|
|
23
|
+
## Setup
|
|
24
|
+
|
|
25
|
+
### Environment variables
|
|
26
|
+
|
|
27
|
+
| Variable | Required | Description |
|
|
28
|
+
| ------------------------------------- | -------- | -------------------------------------------------------------------------------------------- |
|
|
29
|
+
| `OSVA_CONNECTOR_SHOPIFY_SHOP` | Yes | Store handle (`my-store`) or `my-store.myshopify.com` (HTTPS URL without path also accepted) |
|
|
30
|
+
| `OSVA_CONNECTOR_SHOPIFY_ACCESS_TOKEN` | Yes | Admin API access token from your Shopify app |
|
|
31
|
+
| `OSVA_CONNECTOR_SHOPIFY_API_VERSION` | No | `YYYY-MM` version (default `2026-10`) |
|
|
32
|
+
| `OSVA_CONNECTOR_SHOPIFY_TIMEOUT_MS` | No | Per-request deadline in ms (default `30000`, min `1000`, max `120000`) |
|
|
33
|
+
|
|
34
|
+
Configure a custom app or dev store app in the [Shopify Dev Dashboard](https://shopify.dev/docs/apps/build/dev-dashboard), install it on the target store, and copy the **Admin API access token** for server-to-server use. This connector does not implement OAuth or multi-merchant onboarding.
|
|
35
|
+
|
|
36
|
+
### MCP client configuration (stdio)
|
|
37
|
+
|
|
38
|
+
After npm install (see [Package installation](#package-installation)):
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"mcpServers": {
|
|
43
|
+
"osva-shopify": {
|
|
44
|
+
"command": "npx",
|
|
45
|
+
"args": ["-y", "@osva-ai/connector-shopify"],
|
|
46
|
+
"env": {
|
|
47
|
+
"OSVA_CONNECTOR_SHOPIFY_SHOP": "your-store",
|
|
48
|
+
"OSVA_CONNECTOR_SHOPIFY_ACCESS_TOKEN": "shpat_…"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Local monorepo development:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"command": "node",
|
|
60
|
+
"args": ["packages/shopify/dist/stdio.js"]
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Required Shopify scopes (verified against Admin GraphQL)
|
|
65
|
+
|
|
66
|
+
| Tool | Minimum Admin API scopes |
|
|
67
|
+
| --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
68
|
+
| `shopify.shop.get` | Valid Admin API access token for an installed app (no catalog/order scope required for the `shop` query itself) |
|
|
69
|
+
| `shopify.product.list`, `shopify.product.get` | **`read_products`** |
|
|
70
|
+
| `shopify.order.list`, `shopify.order.get` | **`read_orders`** (and **`read_all_orders`** if you need more than the default ~60-day order window — requires Shopify approval) |
|
|
71
|
+
| `shopify.inventory.levels.list` | **`read_inventory`** (prefer over `read_products` alone for inventory level connections) |
|
|
72
|
+
| `shopify.location.list` | **`read_locations`** |
|
|
73
|
+
|
|
74
|
+
### Order access limitations (Shopify-side)
|
|
75
|
+
|
|
76
|
+
- [Protected customer data](https://shopify.dev/docs/apps/launch/protected-customer-data) rules apply regardless of connector output shaping.
|
|
77
|
+
- Without **`read_all_orders`**, Shopify may only expose recent orders (~60 days). Missing scope or protected-data restrictions surface as sanitized `FORBIDDEN` / empty results on Shopify’s side, not as fabricated connector data.
|
|
78
|
+
- This connector **omits** customer names, emails, phones, addresses, and payment instruments from normalized outputs. That reduces MCP exposure but does **not** remove compliance obligations on your app.
|
|
79
|
+
|
|
80
|
+
Permission failures map to sanitized `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, or `RATE_LIMITED` errors (no tokens or raw provider stacks).
|
|
81
|
+
|
|
82
|
+
## Tool contracts
|
|
83
|
+
|
|
84
|
+
### `shopify.shop.get`
|
|
85
|
+
|
|
86
|
+
- **Input:** `{}`
|
|
87
|
+
- **Output:** `id`, `name`, `myshopifyDomain`, `currencyCode`, `ianaTimezone`
|
|
88
|
+
|
|
89
|
+
### `shopify.product.list`
|
|
90
|
+
|
|
91
|
+
- **Input:** `limit` (default 25, max 100), optional `cursor`, optional `query` (max 256 chars)
|
|
92
|
+
- **Output:** `products[]`, `pageInfo` (`hasNextPage`, `endCursor` when applicable)
|
|
93
|
+
- Each product includes a **bounded variant preview** (`variants`, `variantsPreviewComplete`).
|
|
94
|
+
|
|
95
|
+
### `shopify.product.get`
|
|
96
|
+
|
|
97
|
+
- **Input:** `id` (`gid://shopify/Product/…`)
|
|
98
|
+
- **Output:** Product summary, `description`, `tags`, bounded `variants`, `variantsPreviewComplete`
|
|
99
|
+
- No unrestricted metafields.
|
|
100
|
+
|
|
101
|
+
### `shopify.order.list`
|
|
102
|
+
|
|
103
|
+
- **Input:** `limit`, optional `cursor`, optional `query`
|
|
104
|
+
- **Output:** `orders[]`, `pageInfo`
|
|
105
|
+
- Order fields: `id`, `name`, timestamps, `displayFinancialStatus`, `displayFulfillmentStatus`, `totalPrice`, `currencyCode`
|
|
106
|
+
|
|
107
|
+
### `shopify.order.get`
|
|
108
|
+
|
|
109
|
+
- **Input:** `id` (`gid://shopify/Order/…`)
|
|
110
|
+
- **Output:** Order summary, `subtotalPrice`, `totalTax`, bounded `lineItems`, `lineItemsPreviewComplete`
|
|
111
|
+
|
|
112
|
+
### `shopify.inventory.levels.list`
|
|
113
|
+
|
|
114
|
+
- **Input:** optional `locationId`, optional `inventoryItemId` (**at least one required**), `limit`, optional `cursor`
|
|
115
|
+
- **Output:** `inventoryLevels[]` (`inventoryItemId`, `locationId`, `available` when Shopify returns an `available` quantity name, `quantities[]`), `pageInfo`
|
|
116
|
+
- Uses Shopify `inventoryLevels` connections on `Location` or `InventoryItem` (no global unscoped traversal).
|
|
117
|
+
|
|
118
|
+
### `shopify.location.list`
|
|
119
|
+
|
|
120
|
+
- **Input:** `limit`, optional `cursor`
|
|
121
|
+
- **Output:** `locations[]` (`id`, `name`, `isActive`, `fulfillsOnlineOrders`), `pageInfo` (physical addresses omitted)
|
|
122
|
+
|
|
123
|
+
## Pagination and truncation
|
|
124
|
+
|
|
125
|
+
**Shopify pagination (provider):**
|
|
126
|
+
|
|
127
|
+
- Cursor-based GraphQL (`pageInfo.hasNextPage`, `pageInfo.endCursor`).
|
|
128
|
+
- Max **100** top-level nodes per call.
|
|
129
|
+
- Cursors are opaque strings ≤ 512 characters; malformed cursors are rejected at input validation.
|
|
130
|
+
- Each tool performs **one** Shopify GraphQL request per invocation (no recursive auto-fetch).
|
|
131
|
+
|
|
132
|
+
**Connector-side output truncation (distinct from Shopify pagination):**
|
|
133
|
+
|
|
134
|
+
- If normalizing the full provider page would exceed the structured output budget, the connector may return a prefix of list items and set `productsTruncated`, `ordersTruncated`, `locationsTruncated`, or `inventoryLevelsTruncated` to `true`.
|
|
135
|
+
- `pageInfo` still reflects Shopify’s connection for the fetched page; truncation flags mean the **returned array** was shortened for MCP size limits.
|
|
136
|
+
|
|
137
|
+
**Nested previews (not full Shopify pagination):**
|
|
138
|
+
|
|
139
|
+
- **Variants:** up to **10** per product (`variantsPreviewComplete`).
|
|
140
|
+
- **Line items:** up to **25** per order (`lineItemsPreviewComplete`).
|
|
141
|
+
|
|
142
|
+
## Output budgets and data safety
|
|
143
|
+
|
|
144
|
+
- Structured MCP JSON per tool is capped at **256 KiB** (`JSON.stringify` UTF-8 length).
|
|
145
|
+
- Raw HTTP bodies are capped at **2 MiB** before parsing.
|
|
146
|
+
- Long provider strings are truncated with explicit `*Truncated` flags where applicable.
|
|
147
|
+
- Resource IDs, handles, and cursors are not silently truncated.
|
|
148
|
+
- Missing or mistyped provider fields throw `PROVIDER_ERROR` rather than inventing defaults (except explicit nulls such as `available: null` when Shopify omits an `available` quantity).
|
|
149
|
+
- All Shopify content is treated as untrusted (including prompt-injection-like text in titles/descriptions).
|
|
150
|
+
- Read-only: GraphQL documents are fixed queries; no mutations.
|
|
151
|
+
|
|
152
|
+
## Timeouts, throttling, and retries
|
|
153
|
+
|
|
154
|
+
- **Deadline:** `OSVA_CONNECTOR_SHOPIFY_TIMEOUT_MS` applies to the entire GraphQL operation, including at most **one** read-only retry and its backoff.
|
|
155
|
+
- **Cancellation:** MCP abort signals propagate to in-flight HTTP requests and retry delays.
|
|
156
|
+
- **GraphQL Admin throttling:** Shopify reports `THROTTLED` in the JSON body (HTTP `200`). The connector parses `extensions.cost.throttleStatus` when present and maps throttle errors to `RATE_LIMITED`.
|
|
157
|
+
- **HTTP `429`:** Rare for GraphQL Admin but handled; may occur on some platform limits. Mapped to `RATE_LIMITED`.
|
|
158
|
+
- **Read-only retry (bounded):** On `THROTTLED` / HTTP `429` / HTTP 5xx, the connector performs **at most one** retry after **~1 second** (Shopify’s documented recommendation). No retry on auth, validation, oversize responses, or cancellation. No generic retry framework.
|
|
159
|
+
|
|
160
|
+
## Security boundaries
|
|
161
|
+
|
|
162
|
+
- Only **`*.myshopify.com`** hosts (or canonical store handles) are allowed; no arbitrary endpoints, ports, paths, or IP literals.
|
|
163
|
+
- Access tokens are never logged or returned in errors (`shpat_…` patterns are redacted).
|
|
164
|
+
- Errors avoid raw provider exception text and credential-bearing headers.
|
|
165
|
+
|
|
166
|
+
## Package installation
|
|
167
|
+
|
|
168
|
+
From the monorepo root (verification only; does not publish):
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
pnpm test:package-acceptance:shopify
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
This builds a production tarball, installs it in a temp directory **outside** the repo (no workspace symlinks), verifies npm bin metadata and Node shebang on `dist/stdio.js`, resolves `@osva-ai/connector-sdk` from the registry, and runs MCP smoke tests (`initialize`, `tools/list` for all seven tools, input schemas, missing-config exit, invalid input handling, clean stdout).
|
|
175
|
+
|
|
176
|
+
Hermetic GraphQL behavior (pagination, throttling, cancellation, PII exclusion, large responses) is covered by Vitest against a loopback fake HTTP provider — not by the packaged smoke script and **not** against production Shopify.
|
|
177
|
+
|
|
178
|
+
## Local development
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
pnpm install
|
|
182
|
+
pnpm --filter @osva-ai/connector-shopify test
|
|
183
|
+
pnpm --filter @osva-ai/connector-shopify build
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## License
|
|
187
|
+
|
|
188
|
+
Apache-2.0
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAWA,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAoBvE,wBAAgB,iBAAiB,CAC/B,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,aAAa,CAuDf"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ConnectorSdkError } from "@osva-ai/connector-sdk";
|
|
2
|
+
import { DEFAULT_API_VERSION, DEFAULT_REQUEST_TIMEOUT_MS, SHOPIFY_ACCESS_TOKEN_ENV, SHOPIFY_API_VERSION_ENV, SHOPIFY_SHOP_ENV, SHOPIFY_TIMEOUT_MS_ENV, } from "./constants.js";
|
|
3
|
+
import { buildGraphqlEndpoint, parseShopHost } from "./parse-shop-host.js";
|
|
4
|
+
import { shopifyConfigSchema } from "./schemas.js";
|
|
5
|
+
function readBoundedInt(raw, fallback, label) {
|
|
6
|
+
if (raw === undefined || raw.trim().length === 0) {
|
|
7
|
+
return fallback;
|
|
8
|
+
}
|
|
9
|
+
const value = Number(raw.trim());
|
|
10
|
+
if (!Number.isInteger(value)) {
|
|
11
|
+
throw new ConnectorSdkError("CONFIGURATION_ERROR", `${label} must be an integer.`);
|
|
12
|
+
}
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
export function loadShopifyConfig(env = process.env) {
|
|
16
|
+
const rawShop = env[SHOPIFY_SHOP_ENV];
|
|
17
|
+
const rawToken = env[SHOPIFY_ACCESS_TOKEN_ENV];
|
|
18
|
+
if (rawShop === undefined || rawShop.trim().length === 0) {
|
|
19
|
+
throw new ConnectorSdkError("CONFIGURATION_ERROR", "Shopify shop is not configured.");
|
|
20
|
+
}
|
|
21
|
+
if (rawToken === undefined || rawToken.trim().length === 0) {
|
|
22
|
+
throw new ConnectorSdkError("CONFIGURATION_ERROR", "Shopify access token is not configured.");
|
|
23
|
+
}
|
|
24
|
+
let myshopifyDomain;
|
|
25
|
+
try {
|
|
26
|
+
myshopifyDomain = parseShopHost(rawShop).myshopifyDomain;
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
throw new ConnectorSdkError("CONFIGURATION_ERROR", "Shopify shop identifier is not valid.");
|
|
30
|
+
}
|
|
31
|
+
const apiVersionRaw = env[SHOPIFY_API_VERSION_ENV];
|
|
32
|
+
const apiVersion = apiVersionRaw === undefined || apiVersionRaw.trim().length === 0
|
|
33
|
+
? DEFAULT_API_VERSION
|
|
34
|
+
: apiVersionRaw.trim();
|
|
35
|
+
const requestTimeoutMs = readBoundedInt(env[SHOPIFY_TIMEOUT_MS_ENV], DEFAULT_REQUEST_TIMEOUT_MS, "Request timeout");
|
|
36
|
+
const parsed = shopifyConfigSchema.safeParse({
|
|
37
|
+
myshopifyDomain,
|
|
38
|
+
accessToken: rawToken.trim(),
|
|
39
|
+
apiVersion,
|
|
40
|
+
requestTimeoutMs,
|
|
41
|
+
graphqlEndpoint: buildGraphqlEndpoint(myshopifyDomain, apiVersion),
|
|
42
|
+
});
|
|
43
|
+
if (!parsed.success) {
|
|
44
|
+
throw new ConnectorSdkError("CONFIGURATION_ERROR", "Shopify connector configuration is invalid.");
|
|
45
|
+
}
|
|
46
|
+
return parsed.data;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO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CAAC;IAED,MAAM,aAAa,GAAG,GAAG,CAAC,uBAAuB,CAAC,CAAC;IACnD,MAAM,UAAU,GACd,aAAa,KAAK,SAAS,IAAI,aAAa,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;QAC9D,CAAC,CAAC,mBAAmB;QACrB,CAAC,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;IAE3B,MAAM,gBAAgB,GAAG,cAAc,CACrC,GAAG,CAAC,sBAAsB,CAAC,EAC3B,0BAA0B,EAC1B,iBAAiB,CAClB,CAAC;IAEF,MAAM,MAAM,GAAG,mBAAmB,CAAC,SAAS,CAAC;QAC3C,eAAe;QACf,WAAW,EAAE,QAAQ,CAAC,IAAI,EAAE;QAC5B,UAAU;QACV,gBAAgB;QAChB,eAAe,EAAE,oBAAoB,CAAC,eAAe,EAAE,UAAU,CAAC;KACnE,CAAC,CAAC;IAEH,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,iBAAiB,CACzB,qBAAqB,EACrB,6CAA6C,CAC9C,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type DefinedConnector } from "@osva-ai/connector-sdk";
|
|
2
|
+
import type { ShopifyClient } from "./shopify-client.js";
|
|
3
|
+
export interface CreateShopifyConnectorOptions {
|
|
4
|
+
readonly client: ShopifyClient;
|
|
5
|
+
readonly accessToken?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function createShopifyConnector(options: CreateShopifyConnectorOptions): DefinedConnector;
|
|
8
|
+
//# sourceMappingURL=connector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../src/connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;AAwBhC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAkBzD,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAUD,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,6BAA6B,GACrC,gBAAgB,CA6LlB"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { defineConnector, defineTool, ConnectorSdkError, } from "@osva-ai/connector-sdk";
|
|
2
|
+
import { CONNECTOR_KEY, CONNECTOR_NAME, CONNECTOR_VERSION, SHOPIFY_INVENTORY_LEVELS_LIST_TOOL, SHOPIFY_LOCATION_LIST_TOOL, SHOPIFY_ORDER_GET_TOOL, SHOPIFY_ORDER_LIST_TOOL, SHOPIFY_PRODUCT_GET_TOOL, SHOPIFY_PRODUCT_LIST_TOOL, SHOPIFY_SHOP_GET_TOOL, } from "./constants.js";
|
|
3
|
+
import { mapShopifyError } from "./map-shopify-error.js";
|
|
4
|
+
import { mapInventoryLevelsResponse, mapLocationListResponse, mapOrderGetResponse, mapOrderListResponse, mapProductGetResponse, mapProductListResponse, mapShopGetResponse, } from "./normalize-shopify.js";
|
|
5
|
+
import { inventoryLevelsListInputJsonSchema, inventoryLevelsListInputSchema, locationListInputJsonSchema, locationListInputSchema, orderGetInputJsonSchema, orderGetInputSchema, orderListInputJsonSchema, orderListInputSchema, productGetInputJsonSchema, productGetInputSchema, productListInputJsonSchema, productListInputSchema, shopGetInputJsonSchema, shopGetInputSchema, } from "./tool-schemas.js";
|
|
6
|
+
function invalidInputError() {
|
|
7
|
+
return new ConnectorSdkError("INVALID_INPUT", "Invalid tool input.");
|
|
8
|
+
}
|
|
9
|
+
function mapError(error, accessToken) {
|
|
10
|
+
return mapShopifyError(error, { accessToken });
|
|
11
|
+
}
|
|
12
|
+
export function createShopifyConnector(options) {
|
|
13
|
+
const accessToken = options.accessToken;
|
|
14
|
+
return defineConnector({
|
|
15
|
+
key: CONNECTOR_KEY,
|
|
16
|
+
name: CONNECTOR_NAME,
|
|
17
|
+
description: "Shopify Admin API read-only connector for OSVA Connector Profile V1 (shop metadata, products, non-PII orders, inventory levels, and locations). Tool authorization is enforced by OSVA ToolPolicy; Shopify access scopes and protected customer data rules remain the primary authorization layers on the provider side.",
|
|
18
|
+
version: CONNECTOR_VERSION,
|
|
19
|
+
tools: [
|
|
20
|
+
defineTool({
|
|
21
|
+
name: SHOPIFY_SHOP_GET_TOOL,
|
|
22
|
+
description: "Returns basic shop metadata (read-only). Requires read access to shop settings.",
|
|
23
|
+
inputSchema: shopGetInputJsonSchema,
|
|
24
|
+
handler: async (input, context) => {
|
|
25
|
+
const parsed = shopGetInputSchema.safeParse(input);
|
|
26
|
+
if (!parsed.success) {
|
|
27
|
+
throw invalidInputError();
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
const data = await options.client.getShop({
|
|
31
|
+
signal: context.signal,
|
|
32
|
+
});
|
|
33
|
+
return mapShopGetResponse(data);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
throw mapError(error, accessToken);
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
}),
|
|
40
|
+
defineTool({
|
|
41
|
+
name: SHOPIFY_PRODUCT_LIST_TOOL,
|
|
42
|
+
description: "Lists products with cursor pagination and an optional bounded Shopify search query. Variant data is a bounded preview (not guaranteed complete). Does not return unrestricted metafields.",
|
|
43
|
+
inputSchema: productListInputJsonSchema,
|
|
44
|
+
handler: async (input, context) => {
|
|
45
|
+
const parsed = productListInputSchema.safeParse(input);
|
|
46
|
+
if (!parsed.success) {
|
|
47
|
+
throw invalidInputError();
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
const data = await options.client.listProducts({
|
|
51
|
+
limit: parsed.data.limit,
|
|
52
|
+
...(parsed.data.cursor !== undefined
|
|
53
|
+
? { cursor: parsed.data.cursor }
|
|
54
|
+
: {}),
|
|
55
|
+
...(parsed.data.query !== undefined
|
|
56
|
+
? { query: parsed.data.query }
|
|
57
|
+
: {}),
|
|
58
|
+
signal: context.signal,
|
|
59
|
+
});
|
|
60
|
+
return mapProductListResponse(data);
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
throw mapError(error, accessToken);
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
}),
|
|
67
|
+
defineTool({
|
|
68
|
+
name: SHOPIFY_PRODUCT_GET_TOOL,
|
|
69
|
+
description: "Returns a single product summary with bounded variant preview (read-only). Does not return unrestricted metafields.",
|
|
70
|
+
inputSchema: productGetInputJsonSchema,
|
|
71
|
+
handler: async (input, context) => {
|
|
72
|
+
const parsed = productGetInputSchema.safeParse(input);
|
|
73
|
+
if (!parsed.success) {
|
|
74
|
+
throw invalidInputError();
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
const data = await options.client.getProduct({
|
|
78
|
+
id: parsed.data.id,
|
|
79
|
+
signal: context.signal,
|
|
80
|
+
});
|
|
81
|
+
return mapProductGetResponse(data);
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
throw mapError(error, accessToken);
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
}),
|
|
88
|
+
defineTool({
|
|
89
|
+
name: SHOPIFY_ORDER_LIST_TOOL,
|
|
90
|
+
description: "Lists orders with cursor pagination and an optional bounded search query. Returns non-PII financial and fulfillment summaries only (no customer names, emails, phones, addresses, or payment instruments).",
|
|
91
|
+
inputSchema: orderListInputJsonSchema,
|
|
92
|
+
handler: async (input, context) => {
|
|
93
|
+
const parsed = orderListInputSchema.safeParse(input);
|
|
94
|
+
if (!parsed.success) {
|
|
95
|
+
throw invalidInputError();
|
|
96
|
+
}
|
|
97
|
+
try {
|
|
98
|
+
const data = await options.client.listOrders({
|
|
99
|
+
limit: parsed.data.limit,
|
|
100
|
+
...(parsed.data.cursor !== undefined
|
|
101
|
+
? { cursor: parsed.data.cursor }
|
|
102
|
+
: {}),
|
|
103
|
+
...(parsed.data.query !== undefined
|
|
104
|
+
? { query: parsed.data.query }
|
|
105
|
+
: {}),
|
|
106
|
+
signal: context.signal,
|
|
107
|
+
});
|
|
108
|
+
return mapOrderListResponse(data);
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
throw mapError(error, accessToken);
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
}),
|
|
115
|
+
defineTool({
|
|
116
|
+
name: SHOPIFY_ORDER_GET_TOOL,
|
|
117
|
+
description: "Returns a non-PII order summary with totals, statuses, and a bounded line-item preview. Protected customer data and order-history scope restrictions may still apply on Shopify's side.",
|
|
118
|
+
inputSchema: orderGetInputJsonSchema,
|
|
119
|
+
handler: async (input, context) => {
|
|
120
|
+
const parsed = orderGetInputSchema.safeParse(input);
|
|
121
|
+
if (!parsed.success) {
|
|
122
|
+
throw invalidInputError();
|
|
123
|
+
}
|
|
124
|
+
try {
|
|
125
|
+
const data = await options.client.getOrder({
|
|
126
|
+
id: parsed.data.id,
|
|
127
|
+
signal: context.signal,
|
|
128
|
+
});
|
|
129
|
+
return mapOrderGetResponse(data);
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
throw mapError(error, accessToken);
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
}),
|
|
136
|
+
defineTool({
|
|
137
|
+
name: SHOPIFY_INVENTORY_LEVELS_LIST_TOOL,
|
|
138
|
+
description: "Lists inventory levels scoped by locationId or inventoryItemId (at least one required). Quantities include available and selected safe inventory states. Uses Shopify inventoryLevels connections (no global unscoped traversal).",
|
|
139
|
+
inputSchema: inventoryLevelsListInputJsonSchema,
|
|
140
|
+
handler: async (input, context) => {
|
|
141
|
+
const parsed = inventoryLevelsListInputSchema.safeParse(input);
|
|
142
|
+
if (!parsed.success) {
|
|
143
|
+
throw invalidInputError();
|
|
144
|
+
}
|
|
145
|
+
try {
|
|
146
|
+
const data = await options.client.listInventoryLevels({
|
|
147
|
+
...(parsed.data.locationId !== undefined
|
|
148
|
+
? { locationId: parsed.data.locationId }
|
|
149
|
+
: {}),
|
|
150
|
+
...(parsed.data.inventoryItemId !== undefined
|
|
151
|
+
? { inventoryItemId: parsed.data.inventoryItemId }
|
|
152
|
+
: {}),
|
|
153
|
+
limit: parsed.data.limit,
|
|
154
|
+
...(parsed.data.cursor !== undefined
|
|
155
|
+
? { cursor: parsed.data.cursor }
|
|
156
|
+
: {}),
|
|
157
|
+
signal: context.signal,
|
|
158
|
+
});
|
|
159
|
+
return mapInventoryLevelsResponse(data, {
|
|
160
|
+
...(parsed.data.locationId !== undefined
|
|
161
|
+
? { locationId: parsed.data.locationId }
|
|
162
|
+
: {}),
|
|
163
|
+
...(parsed.data.inventoryItemId !== undefined
|
|
164
|
+
? { inventoryItemId: parsed.data.inventoryItemId }
|
|
165
|
+
: {}),
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
throw mapError(error, accessToken);
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
}),
|
|
173
|
+
defineTool({
|
|
174
|
+
name: SHOPIFY_LOCATION_LIST_TOOL,
|
|
175
|
+
description: "Lists fulfillment locations without physical address fields (read-only).",
|
|
176
|
+
inputSchema: locationListInputJsonSchema,
|
|
177
|
+
handler: async (input, context) => {
|
|
178
|
+
const parsed = locationListInputSchema.safeParse(input);
|
|
179
|
+
if (!parsed.success) {
|
|
180
|
+
throw invalidInputError();
|
|
181
|
+
}
|
|
182
|
+
try {
|
|
183
|
+
const data = await options.client.listLocations({
|
|
184
|
+
limit: parsed.data.limit,
|
|
185
|
+
...(parsed.data.cursor !== undefined
|
|
186
|
+
? { cursor: parsed.data.cursor }
|
|
187
|
+
: {}),
|
|
188
|
+
signal: context.signal,
|
|
189
|
+
});
|
|
190
|
+
return mapLocationListResponse(data);
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
throw mapError(error, accessToken);
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
}),
|
|
197
|
+
],
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
//# sourceMappingURL=connector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connector.js","sourceRoot":"","sources":["../src/connector.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,UAAU,EACV,iBAAiB,GAElB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,kCAAkC,EAClC,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,kCAAkC,EAClC,8BAA8B,EAC9B,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAO3B,SAAS,iBAAiB;IACxB,OAAO,IAAI,iBAAiB,CAAC,eAAe,EAAE,qBAAqB,CAAC,CAAC;AACvE,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc,EAAE,WAAoB;IACpD,OAAO,eAAe,CAAC,KAAK,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,OAAsC;IAEtC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAExC,OAAO,eAAe,CAAC;QACrB,GAAG,EAAE,aAAa;QAClB,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KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK;4BACxB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS;gCAClC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE;gCAChC,CAAC,CAAC,EAAE,CAAC;4BACP,MAAM,EAAE,OAAO,CAAC,MAAM;yBACvB,CAAC,CAAC;wBACH,OAAO,uBAAuB,CAAC,IAAI,CAAC,CAAC;oBACvC,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACf,MAAM,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;oBACrC,CAAC;gBACH,CAAC;aACF,CAAC;SACH;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const CONNECTOR_KEY = "osva-connector-shopify";
|
|
2
|
+
export declare const CONNECTOR_NAME = "OSVA Shopify Connector";
|
|
3
|
+
export declare const CONNECTOR_VERSION = "0.1.0";
|
|
4
|
+
export declare const SHOPIFY_SHOP_GET_TOOL = "shopify.shop.get";
|
|
5
|
+
export declare const SHOPIFY_PRODUCT_LIST_TOOL = "shopify.product.list";
|
|
6
|
+
export declare const SHOPIFY_PRODUCT_GET_TOOL = "shopify.product.get";
|
|
7
|
+
export declare const SHOPIFY_ORDER_LIST_TOOL = "shopify.order.list";
|
|
8
|
+
export declare const SHOPIFY_ORDER_GET_TOOL = "shopify.order.get";
|
|
9
|
+
export declare const SHOPIFY_INVENTORY_LEVELS_LIST_TOOL = "shopify.inventory.levels.list";
|
|
10
|
+
export declare const SHOPIFY_LOCATION_LIST_TOOL = "shopify.location.list";
|
|
11
|
+
export declare const SHOPIFY_SHOP_ENV = "OSVA_CONNECTOR_SHOPIFY_SHOP";
|
|
12
|
+
export declare const SHOPIFY_ACCESS_TOKEN_ENV = "OSVA_CONNECTOR_SHOPIFY_ACCESS_TOKEN";
|
|
13
|
+
export declare const SHOPIFY_API_VERSION_ENV = "OSVA_CONNECTOR_SHOPIFY_API_VERSION";
|
|
14
|
+
export declare const SHOPIFY_TIMEOUT_MS_ENV = "OSVA_CONNECTOR_SHOPIFY_TIMEOUT_MS";
|
|
15
|
+
export declare const DEFAULT_API_VERSION = "2026-10";
|
|
16
|
+
export declare const DEFAULT_REQUEST_TIMEOUT_MS = 30000;
|
|
17
|
+
export declare const MIN_REQUEST_TIMEOUT_MS = 1000;
|
|
18
|
+
export declare const MAX_REQUEST_TIMEOUT_MS = 120000;
|
|
19
|
+
export declare const LIST_DEFAULT_LIMIT = 25;
|
|
20
|
+
export declare const LIST_MAX_LIMIT = 100;
|
|
21
|
+
export declare const MAX_CURSOR_LENGTH = 512;
|
|
22
|
+
export declare const MAX_SHOPIFY_SEARCH_QUERY_LENGTH = 256;
|
|
23
|
+
export declare const VARIANTS_PREVIEW_MAX = 10;
|
|
24
|
+
export declare const LINE_ITEMS_PREVIEW_MAX = 25;
|
|
25
|
+
/** Maximum raw HTTP response bytes read before JSON parsing. */
|
|
26
|
+
export declare const MAX_HTTP_RESPONSE_BYTES = 2097152;
|
|
27
|
+
/** Read-only GraphQL: at most one retry after throttle/transient 5xx (Shopify recommends ~1s backoff). */
|
|
28
|
+
export declare const READ_ONLY_GRAPHQL_MAX_RETRIES = 1;
|
|
29
|
+
export declare const READ_ONLY_GRAPHQL_RETRY_DELAY_MS = 1000;
|
|
30
|
+
export { OUTPUT_MAX_GID_LENGTH, OUTPUT_MAX_HANDLE_LENGTH, OUTPUT_MAX_ISO_TIMESTAMP, OUTPUT_MAX_MONEY_AMOUNT_LENGTH, OUTPUT_MAX_PRODUCT_TITLE, OUTPUT_MAX_SEARCH_QUERY, OUTPUT_MAX_SHOP_NAME, OUTPUT_MAX_SKU_LENGTH, OUTPUT_MAX_STRUCTURED_JSON_BYTES, OUTPUT_MAX_TIMEZONE_LENGTH, OUTPUT_MAX_VENDOR_LENGTH, } from "./output-budget.js";
|
|
31
|
+
//# sourceMappingURL=const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O,EACL,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,EACxB,8BAA8B,EAC9B,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,gCAAgC,EAChC,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const CONNECTOR_KEY = "osva-connector-shopify";
|
|
2
|
+
export const CONNECTOR_NAME = "OSVA Shopify Connector";
|
|
3
|
+
export const CONNECTOR_VERSION = "0.1.0";
|
|
4
|
+
export const SHOPIFY_SHOP_GET_TOOL = "shopify.shop.get";
|
|
5
|
+
export const SHOPIFY_PRODUCT_LIST_TOOL = "shopify.product.list";
|
|
6
|
+
export const SHOPIFY_PRODUCT_GET_TOOL = "shopify.product.get";
|
|
7
|
+
export const SHOPIFY_ORDER_LIST_TOOL = "shopify.order.list";
|
|
8
|
+
export const SHOPIFY_ORDER_GET_TOOL = "shopify.order.get";
|
|
9
|
+
export const SHOPIFY_INVENTORY_LEVELS_LIST_TOOL = "shopify.inventory.levels.list";
|
|
10
|
+
export const SHOPIFY_LOCATION_LIST_TOOL = "shopify.location.list";
|
|
11
|
+
export const SHOPIFY_SHOP_ENV = "OSVA_CONNECTOR_SHOPIFY_SHOP";
|
|
12
|
+
export const SHOPIFY_ACCESS_TOKEN_ENV = "OSVA_CONNECTOR_SHOPIFY_ACCESS_TOKEN";
|
|
13
|
+
export const SHOPIFY_API_VERSION_ENV = "OSVA_CONNECTOR_SHOPIFY_API_VERSION";
|
|
14
|
+
export const SHOPIFY_TIMEOUT_MS_ENV = "OSVA_CONNECTOR_SHOPIFY_TIMEOUT_MS";
|
|
15
|
+
export const DEFAULT_API_VERSION = "2026-10";
|
|
16
|
+
export const DEFAULT_REQUEST_TIMEOUT_MS = 30_000;
|
|
17
|
+
export const MIN_REQUEST_TIMEOUT_MS = 1_000;
|
|
18
|
+
export const MAX_REQUEST_TIMEOUT_MS = 120_000;
|
|
19
|
+
export const LIST_DEFAULT_LIMIT = 25;
|
|
20
|
+
export const LIST_MAX_LIMIT = 100;
|
|
21
|
+
export const MAX_CURSOR_LENGTH = 512;
|
|
22
|
+
export const MAX_SHOPIFY_SEARCH_QUERY_LENGTH = 256;
|
|
23
|
+
export const VARIANTS_PREVIEW_MAX = 10;
|
|
24
|
+
export const LINE_ITEMS_PREVIEW_MAX = 25;
|
|
25
|
+
/** Maximum raw HTTP response bytes read before JSON parsing. */
|
|
26
|
+
export const MAX_HTTP_RESPONSE_BYTES = 2_097_152;
|
|
27
|
+
/** Read-only GraphQL: at most one retry after throttle/transient 5xx (Shopify recommends ~1s backoff). */
|
|
28
|
+
export const READ_ONLY_GRAPHQL_MAX_RETRIES = 1;
|
|
29
|
+
export const READ_ONLY_GRAPHQL_RETRY_DELAY_MS = 1_000;
|
|
30
|
+
export { OUTPUT_MAX_GID_LENGTH, OUTPUT_MAX_HANDLE_LENGTH, OUTPUT_MAX_ISO_TIMESTAMP, OUTPUT_MAX_MONEY_AMOUNT_LENGTH, OUTPUT_MAX_PRODUCT_TITLE, OUTPUT_MAX_SEARCH_QUERY, OUTPUT_MAX_SHOP_NAME, OUTPUT_MAX_SKU_LENGTH, OUTPUT_MAX_STRUCTURED_JSON_BYTES, OUTPUT_MAX_TIMEZONE_LENGTH, OUTPUT_MAX_VENDOR_LENGTH, } from "./output-budget.js";
|
|
31
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,wBAAwB,CAAC;AACtD,MAAM,CAAC,MAAM,cAAc,GAAG,wBAAwB,CAAC;AACvD,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAEzC,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AACxD,MAAM,CAAC,MAAM,yBAAyB,GAAG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wB,EACxB,wBAAwB,EACxB,8BAA8B,EAC9B,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,gCAAgC,EAChC,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,oBAAoB,CAAC"}
|
package/dist/gid.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type ShopifyGidResource = "Product" | "Order" | "Location" | "InventoryItem";
|
|
2
|
+
export declare const GID_INPUT_PATTERN: {
|
|
3
|
+
readonly product: RegExp;
|
|
4
|
+
readonly order: RegExp;
|
|
5
|
+
readonly location: RegExp;
|
|
6
|
+
readonly inventoryItem: RegExp;
|
|
7
|
+
};
|
|
8
|
+
export declare function parseShopifyGid(raw: string, resource: ShopifyGidResource): string;
|
|
9
|
+
//# sourceMappingURL=gid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gid.d.ts","sourceRoot":"","sources":["../src/gid.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,kBAAkB,GAC5B,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,eAAe,CAAC;AAKrD,eAAO,MAAM,iBAAiB;;;;;CAKpB,CAAC;AAEX,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,kBAAkB,GAC3B,MAAM,CAsBR"}
|
package/dist/gid.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ConnectorSdkError } from "@osva-ai/connector-sdk";
|
|
2
|
+
const GID_PREFIX = "gid://shopify/";
|
|
3
|
+
const GID_PATTERN = /^gid:\/\/shopify\/(Product|Order|Location|InventoryItem)\/\d+$/;
|
|
4
|
+
export const GID_INPUT_PATTERN = {
|
|
5
|
+
product: /^gid:\/\/shopify\/Product\/\d+$/,
|
|
6
|
+
order: /^gid:\/\/shopify\/Order\/\d+$/,
|
|
7
|
+
location: /^gid:\/\/shopify\/Location\/\d+$/,
|
|
8
|
+
inventoryItem: /^gid:\/\/shopify\/InventoryItem\/\d+$/,
|
|
9
|
+
};
|
|
10
|
+
export function parseShopifyGid(raw, resource) {
|
|
11
|
+
const trimmed = raw.trim();
|
|
12
|
+
if (trimmed.length === 0 || trimmed.length > 128) {
|
|
13
|
+
throw new ConnectorSdkError("INVALID_INPUT", "Invalid Shopify resource ID.");
|
|
14
|
+
}
|
|
15
|
+
if (!GID_PATTERN.test(trimmed)) {
|
|
16
|
+
throw new ConnectorSdkError("INVALID_INPUT", "Invalid Shopify resource ID.");
|
|
17
|
+
}
|
|
18
|
+
const expectedPrefix = `${GID_PREFIX}${resource}/`;
|
|
19
|
+
if (!trimmed.startsWith(expectedPrefix)) {
|
|
20
|
+
throw new ConnectorSdkError("INVALID_INPUT", "Invalid Shopify resource ID.");
|
|
21
|
+
}
|
|
22
|
+
return trimmed;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=gid.js.map
|
package/dist/gid.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gid.js","sourceRoot":"","sources":["../src/gid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAKpC,MAAM,WAAW,GACf,gEAAgE,CAAC;AAEnE,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO,EAAE,iCAAiC;IAC1C,KAAK,EAAE,+BAA+B;IACtC,QAAQ,EAAE,kCAAkC;IAC5C,aAAa,EAAE,uCAAuC;CAC9C,CAAC;AAEX,MAAM,UAAU,eAAe,CAC7B,GAAW,EACX,QAA4B;IAE5B,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAC3B,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;QACjD,MAAM,IAAI,iBAAiB,CACzB,eAAe,EACf,8BAA8B,CAC/B,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,iBAAiB,CACzB,eAAe,EACf,8BAA8B,CAC/B,CAAC;IACJ,CAAC;IACD,MAAM,cAAc,GAAG,GAAG,UAAU,GAAG,QAAQ,GAAG,CAAC;IACnD,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,iBAAiB,CACzB,eAAe,EACf,8BAA8B,CAC/B,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Fixed Admin GraphQL documents (connector-owned, read-only). */
|
|
2
|
+
export declare const SHOP_GET_QUERY = "#graphql\n query OsvaShopGet {\n shop {\n id\n name\n myshopifyDomain\n currencyCode\n ianaTimezone\n }\n }\n";
|
|
3
|
+
export declare const PRODUCT_LIST_QUERY = "#graphql\n query OsvaProductList($first: Int!, $after: String, $query: String) {\n products(first: $first, after: $after, query: $query) {\n nodes {\n id\n title\n handle\n status\n vendor\n productType\n createdAt\n updatedAt\n variants(first: 10) {\n nodes {\n id\n title\n sku\n price\n }\n pageInfo {\n hasNextPage\n }\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n";
|
|
4
|
+
export declare const PRODUCT_GET_QUERY = "#graphql\n query OsvaProductGet($id: ID!) {\n product(id: $id) {\n id\n title\n handle\n status\n vendor\n productType\n createdAt\n updatedAt\n description\n tags\n variants(first: 10) {\n nodes {\n id\n title\n sku\n price\n }\n pageInfo {\n hasNextPage\n }\n }\n }\n }\n";
|
|
5
|
+
export declare const ORDER_LIST_QUERY = "#graphql\n query OsvaOrderList($first: Int!, $after: String, $query: String) {\n orders(first: $first, after: $after, query: $query) {\n nodes {\n id\n name\n createdAt\n updatedAt\n displayFinancialStatus\n displayFulfillmentStatus\n currentTotalPriceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n";
|
|
6
|
+
export declare const ORDER_GET_QUERY = "#graphql\n query OsvaOrderGet($id: ID!) {\n order(id: $id) {\n id\n name\n createdAt\n updatedAt\n displayFinancialStatus\n displayFulfillmentStatus\n currencyCode\n currentTotalPriceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n currentSubtotalPriceSet {\n shopMoney {\n amount\n }\n }\n currentTotalTaxSet {\n shopMoney {\n amount\n }\n }\n lineItems(first: 25) {\n nodes {\n id\n name\n quantity\n currentQuantity\n sku\n }\n pageInfo {\n hasNextPage\n }\n }\n }\n }\n";
|
|
7
|
+
export declare const LOCATION_LIST_QUERY = "#graphql\n query OsvaLocationList($first: Int!, $after: String) {\n locations(first: $first, after: $after) {\n nodes {\n id\n name\n isActive\n fulfillsOnlineOrders\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n";
|
|
8
|
+
export declare const INVENTORY_LEVELS_BY_LOCATION_QUERY = "#graphql\n query OsvaInventoryLevelsByLocation($locationId: ID!, $first: Int!, $after: String) {\n location(id: $locationId) {\n id\n inventoryLevels(first: $first, after: $after) {\n nodes {\n id\n item {\n id\n }\n location {\n id\n }\n quantities(names: [\"available\", \"on_hand\", \"committed\", \"incoming\", \"reserved\"]) {\n name\n quantity\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n }\n";
|
|
9
|
+
export declare const INVENTORY_LEVELS_BY_ITEM_QUERY = "#graphql\n query OsvaInventoryLevelsByItem($inventoryItemId: ID!, $first: Int!, $after: String) {\n inventoryItem(id: $inventoryItemId) {\n id\n inventoryLevels(first: $first, after: $after) {\n nodes {\n id\n item {\n id\n }\n location {\n id\n }\n quantities(names: [\"available\", \"on_hand\", \"committed\", \"incoming\", \"reserved\"]) {\n name\n quantity\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n }\n";
|
|
10
|
+
//# sourceMappingURL=queries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/graphql/queries.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAElE,eAAO,MAAM,cAAc,mJAU1B,CAAC;AAEF,eAAO,MAAM,kBAAkB,+kBA8B9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,maA0B7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,ufAuB5B,CAAC;AAEF,eAAO,MAAM,eAAe,stBAwC3B,CAAC;AAEF,eAAO,MAAM,mBAAmB,ySAe/B,CAAC;AAEF,eAAO,MAAM,kCAAkC,mlBAyB9C,CAAC;AAEF,eAAO,MAAM,8BAA8B,8lBAyB1C,CAAC"}
|