@microagi/alchemy-gcp 0.11.6 → 0.11.8

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 (164) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/lib/ArtifactRegistry/Operations.d.ts +1 -1
  3. package/lib/ArtifactRegistry/Repository.d.ts +2 -2
  4. package/lib/ArtifactRegistry/Repository.d.ts.map +1 -1
  5. package/lib/ArtifactRegistry/Repository.js +5 -5
  6. package/lib/ArtifactRegistry/Repository.js.map +1 -1
  7. package/lib/ArtifactRegistry/RepositoryIamMember.d.ts +2 -1
  8. package/lib/ArtifactRegistry/RepositoryIamMember.d.ts.map +1 -1
  9. package/lib/ArtifactRegistry/RepositoryIamMember.js +1 -1
  10. package/lib/CloudResourceManager/Project.d.ts +2 -1
  11. package/lib/CloudResourceManager/Project.d.ts.map +1 -1
  12. package/lib/CloudResourceManager/Project.js +6 -6
  13. package/lib/CloudResourceManager/Project.js.map +1 -1
  14. package/lib/Compute/Address.d.ts +2 -1
  15. package/lib/Compute/Address.d.ts.map +1 -1
  16. package/lib/Compute/Address.js +4 -4
  17. package/lib/Compute/Address.js.map +1 -1
  18. package/lib/Compute/Firewall.d.ts +2 -1
  19. package/lib/Compute/Firewall.d.ts.map +1 -1
  20. package/lib/Compute/Firewall.js +1 -1
  21. package/lib/Compute/ForwardingRule.d.ts +2 -1
  22. package/lib/Compute/ForwardingRule.d.ts.map +1 -1
  23. package/lib/Compute/ForwardingRule.js +4 -4
  24. package/lib/Compute/ForwardingRule.js.map +1 -1
  25. package/lib/Compute/GlobalAddress.d.ts +2 -1
  26. package/lib/Compute/GlobalAddress.d.ts.map +1 -1
  27. package/lib/Compute/GlobalAddress.js +4 -4
  28. package/lib/Compute/GlobalAddress.js.map +1 -1
  29. package/lib/Compute/Network.d.ts +2 -1
  30. package/lib/Compute/Network.d.ts.map +1 -1
  31. package/lib/Compute/Network.js +1 -1
  32. package/lib/Compute/Operations.d.ts +1 -1
  33. package/lib/Compute/ProjectDefaultNetworkTier.d.ts +2 -1
  34. package/lib/Compute/ProjectDefaultNetworkTier.d.ts.map +1 -1
  35. package/lib/Compute/ProjectDefaultNetworkTier.js +1 -1
  36. package/lib/Compute/SharedVpcHost.d.ts +2 -1
  37. package/lib/Compute/SharedVpcHost.d.ts.map +1 -1
  38. package/lib/Compute/SharedVpcHost.js +1 -1
  39. package/lib/Compute/SharedVpcServiceProject.d.ts +2 -1
  40. package/lib/Compute/SharedVpcServiceProject.d.ts.map +1 -1
  41. package/lib/Compute/SharedVpcServiceProject.js +1 -1
  42. package/lib/Compute/Subnetwork.d.ts +2 -1
  43. package/lib/Compute/Subnetwork.d.ts.map +1 -1
  44. package/lib/Compute/Subnetwork.js +2 -2
  45. package/lib/Compute/Subnetwork.js.map +1 -1
  46. package/lib/Container/Cluster.d.ts +4 -2
  47. package/lib/Container/Cluster.d.ts.map +1 -1
  48. package/lib/Container/Cluster.js +28 -10
  49. package/lib/Container/Cluster.js.map +1 -1
  50. package/lib/Container/NodePool.d.ts +2 -2
  51. package/lib/Container/NodePool.d.ts.map +1 -1
  52. package/lib/Container/NodePool.js +22 -12
  53. package/lib/Container/NodePool.js.map +1 -1
  54. package/lib/Container/Operations.d.ts +1 -1
  55. package/lib/Iam/Operations.d.ts +42 -0
  56. package/lib/Iam/Operations.d.ts.map +1 -0
  57. package/lib/Iam/Operations.js +48 -0
  58. package/lib/Iam/Operations.js.map +1 -0
  59. package/lib/Iam/ServiceAccount.d.ts +2 -1
  60. package/lib/Iam/ServiceAccount.d.ts.map +1 -1
  61. package/lib/Iam/ServiceAccount.js +1 -1
  62. package/lib/Iam/ServiceAccountKey.d.ts +2 -1
  63. package/lib/Iam/ServiceAccountKey.d.ts.map +1 -1
  64. package/lib/Iam/ServiceAccountKey.js +1 -1
  65. package/lib/Iam/WorkloadIdentityPool.d.ts +101 -0
  66. package/lib/Iam/WorkloadIdentityPool.d.ts.map +1 -0
  67. package/lib/Iam/WorkloadIdentityPool.js +175 -0
  68. package/lib/Iam/WorkloadIdentityPool.js.map +1 -0
  69. package/lib/Iam/WorkloadIdentityPoolProvider.d.ts +125 -0
  70. package/lib/Iam/WorkloadIdentityPoolProvider.d.ts.map +1 -0
  71. package/lib/Iam/WorkloadIdentityPoolProvider.js +222 -0
  72. package/lib/Iam/WorkloadIdentityPoolProvider.js.map +1 -0
  73. package/lib/Iam/index.d.ts +4 -0
  74. package/lib/Iam/index.d.ts.map +1 -1
  75. package/lib/Iam/index.js +2 -0
  76. package/lib/Iam/index.js.map +1 -1
  77. package/lib/Kubernetes/Secret.d.ts.map +1 -1
  78. package/lib/Kubernetes/Secret.js.map +1 -1
  79. package/lib/ManagedLustre/Instance.d.ts +2 -1
  80. package/lib/ManagedLustre/Instance.d.ts.map +1 -1
  81. package/lib/ManagedLustre/Instance.js +6 -6
  82. package/lib/ManagedLustre/Instance.js.map +1 -1
  83. package/lib/Providers.d.ts.map +1 -1
  84. package/lib/Providers.js +5 -1
  85. package/lib/Providers.js.map +1 -1
  86. package/lib/Run/IamSync.d.ts +1 -1
  87. package/lib/Run/Job.d.ts +3 -3
  88. package/lib/Run/Job.d.ts.map +1 -1
  89. package/lib/Run/Job.js +5 -5
  90. package/lib/Run/Job.js.map +1 -1
  91. package/lib/Run/Operations.d.ts +1 -1
  92. package/lib/Run/Service.d.ts +2 -2
  93. package/lib/Run/Service.d.ts.map +1 -1
  94. package/lib/Run/Service.js +9 -7
  95. package/lib/Run/Service.js.map +1 -1
  96. package/lib/Run/index.d.ts +2 -2
  97. package/lib/ServiceNetworking/PsaConnection.d.ts +2 -1
  98. package/lib/ServiceNetworking/PsaConnection.d.ts.map +1 -1
  99. package/lib/ServiceNetworking/PsaConnection.js +1 -1
  100. package/lib/ServiceUsage/ApiEnable.d.ts +2 -1
  101. package/lib/ServiceUsage/ApiEnable.d.ts.map +1 -1
  102. package/lib/ServiceUsage/ApiEnable.js +1 -1
  103. package/lib/Sqladmin/Database.d.ts +2 -1
  104. package/lib/Sqladmin/Database.d.ts.map +1 -1
  105. package/lib/Sqladmin/Database.js +1 -1
  106. package/lib/Sqladmin/Instance.d.ts +2 -1
  107. package/lib/Sqladmin/Instance.d.ts.map +1 -1
  108. package/lib/Sqladmin/Instance.js +7 -7
  109. package/lib/Sqladmin/Instance.js.map +1 -1
  110. package/lib/Sqladmin/Operations.d.ts +1 -1
  111. package/lib/Sqladmin/User.d.ts +2 -1
  112. package/lib/Sqladmin/User.d.ts.map +1 -1
  113. package/lib/Sqladmin/User.js +1 -1
  114. package/lib/Storage/Bucket.d.ts +2 -2
  115. package/lib/Storage/Bucket.d.ts.map +1 -1
  116. package/lib/Storage/Bucket.js +1 -1
  117. package/lib/Storage/StorageBucketIamMember.d.ts +2 -1
  118. package/lib/Storage/StorageBucketIamMember.d.ts.map +1 -1
  119. package/lib/Storage/StorageBucketIamMember.js +1 -1
  120. package/lib/Tags.d.ts +3 -1
  121. package/lib/Tags.d.ts.map +1 -1
  122. package/lib/Tags.js +9 -1
  123. package/lib/Tags.js.map +1 -1
  124. package/package.json +9 -9
  125. package/src/ArtifactRegistry/Operations.ts +1 -1
  126. package/src/ArtifactRegistry/Repository.ts +5 -5
  127. package/src/ArtifactRegistry/RepositoryIamMember.ts +1 -1
  128. package/src/CloudResourceManager/Project.ts +6 -6
  129. package/src/Compute/Address.ts +4 -4
  130. package/src/Compute/Firewall.ts +1 -1
  131. package/src/Compute/ForwardingRule.ts +4 -4
  132. package/src/Compute/GlobalAddress.ts +4 -4
  133. package/src/Compute/Network.ts +1 -1
  134. package/src/Compute/Operations.ts +1 -1
  135. package/src/Compute/ProjectDefaultNetworkTier.ts +1 -1
  136. package/src/Compute/SharedVpcHost.ts +1 -1
  137. package/src/Compute/SharedVpcServiceProject.ts +1 -1
  138. package/src/Compute/Subnetwork.ts +2 -2
  139. package/src/Container/Cluster.ts +36 -11
  140. package/src/Container/NodePool.ts +30 -13
  141. package/src/Container/Operations.ts +1 -1
  142. package/src/Iam/Operations.ts +81 -0
  143. package/src/Iam/ServiceAccount.ts +1 -1
  144. package/src/Iam/ServiceAccountKey.ts +1 -1
  145. package/src/Iam/WorkloadIdentityPool.ts +309 -0
  146. package/src/Iam/WorkloadIdentityPoolProvider.ts +429 -0
  147. package/src/Iam/index.ts +10 -0
  148. package/src/Kubernetes/Secret.ts +4 -1
  149. package/src/ManagedLustre/Instance.ts +6 -6
  150. package/src/Providers.ts +12 -0
  151. package/src/Run/IamSync.ts +1 -1
  152. package/src/Run/Job.ts +6 -6
  153. package/src/Run/Operations.ts +1 -1
  154. package/src/Run/Service.ts +9 -7
  155. package/src/Run/index.ts +2 -2
  156. package/src/ServiceNetworking/PsaConnection.ts +1 -1
  157. package/src/ServiceUsage/ApiEnable.ts +1 -1
  158. package/src/Sqladmin/Database.ts +1 -1
  159. package/src/Sqladmin/Instance.ts +13 -7
  160. package/src/Sqladmin/Operations.ts +1 -1
  161. package/src/Sqladmin/User.ts +1 -1
  162. package/src/Storage/Bucket.ts +1 -1
  163. package/src/Storage/StorageBucketIamMember.ts +1 -1
  164. package/src/Tags.ts +16 -1
