@terraforge/core 0.0.4 → 0.0.5
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 +3 -1
- package/dist/index.d.ts +281 -267
- package/dist/index.js +337 -243
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -52,7 +52,9 @@ This example illustrates how simple it is to define multi-stack resources withou
|
|
|
52
52
|
```ts
|
|
53
53
|
const app = new App('todo-app')
|
|
54
54
|
const storage = new Stack(app, 'storage')
|
|
55
|
-
const list = new aws.s3.Bucket(storage, 'list', {
|
|
55
|
+
const list = new aws.s3.Bucket(storage, 'list', {
|
|
56
|
+
bucket: 'your-bucket-name'
|
|
57
|
+
})
|
|
56
58
|
|
|
57
59
|
const items = new Stack(app, 'items')
|
|
58
60
|
const todo = new aws.s3.BucketObject(items, 'item', {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,348 +1,362 @@
|
|
|
1
|
+
import { UUID } from 'node:crypto';
|
|
2
|
+
import { AwsCredentialIdentity, AwsCredentialIdentityProvider } from '@aws-sdk/types';
|
|
3
|
+
import { S3Client } from '@aws-sdk/client-s3';
|
|
4
|
+
import { DynamoDB } from '@aws-sdk/client-dynamodb';
|
|
5
|
+
|
|
1
6
|
declare class Future<T = unknown> {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
protected callback: (resolve: (data: T) => void, reject: (error: unknown) => void) => void;
|
|
8
|
+
protected listeners: Set<{
|
|
9
|
+
resolve: (data: T) => void;
|
|
10
|
+
reject?: (error: unknown) => void;
|
|
11
|
+
}>;
|
|
12
|
+
protected status: 0 | 1 | 2 | 3;
|
|
13
|
+
protected data?: T;
|
|
14
|
+
protected error?: unknown;
|
|
15
|
+
constructor(callback: (resolve: (data: T) => void, reject: (error: unknown) => void) => void);
|
|
16
|
+
get [Symbol.toStringTag](): string;
|
|
17
|
+
pipe<N>(cb: (value: T) => N): Future<Awaited<N>>;
|
|
18
|
+
then(resolve: (data: T) => void, reject?: (error: unknown) => void): void;
|
|
11
19
|
}
|
|
20
|
+
|
|
12
21
|
type Input<T = unknown> = T | Output<T> | Future<T> | Promise<T>;
|
|
13
22
|
type OptionalInput<T = unknown> = Input<T> | Input<T | undefined> | Input<undefined>;
|
|
14
|
-
|
|
23
|
+
type UnwrapInputArray<T extends Input[]> = {
|
|
24
|
+
[K in keyof T]: UnwrapInput<T[K]>;
|
|
25
|
+
};
|
|
26
|
+
type UnwrapInput<T> = T extends Input<infer V> ? V : T;
|
|
27
|
+
declare const findInputDeps: (props: unknown) => Meta[];
|
|
15
28
|
declare const resolveInputs: <T>(inputs: T) => Promise<T>;
|
|
29
|
+
|
|
16
30
|
type OptionalOutput<T = unknown> = Output<T | undefined>;
|
|
17
31
|
declare class Output<T = unknown> extends Future<T> {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
32
|
+
readonly dependencies: Set<Meta>;
|
|
33
|
+
constructor(dependencies: Set<Meta>, callback: (resolve: (data: T) => void, reject: (error: unknown) => void) => void);
|
|
34
|
+
pipe<N>(cb: (value: T) => N): Output<Awaited<N>>;
|
|
21
35
|
}
|
|
22
|
-
declare const deferredOutput:
|
|
23
|
-
declare const output:
|
|
36
|
+
declare const deferredOutput: <T>(cb: (resolve: (data: T) => void) => void) => Output<T>;
|
|
37
|
+
declare const output: <T>(value: T) => Output<T>;
|
|
38
|
+
declare const combine: <T extends Input[], R = UnwrapInputArray<T>>(...inputs: T) => Output<R>;
|
|
39
|
+
declare const resolve: <T extends [Input, ...Input[]], R>(inputs: T, transformer: (...inputs: UnwrapInputArray<T>) => R) => Output<Awaited<R>>;
|
|
40
|
+
declare const interpolate: (literals: TemplateStringsArray, ...placeholders: Input<any>[]) => Output<string>;
|
|
41
|
+
|
|
24
42
|
type URN = `urn:${string}`;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
C extends Config = Config
|
|
31
|
-
> = {
|
|
32
|
-
readonly [nodeMetaSymbol]: Meta<T, I, O, C>;
|
|
33
|
-
readonly urn: URN;
|
|
43
|
+
|
|
44
|
+
declare const nodeMetaSymbol: unique symbol;
|
|
45
|
+
type Node<T extends Tag = Tag, I extends State = State, O extends State = any, C extends Config = Config> = {
|
|
46
|
+
readonly [nodeMetaSymbol]: Meta<T, I, O, C>;
|
|
47
|
+
readonly urn: URN;
|
|
34
48
|
} & O;
|
|
35
49
|
declare const isNode: (obj: object) => obj is {
|
|
36
|
-
|
|
50
|
+
[nodeMetaSymbol]: Meta;
|
|
37
51
|
};
|
|
38
52
|
declare function getMeta(node: Resource): ResourceMeta;
|
|
39
53
|
declare function getMeta(node: DataSource): DataSourceMeta;
|
|
40
54
|
declare function getMeta(node: Node): Meta;
|
|
41
55
|
declare const isResource: (obj: object) => obj is Resource;
|
|
42
56
|
declare const isDataSource: (obj: object) => obj is DataSource;
|
|
57
|
+
|
|
43
58
|
type ResourceConfig = Config & {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
59
|
+
/** Import an existing resource instead of creating a new resource. */
|
|
60
|
+
import?: string;
|
|
61
|
+
/** If true the resource will be retained in the backing cloud provider during a Pulumi delete operation. */
|
|
62
|
+
retainOnDelete?: boolean;
|
|
63
|
+
/** Override the default create-after-delete behavior when replacing a resource. */
|
|
64
|
+
/** If set, the provider’s Delete method will not be called for this resource if the specified resource is being deleted as well. */
|
|
65
|
+
/** Declare that changes to certain properties should be treated as forcing a replacement. */
|
|
66
|
+
replaceOnChanges?: string[];
|
|
52
67
|
};
|
|
53
|
-
type ResourceMeta<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
type Resource<
|
|
58
|
-
I extends State = State,
|
|
59
|
-
O extends State = State
|
|
60
|
-
> = O & {
|
|
61
|
-
readonly [nodeMetaSymbol]: ResourceMeta<I, O>;
|
|
62
|
-
readonly urn: URN;
|
|
68
|
+
type ResourceMeta<I extends State = State, O extends State = State> = Meta<'resource', I, O, ResourceConfig>;
|
|
69
|
+
type Resource<I extends State = State, O extends State = State> = O & {
|
|
70
|
+
readonly [nodeMetaSymbol]: ResourceMeta<I, O>;
|
|
71
|
+
readonly urn: URN;
|
|
63
72
|
};
|
|
64
|
-
type ResourceClass<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
> = {
|
|
68
|
-
new (parent: Group, id: string, props: I, config?: ResourceConfig): Resource<I, O>;
|
|
69
|
-
get(parent: Group, id: string, physicalId: string): DataSource<I, O>;
|
|
73
|
+
type ResourceClass<I extends State = State, O extends State = State> = {
|
|
74
|
+
new (parent: Group, id: string, props: I, config?: ResourceConfig): Resource<I, O>;
|
|
75
|
+
get(parent: Group, id: string, physicalId: string): DataSource<I, O>;
|
|
70
76
|
};
|
|
77
|
+
|
|
71
78
|
declare class Stack extends Group {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
79
|
+
readonly app: App;
|
|
80
|
+
readonly dependencies: Set<Stack>;
|
|
81
|
+
constructor(app: App, name: string);
|
|
82
|
+
dependsOn(...stacks: Stack[]): this;
|
|
76
83
|
}
|
|
77
|
-
|
|
84
|
+
|
|
85
|
+
type Tag = 'resource' | 'data';
|
|
78
86
|
type State = Record<string, unknown>;
|
|
79
87
|
type Config = {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
88
|
+
/** Specify additional explicit dependencies in addition to the ones in the dependency graph. */
|
|
89
|
+
dependsOn?: Resource<any, any>[];
|
|
90
|
+
/** Pass an ID of an explicitly configured provider, instead of using the default provider. */
|
|
91
|
+
provider?: string;
|
|
84
92
|
};
|
|
85
|
-
type Meta<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
readonly input: I;
|
|
98
|
-
readonly config?: C;
|
|
99
|
-
readonly dependencies: Set<URN>;
|
|
100
|
-
readonly resolve: (data: O) => void;
|
|
101
|
-
readonly output: <O>(cb: (data: State) => O) => Output<O>;
|
|
93
|
+
type Meta<T extends Tag = Tag, I extends State = State, O extends State = State, C extends Config = Config> = {
|
|
94
|
+
readonly tag: T;
|
|
95
|
+
readonly urn: URN;
|
|
96
|
+
readonly logicalId: string;
|
|
97
|
+
readonly type: string;
|
|
98
|
+
readonly stack: Stack;
|
|
99
|
+
readonly provider: string;
|
|
100
|
+
readonly input: I;
|
|
101
|
+
readonly config?: C;
|
|
102
|
+
readonly dependencies: Set<URN>;
|
|
103
|
+
readonly resolve: (data: O) => void;
|
|
104
|
+
readonly output: <O>(cb: (data: State) => O) => Output<O>;
|
|
102
105
|
};
|
|
103
|
-
declare const createMeta: <
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
type DataSourceMeta<
|
|
110
|
-
I extends State = State,
|
|
111
|
-
O extends State = State
|
|
112
|
-
> = Meta<"data", I, O>;
|
|
113
|
-
type DataSource<
|
|
114
|
-
I extends State = State,
|
|
115
|
-
O extends State = State
|
|
116
|
-
> = {
|
|
117
|
-
readonly [nodeMetaSymbol]: DataSourceMeta<I, O>;
|
|
106
|
+
declare const createMeta: <T extends Tag = Tag, I extends State = State, O extends State = State, C extends Config = Config>(tag: T, provider: string, parent: Group, type: string, logicalId: string, input: I, config?: C) => Meta<T, I, O, C>;
|
|
107
|
+
|
|
108
|
+
type DataSourceMeta<I extends State = State, O extends State = State> = Meta<'data', I, O>;
|
|
109
|
+
type DataSource<I extends State = State, O extends State = State> = {
|
|
110
|
+
readonly [nodeMetaSymbol]: DataSourceMeta<I, O>;
|
|
111
|
+
readonly urn: URN;
|
|
118
112
|
} & O;
|
|
119
|
-
type DataSourceFunction<
|
|
120
|
-
|
|
121
|
-
O extends State = State
|
|
122
|
-
> = (parent: Group, id: string, input: I, config?: Config) => DataSource<I, O>;
|
|
113
|
+
type DataSourceFunction<I extends State = State, O extends State = State> = (parent: Group, id: string, input: I, config?: Config) => DataSource<I, O>;
|
|
114
|
+
|
|
123
115
|
declare class Group {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
116
|
+
readonly parent: Group | undefined;
|
|
117
|
+
readonly type: string;
|
|
118
|
+
readonly name: string;
|
|
119
|
+
protected children: Array<Group | Node>;
|
|
120
|
+
constructor(parent: Group | undefined, type: string, name: string);
|
|
121
|
+
get urn(): URN;
|
|
122
|
+
protected addChild(child: Group | Node): void;
|
|
123
|
+
add(...children: Array<Group | Node>): void;
|
|
124
|
+
get nodes(): Node[];
|
|
125
|
+
get resources(): Resource[];
|
|
126
|
+
get dataSources(): DataSource[];
|
|
135
127
|
}
|
|
128
|
+
|
|
136
129
|
declare class App extends Group {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
130
|
+
readonly name: string;
|
|
131
|
+
constructor(name: string);
|
|
132
|
+
get stacks(): Stack[];
|
|
140
133
|
}
|
|
141
|
-
|
|
142
|
-
declare const
|
|
143
|
-
|
|
134
|
+
|
|
135
|
+
declare const enableDebug: () => void;
|
|
136
|
+
declare const createDebugger: (group: string) => (...args: unknown[]) => void;
|
|
137
|
+
|
|
144
138
|
interface LockBackend {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
139
|
+
insecureReleaseLock(urn: URN): Promise<void>;
|
|
140
|
+
locked(urn: URN): Promise<boolean>;
|
|
141
|
+
lock(urn: URN): Promise<() => Promise<void>>;
|
|
148
142
|
}
|
|
149
|
-
|
|
143
|
+
|
|
150
144
|
type AppState = {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
145
|
+
name: string;
|
|
146
|
+
version?: number;
|
|
147
|
+
idempotentToken?: UUID;
|
|
148
|
+
stacks: Record<URN, StackState>;
|
|
155
149
|
};
|
|
156
150
|
type StackState = {
|
|
157
|
-
|
|
158
|
-
|
|
151
|
+
name: string;
|
|
152
|
+
nodes: Record<URN, NodeState>;
|
|
159
153
|
};
|
|
160
154
|
type NodeState = {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
155
|
+
tag: 'resource' | 'data';
|
|
156
|
+
type: string;
|
|
157
|
+
version?: number;
|
|
158
|
+
provider: string;
|
|
159
|
+
input: State;
|
|
160
|
+
output: State;
|
|
161
|
+
dependencies: URN[];
|
|
162
|
+
lifecycle?: {
|
|
163
|
+
retainOnDelete?: boolean;
|
|
164
|
+
deleteAfterCreate?: boolean;
|
|
165
|
+
};
|
|
172
166
|
};
|
|
167
|
+
|
|
173
168
|
type StateBackend = {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
169
|
+
get(urn: URN): Promise<AppState | undefined>;
|
|
170
|
+
update(urn: URN, state: AppState): Promise<void>;
|
|
171
|
+
delete(urn: URN): Promise<void>;
|
|
177
172
|
};
|
|
173
|
+
|
|
178
174
|
type CreateProps<T = State> = {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
175
|
+
type: string;
|
|
176
|
+
state: T;
|
|
177
|
+
idempotantToken?: string;
|
|
182
178
|
};
|
|
183
179
|
type UpdateProps<T = State> = {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
180
|
+
type: string;
|
|
181
|
+
priorState: T;
|
|
182
|
+
proposedState: T;
|
|
183
|
+
idempotantToken?: string;
|
|
188
184
|
};
|
|
189
185
|
type DeleteProps<T = State> = {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
186
|
+
type: string;
|
|
187
|
+
state: T;
|
|
188
|
+
idempotantToken?: string;
|
|
193
189
|
};
|
|
194
190
|
type GetProps<T = State> = {
|
|
195
|
-
|
|
196
|
-
|
|
191
|
+
type: string;
|
|
192
|
+
state: T;
|
|
197
193
|
};
|
|
198
194
|
type GetDataProps<T = State> = {
|
|
199
|
-
|
|
200
|
-
|
|
195
|
+
type: string;
|
|
196
|
+
state: T;
|
|
201
197
|
};
|
|
202
198
|
interface Provider {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
199
|
+
ownResource(id: string): boolean;
|
|
200
|
+
getResource(props: GetProps): Promise<{
|
|
201
|
+
version: number;
|
|
202
|
+
state: State;
|
|
203
|
+
}>;
|
|
204
|
+
createResource(props: CreateProps): Promise<{
|
|
205
|
+
version: number;
|
|
206
|
+
state: State;
|
|
207
|
+
}>;
|
|
208
|
+
updateResource(props: UpdateProps): Promise<{
|
|
209
|
+
version: number;
|
|
210
|
+
state: State;
|
|
211
|
+
}>;
|
|
212
|
+
deleteResource(props: DeleteProps): Promise<void>;
|
|
213
|
+
getData?(props: GetDataProps): Promise<{
|
|
214
|
+
state: State;
|
|
215
|
+
}>;
|
|
216
|
+
destroy?(): Promise<void>;
|
|
221
217
|
}
|
|
218
|
+
|
|
222
219
|
type ProcedureOptions = {
|
|
223
|
-
|
|
224
|
-
|
|
220
|
+
filters?: string[];
|
|
221
|
+
idempotentToken?: UUID;
|
|
225
222
|
};
|
|
226
223
|
type WorkSpaceOptions = {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
224
|
+
providers: Provider[];
|
|
225
|
+
concurrency?: number;
|
|
226
|
+
backend: {
|
|
227
|
+
state: StateBackend;
|
|
228
|
+
lock: LockBackend;
|
|
229
|
+
};
|
|
233
230
|
};
|
|
234
231
|
declare class WorkSpace {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
232
|
+
protected props: WorkSpaceOptions;
|
|
233
|
+
constructor(props: WorkSpaceOptions);
|
|
234
|
+
/**
|
|
235
|
+
* Deploy the entire app or use the filter option to deploy specific stacks inside your app.
|
|
236
|
+
*/
|
|
237
|
+
deploy(app: App, options?: ProcedureOptions): Promise<void>;
|
|
238
|
+
/**
|
|
239
|
+
* Delete the entire app or use the filter option to delete specific stacks inside your app.
|
|
240
|
+
*/
|
|
241
|
+
delete(app: App, options?: ProcedureOptions): Promise<void>;
|
|
242
|
+
/**
|
|
243
|
+
* Hydrate the outputs of the resources & data-sources inside your app.
|
|
244
|
+
*/
|
|
245
|
+
hydrate(app: App): Promise<void>;
|
|
246
|
+
/**
|
|
247
|
+
* Refresh the state of the resources & data-sources inside your app.
|
|
248
|
+
*/
|
|
249
|
+
refresh(app: App): Promise<void>;
|
|
250
|
+
protected destroyProviders(): Promise<void>;
|
|
254
251
|
}
|
|
255
|
-
|
|
252
|
+
|
|
253
|
+
type ResourceOperation = 'create' | 'update' | 'delete' | 'replace' | 'import' | 'resolve' | 'get';
|
|
254
|
+
|
|
256
255
|
declare class ResourceError extends Error {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
256
|
+
readonly urn: URN;
|
|
257
|
+
readonly type: string;
|
|
258
|
+
readonly operation: ResourceOperation;
|
|
259
|
+
static wrap(urn: URN, type: string, operation: ResourceOperation, error: unknown): ResourceError;
|
|
260
|
+
constructor(urn: URN, type: string, operation: ResourceOperation, message: string);
|
|
262
261
|
}
|
|
263
262
|
declare class AppError extends Error {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
263
|
+
readonly app: string;
|
|
264
|
+
readonly issues: (ResourceError | Error)[];
|
|
265
|
+
constructor(app: string, issues: (ResourceError | Error)[], message: string);
|
|
266
|
+
}
|
|
267
|
+
declare class ResourceNotFound extends Error {
|
|
268
|
+
}
|
|
269
|
+
declare class ResourceAlreadyExists extends Error {
|
|
267
270
|
}
|
|
268
|
-
|
|
269
|
-
declare class ResourceAlreadyExists extends Error {}
|
|
271
|
+
|
|
270
272
|
declare class MemoryStateBackend implements StateBackend {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
273
|
+
protected states: Map<`urn:${string}`, AppState>;
|
|
274
|
+
get(urn: URN): Promise<AppState | undefined>;
|
|
275
|
+
update(urn: URN, state: AppState): Promise<void>;
|
|
276
|
+
delete(urn: URN): Promise<void>;
|
|
277
|
+
clear(): void;
|
|
276
278
|
}
|
|
279
|
+
|
|
277
280
|
declare class MemoryLockBackend implements LockBackend {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
281
|
+
protected locks: Map<`urn:${string}`, number>;
|
|
282
|
+
insecureReleaseLock(urn: URN): Promise<void>;
|
|
283
|
+
locked(urn: URN): Promise<boolean>;
|
|
284
|
+
lock(urn: URN): Promise<() => Promise<void>>;
|
|
285
|
+
clear(): void;
|
|
283
286
|
}
|
|
287
|
+
|
|
284
288
|
declare class FileStateBackend implements StateBackend {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
289
|
+
private props;
|
|
290
|
+
constructor(props: {
|
|
291
|
+
dir: string;
|
|
292
|
+
});
|
|
293
|
+
private stateFile;
|
|
294
|
+
private mkdir;
|
|
295
|
+
get(urn: URN): Promise<AppState | undefined>;
|
|
296
|
+
update(urn: URN, state: AppState): Promise<void>;
|
|
297
|
+
delete(urn: URN): Promise<void>;
|
|
294
298
|
}
|
|
299
|
+
|
|
295
300
|
declare class FileLockBackend implements LockBackend {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
301
|
+
private props;
|
|
302
|
+
constructor(props: {
|
|
303
|
+
dir: string;
|
|
304
|
+
});
|
|
305
|
+
private lockFile;
|
|
306
|
+
private mkdir;
|
|
307
|
+
insecureReleaseLock(urn: URN): Promise<void>;
|
|
308
|
+
locked(urn: URN): Promise<boolean>;
|
|
309
|
+
lock(urn: URN): Promise<() => Promise<void>>;
|
|
305
310
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
bucket: string;
|
|
311
|
+
|
|
312
|
+
type Props$1 = {
|
|
313
|
+
credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider;
|
|
314
|
+
region: string;
|
|
315
|
+
bucket: string;
|
|
312
316
|
};
|
|
313
317
|
declare class S3StateBackend implements StateBackend {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
318
|
+
private props;
|
|
319
|
+
protected client: S3Client;
|
|
320
|
+
constructor(props: Props$1);
|
|
321
|
+
get(urn: URN): Promise<any>;
|
|
322
|
+
update(urn: URN, state: AppState): Promise<void>;
|
|
323
|
+
delete(urn: URN): Promise<void>;
|
|
320
324
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
tableName: string;
|
|
325
|
+
|
|
326
|
+
type Props = {
|
|
327
|
+
credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider;
|
|
328
|
+
region: string;
|
|
329
|
+
tableName: string;
|
|
327
330
|
};
|
|
328
331
|
declare class DynamoLockBackend implements LockBackend {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
332
|
+
private props;
|
|
333
|
+
protected client: DynamoDB;
|
|
334
|
+
constructor(props: Props);
|
|
335
|
+
insecureReleaseLock(urn: URN): Promise<void>;
|
|
336
|
+
locked(urn: URN): Promise<boolean>;
|
|
337
|
+
lock(urn: URN): Promise<() => Promise<void>>;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
declare const file: (path: string, encoding?: BufferEncoding) => Future<string>;
|
|
341
|
+
declare const hash: (path: string, algo?: string) => Future<string>;
|
|
342
|
+
|
|
343
|
+
declare global {
|
|
344
|
+
var $resolve: typeof resolve;
|
|
345
|
+
var $combine: typeof combine;
|
|
346
|
+
var $interpolate: typeof interpolate;
|
|
347
|
+
var $hash: typeof hash;
|
|
348
|
+
var $file: typeof file;
|
|
335
349
|
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
>(providerId: string, resourceType: string) => ResourceClass<I, O>;
|
|
350
|
+
|
|
351
|
+
declare const createCustomResourceClass: <I extends State, O extends State>(providerId: string, resourceType: string) => ResourceClass<I, O>;
|
|
352
|
+
|
|
340
353
|
type CustomResourceProvider = Partial<{
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
354
|
+
getResource?(props: Omit<GetProps, 'type'>): Promise<State>;
|
|
355
|
+
updateResource?(props: Omit<UpdateProps, 'type'>): Promise<State>;
|
|
356
|
+
createResource?(props: Omit<CreateProps, 'type'>): Promise<State>;
|
|
357
|
+
deleteResource?(props: Omit<DeleteProps, 'type'>): Promise<void>;
|
|
358
|
+
getData?(props: Omit<GetDataProps, 'type'>): Promise<State>;
|
|
346
359
|
}>;
|
|
347
360
|
declare const createCustomProvider: (providerId: string, resourceProviders: Record<string, CustomResourceProvider>) => Provider;
|
|
348
|
-
|
|
361
|
+
|
|
362
|
+
export { App, AppError, type Config, type CreateProps, type CustomResourceProvider, type DataSource, type DataSourceFunction, type DataSourceMeta, type DeleteProps, DynamoLockBackend, FileLockBackend, FileStateBackend, Future, type GetDataProps, type GetProps, Group, type Input, type LockBackend, MemoryLockBackend, MemoryStateBackend, type Meta, type Node, type OptionalInput, type OptionalOutput, Output, type ProcedureOptions, type Provider, type Resource, ResourceAlreadyExists, type ResourceClass, type ResourceConfig, ResourceError, type ResourceMeta, ResourceNotFound, S3StateBackend, Stack, type State, type StateBackend, type Tag, type URN, type UpdateProps, WorkSpace, type WorkSpaceOptions, createCustomProvider, createCustomResourceClass, createDebugger, createMeta, deferredOutput, enableDebug, findInputDeps, getMeta, isDataSource, isNode, isResource, nodeMetaSymbol, output, resolveInputs };
|