@ratio-mcp/shared 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/dist/constants.d.ts +14 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +22 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/scopes-data.d.ts +23 -0
- package/dist/scopes-data.d.ts.map +1 -0
- package/dist/scopes-data.js +1082 -0
- package/dist/scopes-data.js.map +1 -0
- package/dist/types.d.ts +145 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +23 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const RATIO_API_BASE_URL: string;
|
|
2
|
+
export declare const RATIO_API_VERSION = "v1";
|
|
3
|
+
export declare const RATIO_DEVELOPER_DASHBOARD_URL: string;
|
|
4
|
+
export declare const STORE_DIR: string;
|
|
5
|
+
export declare const TOKENS_FILE: string;
|
|
6
|
+
export declare const REQUIREMENTS_FILE: string;
|
|
7
|
+
export declare const OAUTH_BASE_PATH = "/api/v1/oauth";
|
|
8
|
+
export declare const DEVELOPER_API_BASE_PATH = "/api/developer";
|
|
9
|
+
export declare const DEFAULT_REDIRECT_URI = "http://localhost:3000/auth/callback";
|
|
10
|
+
export declare const DOCS_SERVER_NAME = "ratio-docs-server";
|
|
11
|
+
export declare const DOCS_SERVER_VERSION = "1.0.0";
|
|
12
|
+
export declare const DEV_SERVER_NAME = "ratio-dev-server";
|
|
13
|
+
export declare const DEV_SERVER_VERSION = "1.0.0";
|
|
14
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB,QAA6E,CAAC;AAC7G,eAAO,MAAM,iBAAiB,OAAO,CAAC;AACtC,eAAO,MAAM,6BAA6B,QAAsF,CAAC;AAGjI,eAAO,MAAM,SAAS,QAA+B,CAAC;AACtD,eAAO,MAAM,WAAW,QAAiC,CAAC;AAC1D,eAAO,MAAM,iBAAiB,QAAuC,CAAC;AAGtE,eAAO,MAAM,eAAe,kBAAoC,CAAC;AAGjE,eAAO,MAAM,uBAAuB,mBAAmB,CAAC;AAGxD,eAAO,MAAM,oBAAoB,wCAAwC,CAAC;AAG1E,eAAO,MAAM,gBAAgB,sBAAsB,CAAC;AACpD,eAAO,MAAM,mBAAmB,UAAU,CAAC;AAC3C,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAClD,eAAO,MAAM,kBAAkB,UAAU,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { join } from 'path';
|
|
2
|
+
import { homedir } from 'os';
|
|
3
|
+
// ─── API Base URLs (from env vars, with defaults for dev) ───────
|
|
4
|
+
export const RATIO_API_BASE_URL = process.env.RATIO_API_BASE_URL || 'https://dev-os-ecosystem.dev.gokwik.io';
|
|
5
|
+
export const RATIO_API_VERSION = 'v1';
|
|
6
|
+
export const RATIO_DEVELOPER_DASHBOARD_URL = process.env.RATIO_DEVELOPER_DASHBOARD_URL || 'https://dev-developers.dev.gokwik.in';
|
|
7
|
+
// ─── Persistent Store ────────────────────────────────────────────
|
|
8
|
+
export const STORE_DIR = join(homedir(), '.ratio-v2');
|
|
9
|
+
export const TOKENS_FILE = join(STORE_DIR, 'tokens.json');
|
|
10
|
+
export const REQUIREMENTS_FILE = join(STORE_DIR, 'requirements.json');
|
|
11
|
+
// ─── OAuth ───────────────────────────────────────────────────────
|
|
12
|
+
export const OAUTH_BASE_PATH = `/api/${RATIO_API_VERSION}/oauth`;
|
|
13
|
+
// ─── Developer Dashboard API ─────────────────────────────────────
|
|
14
|
+
export const DEVELOPER_API_BASE_PATH = '/api/developer';
|
|
15
|
+
// ─── Default Redirect URI ────────────────────────────────────────
|
|
16
|
+
export const DEFAULT_REDIRECT_URI = 'http://localhost:3000/auth/callback';
|
|
17
|
+
// ─── Server Names ────────────────────────────────────────────────
|
|
18
|
+
export const DOCS_SERVER_NAME = 'ratio-docs-server';
|
|
19
|
+
export const DOCS_SERVER_VERSION = '1.0.0';
|
|
20
|
+
export const DEV_SERVER_NAME = 'ratio-dev-server';
|
|
21
|
+
export const DEV_SERVER_VERSION = '1.0.0';
|
|
22
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAE7B,mEAAmE;AACnE,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,wCAAwC,CAAC;AAC7G,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AACtC,MAAM,CAAC,MAAM,6BAA6B,GAAG,OAAO,CAAC,GAAG,CAAC,6BAA6B,IAAI,sCAAsC,CAAC;AAEjI,oEAAoE;AACpE,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,CAAC,CAAC;AACtD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;AAC1D,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC;AAEtE,oEAAoE;AACpE,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,iBAAiB,QAAQ,CAAC;AAEjE,oEAAoE;AACpE,MAAM,CAAC,MAAM,uBAAuB,GAAG,gBAAgB,CAAC;AAExD,oEAAoE;AACpE,MAAM,CAAC,MAAM,oBAAoB,GAAG,qCAAqC,CAAC;AAE1E,oEAAoE;AACpE,MAAM,CAAC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AACpD,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAC3C,MAAM,CAAC,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAClD,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ApiScope, ResourceMeta } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Static scopes data — sourced from GET /api/v1/scopes
|
|
4
|
+
* Enriched with LLM-friendly descriptions, use_cases, and pairing hints
|
|
5
|
+
* so the LLM can intelligently suggest scopes based on app descriptions.
|
|
6
|
+
*
|
|
7
|
+
* To refresh base data: fetch from ${RATIO_API_BASE_URL}/api/v1/scopes
|
|
8
|
+
*
|
|
9
|
+
* Last updated: 2026-03-18
|
|
10
|
+
*/
|
|
11
|
+
export declare const PRIMARY_RESOURCES: readonly ["orders", "products", "customers", "inventory", "discounts", "payments", "shipping", "fulfillments", "draft_orders", "returns", "gift_cards", "analytics", "channels", "content", "files", "locations", "themes", "markets", "reports", "locales", "publications", "settings", "webhooks", "apps"];
|
|
12
|
+
export type PrimaryResource = (typeof PRIMARY_RESOURCES)[number];
|
|
13
|
+
export declare const RESOURCE_METADATA: Record<string, ResourceMeta>;
|
|
14
|
+
export declare const SCOPES_BY_RESOURCE: Record<string, ApiScope[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Flat set of all valid scope codes for quick validation.
|
|
17
|
+
*/
|
|
18
|
+
export declare const ALL_SCOPE_CODES: Set<string>;
|
|
19
|
+
/**
|
|
20
|
+
* Look up which resource a scope code belongs to.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getResourceForScope(code: string): string | undefined;
|
|
23
|
+
//# sourceMappingURL=scopes-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scopes-data.d.ts","sourceRoot":"","sources":["../src/scopes-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEzD;;;;;;;;GAQG;AAIH,eAAO,MAAM,iBAAiB,8SAyBpB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAMjE,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAmT1D,CAAC;AAIF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,CAyvBzD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,GAAG,CAAC,MAAM,CAEvC,CAAC;AAEF;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOpE"}
|