@mondaydotcomorg/z2h-shared-utils 0.5.0 → 0.6.1

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.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/index.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/index.test.ts"],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- export * from './secrets';
1
+ export { ALWAYS_ON_CHANNELS, DECLARED_INTEGRATIONS, type AlwaysOnChannel, type DeclaredIntegration, } from './integrations';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,mBAAmB,GACzB,MAAM,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- export { decryptSecret, encryptSecret } from './secrets/secret-cipher.mjs';
1
+ export { ALWAYS_ON_CHANNELS, DECLARED_INTEGRATIONS } from './integrations.mjs';
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Backend channels surfaced as `ctx.api.v1.<name>`.
3
+ *
4
+ * Always-on channels need no OAuth and are never declared — the runner builds
5
+ * them for every app regardless of what its handlers touch.
6
+ */
7
+ export declare const ALWAYS_ON_CHANNELS: readonly ["db", "llm", "snowflake"];
8
+ export type AlwaysOnChannel = (typeof ALWAYS_ON_CHANNELS)[number];
9
+ /**
10
+ * Declared (OAuth-gated) integrations: closed set the CLI detects from handler
11
+ * sources and the broker validates on register/update.
12
+ */
13
+ export declare const DECLARED_INTEGRATIONS: readonly ["monday"];
14
+ export type DeclaredIntegration = (typeof DECLARED_INTEGRATIONS)[number];
15
+ //# sourceMappingURL=integrations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../src/integrations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,qCAAsC,CAAC;AACtE,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,qBAAsB,CAAC;AACzD,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Backend channels surfaced as `ctx.api.v1.<name>`.
3
+ *
4
+ * Always-on channels need no OAuth and are never declared — the runner builds
5
+ * them for every app regardless of what its handlers touch.
6
+ */
7
+ const ALWAYS_ON_CHANNELS = ['db', 'llm', 'snowflake'];
8
+ /**
9
+ * Declared (OAuth-gated) integrations: closed set the CLI detects from handler
10
+ * sources and the broker validates on register/update.
11
+ */
12
+ const DECLARED_INTEGRATIONS = ['monday'];
13
+
14
+ export { ALWAYS_ON_CHANNELS, DECLARED_INTEGRATIONS };
@@ -72,5 +72,6 @@ export declare const Z2hAgentEvents: {
72
72
  /** BI events tracked in `z2h-cli`. */
73
73
  export declare const Z2hCliEvents: {
74
74
  readonly error: "z2h_cli_error";
75
+ readonly handlerParseError: "z2h_cli_handler_parse_error";
75
76
  };
76
77
  //# sourceMappingURL=events.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/observability/events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCtB,CAAC;AAEX,iEAAiE;AACjE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;CAmBnB,CAAC;AAEX,oDAAoD;AACpD,eAAO,MAAM,cAAc;;;;;;;;CAQjB,CAAC;AAEX,sCAAsC;AACtC,eAAO,MAAM,YAAY;;CAEf,CAAC"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/observability/events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCtB,CAAC;AAEX,iEAAiE;AACjE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;CAmBnB,CAAC;AAEX,oDAAoD;AACpD,eAAO,MAAM,cAAc;;;;;;;;CAQjB,CAAC;AAEX,sCAAsC;AACtC,eAAO,MAAM,YAAY;;;CAGf,CAAC"}
@@ -72,6 +72,7 @@ const Z2hAgentEvents = {
72
72
  /** BI events tracked in `z2h-cli`. */
73
73
  const Z2hCliEvents = {
74
74
  error: 'z2h_cli_error',
75
+ handlerParseError: 'z2h_cli_handler_parse_error',
75
76
  };
76
77
 
77
78
  export { BackendRunnerEvents, Z2hAgentEvents, Z2hCliEvents, Z2hServiceEvents };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './secrets';
1
+ export { ALWAYS_ON_CHANNELS, DECLARED_INTEGRATIONS, type AlwaysOnChannel, type DeclaredIntegration, } from './integrations';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,mBAAmB,GACzB,MAAM,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
- const secrets_secretCipher = require('./secrets/secret-cipher.js');
3
+ const integrations = require('./integrations.js');
4
4
 
5
5
 
6
6
 
7
- exports.decryptSecret = secrets_secretCipher.decryptSecret;
8
- exports.encryptSecret = secrets_secretCipher.encryptSecret;
7
+ exports.ALWAYS_ON_CHANNELS = integrations.ALWAYS_ON_CHANNELS;
8
+ exports.DECLARED_INTEGRATIONS = integrations.DECLARED_INTEGRATIONS;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Backend channels surfaced as `ctx.api.v1.<name>`.
3
+ *
4
+ * Always-on channels need no OAuth and are never declared — the runner builds
5
+ * them for every app regardless of what its handlers touch.
6
+ */
7
+ export declare const ALWAYS_ON_CHANNELS: readonly ["db", "llm", "snowflake"];
8
+ export type AlwaysOnChannel = (typeof ALWAYS_ON_CHANNELS)[number];
9
+ /**
10
+ * Declared (OAuth-gated) integrations: closed set the CLI detects from handler
11
+ * sources and the broker validates on register/update.
12
+ */
13
+ export declare const DECLARED_INTEGRATIONS: readonly ["monday"];
14
+ export type DeclaredIntegration = (typeof DECLARED_INTEGRATIONS)[number];
15
+ //# sourceMappingURL=integrations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../src/integrations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,qCAAsC,CAAC;AACtE,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,qBAAsB,CAAC;AACzD,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ /**
4
+ * Backend channels surfaced as `ctx.api.v1.<name>`.
5
+ *
6
+ * Always-on channels need no OAuth and are never declared — the runner builds
7
+ * them for every app regardless of what its handlers touch.
8
+ */
9
+ const ALWAYS_ON_CHANNELS = ['db', 'llm', 'snowflake'];
10
+ /**
11
+ * Declared (OAuth-gated) integrations: closed set the CLI detects from handler
12
+ * sources and the broker validates on register/update.
13
+ */
14
+ const DECLARED_INTEGRATIONS = ['monday'];
15
+
16
+ exports.ALWAYS_ON_CHANNELS = ALWAYS_ON_CHANNELS;
17
+ exports.DECLARED_INTEGRATIONS = DECLARED_INTEGRATIONS;
@@ -72,5 +72,6 @@ export declare const Z2hAgentEvents: {
72
72
  /** BI events tracked in `z2h-cli`. */
73
73
  export declare const Z2hCliEvents: {
74
74
  readonly error: "z2h_cli_error";
75
+ readonly handlerParseError: "z2h_cli_handler_parse_error";
75
76
  };
76
77
  //# sourceMappingURL=events.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/observability/events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCtB,CAAC;AAEX,iEAAiE;AACjE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;CAmBnB,CAAC;AAEX,oDAAoD;AACpD,eAAO,MAAM,cAAc;;;;;;;;CAQjB,CAAC;AAEX,sCAAsC;AACtC,eAAO,MAAM,YAAY;;CAEf,CAAC"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/observability/events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCtB,CAAC;AAEX,iEAAiE;AACjE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;CAmBnB,CAAC;AAEX,oDAAoD;AACpD,eAAO,MAAM,cAAc;;;;;;;;CAQjB,CAAC;AAEX,sCAAsC;AACtC,eAAO,MAAM,YAAY;;;CAGf,CAAC"}
@@ -74,6 +74,7 @@ const Z2hAgentEvents = {
74
74
  /** BI events tracked in `z2h-cli`. */
75
75
  const Z2hCliEvents = {
76
76
  error: 'z2h_cli_error',
77
+ handlerParseError: 'z2h_cli_handler_parse_error',
77
78
  };
78
79
 
79
80
  exports.BackendRunnerEvents = BackendRunnerEvents;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mondaydotcomorg/z2h-shared-utils",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {
@@ -29,6 +29,11 @@
29
29
  "require": "./dist/dashboardTemplateHooks.js",
30
30
  "types": "./dist/dashboardTemplateHooks.d.ts"
31
31
  },
32
+ "./secrets": {
33
+ "import": "./dist/esm/secrets/index.mjs",
34
+ "require": "./dist/secrets/index.js",
35
+ "types": "./dist/secrets/index.d.ts"
36
+ },
32
37
  "./package.json": "./package.json"
33
38
  },
34
39
  "nx": {
@@ -0,0 +1,13 @@
1
+ import { describe, expect, it } from 'vitest';
2
+
3
+ // The root barrel is loaded by consumers (e.g. z2h-cli) that never install
4
+ // the optional peer dep `@mondaydotcomorg/trident-backend-api`. Anything that
5
+ // imports it (secrets/*) must stay off this barrel and live behind its own
6
+ // subpath export instead - see package.json `exports`.
7
+ describe('root barrel', () => {
8
+ it('does not re-export secrets/', async () => {
9
+ const barrel = await import('../index');
10
+ expect(barrel).not.toHaveProperty('encryptSecret');
11
+ expect(barrel).not.toHaveProperty('decryptSecret');
12
+ });
13
+ });
package/src/index.ts CHANGED
@@ -1 +1,6 @@
1
- export * from './secrets';
1
+ export {
2
+ ALWAYS_ON_CHANNELS,
3
+ DECLARED_INTEGRATIONS,
4
+ type AlwaysOnChannel,
5
+ type DeclaredIntegration,
6
+ } from './integrations';
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Backend channels surfaced as `ctx.api.v1.<name>`.
3
+ *
4
+ * Always-on channels need no OAuth and are never declared — the runner builds
5
+ * them for every app regardless of what its handlers touch.
6
+ */
7
+ export const ALWAYS_ON_CHANNELS = ['db', 'llm', 'snowflake'] as const;
8
+ export type AlwaysOnChannel = (typeof ALWAYS_ON_CHANNELS)[number];
9
+
10
+ /**
11
+ * Declared (OAuth-gated) integrations: closed set the CLI detects from handler
12
+ * sources and the broker validates on register/update.
13
+ */
14
+ export const DECLARED_INTEGRATIONS = ['monday'] as const;
15
+ export type DeclaredIntegration = (typeof DECLARED_INTEGRATIONS)[number];
@@ -75,4 +75,5 @@ export const Z2hAgentEvents = {
75
75
  /** BI events tracked in `z2h-cli`. */
76
76
  export const Z2hCliEvents = {
77
77
  error: 'z2h_cli_error',
78
+ handlerParseError: 'z2h_cli_handler_parse_error',
78
79
  } as const;