nomoss 0.0.1

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 (81) hide show
  1. package/LICENSE +19 -0
  2. package/README.md +45 -0
  3. package/bin/nomoss +13 -0
  4. package/docs/code-documentation.md +36 -0
  5. package/docs/effect-native-development.md +55 -0
  6. package/docs/engine-design.md +93 -0
  7. package/docs/linting.md +88 -0
  8. package/docs/releasing.md +13 -0
  9. package/docs/resource-command-policy-stage.md +71 -0
  10. package/docs/resource-graph-mvp.md +31 -0
  11. package/docs/resource-graph-testing-approach.md +11 -0
  12. package/docs/resource-lifecycle-tracker.md +93 -0
  13. package/docs/testing.md +86 -0
  14. package/examples/upload-events/README.md +41 -0
  15. package/media/nomoss.gif +0 -0
  16. package/package.json +64 -0
  17. package/src/cli.ts +18 -0
  18. package/src/cliCommand.ts +186 -0
  19. package/src/cliRuntimeLayer.ts +49 -0
  20. package/src/core/index.ts +17 -0
  21. package/src/core/lifecycle.ts +127 -0
  22. package/src/core/model.ts +229 -0
  23. package/src/core/physicalNameStore.ts +226 -0
  24. package/src/core/planner.ts +645 -0
  25. package/src/core/resourceCommandPolicy.ts +79 -0
  26. package/src/core/resourceGraphBuilder.ts +167 -0
  27. package/src/core/resourceGraphStore.ts +288 -0
  28. package/src/core/resourceOutputResolver.ts +185 -0
  29. package/src/core/resourcePolicy.ts +77 -0
  30. package/src/core/resourceStackDefinition.ts +17 -0
  31. package/src/core/resourceStackLifecycle.ts +456 -0
  32. package/src/core/resourceStackOperations.ts +129 -0
  33. package/src/core/runtimeLayer.ts +73 -0
  34. package/src/core/stackWorkflowRenderer.ts +239 -0
  35. package/src/core/stateSecretService.ts +553 -0
  36. package/src/core/stateStore.ts +652 -0
  37. package/src/core/tracing.ts +26 -0
  38. package/src/index.ts +2 -0
  39. package/src/providers/aws/awsApply.ts +132 -0
  40. package/src/providers/aws/awsBucket.ts +329 -0
  41. package/src/providers/aws/awsBucketNotification.ts +351 -0
  42. package/src/providers/aws/awsBucketNotificationResourcePolicy.ts +251 -0
  43. package/src/providers/aws/awsBucketResourcePolicy.ts +198 -0
  44. package/src/providers/aws/awsProviderLayer.ts +274 -0
  45. package/src/providers/aws/awsQueue.ts +346 -0
  46. package/src/providers/aws/awsQueuePolicy.ts +419 -0
  47. package/src/providers/aws/awsQueuePolicyResourcePolicy.ts +215 -0
  48. package/src/providers/aws/awsQueueResourcePolicy.ts +270 -0
  49. package/src/providers/aws/awsReconciliation.ts +92 -0
  50. package/src/providers/aws/awsRefresh.ts +50 -0
  51. package/src/providers/aws/awsResourceLifecycle.ts +118 -0
  52. package/src/providers/aws/awsResourcePolicy.ts +83 -0
  53. package/src/providers/aws/awsResources.ts +274 -0
  54. package/src/providers/aws/awsRuntimeLayer.ts +21 -0
  55. package/src/providers/aws/awsSqsTransport.ts +33 -0
  56. package/src/providers/aws/awsStackLifecycle.ts +272 -0
  57. package/src/providers/aws/awsTagging.ts +186 -0
  58. package/src/providers/aws/constants.ts +3 -0
  59. package/src/providers/aws/index.ts +22 -0
  60. package/src/providers/aws/sampleStack.ts +65 -0
  61. package/src/providers/aws/stackWorkflow.ts +443 -0
  62. package/src/providers/index.ts +5 -0
  63. package/src/providers/provider.ts +5 -0
  64. package/src/providers/providerRuntimeLayer.ts +121 -0
  65. package/src/providers/resourceCommandPolicyLayer.ts +240 -0
  66. package/src/providers/stripe/index.ts +15 -0
  67. package/src/providers/stripe/stripeAccount.ts +139 -0
  68. package/src/providers/stripe/stripeBillingConfigurationExport.ts +180 -0
  69. package/src/providers/stripe/stripeBillingConfigurationExportResourcePolicy.ts +178 -0
  70. package/src/providers/stripe/stripeBillingPortalConfiguration.ts +153 -0
  71. package/src/providers/stripe/stripeBillingPortalConfigurationResourcePolicy.ts +177 -0
  72. package/src/providers/stripe/stripeCustomer.ts +148 -0
  73. package/src/providers/stripe/stripeCustomerResourcePolicy.ts +160 -0
  74. package/src/providers/stripe/stripePrice.ts +218 -0
  75. package/src/providers/stripe/stripePriceResourcePolicy.ts +151 -0
  76. package/src/providers/stripe/stripeProduct.ts +171 -0
  77. package/src/providers/stripe/stripeProductResourcePolicy.ts +161 -0
  78. package/src/providers/stripe/stripeResources.ts +454 -0
  79. package/src/providers/stripe/stripeRuntimeLayer.ts +131 -0
  80. package/src/providers/stripe/stripeWebhookEndpoint.ts +293 -0
  81. package/src/providers/stripe/stripeWebhookEndpointResourcePolicy.ts +198 -0
