Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tailor-platform/function-types",
"version": "0.2.0",
"version": "0.3.0",
"description": "TypeScript types for Tailor Platform Function service",
"repository": {
"type": "git",
Expand Down
26 changes: 21 additions & 5 deletions packages/types/tailor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,24 @@ declare const tailordb: {
};

declare namespace tailor.secretmanager {
// getSecrets returns multiple secret objects(key=name, value=secret) at once according to vault, names
function getSecrets(vault: string, names: string[]): Promise<Record<string, string>>
// getSecret returns a secret according to vault, name
function getSecret(vault: string, name: string): Promise<string>
}
/**
* getSecrets returns multiple secret objects (key = name, value = secret)
* at once according to vault and secret names.
*
* If a secret does not exist, it will not be included in the result.
*/
function getSecrets<const T extends readonly string[]>(
vault: string,
names: T
): Promise<Partial<Record<T[number], string>>>;

/**
* getSecret returns a secret according to vault and name.
*
* If the secret does not exist, undefined is returned.
*/
function getSecret(
vault: string,
name: string
): Promise<string | undefined>;
}