@cimplify/sdk 0.43.0 → 0.44.1

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/mock/msw.mjs CHANGED
@@ -7990,6 +7990,442 @@ function seedGrocery(registry) {
7990
7990
  return { businessId };
7991
7991
  }
7992
7992
 
7993
+ // src/mock/seeds/fashion.ts
7994
+ var ISO8 = "2026-01-01T00:00:00.000Z";
7995
+ var img3 = (id) => `https://images.unsplash.com/photo-${id}?w=900&h=1200&fit=crop&auto=format&q=80`;
7996
+ var PHOTO2 = {
7997
+ "heavyweight-hoodie-charcoal": "1556905055-8f358a7a47b2",
7998
+ "heavyweight-hoodie-cream": "1576566588028-4147f3842f27",
7999
+ "heavyweight-hoodie-cobalt": "1542838686-37da4a9fd1b3",
8000
+ "studio-tee-black": "1521572163474-6864f9cf17ab",
8001
+ "studio-tee-natural": "1485518882345-15568b007407",
8002
+ "graphic-tee-frx-mark": "1521223890158-f9f7c3d5d504",
8003
+ "carbon-bomber": "1591047139829-d91aecb6caea",
8004
+ "field-jacket-olive": "1564859228273-274232fdb516",
8005
+ "wide-leg-trouser": "1542272604-787c3835535d",
8006
+ "track-pant-charcoal": "1604176354204-9268737828e4",
8007
+ "studio-cap": "1620799140408-edc6dcb6d633",
8008
+ "tote-natural": "1591195853828-11db59a44f6b",
8009
+ "knit-beanie": "1542838132-92c53300491e",
8010
+ "studio-sock-3pack": "1602810318383-e386cc2a3ccf"
8011
+ };
8012
+ var photoFor2 = (slug) => img3(PHOTO2[slug] ?? "1556905055-8f358a7a47b2");
8013
+ var SIZES = ["XS", "S", "M", "L", "XL", "2XL"];
8014
+ function seedFashion(registry) {
8015
+ const businessId = "bus_studio_frx";
8016
+ const business = {
8017
+ id: businessId,
8018
+ name: "Studio FRX",
8019
+ handle: "studiofrx",
8020
+ business_type: "retail",
8021
+ email: "hello@studiofrx.test",
8022
+ default_currency: "GHS",
8023
+ default_phone: "+233244000000",
8024
+ default_address: "Osu Oxford Street, Accra",
8025
+ default_offers_table_service: false,
8026
+ default_accepts_online_orders: true,
8027
+ image: img3("1490481651871-ab68de25d43d"),
8028
+ status: "active",
8029
+ created_at: ISO8,
8030
+ updated_at: ISO8,
8031
+ created_by: "seed",
8032
+ preferences: {
8033
+ tagline: "Limited-run streetwear from Accra",
8034
+ description: "Heavyweight cotton, garment-dyed in Tema, hand-screened. Each drop is a closed run \u2014 when it's gone, it's gone.",
8035
+ instagram: "https://instagram.com/studiofrx",
8036
+ theme: "monochrome",
8037
+ checkout: { allow_guest: true }
8038
+ },
8039
+ is_online_only: false,
8040
+ enabled_payment_types: ["card", "mobile_money"],
8041
+ default_location_settings: {},
8042
+ country_code: "GH",
8043
+ timezone: "Africa/Accra"
8044
+ };
8045
+ registry.businesses.put(businessId, business);
8046
+ const categories = [
8047
+ { slug: "new-arrivals", name: "New Arrivals", description: "Just dropped \u2014 the latest from the studio." },
8048
+ { slug: "hoodies", name: "Hoodies", description: "Heavyweight 500gsm, garment-dyed in Tema." },
8049
+ { slug: "tees", name: "Tees", description: "14oz cotton, oversized cut, hand-screened." },
8050
+ { slug: "outerwear", name: "Outerwear", description: "Bombers, field jackets, made for layering." },
8051
+ { slug: "bottoms", name: "Bottoms", description: "Wide-leg trousers and track pants." },
8052
+ { slug: "accessories", name: "Accessories", description: "Caps, totes, beanies, socks." }
8053
+ ];
8054
+ const catIds = /* @__PURE__ */ new Map();
8055
+ for (const c of categories) {
8056
+ const id = `cat_${c.slug}`;
8057
+ catIds.set(c.slug, id);
8058
+ const cat = {
8059
+ id,
8060
+ business_id: businessId,
8061
+ name: c.name,
8062
+ slug: c.slug,
8063
+ description: c.description,
8064
+ product_ids: [],
8065
+ display_order: 0,
8066
+ is_active: true,
8067
+ created_at: ISO8,
8068
+ updated_at: ISO8
8069
+ };
8070
+ registry.categories.put(id, cat);
8071
+ }
8072
+ const products = [
8073
+ // Hoodies
8074
+ {
8075
+ slug: "heavyweight-hoodie-charcoal",
8076
+ name: "Heavyweight Hoodie \xB7 Charcoal",
8077
+ price: "650.00",
8078
+ category: "hoodies",
8079
+ description: "500gsm garment-dyed cotton, hand-screened FRX seal at chest. Numbered run of 600. Oversized fit; size down for regular cut.",
8080
+ tags: ["hoodie", "signature", "drop-04"],
8081
+ isSignature: true
8082
+ },
8083
+ {
8084
+ slug: "heavyweight-hoodie-cream",
8085
+ name: "Heavyweight Hoodie \xB7 Cream",
8086
+ price: "650.00",
8087
+ category: "hoodies",
8088
+ description: "500gsm garment-dyed cotton in natural cream. Numbered run of 600.",
8089
+ tags: ["hoodie", "drop-04"],
8090
+ isNew: true
8091
+ },
8092
+ {
8093
+ slug: "heavyweight-hoodie-cobalt",
8094
+ name: "Heavyweight Hoodie \xB7 Cobalt",
8095
+ price: "650.00",
8096
+ category: "hoodies",
8097
+ description: "Limited cobalt-blue colourway. 500gsm garment-dyed cotton. Numbered run of 200.",
8098
+ tags: ["hoodie", "limited", "drop-04"],
8099
+ isNew: true
8100
+ },
8101
+ // Tees
8102
+ {
8103
+ slug: "studio-tee-black",
8104
+ name: "Studio Tee \xB7 Black",
8105
+ price: "220.00",
8106
+ category: "tees",
8107
+ description: "14oz heavyweight cotton, garment-dyed. Dropped shoulder, oversized fit. The everyday FRX.",
8108
+ tags: ["tee", "signature"],
8109
+ isSignature: true
8110
+ },
8111
+ {
8112
+ slug: "studio-tee-natural",
8113
+ name: "Studio Tee \xB7 Natural",
8114
+ price: "220.00",
8115
+ category: "tees",
8116
+ description: "14oz heavyweight cotton in undyed natural. Softens beautifully with wear.",
8117
+ tags: ["tee"]
8118
+ },
8119
+ {
8120
+ slug: "graphic-tee-frx-mark",
8121
+ name: "Graphic Tee \xB7 FRX Mark",
8122
+ price: "260.00",
8123
+ category: "tees",
8124
+ description: "Hand-screened FRX seal, oversized fit. 14oz cotton. Numbered run of 400.",
8125
+ tags: ["tee", "graphic", "drop-04"],
8126
+ isNew: true
8127
+ },
8128
+ // Outerwear
8129
+ {
8130
+ slug: "carbon-bomber",
8131
+ name: "Carbon Bomber",
8132
+ price: "1200.00",
8133
+ category: "outerwear",
8134
+ description: "Waxed cotton outer, ribbed cuffs, two-way zip. Cut for layering over a hoodie.",
8135
+ tags: ["outerwear", "premium"],
8136
+ isSignature: true
8137
+ },
8138
+ {
8139
+ slug: "field-jacket-olive",
8140
+ name: "Field Jacket \xB7 Olive",
8141
+ price: "1450.00",
8142
+ category: "outerwear",
8143
+ description: "Garment-dyed military canvas, four utility pockets, drawcord hem. A workhorse.",
8144
+ tags: ["outerwear", "premium", "drop-04"],
8145
+ isNew: true
8146
+ },
8147
+ // Bottoms
8148
+ {
8149
+ slug: "wide-leg-trouser",
8150
+ name: "Wide-Leg Trouser",
8151
+ price: "480.00",
8152
+ category: "bottoms",
8153
+ description: "Heavy twill cotton, pleated front, side pockets. Cut for an oversized silhouette.",
8154
+ tags: ["bottom"]
8155
+ },
8156
+ {
8157
+ slug: "track-pant-charcoal",
8158
+ name: "Track Pant \xB7 Charcoal",
8159
+ price: "380.00",
8160
+ category: "bottoms",
8161
+ description: "Heavyweight loopback fleece, tapered leg, elasticated cuffs. The bottom half of the hoodie set.",
8162
+ tags: ["bottom"]
8163
+ },
8164
+ // Accessories
8165
+ {
8166
+ slug: "studio-cap",
8167
+ name: "Studio Cap",
8168
+ price: "120.00",
8169
+ category: "accessories",
8170
+ description: "Brushed cotton 6-panel, embroidered FRX. Adjustable strap.",
8171
+ tags: ["accessory"]
8172
+ },
8173
+ {
8174
+ slug: "tote-natural",
8175
+ name: "Studio Tote \xB7 Natural",
8176
+ price: "150.00",
8177
+ category: "accessories",
8178
+ description: "12oz natural canvas, screen-printed FRX seal. Roomy.",
8179
+ tags: ["accessory"]
8180
+ },
8181
+ {
8182
+ slug: "knit-beanie",
8183
+ name: "Knit Beanie",
8184
+ price: "140.00",
8185
+ category: "accessories",
8186
+ description: "Merino wool blend, woven label. Two colourways.",
8187
+ tags: ["accessory"]
8188
+ },
8189
+ {
8190
+ slug: "studio-sock-3pack",
8191
+ name: "Studio Sock \xB7 3-pack",
8192
+ price: "180.00",
8193
+ category: "accessories",
8194
+ description: "Heavy-cuff crew socks, 3-pack. Cotton-rich blend.",
8195
+ tags: ["accessory"]
8196
+ }
8197
+ ];
8198
+ for (const p of products) {
8199
+ const id = `prod_${p.slug}`;
8200
+ const catId = catIds.get(p.category);
8201
+ const product = {
8202
+ id,
8203
+ business_id: businessId,
8204
+ name: p.name,
8205
+ slug: p.slug,
8206
+ description: p.description,
8207
+ product_type: "product",
8208
+ base_price: p.price,
8209
+ currency: "GHS",
8210
+ image: photoFor2(p.slug),
8211
+ images: [photoFor2(p.slug)],
8212
+ is_available: true,
8213
+ category_ids: [catId],
8214
+ collection_ids: [],
8215
+ add_on_ids: [],
8216
+ variant_ids: [],
8217
+ tags: p.tags ?? [],
8218
+ is_signature: p.isSignature ?? false,
8219
+ is_new: p.isNew ?? false,
8220
+ render_hint: "physical",
8221
+ created_at: ISO8,
8222
+ updated_at: ISO8
8223
+ };
8224
+ registry.products.put(id, product);
8225
+ const cat = registry.categories.get(catId);
8226
+ cat.product_ids.push(id);
8227
+ registry.categories.put(catId, cat);
8228
+ }
8229
+ for (const p of products) {
8230
+ const productId = `prod_${p.slug}`;
8231
+ const axis = {
8232
+ id: `axis_${p.slug}_size`,
8233
+ business_id: businessId,
8234
+ product_id: productId,
8235
+ name: "Size",
8236
+ display_order: 0,
8237
+ affects_recipe: false,
8238
+ values: SIZES.map((s, i) => ({
8239
+ id: `axv_${p.slug}_size_${s.toLowerCase()}`,
8240
+ business_id: businessId,
8241
+ axis_id: `axis_${p.slug}_size`,
8242
+ name: s,
8243
+ display_order: i,
8244
+ created_at: ISO8,
8245
+ updated_at: ISO8
8246
+ })),
8247
+ created_at: ISO8,
8248
+ updated_at: ISO8
8249
+ };
8250
+ registry.variantAxes.put(axis.id, axis);
8251
+ const variantIds = [];
8252
+ let firstVariant = true;
8253
+ for (const sz of axis.values) {
8254
+ const variantId = `var_${p.slug}_size_${sz.name.toLowerCase()}`;
8255
+ const variant = {
8256
+ id: variantId,
8257
+ product_id: productId,
8258
+ business_id: businessId,
8259
+ name: sz.name,
8260
+ sku: `${p.slug.toUpperCase()}-${sz.name}`,
8261
+ price_adjustment: "0.00",
8262
+ component_multiplier: "1.00",
8263
+ is_default: firstVariant,
8264
+ is_active: true,
8265
+ axis_value_ids: [sz.id],
8266
+ created_at: ISO8,
8267
+ updated_at: ISO8
8268
+ };
8269
+ registry.variants.put(variantId, variant);
8270
+ variantIds.push(variantId);
8271
+ firstVariant = false;
8272
+ }
8273
+ const product = registry.products.get(productId);
8274
+ product.variant_ids = variantIds;
8275
+ registry.products.put(productId, product);
8276
+ }
8277
+ const drop04 = {
8278
+ id: "col_drop_04",
8279
+ business_id: businessId,
8280
+ name: "Drop 04",
8281
+ slug: "drop-04",
8282
+ description: "Spring 2026 capsule. 412 pieces left.",
8283
+ product_ids: [
8284
+ "prod_heavyweight-hoodie-charcoal",
8285
+ "prod_heavyweight-hoodie-cream",
8286
+ "prod_heavyweight-hoodie-cobalt",
8287
+ "prod_graphic-tee-frx-mark",
8288
+ "prod_field-jacket-olive"
8289
+ ],
8290
+ is_active: true,
8291
+ created_at: ISO8,
8292
+ updated_at: ISO8
8293
+ };
8294
+ const bestSellers = {
8295
+ id: "col_best_sellers",
8296
+ business_id: businessId,
8297
+ name: "Best Sellers",
8298
+ slug: "best-sellers",
8299
+ description: "What everyone's buying.",
8300
+ product_ids: [
8301
+ "prod_studio-tee-black",
8302
+ "prod_heavyweight-hoodie-charcoal",
8303
+ "prod_carbon-bomber",
8304
+ "prod_studio-cap",
8305
+ "prod_track-pant-charcoal"
8306
+ ],
8307
+ is_active: true,
8308
+ created_at: ISO8,
8309
+ updated_at: ISO8
8310
+ };
8311
+ registry.collections.put(drop04.id, drop04);
8312
+ registry.collections.put(bestSellers.id, bestSellers);
8313
+ for (const col of [drop04, bestSellers]) {
8314
+ for (const pid of col.product_ids) {
8315
+ const p = registry.products.get(pid);
8316
+ if (p) {
8317
+ p.collection_ids.push(col.id);
8318
+ registry.products.put(pid, p);
8319
+ }
8320
+ }
8321
+ }
8322
+ const tags = [
8323
+ { id: "tag_signature", business_id: businessId, name: "Signature", slug: "signature", color: "#0a0a0a", sort_order: 0, usage_count: 3, created_at: ISO8, updated_at: ISO8 },
8324
+ { id: "tag_drop_04", business_id: businessId, name: "Drop 04", slug: "drop-04", color: "#dc2626", sort_order: 1, usage_count: 5, created_at: ISO8, updated_at: ISO8 },
8325
+ { id: "tag_limited", business_id: businessId, name: "Limited", slug: "limited", color: "#dc2626", sort_order: 2, usage_count: 1, created_at: ISO8, updated_at: ISO8 },
8326
+ { id: "tag_premium", business_id: businessId, name: "Premium", slug: "premium", color: "#7c3aed", sort_order: 3, usage_count: 2, created_at: ISO8, updated_at: ISO8 }
8327
+ ];
8328
+ for (const t of tags) registry.tags.put(t.id, t);
8329
+ const apparel = {
8330
+ id: "tax_apparel",
8331
+ business_id: businessId,
8332
+ name: "Apparel",
8333
+ slug: "apparel",
8334
+ path: ["Apparel"],
8335
+ attribute_template_ids: ["attr_fabric", "attr_country_of_origin"],
8336
+ created_at: ISO8,
8337
+ updated_at: ISO8
8338
+ };
8339
+ registry.taxonomies.put(apparel.id, apparel);
8340
+ const attrs = [
8341
+ {
8342
+ id: "attr_fabric",
8343
+ business_id: businessId,
8344
+ namespace: "core",
8345
+ name: "Fabric",
8346
+ slug: "fabric",
8347
+ description: 'Material composition (e.g. "100% cotton, 500gsm").',
8348
+ attribute_type: "text",
8349
+ is_required: false,
8350
+ is_filterable: true,
8351
+ visibility: "public",
8352
+ display_order: 0,
8353
+ applies_to: "product",
8354
+ created_at: ISO8,
8355
+ updated_at: ISO8
8356
+ },
8357
+ {
8358
+ id: "attr_country_of_origin",
8359
+ business_id: businessId,
8360
+ namespace: "core",
8361
+ name: "Country of origin",
8362
+ slug: "country-of-origin",
8363
+ attribute_type: "text",
8364
+ is_required: false,
8365
+ is_filterable: true,
8366
+ visibility: "public",
8367
+ display_order: 1,
8368
+ applies_to: "product",
8369
+ created_at: ISO8,
8370
+ updated_at: ISO8
8371
+ },
8372
+ {
8373
+ id: "attr_fit",
8374
+ business_id: businessId,
8375
+ namespace: "core",
8376
+ name: "Fit",
8377
+ slug: "fit",
8378
+ attribute_type: "single_select",
8379
+ options: ["regular", "oversized", "relaxed", "slim"],
8380
+ is_required: false,
8381
+ is_filterable: true,
8382
+ visibility: "public",
8383
+ display_order: 2,
8384
+ applies_to: "product",
8385
+ created_at: ISO8,
8386
+ updated_at: ISO8
8387
+ }
8388
+ ];
8389
+ for (const a of attrs) registry.attributeDefs.put(a.id, a);
8390
+ const articles = [
8391
+ {
8392
+ id: "kb_sizing",
8393
+ business_id: businessId,
8394
+ title: "Sizing & fit",
8395
+ slug: "sizing",
8396
+ content: "Our pieces are cut for an oversized, dropped-shoulder fit. Order true to size for the intended fit; size down for a regular cut. Charts on every product page.",
8397
+ category: "products",
8398
+ tags: ["sizing", "fit"],
8399
+ created_at: ISO8,
8400
+ updated_at: ISO8
8401
+ },
8402
+ {
8403
+ id: "kb_drops",
8404
+ business_id: businessId,
8405
+ title: "Drops & restocks",
8406
+ slug: "drops",
8407
+ content: "Each drop is a closed, numbered run. We don't restock. The FRX list gets a 24-hour head start before each drop opens to the public.",
8408
+ category: "general",
8409
+ tags: ["drops", "restocks"],
8410
+ created_at: ISO8,
8411
+ updated_at: ISO8
8412
+ },
8413
+ {
8414
+ id: "kb_returns",
8415
+ business_id: businessId,
8416
+ title: "Returns",
8417
+ slug: "returns",
8418
+ content: "Free returns within 30 days from the US, UK, and EU. Item must be unworn with original tags. Underwear and final-sale items aren't returnable.",
8419
+ category: "logistics",
8420
+ tags: ["returns"],
8421
+ created_at: ISO8,
8422
+ updated_at: ISO8
8423
+ }
8424
+ ];
8425
+ for (const a of articles) registry.knowledgeArticles.put(a.id, a);
8426
+ return { businessId };
8427
+ }
8428
+
7993
8429
  // src/mock/seeds/registry.ts