@@ -1,5 +1,5 @@
1
1
  import { ConfigError } from "@distilled.cloud/gcp";
2
- import * as sn from "@distilled.cloud/gcp/servicenetworking-v1";
2
+ import * as sn from "@distilled.cloud/gcp/servicenetworking_v1";
3
3
  import { Resource } from "alchemy";
4
4
  import type { ScopedPlanStatusSession } from "alchemy/Cli/Cli";
5
5
  import { deepEqual, isResolved } from "alchemy/Diff";
@@ -1,5 +1,5 @@
1
1
  import { ConfigError } from "@distilled.cloud/gcp";
2
- import * as su from "@distilled.cloud/gcp/serviceusage-v1";
2
+ import * as su from "@distilled.cloud/gcp/serviceusage_v1";
3
3
  import { Resource } from "alchemy";
4
4
  import type { ScopedPlanStatusSession } from "alchemy/Cli/Cli";
5
5
  import { isResolved } from "alchemy/Diff";
@@ -1,4 +1,4 @@
1
- import * as sql from "@distilled.cloud/gcp/sqladmin-v1";
1
+ import * as sql from "@distilled.cloud/gcp/sqladmin_v1";
2
2
  import { Resource } from "alchemy";
3
3
  import { isResolved, somePropsAreDifferent } from "alchemy/Diff";
