Skip to content

Commit 06bd044

Browse files
committed
pryv@3.3.0 + lockstep bumps: drop pryv.cmc.*, add utils.decomposeAPIEndpoint
pryv@3.3.0 slim-down: the pryv.cmc.* namespace moves to a new sibling package @pryv/cmc@1.0.0 (separate commit). The sole consumer of the pre-existing v3.2.0 pryv.cmc.* surface (hds-macro) is still on pryv@3.0.4 and informed directly, so no deprecation shim is shipped. Removed - components/pryv/src/cmc.js + components/pryv/test/cmc.test.js. - pryv.cmc namespace + types from index.d.ts (was never on master -- only on three unmerged commits 39dfba9 / 589e2d4 / ff55697 that this session reset away). Nothing to remove from index.d.ts proper. - pryv.cmc export from components/pryv/src/index.js. Added - pryv.utils.decomposeAPIEndpoint(apiEndpoint, serviceInfoApi) decomposes a Pryv apiEndpoint into { token, username, host } by inverting the platform's service.info.api template (subdomain vs path-style). Returns the canonical platform host (no <username>. subdomain prefix) -- the identity cross-account features key on, regardless of which user the endpoint belongs to. Previously pryv.cmc.extractActor; promoted to utils for general use. - DecomposedAPIEndpoint type exposed in index.d.ts. - [UTLM] decomposeAPIEndpoint tests (4 cases). Lockstep bumps - @pryv/monitor 3.2.0 -> 3.3.0 (no code change). - @pryv/socket.io 3.2.0 -> 3.3.0 (no code change). Tests: pryv 177/0, @pryv/monitor 24/0.
1 parent 7598a8a commit 06bd044

11 files changed

Lines changed: 214 additions & 545 deletions

File tree

CHANGELOG.md

Lines changed: 57 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,63 @@
22

33
<!-- Format based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -->
44

