jiffoo-theme-api-sdk 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.
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createBrowserTokenProvider = createBrowserTokenProvider;
4
+ function getCookie(name) {
5
+ if (typeof document === 'undefined')
6
+ return null;
7
+ const value = `; ${document.cookie}`;
8
+ const parts = value.split(`; ${name}=`);
9
+ if (parts.length === 2)
10
+ return parts.pop()?.split(';').shift() || null;
11
+ return null;
12
+ }
13
+ /**
14
+ * Browser token provider for theme apps.
15
+ * Priority: localStorage -> cookie
16
+ */
17
+ function createBrowserTokenProvider(key = 'auth_token') {
18
+ return () => {
19
+ if (typeof window === 'undefined')
20
+ return null;
21
+ const local = window.localStorage.getItem(key);
22
+ if (local)
23
+ return local;
24
+ return getCookie(key);
25
+ };
26
+ }
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createThemeApiClient = createThemeApiClient;
4
+ const jiffoo_core_api_sdk_1 = require("jiffoo-core-api-sdk");
5
+ const utils_1 = require("./utils");
6
+ function toCoreTokenProvider(token) {
7
+ return token;
8
+ }
9
+ function buildRequestInit(options) {
10
+ const method = options?.method || 'GET';
11
+ const headers = new Headers(options?.headers);
12
+ const init = { method, headers };
13
+ if (options?.body !== undefined) {
14
+ if ((0, utils_1.shouldUseJsonBody)(options.body)) {
15
+ if (!headers.has('Content-Type')) {
16
+ headers.set('Content-Type', 'application/json');
17
+ }
18
+ init.body = JSON.stringify(options.body);
19
+ }
20
+ else {
21
+ init.body = options.body;
22
+ }
23
+ }
24
+ return init;
25
+ }
26
+ function createThemeApiClient(options = {}) {
27
+ const apiPrefix = (0, utils_1.normalizePrefix)(options.apiPrefix ?? '/api');
28
+ const sdk = (0, jiffoo_core_api_sdk_1.createCoreApiSdk)({
29
+ baseUrl: options.baseUrl ?? '',
30
+ token: toCoreTokenProvider(options.token),
31
+ credentials: options.credentials ?? 'include',
32
+ fetch: options.fetch,
33
+ headers: options.headers,
34
+ });
35
+ const openapi = (0, jiffoo_core_api_sdk_1.createCoreOpenApiClient)({
36
+ baseUrl: options.baseUrl ?? '',
37
+ token: toCoreTokenProvider(options.token),
38
+ credentials: options.credentials ?? 'include',
39
+ fetch: options.fetch,
40
+ headers: options.headers,
41
+ });
42
+ async function request(path, optionsIn) {
43
+ const resolvedPath = (0, utils_1.resolveApiPath)(apiPrefix, path);
44
+ const pathWithQuery = (0, utils_1.buildPathWithQuery)(resolvedPath, optionsIn?.query);
45
+ return sdk.request(pathWithQuery, buildRequestInit(optionsIn));
46
+ }
47
+ return {
48
+ request,
49
+ openapi,
50
+ auth: {
51
+ login: (payload) => request('/auth/login', { method: 'POST', body: payload }),
52
+ register: (payload) => request('/auth/register', { method: 'POST', body: payload }),
53
+ me: () => request('/auth/me'),
54
+ refresh: (payload) => request('/auth/refresh', { method: 'POST', body: payload }),
55
+ logout: () => request('/auth/logout', { method: 'POST' }),
56
+ changePassword: (payload) => request('/auth/change-password', { method: 'POST', body: payload }),
57
+ },
58
+ account: {
59
+ getProfile: () => request('/account/profile'),
60
+ updateProfile: (payload) => request('/account/profile', { method: 'PUT', body: payload }),
61
+ uploadAvatar: (formData) => request('/account/avatar', { method: 'POST', body: formData }),
62
+ },
63
+ products: {
64
+ list: (query) => request('/products', { query }),
65
+ detail: (id, query) => request(`/products/${id}`, { query }),
66
+ categories: (query) => request('/products/categories', { query }),
67
+ search: (query) => request('/products/search', { query }),
68
+ },
69
+ cart: {
70
+ get: () => request('/cart'),
71
+ add: (payload) => request('/cart/items', { method: 'POST', body: payload }),
72
+ updateItem: (itemId, payload) => request(`/cart/items/${itemId}`, { method: 'PUT', body: payload }),
73
+ removeItem: (itemId) => request(`/cart/items/${itemId}`, { method: 'DELETE' }),
74
+ clear: () => request('/cart', { method: 'DELETE' }),
75
+ },
76
+ orders: {
77
+ list: (query) => request('/orders', { query }),
78
+ detail: (id) => request(`/orders/${id}`),
79
+ create: (payload) => request('/orders', { method: 'POST', body: payload }),
80
+ cancel: (id, payload) => request(`/orders/${id}/cancel`, { method: 'POST', body: payload }),
81
+ },
82
+ payments: {
83
+ availableMethods: () => request('/payments/available-methods'),
84
+ createSession: (payload) => request('/payments/create-session', { method: 'POST', body: payload }),
85
+ verifySession: (sessionId) => request(`/payments/verify/${sessionId}`),
86
+ },
87
+ store: {
88
+ context: (query) => request('/store/context', { query }),
89
+ },
90
+ themes: {
91
+ active: (query) => request('/themes/active', { query }),
92
+ installed: (query) => request('/themes/installed', { query }),
93
+ },
94
+ plugins: {
95
+ invoke: (slug, pluginPath, optionsInvoke) => {
96
+ const safePath = pluginPath.startsWith('/') ? pluginPath : `/${pluginPath}`;
97
+ const path = `/extensions/plugin/${slug}/api${safePath}`;
98
+ const query = {
99
+ ...(optionsInvoke?.query || {}),
100
+ ...(optionsInvoke?.installation ? { installation: optionsInvoke.installation } : {}),
101
+ ...(optionsInvoke?.installationId ? { installationId: optionsInvoke.installationId } : {}),
102
+ };
103
+ return request(path, {
104
+ method: optionsInvoke?.method || 'GET',
105
+ query,
106
+ body: optionsInvoke?.body,
107
+ headers: optionsInvoke?.headers,
108
+ });
109
+ },
110
+ },
111
+ };
112
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createBrowserTokenProvider = exports.createThemeApiClient = void 0;
4
+ var client_1 = require("./client");
5
+ Object.defineProperty(exports, "createThemeApiClient", { enumerable: true, get: function () { return client_1.createThemeApiClient; } });
6
+ var auth_1 = require("./auth");
7
+ Object.defineProperty(exports, "createBrowserTokenProvider", { enumerable: true, get: function () { return auth_1.createBrowserTokenProvider; } });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizePath = normalizePath;
4
+ exports.normalizePrefix = normalizePrefix;
5
+ exports.buildPathWithQuery = buildPathWithQuery;
6
+ exports.resolveApiPath = resolveApiPath;
7
+ exports.shouldUseJsonBody = shouldUseJsonBody;
8
+ function normalizePath(path) {
9
+ if (!path)
10
+ return '/';
11
+ return path.startsWith('/') ? path : `/${path}`;
12
+ }
13
+ function normalizePrefix(prefix) {
14
+ if (!prefix)
15
+ return '';
16
+ const withLeading = prefix.startsWith('/') ? prefix : `/${prefix}`;
17
+ return withLeading.endsWith('/') ? withLeading.slice(0, -1) : withLeading;
18
+ }
19
+ function buildPathWithQuery(path, query) {
20
+ if (!query || Object.keys(query).length === 0)
21
+ return path;
22
+ const params = new URLSearchParams();
23
+ for (const [key, raw] of Object.entries(query)) {
24
+ if (raw === undefined || raw === null)
25
+ continue;
26
+ if (Array.isArray(raw)) {
27
+ for (const item of raw) {
28
+ if (item !== undefined && item !== null)
29
+ params.append(key, String(item));
30
+ }
31
+ continue;
32
+ }
33
+ params.append(key, String(raw));
34
+ }
35
+ const queryString = params.toString();
36
+ if (!queryString)
37
+ return path;
38
+ return `${path}${path.includes('?') ? '&' : '?'}${queryString}`;
39
+ }
40
+ function resolveApiPath(apiPrefix, path) {
41
+ if (/^https?:\/\//.test(path))
42
+ return path;
43
+ const normalizedPath = normalizePath(path);
44
+ if (!apiPrefix)
45
+ return normalizedPath;
46
+ if (normalizedPath.startsWith(`${apiPrefix}/`) || normalizedPath === apiPrefix) {
47
+ return normalizedPath;
48
+ }
49
+ return `${apiPrefix}${normalizedPath}`;
50
+ }
51
+ function shouldUseJsonBody(body) {
52
+ if (body === undefined || body === null)
53
+ return false;
54
+ if (typeof FormData !== 'undefined' && body instanceof FormData)
55
+ return false;
56
+ if (typeof URLSearchParams !== 'undefined' && body instanceof URLSearchParams)
57
+ return false;
58
+ return true;
59
+ }
@@ -0,0 +1,23 @@
1
+ function getCookie(name) {
2
+ if (typeof document === 'undefined')
3
+ return null;
4
+ const value = `; ${document.cookie}`;
5
+ const parts = value.split(`; ${name}=`);
6
+ if (parts.length === 2)
7
+ return parts.pop()?.split(';').shift() || null;
8
+ return null;
9
+ }
10
+ /**
11
+ * Browser token provider for theme apps.
12
+ * Priority: localStorage -> cookie
13
+ */
14
+ export function createBrowserTokenProvider(key = 'auth_token') {
15
+ return () => {
16
+ if (typeof window === 'undefined')
17
+ return null;
18
+ const local = window.localStorage.getItem(key);
19
+ if (local)
20
+ return local;
21
+ return getCookie(key);
22
+ };
23
+ }
@@ -0,0 +1,109 @@
1
+ import { createCoreApiSdk, createCoreOpenApiClient, } from 'jiffoo-core-api-sdk';
2
+ import { buildPathWithQuery, normalizePrefix, resolveApiPath, shouldUseJsonBody } from './utils';
3
+ function toCoreTokenProvider(token) {
4
+ return token;
5
+ }
6
+ function buildRequestInit(options) {
7
+ const method = options?.method || 'GET';
8
+ const headers = new Headers(options?.headers);
9
+ const init = { method, headers };
10
+ if (options?.body !== undefined) {
11
+ if (shouldUseJsonBody(options.body)) {
12
+ if (!headers.has('Content-Type')) {
13
+ headers.set('Content-Type', 'application/json');
14
+ }
15
+ init.body = JSON.stringify(options.body);
16
+ }
17
+ else {
18
+ init.body = options.body;
19
+ }
20
+ }
21
+ return init;
22
+ }
23
+ export function createThemeApiClient(options = {}) {
24
+ const apiPrefix = normalizePrefix(options.apiPrefix ?? '/api');
25
+ const sdk = createCoreApiSdk({
26
+ baseUrl: options.baseUrl ?? '',
27
+ token: toCoreTokenProvider(options.token),
28
+ credentials: options.credentials ?? 'include',
29
+ fetch: options.fetch,
30
+ headers: options.headers,
31
+ });
32
+ const openapi = createCoreOpenApiClient({
33
+ baseUrl: options.baseUrl ?? '',
34
+ token: toCoreTokenProvider(options.token),
35
+ credentials: options.credentials ?? 'include',
36
+ fetch: options.fetch,
37
+ headers: options.headers,
38
+ });
39
+ async function request(path, optionsIn) {
40
+ const resolvedPath = resolveApiPath(apiPrefix, path);
41
+ const pathWithQuery = buildPathWithQuery(resolvedPath, optionsIn?.query);
42
+ return sdk.request(pathWithQuery, buildRequestInit(optionsIn));
43
+ }
44
+ return {
45
+ request,
46
+ openapi,
47
+ auth: {
48
+ login: (payload) => request('/auth/login', { method: 'POST', body: payload }),
49
+ register: (payload) => request('/auth/register', { method: 'POST', body: payload }),
50
+ me: () => request('/auth/me'),
51
+ refresh: (payload) => request('/auth/refresh', { method: 'POST', body: payload }),
52
+ logout: () => request('/auth/logout', { method: 'POST' }),
53
+ changePassword: (payload) => request('/auth/change-password', { method: 'POST', body: payload }),
54
+ },
55
+ account: {
56
+ getProfile: () => request('/account/profile'),
57
+ updateProfile: (payload) => request('/account/profile', { method: 'PUT', body: payload }),
58
+ uploadAvatar: (formData) => request('/account/avatar', { method: 'POST', body: formData }),
59
+ },
60
+ products: {
61
+ list: (query) => request('/products', { query }),
62
+ detail: (id, query) => request(`/products/${id}`, { query }),
63
+ categories: (query) => request('/products/categories', { query }),
64
+ search: (query) => request('/products/search', { query }),
65
+ },
66
+ cart: {
67
+ get: () => request('/cart'),
68
+ add: (payload) => request('/cart/items', { method: 'POST', body: payload }),
69
+ updateItem: (itemId, payload) => request(`/cart/items/${itemId}`, { method: 'PUT', body: payload }),
70
+ removeItem: (itemId) => request(`/cart/items/${itemId}`, { method: 'DELETE' }),
71
+ clear: () => request('/cart', { method: 'DELETE' }),
72
+ },
73
+ orders: {
74
+ list: (query) => request('/orders', { query }),
75
+ detail: (id) => request(`/orders/${id}`),
76
+ create: (payload) => request('/orders', { method: 'POST', body: payload }),
77
+ cancel: (id, payload) => request(`/orders/${id}/cancel`, { method: 'POST', body: payload }),
78
+ },
79
+ payments: {
80
+ availableMethods: () => request('/payments/available-methods'),
81
+ createSession: (payload) => request('/payments/create-session', { method: 'POST', body: payload }),
82
+ verifySession: (sessionId) => request(`/payments/verify/${sessionId}`),
83
+ },
84
+ store: {
85
+ context: (query) => request('/store/context', { query }),
86
+ },
87
+ themes: {
88
+ active: (query) => request('/themes/active', { query }),
89
+ installed: (query) => request('/themes/installed', { query }),
90
+ },
91
+ plugins: {
92
+ invoke: (slug, pluginPath, optionsInvoke) => {
93
+ const safePath = pluginPath.startsWith('/') ? pluginPath : `/${pluginPath}`;
94
+ const path = `/extensions/plugin/${slug}/api${safePath}`;
95
+ const query = {
96
+ ...(optionsInvoke?.query || {}),
97
+ ...(optionsInvoke?.installation ? { installation: optionsInvoke.installation } : {}),
98
+ ...(optionsInvoke?.installationId ? { installationId: optionsInvoke.installationId } : {}),
99
+ };
100
+ return request(path, {
101
+ method: optionsInvoke?.method || 'GET',
102
+ query,
103
+ body: optionsInvoke?.body,
104
+ headers: optionsInvoke?.headers,
105
+ });
106
+ },
107
+ },
108
+ };
109
+ }
@@ -0,0 +1,2 @@
1
+ export { createThemeApiClient } from './client';
2
+ export { createBrowserTokenProvider } from './auth';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,52 @@
1
+ export function normalizePath(path) {
2
+ if (!path)
3
+ return '/';
4
+ return path.startsWith('/') ? path : `/${path}`;
5
+ }
6
+ export function normalizePrefix(prefix) {
7
+ if (!prefix)
8
+ return '';
9
+ const withLeading = prefix.startsWith('/') ? prefix : `/${prefix}`;
10
+ return withLeading.endsWith('/') ? withLeading.slice(0, -1) : withLeading;
11
+ }
12
+ export function buildPathWithQuery(path, query) {
13
+ if (!query || Object.keys(query).length === 0)
14
+ return path;
15
+ const params = new URLSearchParams();
16
+ for (const [key, raw] of Object.entries(query)) {
17
+ if (raw === undefined || raw === null)
18
+ continue;
19
+ if (Array.isArray(raw)) {
20
+ for (const item of raw) {
21
+ if (item !== undefined && item !== null)
22
+ params.append(key, String(item));
23
+ }
24
+ continue;
25
+ }
26
+ params.append(key, String(raw));
27
+ }
28
+ const queryString = params.toString();
29
+ if (!queryString)
30
+ return path;
31
+ return `${path}${path.includes('?') ? '&' : '?'}${queryString}`;
32
+ }
33
+ export function resolveApiPath(apiPrefix, path) {
34
+ if (/^https?:\/\//.test(path))
35
+ return path;
36
+ const normalizedPath = normalizePath(path);
37
+ if (!apiPrefix)
38
+ return normalizedPath;
39
+ if (normalizedPath.startsWith(`${apiPrefix}/`) || normalizedPath === apiPrefix) {
40
+ return normalizedPath;
41
+ }
42
+ return `${apiPrefix}${normalizedPath}`;
43
+ }
44
+ export function shouldUseJsonBody(body) {
45
+ if (body === undefined || body === null)
46
+ return false;
47
+ if (typeof FormData !== 'undefined' && body instanceof FormData)
48
+ return false;
49
+ if (typeof URLSearchParams !== 'undefined' && body instanceof URLSearchParams)
50
+ return false;
51
+ return true;
52
+ }
@@ -0,0 +1,6 @@
1
+ import type { ThemeApiTokenProvider } from './types';
2
+ /**
3
+ * Browser token provider for theme apps.
4
+ * Priority: localStorage -> cookie
5
+ */
6
+ export declare function createBrowserTokenProvider(key?: string): ThemeApiTokenProvider;
@@ -0,0 +1,82 @@
1
+ import { createCoreOpenApiClient } from 'jiffoo-core-api-sdk';
2
+ import type { ThemeApiClientOptions, RequestOptions, PluginInvokeOptions } from './types';
3
+ type CoreOpenApiClient = ReturnType<typeof createCoreOpenApiClient>;
4
+ export type ThemeApiClient = {
5
+ request<T = unknown>(path: string, options?: RequestOptions): Promise<T>;
6
+ openapi: CoreOpenApiClient;
7
+ auth: {
8
+ login<T = unknown>(payload: unknown): Promise<T>;
9
+ register<T = unknown>(payload: unknown): Promise<T>;
10
+ me<T = unknown>(): Promise<T>;
11
+ refresh<T = unknown>(payload: {
12
+ refresh_token: string;
13
+ }): Promise<T>;
14
+ logout<T = unknown>(): Promise<T>;
15
+ changePassword<T = unknown>(payload: {
16
+ currentPassword: string;
17
+ newPassword: string;
18
+ }): Promise<T>;
19
+ };
20
+ account: {
21
+ getProfile<T = unknown>(): Promise<T>;
22
+ updateProfile<T = unknown>(payload: Record<string, unknown>): Promise<T>;
23
+ uploadAvatar<T = unknown>(formData: FormData): Promise<T>;
24
+ };
25
+ products: {
26
+ list<T = unknown>(query?: Record<string, unknown>): Promise<T>;
27
+ detail<T = unknown>(id: string, query?: Record<string, unknown>): Promise<T>;
28
+ categories<T = unknown>(query?: Record<string, unknown>): Promise<T>;
29
+ search<T = unknown>(query: {
30
+ q: string;
31
+ page?: number;
32
+ limit?: number;
33
+ locale?: string;
34
+ }): Promise<T>;
35
+ };
36
+ cart: {
37
+ get<T = unknown>(): Promise<T>;
38
+ add<T = unknown>(payload: {
39
+ productId: string;
40
+ quantity: number;
41
+ variantId?: string;
42
+ }): Promise<T>;
43
+ updateItem<T = unknown>(itemId: string, payload: {
44
+ quantity: number;
45
+ }): Promise<T>;
46
+ removeItem<T = unknown>(itemId: string): Promise<T>;
47
+ clear<T = unknown>(): Promise<T>;
48
+ };
49
+ orders: {
50
+ list<T = unknown>(query?: Record<string, unknown>): Promise<T>;
51
+ detail<T = unknown>(id: string): Promise<T>;
52
+ create<T = unknown>(payload: unknown): Promise<T>;
53
+ cancel<T = unknown>(id: string, payload: {
54
+ cancelReason: string;
55
+ }): Promise<T>;
56
+ };
57
+ payments: {
58
+ availableMethods<T = unknown>(): Promise<T>;
59
+ createSession<T = unknown>(payload: unknown): Promise<T>;
60
+ verifySession<T = unknown>(sessionId: string): Promise<T>;
61
+ };
62
+ store: {
63
+ context<T = unknown>(query?: {
64
+ domain?: string;
65
+ slug?: string;
66
+ }): Promise<T>;
67
+ };
68
+ themes: {
69
+ active<T = unknown>(query?: {
70
+ target?: 'shop' | 'admin';
71
+ }): Promise<T>;
72
+ installed<T = unknown>(query?: {
73
+ page?: number;
74
+ limit?: number;
75
+ }): Promise<T>;
76
+ };
77
+ plugins: {
78
+ invoke<T = unknown>(slug: string, pluginPath: string, options?: PluginInvokeOptions): Promise<T>;
79
+ };
80
+ };
81
+ export declare function createThemeApiClient(options?: ThemeApiClientOptions): ThemeApiClient;
82
+ export {};
@@ -0,0 +1,3 @@
1
+ export { createThemeApiClient, type ThemeApiClient } from './client';
2
+ export { createBrowserTokenProvider } from './auth';
3
+ export type { PageResult, ThemeApiClientOptions, ThemeApiTokenProvider, RequestOptions, PluginInvokeOptions, } from './types';
@@ -0,0 +1,47 @@
1
+ export type PageResult<T> = {
2
+ items: T[];
3
+ page: number;
4
+ limit: number;
5
+ total: number;
6
+ totalPages: number;
7
+ };
8
+ export type ThemeApiTokenProvider = string | null | undefined | (() => string | null | undefined | Promise<string | null | undefined>);
9
+ export type ThemeApiClientOptions = {
10
+ /**
11
+ * Core API base URL.
12
+ * Default: '' (browser-relative)
13
+ */
14
+ baseUrl?: string;
15
+ /**
16
+ * API prefix that is prepended to endpoint paths.
17
+ * Default: '/api'
18
+ */
19
+ apiPrefix?: string;
20
+ /**
21
+ * JWT token or provider.
22
+ */
23
+ token?: ThemeApiTokenProvider;
24
+ /**
25
+ * Fetch credentials mode.
26
+ * Default: 'include'
27
+ */
28
+ credentials?: RequestCredentials;
29
+ /**
30
+ * Custom fetch implementation for SSR/tests.
31
+ */
32
+ fetch?: typeof fetch;
33
+ /**
34
+ * Extra headers hook.
35
+ */
36
+ headers?: HeadersInit | (() => HeadersInit | Promise<HeadersInit>);
37
+ };
38
+ export type RequestOptions = {
39
+ query?: Record<string, unknown>;
40
+ body?: unknown;
41
+ headers?: HeadersInit;
42
+ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
43
+ };
44
+ export type PluginInvokeOptions = RequestOptions & {
45
+ installation?: string;
46
+ installationId?: string;
47
+ };
@@ -0,0 +1,5 @@
1
+ export declare function normalizePath(path: string): string;
2
+ export declare function normalizePrefix(prefix: string): string;
3
+ export declare function buildPathWithQuery(path: string, query?: Record<string, unknown>): string;
4
+ export declare function resolveApiPath(apiPrefix: string, path: string): string;
5
+ export declare function shouldUseJsonBody(body: unknown): boolean;
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "jiffoo-theme-api-sdk",
3
+ "version": "0.1.0",
4
+ "description": "Theme-facing SDK for Jiffoo Mall Core API",
5
+ "main": "dist/cjs/index.js",
6
+ "module": "dist/esm/index.js",
7
+ "types": "dist/types/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/esm/index.js",
11
+ "require": "./dist/cjs/index.js",
12
+ "types": "./dist/types/index.d.ts"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "prebuild": "pnpm --filter jiffoo-core-api-sdk build",
20
+ "build": "pnpm run build:esm && pnpm run build:cjs && pnpm run build:types",
21
+ "pretype-check": "pnpm --filter jiffoo-core-api-sdk build",
22
+ "build:esm": "tsc -p tsconfig.esm.json",
23
+ "build:cjs": "tsc -p tsconfig.cjs.json",
24
+ "build:types": "tsc -p tsconfig.types.json",
25
+ "dev": "tsc -p tsconfig.esm.json --watch",
26
+ "clean": "rimraf dist",
27
+ "type-check": "tsc -p tsconfig.esm.json --noEmit"
28
+ },
29
+ "keywords": [
30
+ "jiffoo",
31
+ "theme",
32
+ "sdk",
33
+ "core-api"
34
+ ],
35
+ "author": "Jiffoo Team",
36
+ "license": "MIT",
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
40
+ "engines": {
41
+ "node": ">=18.0.0"
42
+ },
43
+ "dependencies": {
44
+ "jiffoo-core-api-sdk": "^0.1.0"
45
+ },
46
+ "devDependencies": {
47
+ "@types/node": "^22.9.0",
48
+ "rimraf": "^6.0.1",
49
+ "typescript": "^5.8.3"
50
+ }
51
+ }