4
4
  import * as Provider from "alchemy/Provider";
@@ -1,4 +1,4 @@
1
- import * as sql from "@distilled.cloud/gcp/sqladmin-v1";
1
+ import * as sql from "@distilled.cloud/gcp/sqladmin_v1";
2
2
  import { Resource } from "alchemy";
3
3
  import { Unowned } from "alchemy/AdoptPolicy";
4
4
  import type { ScopedPlanStatusSession } from "alchemy/Cli/Cli";
@@ -11,7 +11,7 @@ import * as Effect from "effect/Effect";
11
11
  import * as Redacted from "effect/Redacted";
12
12
  import * as Schedule from "effect/Schedule";
13
13
  import type * as GCP from "../Providers.ts";
14
- import { gcpInternalLabels, hasAlchemyLabels } from "../Tags.ts";
14
+ import { gcpInternalLabels, hasAlchemyLabels, normalizeStringMap } from "../Tags.ts";
15
15
  import { makeAwaitOperation } from "./Operations.ts";
16
16
  import type {
17
17
  PostgresVersion,
@@ -289,7 +289,7 @@ const toAttributes = (
289
289
  }
290
290
  : undefined,
291
291
  settingsVersion: i.settings?.settingsVersion,
292
- labels: { ...(i.settings?.userLabels ?? {}) },
292
+ labels: normalizeStringMap(i.settings?.userLabels) ?? {},
293
293
  };