5-
## [3.2.0-pre.1]
6-
7-
CMC (Cross-account Messaging & Consent) client-side helpers (open-pryv.io ≥ 2.0.0-pre.X).
8-
9-
### Added
10-
- `pryv.cmc` namespace exposing the slug + stream-id helpers that mirror the server-side CMC plugin so apps can construct stream-ids deterministically:
11-
- **Namespace constants**`NS` (`:_cmc:`), `NS_INBOX`, `NS_APPS`, `NS_INTERNAL`, `NS_INTERNAL_RETRIES`.
12-
- **Event-type constants**`ET_REQUEST`, `ET_ACCEPT`, `ET_REFUSE`, `ET_REVOKE`, `ET_CHAT`, `ET_SYSTEM_ALERT`, `ET_SYSTEM_ACK`, `ET_SYSTEM_SCOPE_REQUEST`, `ET_SYSTEM_SCOPE_UPDATE`. Grouped collections `EVENT_TYPES_LIFECYCLE` / `EVENT_TYPES_CHAT` / `EVENT_TYPES_SYSTEM`.
13-
- **Slug helpers**`slugifyHost(host)`, `counterpartySlug({ username, host })``<username>--<host-slug>`, `parseCounterpartySlug(slug)``{ username, hostSlug }`.
14-
- **Stream-id builders**`appScope(appCode)`, `chatsParentUnder(scope)`, `chatStreamUnder(scope, slug)`, `collectorsParentUnder(scope)`, `collectorStreamUnder(scope, slug)`.
15-
- **Classification + parsing**`isCmcStreamId(id)`, `isAppNestedPluginStream(id)`, `getAppCode(id)`, `parseChatStreamId(id)`, `parseCollectorStreamId(id)`.
16-
17-
### Notes
18-
- Client + server use the same algorithms for slug + stream-id construction, so writes from this lib land on the same canonical paths the plugin auto-creates at acceptance.
19-
- All helpers are pure functions; no network calls. Use `pryv.Connection` for the actual `events.create` / `accesses.create` calls.
5+
## [3.3.0]
6+
7+
Lockstep release of `pryv@3.3.0` + `@pryv/monitor@3.3.0` +
8+
`@pryv/socket.io@3.3.0`, plus the new sibling package
9+
`@pryv/cmc@1.0.0`.
10+
11+
### `pryv@3.3.0`
12+
13+
#### Removed
14+
- `pryv.cmc.*` namespace (slug helpers, stream-id builders, event-type
15+
constants, classifiers, `extractActor`). Moved to the new sibling
16+
package `@pryv/cmc@1.0.0`. The single consumer of `pryv.cmc.*`
17+
(hds-macro) was still on `pryv@3.0.4` at the time of this release;
18+
no migration shim was added. Apps using `pryv.cmc.*` from a
19+
hypothetical `npm install pryv@3.2.0` should `npm install @pryv/cmc`
20+
and replace `pryv.cmc.X` with `cmc.X` via
21+
`const cmc = require('@pryv/cmc')`.
22+
23+
#### Added
24+
- `pryv.utils.decomposeAPIEndpoint(apiEndpoint, serviceInfoApi)`
25+
decomposes a Pryv apiEndpoint into `{ token, username, host }` by
26+
inverting the platform's `service.info.api` URL template (subdomain
27+
vs path-style). Returns the **canonical platform host** (no
28+
`<username>.` subdomain prefix) — the identity cross-account
29+
features (e.g. CMC counterparty slugs) key on, regardless of which
30+
user the endpoint belongs to. Previously available as
31+
`pryv.cmc.extractActor` (now in `@pryv/cmc`); promoted to `utils`
32+
since it's generally useful for any caller mixing subdomain and
33+
path-style topologies. Return shape typed as
34+
`pryv.DecomposedAPIEndpoint`.
35+
36+
### `@pryv/cmc@1.0.0` (NEW)
37+
38+
New sibling package — see `components/pryv-cmc/README.md` (and the
39+
inline JSDoc) for the full Level-0 + Level-1 surface.
40+
41+
- **Level-0** — moved verbatim from `pryv.cmc.*`: namespace + event-type
42+
constants, slug helpers (`slugifyHost` / `counterpartySlug` /
43+
`parseCounterpartySlug`), stream-id builders, classifiers, parsers,
44+
and the typed `errorIds` catalogue + new `CmcError` class.
45+
- **Level-1** — protocol functions on top of `pryv.Connection`:
46+
`createInvite`, `listInvites`, `getInviteStatus`, `revokeRelationship`,
47+
`invalidateCapability`, `requestScopeUpdate`, `readOffer`,
48+
`acceptInvite` (default-waits for trigger `status: 'completed'`, opt
49+
out with `waitForCompletion: false`), `refuseInvite`,
50+
`revokeAcceptance`, `listAcceptedRelationships`, `sendChat`,
51+
`sendSystemAlert`, `sendSystemAck`, `acceptScopeUpdate`,
52+
`refuseScopeUpdate`.
53+
- **Observation scopes**`scopes.inbox()`, `scopes.chats(...)`,
54+
`scopes.collectors(...)` return `{ streams: [...] }` objects ready to
55+
hand to `new pryv.Monitor(conn, scope)`.
56+
- Peer-depends on `pryv@^3.3.0`. Targets Node ≥ 20.
57+
58+
### `@pryv/monitor@3.3.0`, `@pryv/socket.io@3.3.0`
59+
60+
- No code changes. Versions bumped in lockstep with `pryv@3.3.0` so the
61+
three companion packages stay aligned on a single release line.
2062

2163
## [3.1.0]
2264

components/pryv-monitor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pryv/monitor",
3-
"version": "3.2.0",
3+
"version": "3.3.0",
44
"description": "Extends `pryv` with event-driven notifications for changes on a Pryv.io account",
55
"keywords": [
66
"Pryv",

components/pryv-socket.io/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pryv/socket.io",
3-
"version": "3.2.0",
3+
"version": "3.3.0",
44
"description": "Extends `pryv` with Socket.IO transport",
55
"keywords": [
66
"Pryv",

components/pryv/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pryv",
3-
"version": "3.2.0",
3+
"version": "3.3.0",
44
"description": "Pryv JavaScript library",
55
"keywords": [
66
"Pryv",

0 commit comments

Comments
 (0)