omni-sync-sdk 0.18.1 → 0.18.3

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/index.d.mts CHANGED
@@ -113,20 +113,26 @@ interface CustomerProfile {
113
113
  updatedAt: string;
114
114
  }
115
115
  interface ProductMetafield {
116
- id?: string;
117
- definitionId?: string;
118
- /** Key from definition (alias: definitionKey) */
119
- key: string;
120
- /** Alias for key from backend */
121
- definitionKey?: string;
116
+ id: string;
117
+ definitionId: string;
118
+ /** Key from the metafield definition */
119
+ definitionKey: string;
120
+ /** Display name from the metafield definition */
121
+ definitionName: string;
122
+ /** Metafield type (e.g., 'text', 'number', 'boolean') */
123
+ type: string;
124
+ /** The metafield value */
122
125
  value: string;
123
- /** Display name (maps to definitionName in backend) */
124
- name?: string;
125
- /** Alias for name from backend */
126
- definitionName?: string;
127
- type?: string;
128
126
  /** Variant ID if this metafield is variant-specific */
129
127
  variantId?: string | null;
128
+ /**
129
+ * @deprecated Use `definitionKey` instead. Alias for backwards compatibility.
130
+ */
131
+ key?: string;
132
+ /**
133
+ * @deprecated Use `definitionName` instead. Alias for backwards compatibility.
134
+ */
135
+ name?: string;
130
136
  }
