@tailor-platform/function-types 0.2.0 → 0.3.0

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/tailor.d.ts +21 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/function-types",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "TypeScript types for Tailor Platform Function service",
5
5
  "repository": {
6
6
  "type": "git",
package/tailor.d.ts CHANGED
@@ -31,8 +31,24 @@ declare const tailordb: {
31
31
  };
32
32
 
33
33
  declare namespace tailor.secretmanager {
34
- // getSecrets returns multiple secret objects(key=name, value=secret) at once according to vault, names
35
- function getSecrets(vault: string, names: string[]): Promise<Record<string, string>>
36
- // getSecret returns a secret according to vault, name
37
- function getSecret(vault: string, name: string): Promise<string>
38
- }
34
+ /**
35
+ * getSecrets returns multiple secret objects (key = name, value = secret)
36
+ * at once according to vault and secret names.
37
+ *
38
+ * If a secret does not exist, it will not be included in the result.
39
+ */
40
+ function getSecrets<const T extends readonly string[]>(
41
+ vault: string,
42
+ names: T
43
+ ): Promise<Partial<Record<T[number], string>>>;
44
+
45
+ /**
46
+ * getSecret returns a secret according to vault and name.
47
+ *
48
+ * If the secret does not exist, undefined is returned.
49
+ */
50
+ function getSecret(
51
+ vault: string,
52
+ name: string
53
+ ): Promise<string | undefined>;
54
+ }