@snowcone-app/sdk 0.27.0 → 0.27.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.27.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#4488](https://github.com/snowcone-app/snowcone-monorepo/pull/4488) [`72cfddc`](https://github.com/snowcone-app/snowcone-monorepo/commit/72cfddc99569dda4ead08c07c11a8af9fc711f2b) Thanks [@kevinsproles](https://github.com/kevinsproles)! - `mockupRole` is an allowlist. A mockup is `ordinary` only when it carries no `linkedAs`, and `'size-picture'` holds its size's role. Any other mark, such as `'size-picture-released'` (a pattern picture that handed its size's role to a lay-flat) or a later role, is `other`: never shown in the gallery and never returned by an ordinary-picture lookup.
8
+
3
9
  ## 0.27.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -184,7 +184,8 @@ var CatalogProductSchema = import_zod.z.object({
184
184
  ar: import_zod.z.number(),
185
185
  gvids: import_zod.z.array(import_zod.z.string()),
186
186
  // Kept through a successful parse (zod strips undeclared keys): the PDP shows one size picture, the chosen size's.
187
- linkedAs: import_zod.z.literal("size-picture").optional()
187
+ // Any mark is kept (a parse must not strip it): only an absent one is an ordinary picture (mockupRole.ts).
188
+ linkedAs: import_zod.z.string().optional()
188
189
  })
189
190
  ).optional(),
