@patchstack/connect 0.3.29 → 0.3.30
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/AGENT-INSTALL.md +37 -21
- package/README.md +24 -10
- package/dist/{chunk-MJOTFUDE.js → chunk-LLKP5EJS.js} +1 -1
- package/dist/chunk-LLKP5EJS.js.map +1 -0
- package/dist/cli.js +1062 -189
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +419 -104
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -9
- package/dist/index.d.ts +28 -9
- package/dist/index.js +412 -97
- package/dist/index.js.map +1 -1
- package/dist/protect/templates/astro-middleware.ts +33 -13
- package/dist/protect/templates/demo-rules.json +2 -3
- package/dist/protect/templates/express-guard.cjs +26 -15
- package/dist/protect/templates/express-guard.js +26 -15
- package/dist/protect/templates/express-guard.ts +33 -16
- package/dist/protect/templates/fastify-plugin.cjs +33 -11
- package/dist/protect/templates/fastify-plugin.js +33 -11
- package/dist/protect/templates/fastify-plugin.ts +40 -12
- package/dist/protect/templates/generic-guard.cjs +28 -12
- package/dist/protect/templates/generic-guard.js +28 -13
- package/dist/protect/templates/generic-guard.ts +41 -20
- package/dist/protect/templates/guard.ts +47 -27
- package/dist/protect/templates/next-middleware.ts +29 -12
- package/dist/protect/templates/nuxt-middleware.ts +29 -12
- package/dist/protect/templates/rules.json +2 -2
- package/dist/protect/templates/sveltekit-hooks.ts +33 -13
- package/dist/protect.cjs +1039 -235
- package/dist/protect.cjs.map +1 -1
- package/dist/protect.d.ts +39 -11
- package/dist/protect.edge.js +663 -132
- package/dist/protect.edge.js.map +4 -4
- package/dist/protect.js +665 -134
- package/dist/protect.js.map +1 -1
- package/dist/{refresh-manifest-VRBE6RH6.js → refresh-manifest-ZSP76JWQ.js} +351 -94
- package/dist/refresh-manifest-ZSP76JWQ.js.map +1 -0
- package/package.json +5 -2
- package/dist/chunk-MJOTFUDE.js.map +0 -1
- package/dist/refresh-manifest-VRBE6RH6.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -74,7 +74,7 @@ declare class PatchstackError extends Error {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
type LockfileFilename = 'package-lock.json' | 'bun.lock' | 'bun.lockb' | 'yarn.lock' | 'pnpm-lock.yaml';
|
|
77
|
-
type DetectionStrategy = 'npm-lockfile' | 'node-modules-walk' | 'pnpm-lockfile' | 'yarn-lockfile';
|
|
77
|
+
type DetectionStrategy = 'npm-lockfile' | 'bun-lockfile' | 'node-modules-walk' | 'pnpm-lockfile' | 'yarn-lockfile';
|
|
78
78
|
interface DetectedLockfile {
|
|
79
79
|
ecosystem: 'npm';
|
|
80
80
|
filePath: string;
|
|
@@ -145,21 +145,40 @@ interface ResolveConfigOptions {
|
|
|
145
145
|
}
|
|
146
146
|
declare function resolveConfig(options: ResolveConfigOptions): Promise<Config>;
|
|
147
147
|
declare function writeConfigFile(cwd: string, config: ConfigFile): Promise<string>;
|
|
148
|
+
/**
|
|
149
|
+
* What happened to the credential file, so a caller can say only what is true.
|
|
150
|
+
*
|
|
151
|
+
* `ignored` is the OUTCOME of the ignore entry, verified by reading the file back — not the fact that a
|
|
152
|
+
* write was attempted. Telling somebody their credential is ignored when it is not is worse than telling
|
|
153
|
+
* them nothing: they stop looking, and a credential committed once is in the history whether or not the
|
|
154
|
+
* file is removed afterwards.
|
|
155
|
+
*/
|
|
156
|
+
interface SecretFileResult {
|
|
157
|
+
/** Absolute path of the credential file. */
|
|
158
|
+
path: string;
|
|
159
|
+
/** True only when `.gitignore` was read back and really covers it. */
|
|
160
|
+
ignored: boolean;
|
|
161
|
+
/** Why not, when it is not — for the caller to print instead of a false assurance. */
|
|
162
|
+
reason?: string;
|
|
163
|
+
}
|
|
148
164
|
/**
|
|
149
165
|
* Merge a new siteUuid into the existing `.patchstackrc.json` (or create it).
|
|
150
166
|
* Preserves any `endpoint` / `timeoutMs` / `apiKey` the user already wrote.
|
|
151
167
|
*/
|
|
152
168
|
declare function persistSiteUuid(cwd: string, siteUuid: string): Promise<string>;
|
|
153
169
|
/**
|
|
154
|
-
* Persist the WP-format api_key issued at provision. Authenticates both the
|
|
155
|
-
*
|
|
156
|
-
*
|
|
170
|
+
* Persist the WP-format api_key issued at provision. Authenticates both the Pulse endpoints and connector
|
|
171
|
+
* log reporting. Never embed it in the public disclosure widget.
|
|
172
|
+
*
|
|
173
|
+
* Written to the credential file, which setup adds to the project's ignore list — the public config is
|
|
174
|
+
* meant to be committed, so a credential in it is a credential in the repository.
|
|
157
175
|
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
176
|
+
* Any copy in the committed config is REMOVED at the same time. Leaving it would mean the value that just
|
|
177
|
+
* got moved is still in the file everyone commits, which is the state this split exists to end. `pulseAuth`
|
|
178
|
+
* goes with it: that field resolves ahead of `apiKey`, so a stale copy would keep authenticating with a
|
|
179
|
+
* credential the server has replaced.
|
|
161
180
|
*/
|
|
162
|
-
declare function persistApiKey(cwd: string, apiKey: string): Promise<
|
|
181
|
+
declare function persistApiKey(cwd: string, apiKey: string): Promise<SecretFileResult>;
|
|
163
182
|
/**
|
|
164
183
|
* Persist a Pulse-specific credential.
|
|
165
184
|
*
|
|
@@ -167,7 +186,7 @@ declare function persistApiKey(cwd: string, apiKey: string): Promise<string>;
|
|
|
167
186
|
* credentials; they share one today, so `persistApiKey` covers both. Retained
|
|
168
187
|
* for callers that separate them.
|
|
169
188
|
*/
|
|
170
|
-
declare function persistPulseAuth(cwd: string, pulseAuth: string): Promise<
|
|
189
|
+
declare function persistPulseAuth(cwd: string, pulseAuth: string): Promise<SecretFileResult>;
|
|
171
190
|
|
|
172
191
|
/**
|
|
173
192
|
* A best-effort description of the stack a build was produced with, derived
|
package/dist/index.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ declare class PatchstackError extends Error {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
type LockfileFilename = 'package-lock.json' | 'bun.lock' | 'bun.lockb' | 'yarn.lock' | 'pnpm-lock.yaml';
|
|
77
|
-
type DetectionStrategy = 'npm-lockfile' | 'node-modules-walk' | 'pnpm-lockfile' | 'yarn-lockfile';
|
|
77
|
+
type DetectionStrategy = 'npm-lockfile' | 'bun-lockfile' | 'node-modules-walk' | 'pnpm-lockfile' | 'yarn-lockfile';
|
|
78
78
|
interface DetectedLockfile {
|
|
79
79
|
ecosystem: 'npm';
|
|
80
80
|
filePath: string;
|
|
@@ -145,21 +145,40 @@ interface ResolveConfigOptions {
|
|
|
145
145
|
}
|
|
146
146
|
declare function resolveConfig(options: ResolveConfigOptions): Promise<Config>;
|
|
147
147
|
declare function writeConfigFile(cwd: string, config: ConfigFile): Promise<string>;
|
|
148
|
+
/**
|
|
149
|
+
* What happened to the credential file, so a caller can say only what is true.
|
|
150
|
+
*
|
|
151
|
+
* `ignored` is the OUTCOME of the ignore entry, verified by reading the file back — not the fact that a
|
|
152
|
+
* write was attempted. Telling somebody their credential is ignored when it is not is worse than telling
|
|
153
|
+
* them nothing: they stop looking, and a credential committed once is in the history whether or not the
|
|
154
|
+
* file is removed afterwards.
|
|
155
|
+
*/
|
|
156
|
+
interface SecretFileResult {
|
|
157
|
+
/** Absolute path of the credential file. */
|
|
158
|
+
path: string;
|
|
159
|
+
/** True only when `.gitignore` was read back and really covers it. */
|
|
160
|
+
ignored: boolean;
|
|
161
|
+
/** Why not, when it is not — for the caller to print instead of a false assurance. */
|
|
162
|
+
reason?: string;
|
|
163
|
+
}
|
|
148
164
|
/**
|
|
149
165
|
* Merge a new siteUuid into the existing `.patchstackrc.json` (or create it).
|
|
150
166
|
* Preserves any `endpoint` / `timeoutMs` / `apiKey` the user already wrote.
|
|
151
167
|
*/
|
|
152
168
|
declare function persistSiteUuid(cwd: string, siteUuid: string): Promise<string>;
|
|
153
169
|
/**
|
|
154
|
-
* Persist the WP-format api_key issued at provision. Authenticates both the
|
|
155
|
-
*
|
|
156
|
-
*
|
|
170
|
+
* Persist the WP-format api_key issued at provision. Authenticates both the Pulse endpoints and connector
|
|
171
|
+
* log reporting. Never embed it in the public disclosure widget.
|
|
172
|
+
*
|
|
173
|
+
* Written to the credential file, which setup adds to the project's ignore list — the public config is
|
|
174
|
+
* meant to be committed, so a credential in it is a credential in the repository.
|
|
157
175
|
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
176
|
+
* Any copy in the committed config is REMOVED at the same time. Leaving it would mean the value that just
|
|
177
|
+
* got moved is still in the file everyone commits, which is the state this split exists to end. `pulseAuth`
|
|
178
|
+
* goes with it: that field resolves ahead of `apiKey`, so a stale copy would keep authenticating with a
|
|
179
|
+
* credential the server has replaced.
|
|
161
180
|
*/
|
|
162
|
-
declare function persistApiKey(cwd: string, apiKey: string): Promise<
|
|
181
|
+
declare function persistApiKey(cwd: string, apiKey: string): Promise<SecretFileResult>;
|
|
163
182
|
/**
|
|
164
183
|
* Persist a Pulse-specific credential.
|
|
165
184
|
*
|
|
@@ -167,7 +186,7 @@ declare function persistApiKey(cwd: string, apiKey: string): Promise<string>;
|
|
|
167
186
|
* credentials; they share one today, so `persistApiKey` covers both. Retained
|
|
168
187
|
* for callers that separate them.
|
|
169
188
|
*/
|
|
170
|
-
declare function persistPulseAuth(cwd: string, pulseAuth: string): Promise<
|
|
189
|
+
declare function persistPulseAuth(cwd: string, pulseAuth: string): Promise<SecretFileResult>;
|
|
171
190
|
|
|
172
191
|
/**
|
|
173
192
|
* A best-effort description of the stack a build was produced with, derived
|