294
294
  };
295
295
 
@@ -341,7 +341,7 @@ const toSettingsBody = (
341
341
  }
342
342
  : {}),
343
343
  ...(s.backupConfiguration ? { backupConfiguration: s.backupConfiguration } : {}),
344
- ...(s.databaseFlags ? { databaseFlags: s.databaseFlags } : {}),
344
+ ...(s.databaseFlags ? { databaseFlags: [...s.databaseFlags] } : {}),
345
345
  ...(s.deletionProtectionEnabled !== undefined
346
346
  ? { deletionProtectionEnabled: s.deletionProtectionEnabled }
347
347
  : {}),
@@ -454,7 +454,7 @@ export const SqlInstanceProvider = () =>
454
454
  );
455
455
 
456
456
  const labelDiff = diffTags(
457
- { ...(obsSettings.userLabels ?? {}) },
457
+ normalizeStringMap(obsSettings.userLabels) ?? {},
458
458
  args.desiredLabels,
459
459
  );
460
460
  if (labelDiff.removed.length > 0 || labelDiff.upsert.length > 0) {
@@ -631,7 +631,10 @@ export const SqlInstanceProvider = () =>
631
631
  );
632
632
  for (const candidate of page?.items ?? []) {
633
633
  if (
634
- yield* hasAlchemyLabels(id, candidate.settings?.userLabels)
634
+ yield* hasAlchemyLabels(
635
+ id,
636
+ normalizeStringMap(candidate.settings?.userLabels),
637
+ )
635
638
  ) {
636
639
  observed = candidate;
637
640
  break;
@@ -644,7 +647,10 @@ export const SqlInstanceProvider = () =>
644
647
  region,
645
648
  name: observed.name,
646
649
  });