190
191
  options: import_zod.z.object({
@@ -1080,7 +1081,9 @@ function bffSigner(endpoint = "/api/sign", opts) {
1080
1081
  // src/mockup/mockupRole.ts
1081
1082
  var SIZE_PICTURE = "size-picture";
1082
1083
  function mockupRole(m) {
1083
- return m?.linkedAs === SIZE_PICTURE ? SIZE_PICTURE : "ordinary";
1084
+ const mark = m?.linkedAs;
1085
+ if (mark === void 0 || mark === null || mark === "") return "ordinary";
1086
+ return mark === SIZE_PICTURE ? SIZE_PICTURE : "other";
1084
1087
  }
1085
1088
  function ordinaryMockups(mockups) {
1086
1089
  return (mockups ?? []).filter((m) => mockupRole(m) === "ordinary");
package/dist/index.d.cts CHANGED
@@ -24,9 +24,9 @@ interface CatalogProduct {
24
24
  [k: string]: string;
25
25
  };
26
26
  /**
27
- * What this mockup is on the product page. 'size-picture': the picture of ONE size (its gvids are that size). The gallery shows only the chosen size's one, last; ordinary-picture lookups (a variant's picture, a card) never return it. Absent on ordinary mockups.
27
+ * What this mockup is on the product page. 'size-picture': the picture of ONE size (its gvids are that size). The gallery shows only the chosen size's one, last; ordinary-picture lookups (a variant's picture, a card) never return it. 'size-picture-released': a picture that handed its size's role to another (never shown, never an ordinary picture). Absent on ordinary mockups.
28
28
  */
29
- linkedAs?: "size-picture";
29
+ linkedAs?: "size-picture" | "size-picture-released";
30
30
  }[];
31
31
  options?: {
32
32
  selected?: {
@@ -485,7 +485,13 @@ declare function bffSigner(endpoint?: string, opts?: BffSignerOptions): (url: st
485
485
  * branded list, so code that forgot the filter does not type-check where an ordinary list is required.
486
486
  */
487
487
  declare const SIZE_PICTURE: "size-picture";
488
- type MockupRole = "ordinary" | typeof SIZE_PICTURE;
488
+ /**
489
+ * `ordinary` ONLY when the mockup carries no `linkedAs` (an allowlist): any other value is never an ordinary picture.
490
+ * `size-picture` holds the role for its size; `other` is every other mark, e.g. 'size-picture-released' (a pattern
491
+ * picture that handed its size's role to a lay-flat, rendercenter linker #4487) or a role added later: never shown in
492
+ * the gallery, never returned by an ordinary-picture lookup.
493
+ */
494
+ type MockupRole = "ordinary" | typeof SIZE_PICTURE | "other";
489
495
  type WithRole = {
490
496
  id?: unknown;
491
497
  linkedAs?: unknown;
package/dist/index.d.ts CHANGED
@@ -24,9 +24,9 @@ interface CatalogProduct {
24
24
  [k: string]: string;
25
25
  };
26
26
  /**
27
- * What this mockup is on the product page. 'size-picture': the picture of ONE size (its gvids are that size). The gallery shows only the chosen size's one, last; ordinary-picture lookups (a variant's picture, a card) never return it. Absent on ordinary mockups.
27
+ * What this mockup is on the product page. 'size-picture': the picture of ONE size (its gvids are that size). The gallery shows only the chosen size's one, last; ordinary-picture lookups (a variant's picture, a card) never return it. 'size-picture-released': a picture that handed its size's role to another (never shown, never an ordinary picture). Absent on ordinary mockups.
28
28
  */
29
- linkedAs?: "size-picture";
29
+ linkedAs?: "size-picture" | "size-picture-released";
30
30
  }[];
31
31
  options?: {
32
32
  selected?: {
@@ -485,7 +485,13 @@ declare function bffSigner(endpoint?: string, opts?: BffSignerOptions): (url: st
485
485
  * branded list, so code that forgot the filter does not type-check where an ordinary list is required.
486
486
  */
487
487
  declare const SIZE_PICTURE: "size-picture";
488
- type MockupRole = "ordinary" | typeof SIZE_PICTURE;
488
+ /**
489
+ * `ordinary` ONLY when the mockup carries no `linkedAs` (an allowlist): any other value is never an ordinary picture.
490
+ * `size-picture` holds the role for its size; `other` is every other mark, e.g. 'size-picture-released' (a pattern
491
+ * picture that handed its size's role to a lay-flat, rendercenter linker #4487) or a role added later: never shown in
492
+ * the gallery, never returned by an ordinary-picture lookup.
493
+ */
494
+ type MockupRole = "ordinary" | typeof SIZE_PICTURE | "other";
489
495
  type WithRole = {
490
496
  id?: unknown;
491
497
  linkedAs?: unknown;
package/dist/index.js CHANGED
@@ -29,7 +29,8 @@ var CatalogProductSchema = z.object({
29
29
  ar: z.number(),
30
30
  gvids: z.array(z.string()),
31
31
  // Kept through a successful parse (zod strips undeclared keys): the PDP shows one size picture, the chosen size's.
32
- linkedAs: z.literal("size-picture").optional()
32
+ // Any mark is kept (a parse must not strip it): only an absent one is an ordinary picture (mockupRole.ts).
33
+ linkedAs: z.string().optional()
33
34
  })
34
35
  ).optional(),
35
36
  options: z.object({
@@ -638,7 +639,9 @@ function bffSigner(endpoint = "/api/sign", opts) {
638
639
  // src/mockup/mockupRole.ts
639
640
  var SIZE_PICTURE = "size-picture";
640
641
  function mockupRole(m) {
641
- return m?.linkedAs === SIZE_PICTURE ? SIZE_PICTURE : "ordinary";
642
+ const mark = m?.linkedAs;
643
+ if (mark === void 0 || mark === null || mark === "") return "ordinary";
644
+ return mark === SIZE_PICTURE ? SIZE_PICTURE : "other";
642
645
  }
643
646
  function ordinaryMockups(mockups) {
644
647
  return (mockups ?? []).filter((m) => mockupRole(m) === "ordinary");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snowcone-app/sdk",
3
- "version": "0.27.0",
3
+ "version": "0.27.1",
4
4
  "description": "Snowcone SDK for product mockups and print-on-demand",
5
5
  "keywords": [
6
6
  "merch",