@absolutejs/deploy 0.14.0 → 0.15.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 +12 -6
- package/dist/gcp.d.ts +10 -0
- package/dist/gcp.js +14 -1
- package/dist/gcp.js.map +3 -3
- package/dist/hetzner.d.ts +4 -0
- package/dist/hetzner.js.map +2 -2
- package/dist/hetznerInfrastructure.d.ts +20 -0
- package/dist/hetznerInfrastructure.js +557 -0
- package/dist/hetznerInfrastructure.js.map +14 -0
- package/dist/infrastructureAdapter.d.ts +14 -0
- package/dist/linodeInfrastructure.d.ts +18 -0
- package/dist/linodeInfrastructure.js +573 -0
- package/dist/linodeInfrastructure.js.map +14 -0
- package/dist/vultrInfrastructure.d.ts +18 -0
- package/dist/vultrInfrastructure.js +552 -0
- package/dist/vultrInfrastructure.js.map +14 -0
- package/package.json +17 -2
package/README.md
CHANGED
|
@@ -42,12 +42,18 @@ await provider.provisionNode({
|
|
|
42
42
|
});
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
The same contract is implemented by
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
The same contract is implemented by GCP, Hetzner, Linode, and Vultr adapters:
|
|
46
|
+
|
|
47
|
+
- `@absolutejs/deploy/gcp`
|
|
48
|
+
- `@absolutejs/deploy/hetzner-infrastructure`
|
|
49
|
+
- `@absolutejs/deploy/linode-infrastructure`
|
|
50
|
+
- `@absolutejs/deploy/vultr-infrastructure`
|
|
51
|
+
|
|
52
|
+
GCP uses Application Default Credentials and an immutable instance template.
|
|
53
|
+
Every adapter exposes declared capabilities, normalized node identity/state/
|
|
54
|
+
address data, list/get/provision/terminate, and regional placement. Application
|
|
55
|
+
deployment, draining, migration, and edge cutover remain higher-level
|
|
56
|
+
orchestration concerns.
|
|
51
57
|
|
|
52
58
|
```ts
|
|
53
59
|
import {
|
package/dist/gcp.d.ts
CHANGED
|
@@ -6,6 +6,16 @@ export type GcpComputeRequest = <T>(options: {
|
|
|
6
6
|
}) => Promise<{
|
|
7
7
|
data: T;
|
|
8
8
|
}>;
|
|
9
|
+
export type GcpIdentityTokenRequest = (audience: string, url: string, init: NonNullable<Parameters<typeof fetch>[1]>) => Promise<Response>;
|
|
10
|
+
export type GcpIdentityAuth = {
|
|
11
|
+
getIdTokenClient: (audience: string) => Promise<{
|
|
12
|
+
getRequestHeaders: (url: string) => Promise<Headers>;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
export declare const createGcpIdentityTokenRequest: (dependencies?: {
|
|
16
|
+
auth?: GcpIdentityAuth;
|
|
17
|
+
fetch?: typeof fetch;
|
|
18
|
+
}) => GcpIdentityTokenRequest;
|
|
9
19
|
export type GcpInfrastructureProviderOptions = {
|
|
10
20
|
agentAudience?: string;
|
|
11
21
|
agentAudienceMetadataKey?: string;
|
package/dist/gcp.js
CHANGED
|
@@ -10352,6 +10352,18 @@ var DEFAULT_AGENT_URL_METADATA_KEY = "absolutejs-agent-url";
|
|
|
10352
10352
|
var DEFAULT_NODE_PREFIX = "absolutejs-node";
|
|
10353
10353
|
var NODE_NAME_SUFFIX_LENGTH = 8;
|
|
10354
10354
|
var NODE_NAME_MATCH = /^gcp:([a-z0-9-]+):([a-z]([-a-z0-9]*[a-z0-9])?)$/;
|
|
10355
|
+
var createGcpIdentityTokenRequest = (dependencies = {}) => {
|
|
10356
|
+
const auth = dependencies.auth ?? new import_google_auth_library.GoogleAuth;
|
|
10357
|
+
const request = dependencies.fetch ?? fetch;
|
|
10358
|
+
return async (audience, url, init) => {
|
|
10359
|
+
const client = await auth.getIdTokenClient(audience);
|
|
10360
|
+
const headers = await client.getRequestHeaders(url);
|
|
10361
|
+
return request(url, {
|
|
10362
|
+
...init,
|
|
10363
|
+
headers: { ...Object.fromEntries(headers), ...init.headers }
|
|
10364
|
+
});
|
|
10365
|
+
};
|
|
10366
|
+
};
|
|
10355
10367
|
|
|
10356
10368
|
class GcpInfrastructureError extends Error {
|
|
10357
10369
|
}
|
|
@@ -10467,8 +10479,9 @@ var createGcpNodeName = (prefix = DEFAULT_NODE_PREFIX) => `${prefix}-${crypto.ra
|
|
|
10467
10479
|
export {
|
|
10468
10480
|
createGcpNodeName,
|
|
10469
10481
|
createGcpInfrastructureProvider,
|
|
10482
|
+
createGcpIdentityTokenRequest,
|
|
10470
10483
|
GcpInfrastructureError
|
|
10471
10484
|
};
|
|
10472
10485
|
|
|
10473
|
-
//# debugId=
|
|
10486
|
+
//# debugId=FD4D7CAA2707CCB764756E2164756E21
|
|
10474
10487
|
//# sourceMappingURL=gcp.js.map
|