@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 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 member's role
228
- independently of the key's scopes, so a plain member's key is refused with a
229
- 403 even when it carries `secrets:write`.
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
@@ -1624,7 +1624,7 @@ function sleep(ms) {
1624
1624
  }
1625
1625
 
1626
1626
  // src/version.ts
1627
- var VERSION = "1.12.0";
1627
+ var VERSION = "1.13.0";
1628
1628
  var USER_AGENT = `cosmoner-node/${VERSION}`;
1629
1629
 
1630
1630
  // src/transport.ts
package/dist/index.mjs CHANGED
@@ -1549,7 +1549,7 @@ function sleep(ms) {
1549
1549
  }
1550
1550
 
1551
1551
  // src/version.ts
1552
- var VERSION = "1.12.0";
1552
+ var VERSION = "1.13.0";
1553
1553
  var USER_AGENT = `cosmoner-node/${VERSION}`;
1554
1554
 
1555
1555
  // src/transport.ts
@@ -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
- /** A project member, as embedded in the audit fields of a secret or variable. */
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
- /** Id of the member who created it. */
21
- createdBy: string;
22
- /** Id of the member who last changed it. */
23
- updatedBy: string;
24
- createdByUser: Actor;
25
- updatedByUser: Actor;
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
- actorId: string;
75
- actor: Actor;
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 member's role independently of the key's scopes,
118
- * so a plain member's key is refused even when it carries the scope.
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
- /** Id of the member who created it. */
20
- createdBy: string;
21
- /** Id of the member who last changed it. */
22
- updatedBy: string;
23
- createdByUser: Actor;
24
- updatedByUser: Actor;
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 member's role independently of the key's scopes,
70
- * so a plain member's key is refused even when it carries the scope.
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.0";
12
- export declare const USER_AGENT = "cosmoner-node/1.12.0";
11
+ export declare const VERSION = "1.13.0";
12
+ export declare const USER_AGENT = "cosmoner-node/1.13.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmoner/sdk",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "Cosmoner SDK for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",