@objectstack/service-analytics 17.0.0 → 17.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,254 @@
1
1
  # Changelog — @objectstack/service-analytics
2
2
 
3
+ ## 17.1.0
4
+
5
+ ### Patch Changes
6
+
7
+ - d09d0fd: Source the comparand-type allow-list and the accepted-set refusal sentence from the shared `@objectstack/spec/data` door instead of re-spelling them locally.
8
+
9
+ `comparand-shape.ts`'s `isBindableComparand` / `isRenderableTextComparand` spelled the same six accepted comparand types (`string | number | bigint | boolean | null | Date`) that `isAcceptedFilterComparand` single-sources for the SQL driver family, and two refusal messages hand-copied the accepted-set sentence. Both predicates now delegate the type membership to the door and quote `ACCEPTED_FILTER_COMPARAND_TYPES_SENTENCE`, matching how `driver-sql` and `driver-turso` consume it.
10
+
11
+ No comparand is accepted or refused differently: the local copies already agreed with the door, and the full accept/refuse matrix is pinned end to end at both analytics filter doors, in three comparand positions each, measured before the change and re-run unchanged after it.
12
+
13
+ One user-visible wording correction falls out of removing the copy: the hand-copied sentence omitted `bigint`, a type both predicates have always accepted and both doors have always compiled, so a refusal message under-described the values it accepts. The message now names the full set. The package-local extras — a binary bindable, and the `undefined` arm both doors already refuse upstream — are unchanged and recorded at their use sites.
14
+ - 0425db9: Published READMEs link to the docs site in the one form that works on npm, on GitHub and on the docs site (#9632)
15
+
16
+ **Seven docs links in these READMEs pointed nowhere.** They were spelled as a repo
17
+ path rooted at `/` — `[Flows](/content/docs/automation/flows.mdx)` — and a README in a
18
+ package's `files` array with `private` unset is rendered on the **npm package page** and
19
+ on **GitHub**, not only in this repository. There a root-relative href resolves against
20
+ `npmjs.com` and `github.com` respectively. It was not a docs-site route either:
21
+ `apps/docs/lib/source.ts` mounts `loader({ baseUrl: '/docs' })` over `content/docs`, so
22
+ the route for that first link is `/docs/automation/flows`, and `apps/docs/redirects.mjs`
23
+ carries no `/content` source that would rescue the written form. Every target page
24
+ existed and every one of them was reachable — only the links were not.
25
+
26
+ All seven now use the absolute form the repo had already established in
27
+ `create-objectstack`'s published READMEs: `https://docs.objectstack.ai/docs/...`, with
28
+ the path taken under `content/docs` and the page extension dropped, because the route
29
+ carries none. Each target was re-verified at the route level rather than as a file — the
30
+ two that named a **directory** (`/content/docs/automation/`,
31
+ `/content/docs/references/automation/`) resolve only because those directories carry an
32
+ `index.mdx`; a directory without one is a 404, not a section.
33
+
34
+ **Two more links in the same class were converted in the same pass.**
35
+ `service-knowledge` and `knowledge-ragflow` pointed at
36
+ `../../../content/docs/protocol/knowledge.mdx`. Those relative paths do resolve on both
37
+ GitHub and npm, so they are a milder defect than the seven — but they land the reader on
38
+ **raw MDX source** instead of the rendered page. They now point at the rendered page as
39
+ well. `service-knowledge`'s link text changed with it: it was the source filename in a
40
+ code span, which stops being an honest label once the destination is the page.
41
+
42
+ No API, behaviour or type surface changes — this is the published documentation these
43
+ packages ship.
44
+ - f01c0ee: docs: five published service READMEs stop documenting an API that does not exist (#9532)
45
+
46
+ A version bump is the point, not a side effect: these five READMEs are in their
47
+ packages' `files` arrays with `private` unset, so they are the pages npm renders —
48
+ and a docs-only fix with no bump never reaches npm at all.
49
+
50
+ Each of the five told a reader to an import of a `Service…` class from its own package
51
+ and call a static `.configure({...})` on it. Neither has ever existed: no class in
52
+ this repo exposes a static `configure`, and none of `ServiceAnalytics`,
53
+ `ServiceAutomation`, `ServiceCache`, `ServiceI18n` or `ServiceJob` is exported by
54
+ anything. A reader following any of them wrote code that could not compile. The real
55
+ entry point in every case is a kernel plugin constructed with `new`:
56
+ `AnalyticsServicePlugin`, `AutomationServicePlugin`, `CacheServicePlugin`,
57
+ `I18nServicePlugin`, `JobServicePlugin`.
58
+
59
+ ⛔ A name swap alone would not have been enough, and the gate landed in #9546 is what
60
+ proves it: substituting the genuine class while keeping `.configure(...)` turns the
61
+ import finding into a call-site finding rather than into silence. Each README is
62
+ rewritten against the package's built type surface, and each package's entry is
63
+ deleted from `scripts/published-readme-exports.baseline.json` in the same change
64
+ (the baseline is reconciled in both directions, so a stale entry fails too).
65
+
66
+ What was removed as fabricated, beyond the entry point:
67
+
68
+ - **service-analytics** — a nine-endpoint REST surface (`/analytics/count`, `/sum`,
69
+ `/avg`, `/min`, `/max`, `/group-by`, `/time-series`, `/metrics`, `/metrics/:name`)
70
+ of which none exists; the real surface is `POST /analytics/query`,
71
+ `GET /analytics/meta`, `POST /analytics/sql` and `POST /analytics/dataset/query`.
72
+ Also removed: `defineMetric`, `getMetric`, `compare`, `funnel`,
73
+ `executeDashboard`, `invalidateCache`, and an `AnalyticsServiceConfig` block whose
74
+ four keys (`defaultDriver`, `enableCaching`, `cacheTTL`, `maxMemoryResults`) are
75
+ none of the real ones.
76
+ - **service-automation** — `executeFlow`/`getFlow`/`listFlows`/`getFlowHistory`/
77
+ `registerTrigger` as the contract (the real contract is `execute(flowName, context?)`
78
+ plus `listFlows()` and a set of optional members), and a five-endpoint REST list that
79
+ matches no mounted route. The flow-authoring half of that README was already accurate
80
+ and is kept.
81
+ - **service-cache** — `mget`/`mset`/`del`/`delPattern`/`namespace`/`ttl`/`expire`/
82
+ `persist`/`incr`/`incrby`/`decr`/`getOrSet`/`invalidateTag`/`resetStats`, none of
83
+ which exist; `ICacheService` has six members. `CacheStats.keys`/`hitRate` corrected to
84
+ `keyCount` (there is no `hitRate`), and `set(key, value, { ttl })` corrected to the
85
+ real positional `set(key, value, ttl?)` in seconds.
86
+ - **service-i18n** — an `await i18n.t('ns:key')` dialect with namespaces, plural
87
+ suffixes, `context`, `returnObjects`, `setLocale`/`getLocale`, `formatDate`/
88
+ `formatNumber`/`formatRelative`, `addLocale`/`removeLocale`/`reload`, `getCoverage`/
89
+ `getMissingKeys`, and a `{{lng}}/{{ns}}` file layout. The real `t()` is synchronous
90
+ and takes the locale positionally — `t(key, locale, params?)` — over one
91
+ `{locale}.json` file per locale. The `POST /i18n/translate` endpoint does not exist.
92
+ - **service-job** — `scheduleInterval`/`scheduleOnce`/`getJob`/`stopJob`/`resumeJob`/
93
+ `deleteJob`/`runNow`/`getJobHistory`/`clearHistory`/`getLastExecution`, and a
94
+ `schedule({ name, schedule, handler })` options-object call. The real `schedule` is
95
+ positional — `schedule(name, schedule, handler, options?)` — and returns `void`.
96
+ Retry defaults corrected to the enforced ones (`maxRetries: 0`,
97
+ `backoffMultiplier: 1`).
98
+
99
+ Two capability claims are corrected rather than deleted, because the source is what
100
+ decides:
101
+
102
+ - **service-cache** advertised Redis as production support. `RedisCacheAdapter` throws
103
+ `RedisCacheAdapter not yet implemented` from every method, and
104
+ `new CacheServicePlugin({ adapter: 'redis' })` throws during `init` rather than
105
+ falling back to memory. The README now says so at the top and points at registering
106
+ a custom `ICacheService` under the slot instead.
107
+ - **service-job**'s `adapter: 'interval'` stores cron registrations that never fire.
108
+ That is now stated in the adapter table rather than left for a reader to discover.
109
+
110
+ No compliance claim (SOC 2 / HIPAA / GDPR or similar) was found in any of the five —
111
+ the shape that raised `plugin-audit`'s severity in #9517 is absent here.
112
+ - 402c125: fix(objectql): a temporal filter comparand the platform cannot interpret is refused at the engine door instead of answering 200 with zero rows (#8690)
113
+
114
+ <!-- adr-0087: not-required (no-migration-prescription) Nothing authorable is
115
+ renamed, retired or tombstoned — no spec schema is touched at all. The change
116
+ is a new runtime refusal at the engine's filter collection point, plus the
117
+ routing decline that stops the raw-SQL analytics path bypassing it. -->
118
+
119
+ A `datetime` / `date` / `time` field filtered with a bare string the platform
120
+ cannot read — `last_30_days`, `not-a-date-at-all` — was bound **as written**
121
+ all the way to the driver, where the comparison is false for every row. The
122
+ caller received `HTTP 200`, an empty result set, and nothing to indicate the
123
+ filter was meaningless. An unknown `{placeholder}` in the same position was
124
+ already refused loudly (`FILTER_TOKEN_UNKNOWN` / 400, listing the resolvable
125
+ tokens), so one API answered two shapes of unusable comparand two different
126
+ ways.
127
+
128
+ It is concretely reachable rather than theoretical: `last_7_days` /
129
+ `last_30_days` / `last_90_days` are **declared preset names** in the dashboard
130
+ schema. The shipped console lowers them to `{N_days_ago}` macros before they
131
+ reach the API, so the console path was always safe — but a saved report, an
132
+ integration, an MCP client or an AI-authored query sends the preset name itself
133
+ and got a silent zero. An empty chart is the hardest failure to debug: it is
134
+ indistinguishable from "there is genuinely no data".
135
+
136
+ Such a comparand is now refused at the ObjectQL engine's single filter
137
+ collection point, with `code: 'INVALID_FILTER'` and `status: 400`, naming the
138
+ field, the value, the key path and the spellings that would work. That seam is
139
+ the one place holding the caller's comparand and the field's **declared type**
140
+ at the same moment, and every verb (`find` / `findOne` / `count` / `aggregate`
141
+ / `update` / `delete`) and both filter spellings (the array sugar and the
142
+ lowered condition) pass through it, so all four backends inherit one answer
143
+ rather than four. `NativeSQLStrategy` additionally **declines** such a query so
144
+ the raw-SQL analytics path falls through to that door instead of binding the
145
+ value into its own statement.
146
+
147
+ Deliberately unchanged, each by ruling: a `{placeholder}` keeps its existing
148
+ refusal one layer down (the door runs before token resolution and steps around
149
+ them, so `{30_days_ago}` still resolves normally); non-string comparands are
150
+ untouched (a number is epoch milliseconds, a `Date` is an instant); and the
151
+ **empty string** keeps today's behaviour exactly — it binds as `''` and matches
152
+ every non-null row, which is a separate question that remains its own card.
153
+ - Updated dependencies [56656aa]
154
+ - Updated dependencies [07e630e]
155
+ - Updated dependencies [2f65b1b]
156
+ - Updated dependencies [720ee95]
157
+ - Updated dependencies [f287435]
158
+ - Updated dependencies [2782805]
159
+ - Updated dependencies [e43d63a]
160
+ - Updated dependencies [9aa8890]
161
+ - Updated dependencies [7c9c1dd]
162
+ - Updated dependencies [75b7c24]
163
+ - Updated dependencies [d5552ca]
164
+ - Updated dependencies [d9813a9]
165
+ - Updated dependencies [8640fb2]
166
+ - Updated dependencies [2420641]
167
+ - Updated dependencies [2ad91c3]
168
+ - Updated dependencies [f57fb38]
169
+ - Updated dependencies [00777a0]
170
+ - Updated dependencies [d491625]
171
+ - Updated dependencies [2d0af57]
172
+ - Updated dependencies [420804d]
173
+ - Updated dependencies [716ac9b]
174
+ - Updated dependencies [a38408a]
175
+ - Updated dependencies [62b1427]
176
+ - Updated dependencies [7ea1372]
177
+ - Updated dependencies [23abe27]
178
+ - Updated dependencies [985a9cd]
179
+ - Updated dependencies [5f5e234]
180
+ - Updated dependencies [a8189ae]
181
+ - Updated dependencies [26e70fb]
182
+ - Updated dependencies [27a567d]
183
+ - Updated dependencies [42b05af]
184
+ - Updated dependencies [2b292ce]
185
+ - Updated dependencies [abcf853]
186
+ - Updated dependencies [8b9eba5]
187
+ - Updated dependencies [d575779]
188
+ - Updated dependencies [94f7ef8]
189
+ - Updated dependencies [c5ac5e4]
190
+ - Updated dependencies [a777944]
191
+ - Updated dependencies [dd88e1c]
192
+ - Updated dependencies [856527c]
193
+ - Updated dependencies [870f710]
194
+ - Updated dependencies [79c46da]
195
+ - Updated dependencies [7ff3975]
196
+ - Updated dependencies [29d055b]
197
+ - Updated dependencies [65589d6]
198
+ - Updated dependencies [2c86fe3]
199
+ - Updated dependencies [e196c6a]
200
+ - Updated dependencies [24173e9]
201
+ - Updated dependencies [4ab7523]
202
+ - Updated dependencies [19539b4]
203
+ - Updated dependencies [f8eb736]
204
+ - Updated dependencies [11b779e]
205
+ - Updated dependencies [739fe5b]
206
+ - Updated dependencies [4bfe1a5]
207
+ - Updated dependencies [2065e31]
208
+ - Updated dependencies [b69d0f5]
209
+ - Updated dependencies [4d47afe]
210
+ - Updated dependencies [e4e5c6e]
211
+ - Updated dependencies [9a56784]
212
+ - Updated dependencies [d00d2f6]
213
+ - Updated dependencies [df0c12d]
214
+ - Updated dependencies [d31785f]
215
+ - Updated dependencies [c308a4f]
216
+ - Updated dependencies [e2899f6]
217
+ - Updated dependencies [3851f87]
218
+ - Updated dependencies [2a29caa]
219
+ - Updated dependencies [09a6eee]
220
+ - Updated dependencies [1a7f907]
221
+ - Updated dependencies [cd455c8]
222
+ - Updated dependencies [e1bb0ca]
223
+ - Updated dependencies [30d3752]
224
+ - Updated dependencies [c80e7ae]
225
+ - Updated dependencies [09a9a8a]
226
+ - Updated dependencies [07026cf]
227
+ - Updated dependencies [5d4f3d5]
228
+ - Updated dependencies [4d80e8b]
229
+ - Updated dependencies [30b1c63]
230
+ - Updated dependencies [079b457]
231
+ - Updated dependencies [e43b211]
232
+ - Updated dependencies [890b38f]
233
+ - Updated dependencies [8bee54b]
234
+ - Updated dependencies [7a537ce]
235
+ - Updated dependencies [593c4bf]
236
+ - Updated dependencies [ff08691]
237
+ - Updated dependencies [60e0f90]
238
+ - Updated dependencies [90c5285]
239
+ - Updated dependencies [402c125]
240
+ - Updated dependencies [7901b2d]
241
+ - Updated dependencies [56bca91]
242
+ - Updated dependencies [79394d7]
243
+ - Updated dependencies [730fd9a]
244
+ - Updated dependencies [44bc51d]
245
+ - Updated dependencies [bbbfcfc]
246
+ - Updated dependencies [73cfddf]
247
+ - Updated dependencies [d634e66]
248
+ - @objectstack/spec@17.1.0
249
+ - @objectstack/types@17.1.0
250
+ - @objectstack/core@17.1.0
251
+
3
252
  ## 17.0.0
4
253
 
5
254
  ### Major Changes