@ai-matrx/vault 0.1.19 → 0.1.21
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 +30 -1
- package/dist/index.cjs +163 -78
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -5
- package/dist/index.d.ts +30 -5
- package/dist/index.js +184 -99
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -152,17 +152,25 @@ declare function siteDomainOf(host: string): string;
|
|
|
152
152
|
* order, then everything never opened by name. Without it `viewed` sorts by name.
|
|
153
153
|
*/
|
|
154
154
|
declare function sortItems(items: readonly VaultItem[], sort: VaultSort, recents?: readonly string[] | null): VaultItem[];
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
label: string;
|
|
158
|
-
value: string;
|
|
155
|
+
/** A secret's automation settings, chosen before it is saved. */
|
|
156
|
+
interface FieldSettingsDraft {
|
|
159
157
|
/** The name sandboxes and workflows find it by (`GITHUB_TOKEN`); absent = none. */
|
|
160
158
|
envKey?: string;
|
|
161
|
-
/** Who may see it; absent = `revealable` (
|
|
159
|
+
/** Who may see it; absent = `revealable` (or what its type declares). */
|
|
162
160
|
handling?: FieldHandling;
|
|
163
161
|
/** Sandboxes get it as an env variable (needs `envKey`). */
|
|
164
162
|
injectIntoSandbox?: boolean;
|
|
165
163
|
}
|
|
164
|
+
interface NewSecretField extends FieldSettingsDraft {
|
|
165
|
+
/** The stored field key; empty = made from the label. */
|
|
166
|
+
key: string;
|
|
167
|
+
label: string;
|
|
168
|
+
value: string;
|
|
169
|
+
/** Several lines (a secure note): edited in a multi-line box. */
|
|
170
|
+
multiline?: boolean;
|
|
171
|
+
/** Plain words stored with the field. */
|
|
172
|
+
description?: string;
|
|
173
|
+
}
|
|
166
174
|
/** How the browser treats a NEW item, chosen before its first save (afterwards: item settings). */
|
|
167
175
|
interface DraftBrowserSettings {
|
|
168
176
|
uriMatchMode: UriMatchMode;
|
|
@@ -186,6 +194,8 @@ interface ItemDraft {
|
|
|
186
194
|
authenticator: string;
|
|
187
195
|
/** New item only: website matching and browser fill chosen before the first save; absent = the defaults. */
|
|
188
196
|
browser?: DraftBrowserSettings;
|
|
197
|
+
/** New item only: env key, who can see it and sandbox use of each declared secret, by field key. */
|
|
198
|
+
fieldSettings?: Record<string, FieldSettingsDraft>;
|
|
189
199
|
}
|
|
190
200
|
|
|
191
201
|
/** One recorded earlier value of a secret field. Value-free: the value comes only from `revealHistory`. */
|
|
@@ -952,6 +962,15 @@ interface RecentsPort {
|
|
|
952
962
|
* anything with a supabase-js style `rpc`. The server API has no endpoint for it (see FEATURE.md),
|
|
953
963
|
* so the HOST supplies it; without it `favorites` and `recents` are absent and their controls hide.
|
|
954
964
|
*/
|
|
965
|
+
/** The one read Trash needs beyond the platform's trash list: each deleted item's type (row security decides what comes back). */
|
|
966
|
+
interface DeletedTypeRead {
|
|
967
|
+
in(column: "id", values: readonly string[]): PromiseLike<{
|
|
968
|
+
data?: unknown;
|
|
969
|
+
error?: {
|
|
970
|
+
message?: string;
|
|
971
|
+
} | null;
|
|
972
|
+
}>;
|
|
973
|
+
}
|
|
955
974
|
interface VaultUserStateDoor {
|
|
956
975
|
rpc(fn: string, args?: Record<string, unknown>): PromiseLike<{
|
|
957
976
|
data?: unknown;
|
|
@@ -959,6 +978,12 @@ interface VaultUserStateDoor {
|
|
|
959
978
|
message?: string;
|
|
960
979
|
} | null;
|
|
961
980
|
}>;
|
|
981
|
+
/** The host's supabase client gives this; without it Trash rows say "Credential" instead of the item's type. */
|
|
982
|
+
schema?(name: "users"): {
|
|
983
|
+
from(table: "credential_items"): {
|
|
984
|
+
select(columns: "id,definition_key"): DeletedTypeRead;
|
|
985
|
+
};
|
|
986
|
+
};
|
|
962
987
|
}
|
|
963
988
|
/** List-level state: trash and restore, favorites, recently opened. */
|
|
964
989
|
interface ListsPort {
|
package/dist/index.d.ts
CHANGED
|
@@ -152,17 +152,25 @@ declare function siteDomainOf(host: string): string;
|
|
|
152
152
|
* order, then everything never opened by name. Without it `viewed` sorts by name.
|
|
153
153
|
*/
|
|
154
154
|
declare function sortItems(items: readonly VaultItem[], sort: VaultSort, recents?: readonly string[] | null): VaultItem[];
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
label: string;
|
|
158
|
-
value: string;
|
|
155
|
+
/** A secret's automation settings, chosen before it is saved. */
|
|
156
|
+
interface FieldSettingsDraft {
|
|
159
157
|
/** The name sandboxes and workflows find it by (`GITHUB_TOKEN`); absent = none. */
|
|
160
158
|
envKey?: string;
|
|
161
|
-
/** Who may see it; absent = `revealable` (
|
|
159
|
+
/** Who may see it; absent = `revealable` (or what its type declares). */
|
|
162
160
|
handling?: FieldHandling;
|
|
163
161
|
/** Sandboxes get it as an env variable (needs `envKey`). */
|
|
164
162
|
injectIntoSandbox?: boolean;
|
|
165
163
|
}
|
|
164
|
+
interface NewSecretField extends FieldSettingsDraft {
|
|
165
|
+
/** The stored field key; empty = made from the label. */
|
|
166
|
+
key: string;
|
|
167
|
+
label: string;
|
|
168
|
+
value: string;
|
|
169
|
+
/** Several lines (a secure note): edited in a multi-line box. */
|
|
170
|
+
multiline?: boolean;
|
|
171
|
+
/** Plain words stored with the field. */
|
|
172
|
+
description?: string;
|
|
173
|
+
}
|
|
166
174
|
/** How the browser treats a NEW item, chosen before its first save (afterwards: item settings). */
|
|
167
175
|
interface DraftBrowserSettings {
|
|
168
176
|
uriMatchMode: UriMatchMode;
|
|
@@ -186,6 +194,8 @@ interface ItemDraft {
|
|
|
186
194
|
authenticator: string;
|
|
187
195
|
/** New item only: website matching and browser fill chosen before the first save; absent = the defaults. */
|
|
188
196
|
browser?: DraftBrowserSettings;
|
|
197
|
+
/** New item only: env key, who can see it and sandbox use of each declared secret, by field key. */
|
|
198
|
+
fieldSettings?: Record<string, FieldSettingsDraft>;
|
|
189
199
|
}
|
|
190
200
|
|
|
191
201
|
/** One recorded earlier value of a secret field. Value-free: the value comes only from `revealHistory`. */
|
|
@@ -952,6 +962,15 @@ interface RecentsPort {
|
|
|
952
962
|
* anything with a supabase-js style `rpc`. The server API has no endpoint for it (see FEATURE.md),
|
|
953
963
|
* so the HOST supplies it; without it `favorites` and `recents` are absent and their controls hide.
|
|
954
964
|
*/
|
|
965
|
+
/** The one read Trash needs beyond the platform's trash list: each deleted item's type (row security decides what comes back). */
|
|
966
|
+
interface DeletedTypeRead {
|
|
967
|
+
in(column: "id", values: readonly string[]): PromiseLike<{
|
|
968
|
+
data?: unknown;
|
|
969
|
+
error?: {
|
|
970
|
+
message?: string;
|
|
971
|
+
} | null;
|
|
972
|
+
}>;
|
|
973
|
+
}
|
|
955
974
|
interface VaultUserStateDoor {
|
|
956
975
|
rpc(fn: string, args?: Record<string, unknown>): PromiseLike<{
|
|
957
976
|
data?: unknown;
|
|
@@ -959,6 +978,12 @@ interface VaultUserStateDoor {
|
|
|
959
978
|
message?: string;
|
|
960
979
|
} | null;
|
|
961
980
|
}>;
|
|
981
|
+
/** The host's supabase client gives this; without it Trash rows say "Credential" instead of the item's type. */
|
|
982
|
+
schema?(name: "users"): {
|
|
983
|
+
from(table: "credential_items"): {
|
|
984
|
+
select(columns: "id,definition_key"): DeletedTypeRead;
|
|
985
|
+
};
|
|
986
|
+
};
|
|
962
987
|
}
|
|
963
988
|
/** List-level state: trash and restore, favorites, recently opened. */
|
|
964
989
|
interface ListsPort {
|