@cosmoner/sdk 1.12.0 → 1.13.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.
- package/README.md +5 -3
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/services/project-config.d.ts +5 -1
- package/dist/services/secrets.d.ts +18 -10
- package/dist/services/variables.d.ts +15 -8
- package/dist/version.d.ts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -224,9 +224,11 @@ removes it; `usage()` reports how many secrets the project holds and may hold;
|
|
|
224
224
|
|
|
225
225
|
Two API behaviours are worth knowing before you debug them:
|
|
226
226
|
|
|
227
|
-
- **Writes need an owner or admin.** The API checks the
|
|
228
|
-
independently of
|
|
229
|
-
|
|
227
|
+
- **Writes need an owner or admin role.** The API checks the role the key acts
|
|
228
|
+
with independently of its scopes: a project key acts with its service
|
|
229
|
+
account's role, a personal access token with its holder's. A key on a
|
|
230
|
+
`developer` service account is refused with a 403 even when it carries
|
|
231
|
+
`secrets:write`.
|
|
230
232
|
- **Creating is rate-limited** to 100 per project every 10 minutes, shared by
|
|
231
233
|
every key and machine working on the project, and a project at its secret
|
|
232
234
|
limit answers 402.
|
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
export type ProjectEnvironment = "default" | "development" | "staging" | "production";
|
|
9
9
|
/** Every environment the API accepts. */
|
|
10
10
|
export declare const PROJECT_ENVIRONMENTS: readonly ProjectEnvironment[];
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Who touched a secret or variable, as embedded in its audit fields: a project
|
|
13
|
+
* member, or a service account when a project API key made the change. The
|
|
14
|
+
* fields that carry one are null once that account has been deleted.
|
|
15
|
+
*/
|
|
12
16
|
export interface Actor {
|
|
13
17
|
id: string;
|
|
14
18
|
name: string;
|
|
@@ -17,12 +17,17 @@ export interface ProjectSecret {
|
|
|
17
17
|
environment: ProjectEnvironment;
|
|
18
18
|
/** Incremented every time the value is replaced. Starts at 1. */
|
|
19
19
|
version: number;
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Id of the member or service account that created it. Null once that
|
|
22
|
+
* account has been deleted; the secret stays with the project.
|
|
23
|
+
*/
|
|
24
|
+
createdBy: string | null;
|
|
25
|
+
/** Id of the member or service account that last changed it. Null under the same rule. */
|
|
26
|
+
updatedBy: string | null;
|
|
27
|
+
/** Who created it. Null once that account has been deleted. */
|
|
28
|
+
createdByUser: Actor | null;
|
|
29
|
+
/** Who last changed it. Null once that account has been deleted. */
|
|
30
|
+
updatedByUser: Actor | null;
|
|
26
31
|
createdAt: string;
|
|
27
32
|
updatedAt: string;
|
|
28
33
|
}
|
|
@@ -71,8 +76,9 @@ export interface SecretAuditEntry {
|
|
|
71
76
|
id: string;
|
|
72
77
|
secretId: string;
|
|
73
78
|
action: "CREATED" | "UPDATED" | "DELETED";
|
|
74
|
-
|
|
75
|
-
|
|
79
|
+
/** Null once the account that acted has been deleted; the entry itself is kept. */
|
|
80
|
+
actorId: string | null;
|
|
81
|
+
actor: Actor | null;
|
|
76
82
|
metadata: string | null;
|
|
77
83
|
createdAt: string;
|
|
78
84
|
}
|
|
@@ -114,8 +120,10 @@ export type GetSecretAuditResponse = Envelope<SecretAuditEntry[]>;
|
|
|
114
120
|
* Manages a project's secrets.
|
|
115
121
|
*
|
|
116
122
|
* Reads need `secrets:read`. Writes need `secrets:write` *and* an owner or
|
|
117
|
-
* admin: the API checks the
|
|
118
|
-
*
|
|
123
|
+
* admin role: the API checks the role the key acts with independently of its
|
|
124
|
+
* scopes. A project key acts with its service account's role, a personal
|
|
125
|
+
* access token with its holder's, so a key on a `developer` service account is
|
|
126
|
+
* refused even when it carries the scope.
|
|
119
127
|
*/
|
|
120
128
|
export declare class SecretsService {
|
|
121
129
|
private readonly transport;
|
|
@@ -16,12 +16,17 @@ export interface ProjectVariable {
|
|
|
16
16
|
description: string | null;
|
|
17
17
|
value: string;
|
|
18
18
|
environment: ProjectEnvironment;
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Id of the member or service account that created it. Null once that
|
|
21
|
+
* account has been deleted; the variable stays with the project.
|
|
22
|
+
*/
|
|
23
|
+
createdBy: string | null;
|
|
24
|
+
/** Id of the member or service account that last changed it. Null under the same rule. */
|
|
25
|
+
updatedBy: string | null;
|
|
26
|
+
/** Who created it. Null once that account has been deleted. */
|
|
27
|
+
createdByUser: Actor | null;
|
|
28
|
+
/** Who last changed it. Null once that account has been deleted. */
|
|
29
|
+
updatedByUser: Actor | null;
|
|
25
30
|
createdAt: string;
|
|
26
31
|
updatedAt: string;
|
|
27
32
|
}
|
|
@@ -66,8 +71,10 @@ export type SetVariableResponse = Envelope<ProjectVariable>;
|
|
|
66
71
|
* Manages a project's variables.
|
|
67
72
|
*
|
|
68
73
|
* Reads need `variables:read`. Writes need `variables:write` *and* an owner or
|
|
69
|
-
* admin: the API checks the
|
|
70
|
-
*
|
|
74
|
+
* admin role: the API checks the role the key acts with independently of its
|
|
75
|
+
* scopes. A project key acts with its service account's role, a personal
|
|
76
|
+
* access token with its holder's, so a key on a `developer` service account is
|
|
77
|
+
* refused even when it carries the scope.
|
|
71
78
|
*/
|
|
72
79
|
export declare class VariablesService {
|
|
73
80
|
private readonly transport;
|
package/dist/version.d.ts
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
* the release workflow runs that straight after `npm version`, and
|
|
9
9
|
* `version.test.ts` fails the build if the two ever disagree.
|
|
10
10
|
*/
|
|
11
|
-
export declare const VERSION = "1.
|
|
12
|
-
export declare const USER_AGENT = "cosmoner-node/1.
|
|
11
|
+
export declare const VERSION = "1.13.0";
|
|
12
|
+
export declare const USER_AGENT = "cosmoner-node/1.13.0";
|