musora-content-services 2.186.1 → 2.188.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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [2.188.0](https://github.com/railroadmedia/musora-content-services/compare/v2.187.0...v2.188.0) (2026-10-20)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **MU2-2024:** add brand filtering to promotional campaign queries ([0d6fed8](https://github.com/railroadmedia/musora-content-services/commit/0d6fed83329ccfeabab2ddbd6dff129075c1207b))
|
|
11
|
+
|
|
12
|
+
## [2.187.0](https://github.com/railroadmedia/musora-content-services/compare/v2.186.1...v2.187.0) (2026-10-19)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **MU2-2024:** add disclaimer to the promotional campaign placement type ([9905117](https://github.com/railroadmedia/musora-content-services/commit/990511777622eca93758b5252c908900e484b6f5))
|
|
18
|
+
|
|
5
19
|
### [2.186.1](https://github.com/railroadmedia/musora-content-services/compare/v2.186.0...v2.186.1) (2026-10-19)
|
|
6
20
|
|
|
7
21
|
|
package/package.json
CHANGED
package/src/lib/brands.ts
CHANGED
|
@@ -99,6 +99,7 @@ export type PromotionalCampaignDocument = {
|
|
|
99
99
|
_createdAt: string
|
|
100
100
|
_updatedAt: string
|
|
101
101
|
_rev: string
|
|
102
|
+
brand: "musora" | "drumeo" | "pianote" | "singeo" | "guitareo" | "playbass"
|
|
102
103
|
/** Campaign Name */
|
|
103
104
|
name: string
|
|
104
105
|
slug: { _type: "slug"; current: string }
|
|
@@ -115,6 +116,7 @@ export type PromotionalCampaignDocument = {
|
|
|
115
116
|
key: string
|
|
116
117
|
title?: string
|
|
117
118
|
body?: string
|
|
119
|
+
disclaimer?: string
|
|
118
120
|
/** Resolved to a CDN url by the promotions query projection. */
|
|
119
121
|
dark_mode_image?: string
|
|
120
122
|
/** Resolved to a CDN url by the promotions query projection. */
|
|
@@ -5,8 +5,8 @@ import { Filters as f } from '../../lib/sanity/filter'
|
|
|
5
5
|
import { groq } from '../../lib/sanity/groq'
|
|
6
6
|
import type { GroqBuilder } from '../../lib/sanity/groq'
|
|
7
7
|
import type { PromotionalCampaignDocument } from '../../lib/sanity/types/marketing'
|
|
8
|
-
import { SanityQueryError } from '../../lib/sanity/runner'
|
|
9
8
|
import { AsyncEither } from '../../lib/ads/async-either'
|
|
9
|
+
import { Brand } from '../../lib/brands'
|
|
10
10
|
|
|
11
11
|
const excludeFromGeneratedIndex = [
|
|
12
12
|
'campaignQuery',
|
|
@@ -36,6 +36,8 @@ export type WithUserCampaignState<T extends PromotionalCampaignDocument> = T & {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export interface CampaignQueryOptions {
|
|
39
|
+
/** Restricts the query to one brand's campaigns. */
|
|
40
|
+
brand?: Brand
|
|
39
41
|
/** Restricts the query to one campaign, or to any of several. */
|
|
40
42
|
slug?: string | string[]
|
|
41
43
|
/** The moment the campaign window is tested against. Defaults to now. */
|
|
@@ -78,12 +80,13 @@ function slugFilter(slug: CampaignQueryOptions['slug']): string {
|
|
|
78
80
|
export function campaignQuery(
|
|
79
81
|
options: CampaignQueryOptions = {}
|
|
80
82
|
): GroqBuilder<PromotionalCampaignDocument[]> {
|
|
81
|
-
const { slug, on = new Date(), running = true, active = true } = options
|
|
83
|
+
const { brand, slug, on = new Date(), running = true, active = true } = options
|
|
82
84
|
|
|
83
85
|
return groq<PromotionalCampaignDocument[]>()
|
|
84
86
|
.and(
|
|
85
87
|
f.combine(
|
|
86
88
|
f.type('promotional-campaign'),
|
|
89
|
+
brand && f.brand(brand),
|
|
87
90
|
active && f.flag('active'),
|
|
88
91
|
running && f.dateWithin('starts_at', 'ends_at', on.toISOString()),
|
|
89
92
|
slugFilter(slug)
|
package/src/version-info.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const MCS_VERSION = '2.
|
|
1
|
+
export const MCS_VERSION = '2.188.0'
|