647
- return (yield* hasAlchemyLabels(id, observed.settings?.userLabels))
650
+ return (yield* hasAlchemyLabels(
651
+ id,
652
+ normalizeStringMap(observed.settings?.userLabels),
653
+ ))
648
654
  ? attrs
649
655
  : Unowned(attrs);
650
656
  }),
@@ -1,5 +1,5 @@
1
1
  import { ConfigError } from "@distilled.cloud/gcp";
2
- import * as sql from "@distilled.cloud/gcp/sqladmin-v1";
2
+ import * as sql from "@distilled.cloud/gcp/sqladmin_v1";
3
3
  import type { ScopedPlanStatusSession } from "alchemy/Cli/Cli";
4
4
  import * as Duration from "effect/Duration";
5
5
  import * as Effect from "effect/Effect";
@@ -1,4 +1,4 @@
1
- import * as sql from "@distilled.cloud/gcp/sqladmin-v1";
1
+ import * as sql from "@distilled.cloud/gcp/sqladmin_v1";
2
2
  import { Resource } from "alchemy";
3
3
  import { isResolved, somePropsAreDifferent } from "alchemy/Diff";
4
4
  import * as Provider from "alchemy/Provider";
@@ -1,5 +1,5 @@
1
1
  import { ConfigError } from "@distilled.cloud/gcp";
2
- import * as storage from "@distilled.cloud/gcp/storage-v1";
2
+ import * as storage from "@distilled.cloud/gcp/storage_v1";
3
3
  import { Resource } from "alchemy";
4
4
  import { Unowned } from "alchemy/AdoptPolicy";
5
5
  import { isResolved } from "alchemy/Diff";
@@ -1,5 +1,5 @@
1
1
  import { ConfigError } from "@distilled.cloud/gcp";
2
- import * as storage from "@distilled.cloud/gcp/storage-v1";
2
+ import * as storage from "@distilled.cloud/gcp/storage_v1";
3
3
  import { Resource } from "alchemy";
4
4
  import { isResolved } from "alchemy/Diff";
5
5
  import * as Provider from "alchemy/Provider";
package/src/Tags.ts CHANGED
@@ -28,6 +28,18 @@ const sanitizeLabelValue = (raw: string): string => {
28
28
  return replaced.slice(0, 63);
29
29
  };
30
30
 
31
+ /** Normalize an SDK string map by omitting absent values at the boundary. */
32
+ export const normalizeStringMap = (
33
+ value: Record<string, string | undefined> | undefined,
34
+ ): Record<string, string> | undefined =>
35
+ value === undefined
36
+ ? undefined
37
+ : Object.fromEntries(
38
+ Object.entries(value).filter(
39
+ (entry): entry is [string, string] => entry[1] !== undefined,
40
+ ),
41
+ );
42
+
31
43
  /**
32
44
  * Compute the alchemy-internal label set for a Resource. Merge the
33
45
  * result with user-provided labels (user wins on key collision is
@@ -50,7 +62,10 @@ export const gcpInternalLabels = Effect.fnUntraced(function* (id: string) {
50
62
  */
51
63
  export const hasAlchemyLabels = Effect.fnUntraced(function* (
52
64
  id: string,
53
- labels: Record<string, string> | undefined,
65
+ // Distilled's generated Kubernetes/GCP map types have index signatures that
66
+ // include `undefined` (`{ [k: string]: string | undefined }`), so accept the
67
+ // wider shape — the equality checks below are unaffected.
68
+ labels: Record<string, string | undefined> | undefined,
54
69
  ) {
55
70
  if (!labels) return false;
56
71
  const expected = yield* gcpInternalLabels(id);