ugly-app 0.1.768 → 0.1.769
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/cli/version.d.ts +1 -1
- package/dist/cli/version.js +1 -1
- package/dist/server/adapter/publishFrame.d.ts +11 -0
- package/dist/server/adapter/publishFrame.d.ts.map +1 -1
- package/dist/server/adapter/publishFrame.js +19 -0
- package/dist/server/adapter/publishFrame.js.map +1 -1
- package/package.json +2 -1
- package/src/cli/version.ts +1 -1
- package/src/server/adapter/publishFrame.ts +25 -0
package/dist/cli/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CLI_VERSION = "0.1.
|
|
1
|
+
export declare const CLI_VERSION = "0.1.769";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/cli/version.js
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
export declare function publishFrame(topic: string, frame: unknown, streamId?: string): void;
|
|
2
|
+
/**
|
|
3
|
+
* Escape a pub/sub topic token identically to `escapeNatsToken` (NatsStore.ts)
|
|
4
|
+
* and the Workers `do-collection.ts` key filter, so a published frame lands on
|
|
5
|
+
* the exact subject a `trackDocs({ keys })` subscription reads. Duplicated here
|
|
6
|
+
* (like do-collection does) so this module stays nats-free — its only dep is the
|
|
7
|
+
* pure `singleton`, making it safe to import from BOTH the Node and Workers
|
|
8
|
+
* builds (it pulls neither the `nats` package nor Durable Object globals).
|
|
9
|
+
*/
|
|
10
|
+
export declare function escapeTopicToken(token: string): string;
|
|
11
|
+
/** Build a key-channel topic: `dbkey.<collection>.<field>.<escaped value>`. */
|
|
12
|
+
export declare function keyChannelTopic(collection: string, field: string, value: string): string;
|
|
2
13
|
//# sourceMappingURL=publishFrame.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publishFrame.d.ts","sourceRoot":"","sources":["../../../src/server/adapter/publishFrame.ts"],"names":[],"mappings":"AAiBA,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,OAAO,EACd,QAAQ,SAAK,GACZ,IAAI,CAEN"}
|
|
1
|
+
{"version":3,"file":"publishFrame.d.ts","sourceRoot":"","sources":["../../../src/server/adapter/publishFrame.ts"],"names":[],"mappings":"AAiBA,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,OAAO,EACd,QAAQ,SAAK,GACZ,IAAI,CAEN;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMtD;AAED,+EAA+E;AAC/E,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,MAAM,CAER"}
|
|
@@ -17,4 +17,23 @@ import { getAdapter } from './singleton.js';
|
|
|
17
17
|
export function publishFrame(topic, frame, streamId = '') {
|
|
18
18
|
void getAdapter().pubsub.publish(topic, { type: 'frame', streamId, frame });
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Escape a pub/sub topic token identically to `escapeNatsToken` (NatsStore.ts)
|
|
22
|
+
* and the Workers `do-collection.ts` key filter, so a published frame lands on
|
|
23
|
+
* the exact subject a `trackDocs({ keys })` subscription reads. Duplicated here
|
|
24
|
+
* (like do-collection does) so this module stays nats-free — its only dep is the
|
|
25
|
+
* pure `singleton`, making it safe to import from BOTH the Node and Workers
|
|
26
|
+
* builds (it pulls neither the `nats` package nor Durable Object globals).
|
|
27
|
+
*/
|
|
28
|
+
export function escapeTopicToken(token) {
|
|
29
|
+
return token
|
|
30
|
+
.replace(/\./g, '_DOT_')
|
|
31
|
+
.replace(/\+/g, '_PLUS_')
|
|
32
|
+
.replace(/\*/g, '_STAR_')
|
|
33
|
+
.replace(/>/g, '_GT_');
|
|
34
|
+
}
|
|
35
|
+
/** Build a key-channel topic: `dbkey.<collection>.<field>.<escaped value>`. */
|
|
36
|
+
export function keyChannelTopic(collection, field, value) {
|
|
37
|
+
return `dbkey.${collection}.${field}.${escapeTopicToken(value)}`;
|
|
38
|
+
}
|
|
20
39
|
//# sourceMappingURL=publishFrame.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publishFrame.js","sourceRoot":"","sources":["../../../src/server/adapter/publishFrame.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,YAAY,CAC1B,KAAa,EACb,KAAc,EACd,QAAQ,GAAG,EAAE;IAEb,KAAK,UAAU,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;AAC9E,CAAC"}
|
|
1
|
+
{"version":3,"file":"publishFrame.js","sourceRoot":"","sources":["../../../src/server/adapter/publishFrame.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,YAAY,CAC1B,KAAa,EACb,KAAc,EACd,QAAQ,GAAG,EAAE;IAEb,KAAK,UAAU,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;AAC9E,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,OAAO,KAAK;SACT,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC;SACvB,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC;SACxB,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC;SACxB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC3B,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,eAAe,CAC7B,UAAkB,EAClB,KAAa,EACb,KAAa;IAEb,OAAO,SAAS,UAAU,IAAI,KAAK,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;AACnE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ugly-app",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.769",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"comment:files": "Allowlist what ships to npm. dist = runtime; src = sourcemap targets (dist/*.js.map reference ../../src/); templates = CLI scaffold. Everything else at repo root (.pgdata local Postgres, coverage, assets/icons sources, test/, test-results/) is excluded by omission. The !negations strip the scaffold's installed deps + cruft (templates/node_modules is 200MB+ and must never ship). package.json/README/LICENSE ship automatically.",
|
|
6
6
|
"files": [
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
".": "./dist/server/index.js",
|
|
19
19
|
"./server": "./dist/server/index.js",
|
|
20
20
|
"./server/adapter/workers": "./dist/server/adapter/workers/index.js",
|
|
21
|
+
"./server/publishFrame": "./dist/server/adapter/publishFrame.js",
|
|
21
22
|
"./shared": "./dist/shared/index.js",
|
|
22
23
|
"./cli/publish": "./dist/cli/publish/orchestrator.js",
|
|
23
24
|
"./cli/publish/types": "./dist/cli/publish/types.js",
|
package/src/cli/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Auto-generated by prebuild — do not edit manually
|
|
2
|
-
export const CLI_VERSION = "0.1.
|
|
2
|
+
export const CLI_VERSION = "0.1.769";
|
|
@@ -22,3 +22,28 @@ export function publishFrame(
|
|
|
22
22
|
): void {
|
|
23
23
|
void getAdapter().pubsub.publish(topic, { type: 'frame', streamId, frame });
|
|
24
24
|
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Escape a pub/sub topic token identically to `escapeNatsToken` (NatsStore.ts)
|
|
28
|
+
* and the Workers `do-collection.ts` key filter, so a published frame lands on
|
|
29
|
+
* the exact subject a `trackDocs({ keys })` subscription reads. Duplicated here
|
|
30
|
+
* (like do-collection does) so this module stays nats-free — its only dep is the
|
|
31
|
+
* pure `singleton`, making it safe to import from BOTH the Node and Workers
|
|
32
|
+
* builds (it pulls neither the `nats` package nor Durable Object globals).
|
|
33
|
+
*/
|
|
34
|
+
export function escapeTopicToken(token: string): string {
|
|
35
|
+
return token
|
|
36
|
+
.replace(/\./g, '_DOT_')
|
|
37
|
+
.replace(/\+/g, '_PLUS_')
|
|
38
|
+
.replace(/\*/g, '_STAR_')
|
|
39
|
+
.replace(/>/g, '_GT_');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Build a key-channel topic: `dbkey.<collection>.<field>.<escaped value>`. */
|
|
43
|
+
export function keyChannelTopic(
|
|
44
|
+
collection: string,
|
|
45
|
+
field: string,
|
|
46
|
+
value: string,
|
|
47
|
+
): string {
|
|
48
|
+
return `dbkey.${collection}.${field}.${escapeTopicToken(value)}`;
|
|
49
|
+
}
|