@terraforge/terraform 0.0.9 → 0.0.11
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 +54 -1
- package/cli/build-package.ts +31 -9
- package/dist/index.d.mts +310 -0
- package/dist/index.mjs +2367 -0
- package/package.json +8 -8
- package/dist/index.d.ts +0 -92
- package/dist/index.js +0 -1986
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@terraforge/terraform",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,24 +9,24 @@
|
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/terraforge-js/terraforge/issues"
|
|
11
11
|
},
|
|
12
|
-
"module": "./dist/index.
|
|
13
|
-
"types": "./dist/index.d.
|
|
12
|
+
"module": "./dist/index.mjs",
|
|
13
|
+
"types": "./dist/index.d.mjs",
|
|
14
14
|
"bin": {
|
|
15
15
|
"build-package": "./cli/build-package.ts"
|
|
16
16
|
},
|
|
17
17
|
"exports": {
|
|
18
18
|
".": {
|
|
19
|
-
"import": "./dist/index.
|
|
20
|
-
"types": "./dist/index.d.
|
|
19
|
+
"import": "./dist/index.mjs",
|
|
20
|
+
"types": "./dist/index.d.mjs"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
|
-
"build": "
|
|
25
|
-
"prepublishOnly": "bun run build",
|
|
24
|
+
"build": "tsdown src/index.ts --format esm --dts --clean --out-dir ./dist",
|
|
25
|
+
"prepublishOnly": "if bun run test; then bun run build; else exit; fi",
|
|
26
26
|
"test": "bun test"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@terraforge/core": "0.0.
|
|
29
|
+
"@terraforge/core": "0.0.10"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@grpc/grpc-js": "1.12.6",
|
package/dist/index.d.ts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { Provider, State as State$1, GetProps, CreateProps, UpdateProps, DeleteProps, GetDataProps } from '@terraforge/core';
|
|
2
|
-
|
|
3
|
-
type Property = {
|
|
4
|
-
description?: string;
|
|
5
|
-
required?: boolean;
|
|
6
|
-
optional?: boolean;
|
|
7
|
-
/** The computed field means that it could be computed by the server. */
|
|
8
|
-
computed?: boolean;
|
|
9
|
-
deprecated?: boolean;
|
|
10
|
-
sensitive?: boolean;
|
|
11
|
-
} & ({
|
|
12
|
-
type: 'string' | 'number' | 'boolean';
|
|
13
|
-
} | {
|
|
14
|
-
type: 'array' | 'record';
|
|
15
|
-
item: Property;
|
|
16
|
-
} | {
|
|
17
|
-
type: 'object' | 'array-object';
|
|
18
|
-
properties: Record<string, Property>;
|
|
19
|
-
} | {
|
|
20
|
-
type: 'unknown';
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
declare const generateTypes: (providers: Record<string, Property>, resources: Record<string, Property>, dataSources: Record<string, Property>) => string;
|
|
24
|
-
|
|
25
|
-
type State = Record<string, unknown>;
|
|
26
|
-
type Plugin = Readonly<{
|
|
27
|
-
schema: () => {
|
|
28
|
-
provider: Property;
|
|
29
|
-
resources: Record<string, Property>;
|
|
30
|
-
dataSources: Record<string, Property>;
|
|
31
|
-
};
|
|
32
|
-
stop: () => Promise<void>;
|
|
33
|
-
configure: (config: State) => Promise<void>;
|
|
34
|
-
readResource: (type: string, state: State) => Promise<State>;
|
|
35
|
-
readDataSource: (type: string, state: State) => Promise<State>;
|
|
36
|
-
validateResource: (type: string, state: State) => Promise<void>;
|
|
37
|
-
planResourceChange: (type: string, priorState: State | null, proposedNewState: State | null) => Promise<{
|
|
38
|
-
requiresReplace: Array<string | number>[];
|
|
39
|
-
plannedState: State;
|
|
40
|
-
}>;
|
|
41
|
-
applyResourceChange: (type: string, priorState: State | null, proposedNewState: State | null) => Promise<State>;
|
|
42
|
-
}>;
|
|
43
|
-
|
|
44
|
-
declare class TerraformProvider implements Provider {
|
|
45
|
-
private type;
|
|
46
|
-
private id;
|
|
47
|
-
private createPlugin;
|
|
48
|
-
private config;
|
|
49
|
-
private configured?;
|
|
50
|
-
private plugin?;
|
|
51
|
-
constructor(type: string, id: string, createPlugin: () => Promise<Plugin>, config: State$1);
|
|
52
|
-
private configure;
|
|
53
|
-
private prepare;
|
|
54
|
-
destroy(): Promise<void>;
|
|
55
|
-
ownResource(id: string): boolean;
|
|
56
|
-
getResource({ type, state }: GetProps): Promise<{
|
|
57
|
-
version: number;
|
|
58
|
-
state: State;
|
|
59
|
-
}>;
|
|
60
|
-
createResource({ type, state }: CreateProps): Promise<{
|
|
61
|
-
version: number;
|
|
62
|
-
state: State;
|
|
63
|
-
}>;
|
|
64
|
-
updateResource({ type, priorState, proposedState }: UpdateProps): Promise<{
|
|
65
|
-
version: number;
|
|
66
|
-
state: State;
|
|
67
|
-
}>;
|
|
68
|
-
deleteResource({ type, state }: DeleteProps): Promise<void>;
|
|
69
|
-
getData({ type, state }: GetDataProps): Promise<{
|
|
70
|
-
state: State;
|
|
71
|
-
}>;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
type Version = `${number}.${number}.${number}` | 'latest';
|
|
75
|
-
|
|
76
|
-
type TerraformProviderConfig = {
|
|
77
|
-
id?: string;
|
|
78
|
-
location?: string;
|
|
79
|
-
};
|
|
80
|
-
type InstallProps = {
|
|
81
|
-
location?: string;
|
|
82
|
-
};
|
|
83
|
-
declare const createTerraformProxy: (props: {
|
|
84
|
-
namespace: string;
|
|
85
|
-
provider: {
|
|
86
|
-
org: string;
|
|
87
|
-
type: string;
|
|
88
|
-
version: Version;
|
|
89
|
-
};
|
|
90
|
-
}) => () => void;
|
|
91
|
-
|
|
92
|
-
export { type InstallProps, TerraformProvider, type TerraformProviderConfig, createTerraformProxy, generateTypes };
|