131
137
  interface Product {
132
138
  id: string;
@@ -141,7 +147,8 @@ interface Product {
141
147
  salePrice?: string | null;
142
148
  /** Cost price as string. Use parseFloat() for calculations. */
143
149
  costPrice?: string | null;
144
- status?: string | null;
150
+ /** Product status (active, draft, archived). Always returned by backend. */
151
+ status: string;
145
152
  type: 'SIMPLE' | 'VARIABLE';
146
153
  isDownloadable?: boolean;
147
154
  images?: ProductImage[];
@@ -162,6 +169,10 @@ interface Product {
162
169
  channels?: Record<string, Record<string, unknown>>;
163
170
  /** Shopify product ID (admin mode only) */
164
171
  shopifyProductId?: string | null;
172
+ /** WooCommerce product ID (admin mode only) */
173
+ woocommerceProductId?: string | null;
174
+ /** Meta/Facebook Item Group ID (admin mode only) */
175
+ metaItemGroupId?: string | null;
165
176
  /** Whether product needs sync to platforms (admin mode only) */
166
177
  needsSync?: boolean;
167
178
  /** Last sync timestamp (admin mode only) */
@@ -201,6 +212,20 @@ interface ProductImage {
201
212
  isMain?: boolean;
202
213
  /** Alt text for accessibility */
203
214
  alt?: string;
215
+ /** Image ID (admin mode only) */
216
+ id?: string;
217
+ /** Storage key (admin mode only) */
218
+ key?: string;
219
+ /** Thumbnail URL for previews (admin mode only) */
220
+ thumbnailUrl?: string;
221
+ /** Image width in pixels (admin mode only) */
222
+ width?: number;
223
+ /** Image height in pixels (admin mode only) */
224
+ height?: number;
225
+ /** File size in bytes (admin mode only) */
226
+ size?: number;
227
+ /** MIME type (admin mode only) */
228
+ mimeType?: string;
204
229
  }
205
230
  interface ProductVariant {
206
231
  id: string;
@@ -216,7 +241,10 @@ interface ProductVariant {
216
241
  attributes?: Record<string, unknown> | null;
217
242
  inventory?: InventoryInfo | null;
218
243
  /** Variant image URL or image object */
219
- image?: unknown | null;
244
+ image?: string | {
245
+ url: string;
246
+ thumbnailUrl?: string;
247
+ } | null;
220
248
  /** Display position/order for sorting variants */
221
249
  position: number;
222
250
  /** Variant status */
@@ -246,7 +274,7 @@ interface InventoryInfo {
246
274
  * - All DISABLED → DISABLED
247
275
  * - Mixed → TRACKED
248
276
  */
249
- trackingMode?: InventoryTrackingMode;
277
+ trackingMode: InventoryTrackingMode;
250
278
  /**
251
279
  * Whether the item is in stock.
252
280
  * Pre-calculated by backend - USE THIS instead of checking `available > 0`!
@@ -1824,9 +1852,12 @@ interface UpdateVariantInventoryDto {
1824
1852
  reason?: string;
1825
1853
  }
1826
1854
  interface VariantInventoryResponse {
1855
+ trackingMode: InventoryTrackingMode;
1827
1856
  total: number;
1828
1857
  reserved: number;
1829
1858
  available: number;
1859
+ inStock: boolean;
1860
+ canPurchase: boolean;
1830
1861
  lastInventorySyncAt?: string | null;
1831
1862
  }
1832
1863
  type RefundType = 'full' | 'partial';
package/dist/index.d.ts CHANGED
@@ -113,20 +113,26 @@ interface CustomerProfile {
113
113
  updatedAt: string;
114
114
  }
115
115
  interface ProductMetafield {
116
- id?: string;
117
- definitionId?: string;
118
- /** Key from definition (alias: definitionKey) */
119
- key: string;
120
- /** Alias for key from backend */
121
- definitionKey?: string;
116
+ id: string;
117
+ definitionId: string;
118
+ /** Key from the metafield definition */
119
+ definitionKey: string;
120
+ /** Display name from the metafield definition */
121
+ definitionName: string;
122
+ /** Metafield type (e.g., 'text', 'number', 'boolean') */
123
+ type: string;
124
+ /** The metafield value */
122
125
  value: string;
123
- /** Display name (maps to definitionName in backend) */
124
- name?: string;
125
- /** Alias for name from backend */
126
- definitionName?: string;
127
- type?: string;
128
126
  /** Variant ID if this metafield is variant-specific */
129
127
  variantId?: string | null;
128
+ /**
129
+ * @deprecated Use `definitionKey` instead. Alias for backwards compatibility.
130
+ */
131
+ key?: string;
132
+ /**
133
+ * @deprecated Use `definitionName` instead. Alias for backwards compatibility.
134
+ */
135
+ name?: string;
130
136
  }
131
137
  interface Product {
132
138
  id: string;
@@ -141,7 +147,8 @@ interface Product {
141
147
  salePrice?: string | null;
142
148
  /** Cost price as string. Use parseFloat() for calculations. */
143
149
  costPrice?: string | null;
144
- status?: string | null;
150
+ /** Product status (active, draft, archived). Always returned by backend. */
151
+ status: string;
145
152
  type: 'SIMPLE' | 'VARIABLE';
146
153
  isDownloadable?: boolean;
147
154
  images?: ProductImage[];
@@ -162,6 +169,10 @@ interface Product {
162
169
  channels?: Record<string, Record<string, unknown>>;
163
170
  /** Shopify product ID (admin mode only) */
164
171
  shopifyProductId?: string | null;
172
+ /** WooCommerce product ID (admin mode only) */
173
+ woocommerceProductId?: string | null;
174
+ /** Meta/Facebook Item Group ID (admin mode only) */
175
+ metaItemGroupId?: string | null;
165
176
  /** Whether product needs sync to platforms (admin mode only) */
166
177
  needsSync?: boolean;
167
178
  /** Last sync timestamp (admin mode only) */
@@ -201,6 +212,20 @@ interface ProductImage {
201
212
  isMain?: boolean;
202
213
  /** Alt text for accessibility */
203
214
  alt?: string;
215
+ /** Image ID (admin mode only) */
216
+ id?: string;
217
+ /** Storage key (admin mode only) */
218
+ key?: string;
219
+ /** Thumbnail URL for previews (admin mode only) */
220
+ thumbnailUrl?: string;
221
+ /** Image width in pixels (admin mode only) */
222
+ width?: number;
223
+ /** Image height in pixels (admin mode only) */
224
+ height?: number;
225
+ /** File size in bytes (admin mode only) */
226
+ size?: number;
227
+ /** MIME type (admin mode only) */
228
+ mimeType?: string;
204
229
  }
205
230
  interface ProductVariant {
206
231
  id: string;
@@ -216,7 +241,10 @@ interface ProductVariant {
216
241
  attributes?: Record<string, unknown> | null;
217
242
  inventory?: InventoryInfo | null;
218
243
  /** Variant image URL or image object */
219
- image?: unknown | null;
244
+ image?: string | {
245
+ url: string;
246
+ thumbnailUrl?: string;
247
+ } | null;
220
248
  /** Display position/order for sorting variants */
221
249
  position: number;
222
250
  /** Variant status */
@@ -246,7 +274,7 @@ interface InventoryInfo {
246
274
  * - All DISABLED → DISABLED
247
275
  * - Mixed → TRACKED
248
276
  */
249
- trackingMode?: InventoryTrackingMode;
277
+ trackingMode: InventoryTrackingMode;
250
278
  /**
251
279
  * Whether the item is in stock.
252
280
  * Pre-calculated by backend - USE THIS instead of checking `available > 0`!
@@ -1824,9 +1852,12 @@ interface UpdateVariantInventoryDto {
1824
1852
  reason?: string;
1825
1853
  }
1826
1854
  interface VariantInventoryResponse {
1855
+ trackingMode: InventoryTrackingMode;
1827
1856
  total: number;
1828
1857
  reserved: number;
1829
1858
  available: number;
1859
+ inStock: boolean;
1860
+ canPurchase: boolean;
1830
1861
  lastInventorySyncAt?: string | null;
1831
1862
  }
1832
1863
  type RefundType = 'full' | 'partial';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omni-sync-sdk",
3
- "version": "0.18.1",
3
+ "version": "0.18.3",
4
4
  "description": "Official SDK for building e-commerce storefronts with OmniSync Platform. Perfect for vibe-coded sites, AI-built stores (Cursor, Lovable, v0), and custom storefronts.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -16,6 +16,14 @@
16
16
  "dist",
17
17
  "README.md"
18
18
  ],
19
+ "scripts": {
20
+ "build": "tsup src/index.ts --format cjs,esm --dts",
21
+ "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
22
+ "lint": "eslint \"src/**/*.ts\"",
23
+ "test": "vitest run",
24
+ "test:watch": "vitest",
25
+ "prepublishOnly": "pnpm build"
26
+ },
19
27
  "keywords": [
20
28
  "omni-sync",
21
29
  "e-commerce",
@@ -64,12 +72,5 @@
64
72
  "typescript": {
65
73
  "optional": true
66
74
  }
67
- },
68
- "scripts": {
69
- "build": "tsup src/index.ts --format cjs,esm --dts",
70
- "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
71
- "lint": "eslint \"src/**/*.ts\"",
72
- "test": "vitest run",
73
- "test:watch": "vitest"
74
75
  }
75
- }
76
+ }
package/LICENSE DELETED
File without changes