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