@stanterprise/protobuf 0.0.6 → 0.0.7

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/lib/index.ts CHANGED
@@ -1,5 +1,45 @@
1
- export { google as google_protobuf } from "./google/protobuf/timestamp";
2
- export { testsystem as testsystem_v1_common } from "./testsystem/v1/common/common";
3
- export { testsystem as testsystem_v1_entities } from "./testsystem/v1/entities/entities";
4
- export { testsystem as testsystem_v1_events } from "./testsystem/v1/events/events";
5
- export { testsystem as testsystem_v1_observer } from "./testsystem/v1/observer/observer";
1
+ // AUTO-COPIED FROM scripts/static-lib-index.ts
2
+ // DO NOT EDIT GENERATED lib/index.ts DIRECTLY
3
+ // scripts/static-lib-index.ts
4
+ // Source of truth for merged protobuf namespaces barrel (copied to lib/index.ts after generation)
5
+ // Update when adding new testsystem packages.
6
+
7
+ import * as googleTimestamp from '../lib/google/protobuf/timestamp';
8
+ import * as testsystemCommon from '../lib/testsystem/v1/common/common';
9
+ import * as testsystemEntities from '../lib/testsystem/v1/entities/entities';
10
+ import * as testsystemEvents from '../lib/testsystem/v1/events/events';
11
+ import * as testsystemObserver from '../lib/testsystem/v1/observer/observer';
12
+
13
+ type TestsystemNS = typeof testsystemCommon.testsystem &
14
+ typeof testsystemEntities.testsystem &
15
+ typeof testsystemEvents.testsystem &
16
+ typeof testsystemObserver.testsystem;
17
+
18
+ type PlainObject = Record<string, unknown>;
19
+
20
+ function isPlainObject(o: unknown): o is PlainObject {
21
+ return !!o && Object.prototype.toString.call(o) === '[object Object]';
22
+ }
23
+ function mergeNamespace<T extends PlainObject, S extends PlainObject>(target: T, source: S): T & S {
24
+ for (const k of Object.keys(source)) {
25
+ const key = k as keyof S & string;
26
+ const sv = source[key];
27
+ const tv = (target as PlainObject)[key];
28
+ if (isPlainObject(tv) && isPlainObject(sv))
29
+ mergeNamespace(tv as PlainObject, sv as PlainObject);
30
+ else (target as PlainObject)[key] = sv as unknown;
31
+ }
32
+ return target as T & S;
33
+ }
34
+ const testsystem: TestsystemNS = mergeNamespace(
35
+ mergeNamespace(
36
+ mergeNamespace(
37
+ mergeNamespace({}, testsystemCommon.testsystem as PlainObject),
38
+ testsystemEntities.testsystem as PlainObject
39
+ ),
40
+ testsystemEvents.testsystem as PlainObject
41
+ ),
42
+ testsystemObserver.testsystem as PlainObject
43
+ ) as TestsystemNS;
44
+ export { testsystem };
45
+ export const google = googleTimestamp.google;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stanterprise/protobuf",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Generated Protobuf code",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",