@@ -0,0 +1,161 @@
1
+ import { Context, Effect, Match } from "effect";
2
+
3
+ import {
4
+ type PlanDecision,
5
+ ResourceCommand,
6
+ ResourceCommandResult,
7
+ ResourceCommandUnsupported,
8
+ } from "../../core/lifecycle.js";
9
+ import {
10
+ ResourceModel,
11
+ type ResourceNode,
12
+ readResourceSchemaAnnotation,
13
+ } from "../../core/model.js";
14
+ import {
15
+ StripeProductLifecycle,
16
+ type StripeProductOutputs,
17
+ StripeProductOutputsSchema,
18
+ StripeProductPropsSchema,
19
+ StripeProductUpdatePropsSchema,
20
+ stripeProductOutputsFromState,
21
+ } from "./stripeProduct.js";
22
+
23
+ /**
24
+ * Stripe Product commands use the shared resource command protocol so the
25
+ * Example pricing catalog can apply beside dependent Price resources.
26
+ */
27
+ export class StripeProductResourcePolicy extends Context.Service<StripeProductResourcePolicy>()(
28
+ "nomoss/providers/stripe/stripeProductResourcePolicy",
29
+ {
30
+ make: Effect.gen(function* () {
31
+ const lifecycle = yield* StripeProductLifecycle;
32
+ const model = yield* ResourceModel;
33
+ const schema = yield* readResourceSchemaAnnotation(
34
+ StripeProductPropsSchema,
35
+ ).pipe(Effect.fromOption);
36
+
37
+ const resourceNode = Effect.fn(
38
+ "StripeProductResourcePolicy.resourceNode",
39
+ )(function* (node: ResourceNode, outputs: StripeProductOutputs) {
40
+ const props = yield* model.decodeProps(node, StripeProductPropsSchema);
41
+ const appliedNode = yield* model.nodeFromResource({
42
+ key: node.key,
43
+ propsSchema: StripeProductPropsSchema,
44
+ outputsSchema: StripeProductOutputsSchema,
45
+ props,
46
+ outputs,
47
+ });
48
+
49
+ return appliedNode;
50
+ });
51
+
52
+ const create = Effect.fn("StripeProductResourcePolicy.create")(function* (
53
+ node: ResourceNode,
54
+ ) {
55
+ const props = yield* model.decodeProps(node, StripeProductPropsSchema);
56
+ const product = yield* lifecycle.createProduct(props);
57
+ const outputs = stripeProductOutputsFromState(product);
58
+ const appliedNode = yield* resourceNode(node, outputs);
59
+
60
+ return ResourceCommandResult.Created({ node: appliedNode });
61
+ });
62
+
63
+ const update = Effect.fn("StripeProductResourcePolicy.update")(function* (
64
+ node: ResourceNode,
65
+ current: ResourceNode,
66
+ ) {
67
+ const props = yield* model.decodeProps(node, StripeProductPropsSchema);
68
+ const currentOutputs = yield* model.decodeOutputs(
69
+ current,
70
+ StripeProductOutputsSchema,
71
+ );
72
+ const input = yield* StripeProductUpdatePropsSchema.makeEffect({
73
+ id: currentOutputs.ProductId,
74
+ active: props.active,
75
+ description: props.description,
76
+ metadata: props.metadata,
77
+ name: props.name,
78
+ statement_descriptor: props.statement_descriptor,
79
+ tax_code: props.tax_code,
80
+ unit_label: props.unit_label,
81
+ url: props.url,
82
+ });
83
+ const product = yield* lifecycle.updateProduct(input);
84
+ const outputs = stripeProductOutputsFromState(product);
85
+ const appliedNode = yield* resourceNode(node, outputs);
86
+
87
+ return ResourceCommandResult.Updated({ node: appliedNode });
88
+ });
89
+
90
+ const destroy = Effect.fn("StripeProductResourcePolicy.destroy")(
91
+ function* (node: ResourceNode) {
92
+ const outputs = yield* model.decodeOutputs(
93
+ node,
94
+ StripeProductOutputsSchema,
95
+ );
96
+
97
+ yield* lifecycle.deactivateProduct(outputs.ProductId);
98
+
99
+ return ResourceCommandResult.Destroyed({ node });
100
+ },
101
+ );
102
+
103
+ const apply = Effect.fn("StripeProductResourcePolicy.apply")(function* (
104
+ decision: PlanDecision,
105
+ ) {
106
+ return yield* Match.value(decision).pipe(
107
+ Match.tagsExhaustive({
108
+ Create: ({ node }) => create(node),
109
+ Update: ({ node, current }) => update(node, current),
110
+ Destroy: ({ node }) => destroy(node),
111
+ NoOp: () =>
112
+ Effect.fail(
113
+ new ResourceCommandUnsupported({
114
+ command: ResourceCommand.Apply({ decision }),
115
+ }),
116
+ ),
117
+ Repair: () =>
118
+ Effect.fail(
119
+ new ResourceCommandUnsupported({
120
+ command: ResourceCommand.Apply({ decision }),
121
+ }),
122
+ ),
123
+ Delete: () =>
124
+ Effect.fail(
125
+ new ResourceCommandUnsupported({
126
+ command: ResourceCommand.Apply({ decision }),
127
+ }),
128
+ ),
129
+ }),
130
+ );
131
+ });
132
+
133
+ return {
134
+ schema,
135
+ create,
136
+ update,
137
+ destroy,
138
+ apply,
139
+ execute: Effect.fn("StripeProductResourcePolicy.execute")(function* (
140
+ command: ResourceCommand,
141
+ ) {
142
+ return yield* Match.value(command).pipe(
143
+ Match.tagsExhaustive({
144
+ Read: () =>
145
+ Effect.fail(new ResourceCommandUnsupported({ command })),
146
+ Diff: () =>
147
+ Effect.fail(new ResourceCommandUnsupported({ command })),
148
+ Apply: ({ decision }) => apply(decision),
149
+ Create: ({ node }) => create(node),
150
+ Update: () =>
151
+ Effect.fail(new ResourceCommandUnsupported({ command })),
152
+ Delete: () =>
153
+ Effect.fail(new ResourceCommandUnsupported({ command })),
154
+ Destroy: ({ node }) => destroy(node),
155
+ }),
156
+ );
157
+ }),
158
+ };
159
+ }),
160
+ },
161
+ ) {}
@@ -0,0 +1,454 @@
1
+ import { Context, Data, Effect, Option, Record } from "effect";
2
+
3
+ import { type ResourceOutputRef, resourceOutputRef } from "../../core/model.js";
4
+ import { ResourceGraphBuilder } from "../../core/resourceGraphBuilder.js";
5
+ import {
6
+ StripeBillingConfigurationExportOutputsSchema,
7
+ StripeBillingConfigurationExportPropsSchema,
8
+ } from "./stripeBillingConfigurationExport.js";
9
+ import {
10
+ pendingStripeBillingPortalConfigurationOutputs,
11
+ StripeBillingPortalConfigurationOutputsSchema,
12
+ type StripeBillingPortalConfigurationProps,
13
+ StripeBillingPortalConfigurationPropsSchema,
14
+ type StripeBillingPortalConfigurationSubscriptionUpdateProductDeclaration,
15
+ } from "./stripeBillingPortalConfiguration.js";
16
+ import {
17
+ pendingStripeCustomerOutputs,
18
+ StripeCustomerOutputsSchema,
19
+ type StripeCustomerProps,
20
+ StripeCustomerPropsSchema,
21
+ } from "./stripeCustomer.js";
22
+ import {
23
+ pendingStripePriceOutputs,
24
+ StripePriceDeclarationPropsSchema,
25
+ StripePriceOutputsSchema,
26
+ type StripeRecurringPriceDeclarationProps,
27
+ StripeRecurringPriceDeclarationPropsSchema,
28
+ stripePricePropsFromDeclaration,
29
+ } from "./stripePrice.js";
30
+ import {
31
+ StripeProductOutputsSchema,
32
+ type StripeProductProps,
33
+ StripeProductPropsSchema,
34
+ stripeProductOutputsFromProps,
35
+ } from "./stripeProduct.js";
36
+ import {
37
+ pendingStripeWebhookEndpointOutputs,
38
+ StripeWebhookEndpointOutputsSchema,
39
+ StripeWebhookEndpointPropsSchema,
40
+ type StripeWebhookEndpointRequestProps,
41
+ } from "./stripeWebhookEndpoint.js";
42
+
43
+ /**
44
+ * A stack declaration uses this input when it asks Nomoss to create or track
45
+ * a Stripe Customer resource. The logical id becomes the stable graph key, and
46
+ * the props follow the generated Stripe Customer operation schema.
47
+ */
48
+ export type StripeCustomerInput = {
49
+ readonly logicalId: string;
50
+ readonly props: StripeCustomerProps;
51
+ };
52
+
53
+ /**
54
+ * A stack declaration uses this input when it asks Nomoss to create or track
55
+ * a Stripe Product resource. Product outputs can be referenced by Prices and by
56
+ * the billing configuration export.
57
+ */
58
+ export type StripeProductInput = {
59
+ readonly logicalId: string;
60
+ readonly props: StripeProductProps;
61
+ };
62
+
63
+ /**
64
+ * A stack declaration uses this input when it asks Nomoss to create a Stripe
65
+ * Price for an already-declared Product. The Product id stays as a resource ref
66
+ * until apply resolves it from the Nomoss state graph.
67
+ */
68
+ export type StripePriceInput = {
69
+ readonly logicalId: string;
70
+ readonly product: ResourceOutputRef;
71
+ readonly props: StripeRecurringPriceDeclarationProps;
72
+ };
73
+
74
+ /**
75
+ * A stack declaration uses this input when it asks Nomoss to register a
76
+ * Stripe webhook endpoint. Runtime configuration may add delivery credentials
77
+ * during apply without storing those credentials in resource state.
78
+ */
79
+ export type StripeWebhookEndpointInput = {
80
+ readonly logicalId: string;
81
+ readonly props: StripeWebhookEndpointRequestProps;
82
+ readonly rotationKey?: string;
83
+ };
84
+
85
+ /**
86
+ * A stack declaration uses this input when it asks Nomoss to manage the
87
+ * Stripe Billing Portal configuration that account billing pages open through
88
+ * the backend Portal session mutation.
89
+ */
90
+ export type StripeBillingPortalConfigurationInput = {
91
+ readonly logicalId: string;
92
+ readonly props: StripeBillingPortalConfigurationProps;
93
+ readonly subscriptionUpdateProducts?: ReadonlyArray<StripeBillingPortalConfigurationSubscriptionUpdateProductDeclaration>;
94
+ };
95
+
96
+ class BillingPortalSubscriptionUpdateConfigurationMissing extends Data.TaggedError(
97
+ "BillingPortalSubscriptionUpdateConfigurationMissing",
98
+ )<{
99
+ readonly logicalId: string;
100
+ }> {}
101
+
102
+ /**
103
+ * A stack declaration uses this input when it asks Nomoss to write the
104
+ * applied billing configuration file. The export receives refs from Product,
105
+ * Price, Portal, and webhook resources so application code can read concrete
106
+ * Stripe ids after apply.
107
+ */
108
+ export type StripeBillingConfigurationExportInput = {
109
+ readonly logicalId: string;
110
+ readonly apiVersion: string;
111
+ readonly billingPortalConfigurationId: ResourceOutputRef;
112
+ readonly mode: "test" | "live";
113
+ readonly outputPath: string;
114
+ readonly prices: {
115
+ readonly activeMonthly: ResourceOutputRef;
116
+ readonly advancedMonthly: ResourceOutputRef;
117
+ readonly starterMonthly: ResourceOutputRef;
118
+ };
119
+ readonly products: {
120
+ readonly active: ResourceOutputRef;
121
+ readonly advanced: ResourceOutputRef;
122
+ readonly starter: ResourceOutputRef;
123
+ };
124
+ readonly webhookEndpoint: {
125
+ readonly id: ResourceOutputRef;
126
+ };
127
+ };
128
+
129
+ /**
130
+ * Stripe stack programs declare billing resources through this service. The
131
+ * service validates each declaration, records the graph node, and returns output
132
+ * refs that downstream resources can depend on before apply creates Stripe ids.
133
+ */
134
+ export class StripeResources extends Context.Service<StripeResources>()(
135
+ "nomoss/providers/stripe/stripeResources",
136
+ {
137
+ make: Effect.gen(function* () {
138
+ const graph = yield* ResourceGraphBuilder;
139
+
140
+ return {
141
+ Customer: Effect.fn("StripeResources.Customer")(function* (
142
+ input: StripeCustomerInput,
143
+ ) {
144
+ const key = { logicalId: input.logicalId };
145
+ const declaration = yield* graph.resource(key);
146
+ const props = yield* StripeCustomerPropsSchema.makeEffect(
147
+ input.props,
148
+ );
149
+ const outputs = pendingStripeCustomerOutputs(input.logicalId);
150
+
151
+ yield* declaration.register({
152
+ propsSchema: StripeCustomerPropsSchema,
153
+ outputsSchema: StripeCustomerOutputsSchema,
154
+ props,
155
+ outputs,
156
+ });
157
+
158
+ const resource = {
159
+ key,
160
+ props,
161
+ CustomerId: resourceOutputRef(key, "CustomerId"),
162
+ };
163
+
164
+ return resource;
165
+ }),
166
+
167
+ Product: Effect.fn("StripeResources.Product")(function* (
168
+ input: StripeProductInput,
169
+ ) {
170
+ const key = { logicalId: input.logicalId };
171
+ const declaration = yield* graph.resource(key);
172
+ const props = yield* StripeProductPropsSchema.makeEffect(input.props);
173
+ const outputs = stripeProductOutputsFromProps(input.logicalId, props);
174
+
175
+ yield* declaration.register({
176
+ propsSchema: StripeProductPropsSchema,
177
+ outputsSchema: StripeProductOutputsSchema,
178
+ props,
179
+ outputs,
180
+ });
181
+
182
+ const resource = {
183
+ key,
184
+ props,
185
+ ProductId: resourceOutputRef(key, "ProductId"),
186
+ };
187
+
188
+ return resource;
189
+ }),
190
+
191
+ Price: Effect.fn("StripeResources.Price")(function* (
192
+ input: StripePriceInput,
193
+ ) {
194
+ const key = { logicalId: input.logicalId };
195
+ const declaration = yield* graph.resource(key);
196
+ yield* declaration.after(
197
+ input.product.source,
198
+ "product",
199
+ input.product.property,
200
+ );
201
+ const declarationProps =
202
+ yield* StripeRecurringPriceDeclarationPropsSchema.makeEffect(
203
+ input.props,
204
+ );
205
+ const props = stripePricePropsFromDeclaration(
206
+ input.product,
207
+ declarationProps,
208
+ );
209
+ const outputs = pendingStripePriceOutputs(input.logicalId);
210
+
211
+ yield* declaration.register({
212
+ propsSchema: StripePriceDeclarationPropsSchema,
213
+ outputsSchema: StripePriceOutputsSchema,
214
+ props,
215
+ outputs,
216
+ });
217
+
218
+ const resource = {
219
+ key,
220
+ props,
221
+ PriceId: resourceOutputRef(key, "PriceId"),
222
+ };
223
+
224
+ return resource;
225
+ }),
226
+
227
+ WebhookEndpoint: Effect.fn("StripeResources.WebhookEndpoint")(
228
+ function* (input: StripeWebhookEndpointInput) {
229
+ const key = { logicalId: input.logicalId };
230
+ const declaration = yield* graph.resource(key);
231
+ const props = yield* Option.fromUndefinedOr(input.rotationKey).pipe(
232
+ Option.match({
233
+ onNone: () =>
234
+ StripeWebhookEndpointPropsSchema.makeEffect({
235
+ endpoint: input.props,
236
+ }),
237
+ onSome: (rotationKey) =>
238
+ StripeWebhookEndpointPropsSchema.makeEffect({
239
+ endpoint: input.props,
240
+ rotationKey,
241
+ }),
242
+ }),
243
+ );
244
+ const outputs = pendingStripeWebhookEndpointOutputs(
245
+ input.logicalId,
246
+ );
247
+
248
+ yield* declaration.register({
249
+ propsSchema: StripeWebhookEndpointPropsSchema,
250
+ outputsSchema: StripeWebhookEndpointOutputsSchema,
251
+ props,
252
+ outputs,
253
+ });
254
+
255
+ const resource = {
256
+ key,
257
+ props,
258
+ WebhookEndpointId: resourceOutputRef(key, "WebhookEndpointId"),
259
+ };
260
+
261
+ return resource;
262
+ },
263
+ ),
264
+
265
+ BillingPortalConfiguration: Effect.fn(
266
+ "StripeResources.BillingPortalConfiguration",
267
+ )(function* (input: StripeBillingPortalConfigurationInput) {
268
+ const key = { logicalId: input.logicalId };
269
+ const declaration = yield* graph.resource(key);
270
+ const props = yield* Option.match(
271
+ Option.fromUndefinedOr(input.subscriptionUpdateProducts),
272
+ {
273
+ onNone: () =>
274
+ StripeBillingPortalConfigurationPropsSchema.makeEffect(
275
+ input.props,
276
+ ),
277
+ onSome: (products) =>
278
+ Option.match(
279
+ Option.fromUndefinedOr(
280
+ input.props.features.subscription_update,
281
+ ),
282
+ {
283
+ onNone: () =>
284
+ Effect.fail(
285
+ new BillingPortalSubscriptionUpdateConfigurationMissing(
286
+ {
287
+ logicalId: input.logicalId,
288
+ },
289
+ ),
290
+ ),
291
+ onSome: (subscriptionUpdate) =>
292
+ Effect.forEach(products, (product, productIndex) =>
293
+ Effect.all({
294
+ product: declaration.stringFrom(
295
+ product.product,
296
+ `features.subscription_update.products.${productIndex}.product`,
297
+ ),
298
+ prices: Effect.forEach(
299
+ product.prices,
300
+ (price, priceIndex) =>
301
+ declaration.stringFrom(
302
+ price,
303
+ `features.subscription_update.products.${productIndex}.prices.${priceIndex}`,
304
+ ),
305
+ ),
306
+ }),
307
+ ).pipe(
308
+ Effect.flatMap((subscriptionUpdateProducts) =>
309
+ StripeBillingPortalConfigurationPropsSchema.makeEffect(
310
+ {
311
+ business_profile: input.props.business_profile,
312
+ default_return_url:
313
+ input.props.default_return_url,
314
+ features: Record.filter(
315
+ {
316
+ customer_update:
317
+ input.props.features.customer_update,
318
+ invoice_history:
319
+ input.props.features.invoice_history,
320
+ payment_method_update:
321
+ input.props.features.payment_method_update,
322
+ subscription_cancel:
323
+ input.props.features.subscription_cancel,
324
+ subscription_update: Record.filter(
325
+ {
326
+ billing_cycle_anchor:
327
+ subscriptionUpdate.billing_cycle_anchor,
328
+ default_allowed_updates:
329
+ subscriptionUpdate.default_allowed_updates,
330
+ enabled: subscriptionUpdate.enabled,
331
+ products: subscriptionUpdateProducts,
332
+ proration_behavior:
333
+ subscriptionUpdate.proration_behavior,
334
+ schedule_at_period_end:
335
+ subscriptionUpdate.schedule_at_period_end,
336
+ trial_update_behavior:
337
+ subscriptionUpdate.trial_update_behavior,
338
+ },
339
+ (value) => value !== undefined,
340
+ ),
341
+ },
342
+ (value) => value !== undefined,
343
+ ),
344
+ login_page: input.props.login_page,
345
+ metadata: input.props.metadata,
346
+ name: input.props.name,
347
+ },
348
+ ),
349
+ ),
350
+ ),
351
+ },
352
+ ),
353
+ },
354
+ );
355
+ const outputs = pendingStripeBillingPortalConfigurationOutputs(
356
+ input.logicalId,
357
+ );
358
+
359
+ yield* declaration.register({
360
+ propsSchema: StripeBillingPortalConfigurationPropsSchema,
361
+ outputsSchema: StripeBillingPortalConfigurationOutputsSchema,
362
+ props,
363
+ outputs,
364
+ });
365
+
366
+ const resource = {
367
+ key,
368
+ props,
369
+ BillingPortalConfigurationId: resourceOutputRef(
370
+ key,
371
+ "BillingPortalConfigurationId",
372
+ ),
373
+ };
374
+
375
+ return resource;
376
+ }),
377
+
378
+ BillingConfigurationExport: Effect.fn(
379
+ "StripeResources.BillingConfigurationExport",
380
+ )(function* (input: StripeBillingConfigurationExportInput) {
381
+ const key = { logicalId: input.logicalId };
382
+ const declaration = yield* graph.resource(key);
383
+ yield* declaration.after(
384
+ input.billingPortalConfigurationId.source,
385
+ "billingPortalConfigurationId",
386
+ input.billingPortalConfigurationId.property,
387
+ );
388
+ yield* declaration.after(
389
+ input.prices.activeMonthly.source,
390
+ "prices.activeMonthly",
391
+ input.prices.activeMonthly.property,
392
+ );
393
+ yield* declaration.after(
394
+ input.prices.advancedMonthly.source,
395
+ "prices.advancedMonthly",
396
+ input.prices.advancedMonthly.property,
397
+ );
398
+ yield* declaration.after(
399
+ input.prices.starterMonthly.source,
400
+ "prices.starterMonthly",
401
+ input.prices.starterMonthly.property,
402
+ );
403
+ yield* declaration.after(
404
+ input.products.active.source,
405
+ "products.active",
406
+ input.products.active.property,
407
+ );
408
+ yield* declaration.after(
409
+ input.products.advanced.source,
410
+ "products.advanced",
411
+ input.products.advanced.property,
412
+ );
413
+ yield* declaration.after(
414
+ input.products.starter.source,
415
+ "products.starter",
416
+ input.products.starter.property,
417
+ );
418
+ yield* declaration.after(
419
+ input.webhookEndpoint.id.source,
420
+ "webhookEndpoint.id",
421
+ input.webhookEndpoint.id.property,
422
+ );
423
+ const props =
424
+ yield* StripeBillingConfigurationExportPropsSchema.makeEffect({
425
+ apiVersion: input.apiVersion,
426
+ billingPortalConfigurationId: input.billingPortalConfigurationId,
427
+ mode: input.mode,
428
+ outputPath: input.outputPath,
429
+ prices: input.prices,
430
+ products: input.products,
431
+ webhookEndpoint: input.webhookEndpoint,
432
+ });
433
+ const outputs = {
434
+ OutputPath: props.outputPath,
435
+ };
436
+ yield* declaration.register({
437
+ propsSchema: StripeBillingConfigurationExportPropsSchema,
438
+ outputsSchema: StripeBillingConfigurationExportOutputsSchema,
439
+ props,
440
+ outputs,
441
+ });
442
+
443
+ const resource = {
444
+ key,
445
+ props,
446
+ OutputPath: resourceOutputRef(key, "OutputPath"),
447
+ };
448
+
449
+ return resource;
450
+ }),
451
+ };
452
+ }),
453
+ },
454
+ ) {}