@pikku/inspector 0.12.92 → 0.12.94

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,3 +1,27 @@
1
+ ## 0.12.94
2
+
3
+ ### Patch Changes
4
+
5
+ - 4323bcf: Inline wiring functions now record their source file, so `pikku release` leaves scaffold-injected ones out of the API surface.
6
+
7
+ ## 0.12.93
8
+
9
+ ### Patch Changes
10
+
11
+ - 658f047: A function whose services are all singletons no longer builds wire services, so an addon's credential-bound wire factory does not run for, or fail, a webhook `receive` step that needs no connection. The inspector decides this from the `Services` type and records it as `singletonServicesOnly` on the function's runtime meta; the runner only reads the flag.
12
+ - 658f047: Webhook signing secrets live in the credential store. `WebhookSigningSecret.fromCredential(provider, credentialService, name)` reads the secret per delivery via `load()`, so a `setup` step (or a handshake) that stores a new one with `credentialService.set` takes effect without a deploy.
13
+
14
+ Breaking: `setup` no longer returns `secret`, `wireTriggerWebhookSource` no longer takes `secret`, lifecycle outcomes drop `secretName`/`secret`, and `pikku webhooks setup` drops `--secretsOut`.
15
+
16
+ - 658f047: A webhook source's `method` may be a list, mounting one route per method, for providers that verify the URL with a GET and deliver events with a POST (WhatsApp, Strava, Onfleet, Mailchimp), or a HEAD (Trello, Mandrill, SurveyMonkey).
17
+ - Updated dependencies [658f047]
18
+ - Updated dependencies [de63ab2]
19
+ - Updated dependencies [658f047]
20
+ - Updated dependencies [658f047]
21
+ - Updated dependencies [658f047]
22
+ - Updated dependencies [658f047]
23
+ - @pikku/core@0.12.128
24
+
1
25
  ## 0.12.92
2
26
 
3
27
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  import * as ts from 'typescript';
2
- import { getPropertyValue, getCommonWireMetaData, } from '../utils/get-property-value.js';
2
+ import { getArrayPropertyValue, getPropertyValue, getCommonWireMetaData, } from '../utils/get-property-value.js';
3
3
  import { extractFunctionName, makeContextBasedId, } from '../utils/extract-function-name.js';
4
4
  import { getPropertyAssignmentInitializer } from '../utils/type-utils.js';
5
5
  import { ensureInlineWiringFunction } from '../utils/ensure-function-metadata.js';
@@ -114,9 +114,10 @@ const addWireTriggerWebhookSource = (logger, node, checker, state, firstArg) =>
114
114
  logger.critical(ErrorCode.MISSING_NAME, `wireTriggerWebhookSource in ${node.getSourceFile().fileName} needs 'name' as a string literal.`);
115
115
  return;
116
116
  }
117
- const method = getPropertyValue(obj, 'method') ?? 'post';
117
+ const method = getArrayPropertyValue(obj, 'method') ??
118
+ getPropertyValue(obj, 'method') ??
119
+ 'post';
118
120
  const route = getPropertyValue(obj, 'route') ?? `/webhooks/${name}`;
119
- let secret = getPropertyValue(obj, 'secret');
120
121
  const eventsInitializer = getPropertyAssignmentInitializer(obj, 'events', false, checker);
121
122
  const events = eventsInitializer
122
123
  ? checker
@@ -151,23 +152,11 @@ const addWireTriggerWebhookSource = (logger, node, checker, state, firstArg) =>
151
152
  steps[step] = pikkuFuncId;
152
153
  state.serviceAggregation.usedFunctions.add(pikkuFuncId);
153
154
  }
154
- // An addon's receive reads the secret by its own name; the app may have
155
- // renamed it for this instance.
156
- const namespace = steps.receive?.includes(':')
157
- ? steps.receive.slice(0, steps.receive.indexOf(':'))
158
- : null;
159
- const addon = namespace
160
- ? state.rpc.wireAddonDeclarations.get(namespace)
161
- : undefined;
162
- if (secret && addon?.secretOverrides?.[secret]) {
163
- secret = addon.secretOverrides[secret];
164
- }
165
155
  const meta = {
166
156
  name,
167
157
  method: method,
168
158
  route,
169
159
  events,
170
- ...(secret ? { secret } : {}),
171
160
  ...steps,
172
161
  };
173
162
  state.triggers.webhookSourceMeta[name] = meta;
@@ -176,6 +176,9 @@ export function ensureFunctionMetadata(state, pikkuFuncId, fallbackName, funcIni
176
176
  };
177
177
  }
178
178
  const meta = state.functions.meta[pikkuFuncId];
179
+ if (!meta.sourceFile && funcInitializer) {
180
+ meta.sourceFile = funcInitializer.getSourceFile().fileName;
181
+ }
179
182
  if (funcInitializer && checker) {
180
183
  let pikkuFuncCall = null;
181
184
  if (ts.isCallExpression(funcInitializer)) {
@@ -94,6 +94,24 @@ function extractAllServices(state) {
94
94
  state.serviceAggregation.allWireServices = extractTypeKeys(servicesType)
95
95
  .filter((name) => !singletonSet.has(name))
96
96
  .sort();
97
+ markSingletonServicesOnly(state, new Set(state.serviceAggregation.allWireServices));
98
+ }
99
+ }
100
+ /**
101
+ * Marks the functions that never read a wire service, so the runner can skip
102
+ * `createWireServices` for them. Only called once the `Services` type has
103
+ * resolved: an unresolved type yields no wire services, which would otherwise
104
+ * mark every function.
105
+ */
106
+ function markSingletonServicesOnly(state, wireServices) {
107
+ for (const meta of Object.values(state.functions.meta)) {
108
+ if (meta.services?.optimized &&
109
+ !meta.services.services.some((name) => wireServices.has(name))) {
110
+ meta.singletonServicesOnly = true;
111
+ }
112
+ else {
113
+ delete meta.singletonServicesOnly;
114
+ }
97
115
  }
98
116
  }
99
117
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/inspector",
3
- "version": "0.12.92",
3
+ "version": "0.12.94",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/pikkujs/pikku.git",
@@ -54,10 +54,10 @@
54
54
  "zod": "^4.4.3"
55
55
  },
56
56
  "peerDependencies": {
57
- "@pikku/core": "^0.12.127"
57
+ "@pikku/core": "^0.12.128"
58
58
  },
59
59
  "devDependencies": {
60
- "@pikku/core": "^0.12.127",
60
+ "@pikku/core": "^0.12.128",
61
61
  "@types/node": "^24.13.3"
62
62
  },
63
63
  "engines": {