7994
8430
  var SEEDS = {
7995
8431
  default: seedDefault,
@@ -7998,7 +8434,8 @@ var SEEDS = {
7998
8434
  restaurant: seedRestaurant,
7999
8435
  retail: seedRetail,
8000
8436
  services: seedServices,
8001
- grocery: seedGrocery
8437
+ grocery: seedGrocery,
8438
+ fashion: seedFashion
8002
8439
  };
8003
8440
  function applySeed(registry, name) {
8004
8441
  const fn = SEEDS[name];
@@ -883,7 +883,7 @@ interface LiteService {
883
883
  getMenuCategory(categoryId: string): unknown;
884
884
  }
885
885
 
886
- type SeedName = "default" | "empty" | "reesa-storefront" | "restaurant" | "retail" | "services" | "grocery";
886
+ type SeedName = "default" | "empty" | "reesa-storefront" | "restaurant" | "retail" | "services" | "grocery" | "fashion";
887
887
  declare function applySeed(registry: StateRegistry, name: SeedName): {
888
888
  businessId: string;
889
889
  };
@@ -883,7 +883,7 @@ interface LiteService {
883
883
  getMenuCategory(categoryId: string): unknown;
884
884
  }
885
885
 
886
- type SeedName = "default" | "empty" | "reesa-storefront" | "restaurant" | "retail" | "services" | "grocery";
886
+ type SeedName = "default" | "empty" | "reesa-storefront" | "restaurant" | "retail" | "services" | "grocery" | "fashion";
887
887
  declare function applySeed(registry: StateRegistry, name: SeedName): {
888
888
  businessId: string;
889
889
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cimplify/sdk",
3
- "version": "0.43.0",
3
+ "version": "0.44.1",
4
4
  "description": "Cimplify Commerce SDK for storefronts",
5
5
  "keywords": [
6
6
  "cimplify",
@@ -3,9 +3,9 @@
3
3
  "private": true,
4
4
  "version": "0.0.0",
5
5
  "scripts": {
6
- "dev": "concurrently -k -n mock,next -c blue,magenta \"bunx @cimplify/sdk --quiet\" \"next dev\"",
6
+ "dev": "concurrently -k -n mock,next -c blue,magenta \"bunx @cimplify/sdk --seed default --quiet\" \"next dev\"",
7
7
  "dev:storefront": "next dev",
8
- "dev:mock": "bunx @cimplify/sdk",
8
+ "dev:mock": "bunx @cimplify/sdk --seed default",
9
9
  "build": "next build",
10
10
  "start": "next start",
11
11
  "lint": "next lint"
@@ -7,8 +7,8 @@ NEXT_PUBLIC_CIMPLIFY_API_URL=
7
7
  # Tenant public key. The mock accepts any value.
8
8
  NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
9
9
 
10
- # Business id used by the mock seed (retail: Currents Electronics).
11
- NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_currents_electronics
10
+ # Business id used by the mock seed (fashion: Studio FRX).
11
+ NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_studio_frx
12
12
 
13
13
  # Canonical public site URL — used by sitemap.xml, robots.txt, llms.txt,
14
14
  # and OpenGraph metadata. Set this on production deploys (Vercel auto-injects
@@ -510,7 +510,7 @@ export const brand: Brand = {
510
510
  },
511
511
 
512
512
  mock: {
513
- seed: "retail",
514
- businessId: "bus_currents_electronics",
513
+ seed: "fashion",
514
+ businessId: "bus_studio_frx",
515
515
  },
516
516
  };
@@ -3,15 +3,15 @@
3
3
  "private": true,
4
4
  "version": "0.0.0",
5
5
  "scripts": {
6
- "dev": "concurrently -k -n mock,next -c blue,magenta \"bunx @cimplify/sdk --seed retail --quiet\" \"next dev\"",
6
+ "dev": "concurrently -k -n mock,next -c blue,magenta \"bunx @cimplify/sdk --seed fashion --quiet\" \"next dev\"",
7
7
  "dev:storefront": "next dev",
8
- "dev:mock": "bunx @cimplify/sdk --seed retail",
8
+ "dev:mock": "bunx @cimplify/sdk --seed fashion",
9
9
  "build": "next build",
10
10
  "start": "next start",
11
11
  "lint": "next lint"
12
12
  },
13
13
  "dependencies": {
14
- "@cimplify/sdk": "^0.40.1",
14
+ "@cimplify/sdk": "^0.43.0",
15
15
  "next": "^16.2.4",
16
16
  "react": "^19.0.0",
17
17
  "react-dom": "^19.0.0"