@reventlessdev/rescript-pulumi-aws 2.4.0-alpha.79 → 3.0.0-alpha.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/CHANGELOG.md CHANGED
@@ -3,6 +3,31 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 3.0.0-alpha.0 (2026-08-18)
7
+
8
+ * feat(sury)!: migrate to sury 11.0.0-rc.1 ([2cf8969](https://github.com/ReventlessDev/reventless-core/commit/2cf8969a222ce1b775563668a4126cb20611966c))
9
+ ### Features
10
+
11
+ * **pulumi-aws:** expose recovery actions and M-of-N on metric alarms ([0062155](https://github.com/ReventlessDev/reventless-core/commit/00621553ffc56f29a2395d444e898175ec409cbc))
12
+
13
+ ### BREAKING CHANGES
14
+
15
+ * sury is a direct dependency of the published packages and
16
+ its schema and serialization surface changed; consumers must migrate to
17
+ sury 11.
18
+
19
+
20
+
21
+ # 2.4.0-alpha.80 (2026-08-18)
22
+
23
+ ### Bug Fixes
24
+
25
+ * **aws:** make the unowned stub callable on the doors that call it ([931aa39](https://github.com/ReventlessDev/reventless-core/commit/931aa3968ae0e29befab7183125ed2453d4765cb))
26
+ ### Features
27
+
28
+ * **aws:** compile every resolver against AppSync before the deploy attaches one ([635bc26](https://github.com/ReventlessDev/reventless-core/commit/635bc265c63e19f1a69f31dfefe116b523b1c39b))
29
+
30
+
6
31
  # 2.4.0-alpha.79 (2026-08-18)
7
32
 
8
33
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/rescript-pulumi-aws",
3
- "version": "2.4.0-alpha.79",
3
+ "version": "3.0.0-alpha.0",
4
4
  "description": "ReScript bindings for @pulumi/aws",
5
5
  "license": "Apache-2.0",
6
6
  "jest": {
@@ -21,14 +21,14 @@
21
21
  "dependencies": {
22
22
  "@pulumi/aws": "~7.19.0",
23
23
  "@pulumi/aws-native": "^1.62.0",
24
- "sury": "11.0.0-alpha.4",
24
+ "sury": "11.0.0-rc.1",
25
25
  "@reventlessdev/rescript-aws-sdk": "3.0.0-alpha.12",
26
26
  "@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.19"
27
27
  },
28
28
  "devDependencies": {
29
29
  "esbuild": "^0.25.12",
30
30
  "rescript": "12.3.0",
31
- "sury-ppx": "11.0.0-alpha.2"
31
+ "sury-ppx": "11.0.0-rc.1"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "rescript": "12.3.0"
@@ -225,7 +225,13 @@ let ownerScopedResultResponse = (
225
225
  | (None, None) => resultResponseCode
226
226
  | _ =>
227
227
  let ownerPart = switch ownerField {
228
- | None => "\n const _owns = () => true;"
228
+ // Takes the row it ignores: APPSYNC_JS type-checks the resolver, so a
229
+ // zero-parameter stub called as `_owns(row)` is TS2554 ("Expected 0
230
+ // arguments, but got 1") and AppSync rejects the whole resolver at create
231
+ // time with "The code contains one or more errors". Only a door that emits
232
+ // the call conditionally is safe with a bare `() => true`, and that is not a
233
+ // property worth relying on across three templates.
234
+ | None => "\n const _owns = (row) => true;"
229
235
  | Some(field) =>
230
236
  `
231
237
  // ── owner scoping (generated) ──${ownerGuardPreamble(~ownerField=field, ~elevatedGroups)}`
@@ -254,7 +260,13 @@ let ownerScopedFirstResultResponse = (
254
260
  | (None, None) => firstResultResponseCode
255
261
  | _ =>
256
262
  let ownerPart = switch ownerField {
257
- | None => "\n const _owns = () => true;"
263
+ // Takes the row it ignores: APPSYNC_JS type-checks the resolver, so a
264
+ // zero-parameter stub called as `_owns(row)` is TS2554 ("Expected 0
265
+ // arguments, but got 1") and AppSync rejects the whole resolver at create
266
+ // time with "The code contains one or more errors". Only a door that emits
267
+ // the call conditionally is safe with a bare `() => true`, and that is not a
268
+ // property worth relying on across three templates.
269
+ | None => "\n const _owns = (row) => true;"
258
270
  | Some(field) =>
259
271
  `
260
272
  // ── owner scoping (generated) ──${ownerGuardPreamble(~ownerField=field, ~elevatedGroups)}`
@@ -288,22 +300,23 @@ ${resultResponseCode}
288
300
  // Relay Node resolver — pipeline functions for node(id: ID!) query
289
301
  // ---------------------------------------------------------------------------
290
302
 
291
- /** Pipeline function (NONE datasource): decodes global ID and stashes typeName + localId. */
303
+ /** Pipeline function (NONE datasource): decodes global ID and stashes typeName + localId.
304
+
305
+ Written without a `try`: APPSYNC_JS rejects try statements outright
306
+ (`@aws-appsync/no-try`), so a guarded version of this cannot be deployed at
307
+ all. Nothing is lost by dropping it — `util.base64Decode` does not throw on
308
+ malformed input, it returns the bytes it made of it, so the catch could never
309
+ run. An id that decodes to no `type:localId` pair therefore fails the one way
310
+ that is left: both halves stash as null, which is also what the guarded
311
+ version reported for a decode it could not parse. */
292
312
  let nodeDecodeGlobalId =
293
313
  `${importUtil}
294
314
  export function request(ctx) {
295
- const globalId = ctx.args.id;
296
- try {
297
- const decoded = util.base64Decode(globalId);
298
- const colonIdx = decoded.indexOf(':');
299
- if (colonIdx > 0) {
300
- ctx.stash.typeName = decoded.substring(0, colonIdx);
301
- ctx.stash.localId = decoded.substring(colonIdx + 1);
302
- }
303
- } catch (e) {
304
- ctx.stash.typeName = null;
305
- ctx.stash.localId = null;
306
- }
315
+ const decoded = util.base64Decode(ctx.args.id);
316
+ const colonIdx = decoded.indexOf(':');
317
+ const parsed = colonIdx > 0;
318
+ ctx.stash.typeName = parsed ? decoded.substring(0, colonIdx) : null;
319
+ ctx.stash.localId = parsed ? decoded.substring(colonIdx + 1) : null;
307
320
  return { payload: null };
308
321
  }
309
322
  export function response(ctx) {
@@ -1335,7 +1348,13 @@ let refsByIds = (
1335
1348
  ~elevatedGroups: array<string>=[],
1336
1349
  ) => (tableName: string) => {
1337
1350
  let ownerGuard = switch ownerField {
1338
- | None => "\n const _owns = () => true;"
1351
+ // Takes the row it ignores: APPSYNC_JS type-checks the resolver, so a
1352
+ // zero-parameter stub called as `_owns(row)` is TS2554 ("Expected 0
1353
+ // arguments, but got 1") and AppSync rejects the whole resolver at create
1354
+ // time with "The code contains one or more errors". Only a door that emits
1355
+ // the call conditionally is safe with a bare `() => true`, and that is not a
1356
+ // property worth relying on across three templates.
1357
+ | None => "\n const _owns = (row) => true;"
1339
1358
  | Some(field) => ownerGuardPreamble(~ownerField=field, ~elevatedGroups)
1340
1359
  }
1341
1360
  // Retirement, in the vocabulary the row itself uses: a member test for the
@@ -113,7 +113,7 @@ function ownerScopedResultResponse(ownerField, elevatedGroups, retiredField, ret
113
113
  return resultResponseCode;
114
114
  }
115
115
  let ownerPart = ownerField !== undefined ? `
116
- // ── owner scoping (generated) ──` + ownerGuardPreamble(ownerField, elevatedGroups) : "\n const _owns = () => true;";
116
+ // ── owner scoping (generated) ──` + ownerGuardPreamble(ownerField, elevatedGroups) : "\n const _owns = (row) => true;";
117
117
  let retiredPart = retiredGuardPreamble(retiredField, retiredValues, elevatedGroups, Stdlib_Option.isSome(ownerField));
118
118
  return `
119
119
  export function response(ctx) {
@@ -129,7 +129,7 @@ function ownerScopedFirstResultResponse(ownerField, elevatedGroups, retiredField
129
129
  return firstResultResponseCode;
130
130
  }
131
131
  let ownerPart = ownerField !== undefined ? `
132
- // ── owner scoping (generated) ──` + ownerGuardPreamble(ownerField, elevatedGroups) : "\n const _owns = () => true;";
132
+ // ── owner scoping (generated) ──` + ownerGuardPreamble(ownerField, elevatedGroups) : "\n const _owns = (row) => true;";
133
133
  let retiredPart = retiredGuardPreamble(retiredField, retiredValues, elevatedGroups, Stdlib_Option.isSome(ownerField));
134
134
  return `
135
135
  export function response(ctx) {
@@ -148,18 +148,11 @@ export function request(ctx) { return {}; }
148
148
 
149
149
  let nodeDecodeGlobalId = importUtil + `
150
150
  export function request(ctx) {
151
- const globalId = ctx.args.id;
152
- try {
153
- const decoded = util.base64Decode(globalId);
154
- const colonIdx = decoded.indexOf(':');
155
- if (colonIdx > 0) {
156
- ctx.stash.typeName = decoded.substring(0, colonIdx);
157
- ctx.stash.localId = decoded.substring(colonIdx + 1);
158
- }
159
- } catch (e) {
160
- ctx.stash.typeName = null;
161
- ctx.stash.localId = null;
162
- }
151
+ const decoded = util.base64Decode(ctx.args.id);
152
+ const colonIdx = decoded.indexOf(':');
153
+ const parsed = colonIdx > 0;
154
+ ctx.stash.typeName = parsed ? decoded.substring(0, colonIdx) : null;
155
+ ctx.stash.localId = parsed ? decoded.substring(colonIdx + 1) : null;
163
156
  return { payload: null };
164
157
  }
165
158
  export function response(ctx) {
@@ -948,7 +941,7 @@ export function response(ctx) {
948
941
  function refsByIds(labelField, retiredField, retiredValues, namedWhenRetired, ownerField, $staropt$star) {
949
942
  return tableName => {
950
943
  let elevatedGroups = $staropt$star !== undefined ? $staropt$star : [];
951
- let ownerGuard = ownerField !== undefined ? ownerGuardPreamble(ownerField, elevatedGroups) : "\n const _owns = () => true;";
944
+ let ownerGuard = ownerField !== undefined ? ownerGuardPreamble(ownerField, elevatedGroups) : "\n const _owns = (row) => true;";
952
945
  let retiredExpr;
953
946
  if (retiredField !== undefined) {
954
947
  if (retiredValues !== undefined) {
@@ -13,6 +13,11 @@ type args = {
13
13
  name?: Pulumi.Input.t<string>,
14
14
  comparisonOperator: Pulumi.Input.t<string>,
15
15
  evaluationPeriods: Pulumi.Input.t<int>,
16
+ /** How many of the last `evaluationPeriods` datapoints must breach to alarm
17
+ ("M out of N"). Defaults to `evaluationPeriods` when omitted, which is the
18
+ all-or-nothing behaviour. Setting it below `evaluationPeriods` is how an
19
+ alarm rides out an isolated blip without going blind to a sustained one. */
20
+ datapointsToAlarm?: Pulumi.Input.t<int>,
16
21
  metricName: Pulumi.Input.t<string>,
17
22
  namespace: Pulumi.Input.t<string>,
18
23
  /** Metric period in seconds. */
@@ -23,6 +28,12 @@ type args = {
23
28
  dimensions?: Pulumi.Input.t<Dict.t<string>>,
24
29
  treatMissingData?: Pulumi.Input.t<string>,
25
30
  alarmActions?: Pulumi.Input.t<array<Pulumi.Input.t<string>>>,
31
+ /** ARNs fired when the alarm returns to OK. Without these a notification
32
+ channel reports every incident and no recovery, so a reader of an ALARM
33
+ message cannot tell an ongoing outage from one that cleared minutes later. */
34
+ okActions?: Pulumi.Input.t<array<Pulumi.Input.t<string>>>,
35
+ /** ARNs fired when the alarm enters INSUFFICIENT_DATA. */
36
+ insufficientDataActions?: Pulumi.Input.t<array<Pulumi.Input.t<string>>>,
26
37
  alarmDescription?: Pulumi.Input.t<string>,
27
38
  tags?: Pulumi.Input.t<Aws.tags>,
28
39
  }
@@ -124,12 +124,12 @@ type t = policy
124
124
 
125
125
  let toJsonString: t => string = t => {
126
126
  t
127
- ->S.reverseConvertToJsonOrThrow(policySchema)
127
+ ->S.decodeOrThrow(~from=policySchema, ~to=S.json)
128
128
  ->JSON.stringify(~space=1)
129
129
  }
130
130
 
131
131
  let fromJsonString: string => t = (policyString: string) =>
132
- policyString->S.parseJsonStringOrThrow(policySchema)
132
+ policyString->S.decodeOrThrow(~from=S.jsonString, ~to=policySchema)
133
133
 
134
134
  let make = (~version=Version2012, ~id=?, ~statements) => {
135
135
  version,
@@ -1,130 +1,131 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
3
  import * as S from "sury/src/S.res.mjs";
4
+ import * as Sury from "sury";
4
5
  import * as Aws from "@pulumi/aws";
5
6
 
6
- let versionSchema = S.union([
7
- S.literal("2008-10-17"),
8
- S.literal("2012-10-17")
7
+ let versionSchema = Sury.union([
8
+ Sury.literal("2008-10-17"),
9
+ Sury.literal("2012-10-17")
9
10
  ]);
10
11
 
11
- let effectSchema = S.union([
12
- S.literal("Allow"),
13
- S.literal("Deny")
12
+ let effectSchema = Sury.union([
13
+ Sury.literal("Allow"),
14
+ Sury.literal("Deny")
14
15
  ]);
15
16
 
16
- let principalEntrySchema = S.union([
17
- S.schema(s => (s.m(S.string))),
18
- S.schema(s => (s.m(S.array(S.string))))
17
+ let principalEntrySchema = Sury.union([
18
+ Sury.$schema(s => (s.m(Sury.string))),
19
+ Sury.$schema(s => (s.m(Sury.array(Sury.string))))
19
20
  ]);
20
21
 
21
- let principalSchema = S.schema(s => ({
22
- AWS: s.m(S.option(principalEntrySchema)),
23
- Federated: s.m(S.option(principalEntrySchema)),
24
- Service: s.m(S.option(principalEntrySchema)),
25
- CanonicalUser: s.m(S.option(principalEntrySchema))
22
+ let principalSchema = Sury.$schema(s => ({
23
+ AWS: s.m(Sury.$option(principalEntrySchema)),
24
+ Federated: s.m(Sury.$option(principalEntrySchema)),
25
+ Service: s.m(Sury.$option(principalEntrySchema)),
26
+ CanonicalUser: s.m(Sury.$option(principalEntrySchema))
26
27
  }));
27
28
 
28
- let principalsSchema = S.union([
29
- S.literal("*"),
30
- S.schema(s => (s.m(principalSchema)))
29
+ let principalsSchema = Sury.union([
30
+ Sury.literal("*"),
31
+ Sury.$schema(s => (s.m(principalSchema)))
31
32
  ]);
32
33
 
33
- let actionsSchema = S.union([
34
- S.literal("*"),
35
- S.schema(s => (s.m(S.string))),
36
- S.schema(s => (s.m(S.array(S.string))))
34
+ let actionsSchema = Sury.union([
35
+ Sury.literal("*"),
36
+ Sury.$schema(s => (s.m(Sury.string))),
37
+ Sury.$schema(s => (s.m(Sury.array(Sury.string))))
37
38
  ]);
38
39
 
39
- let resourcesSchema = S.union([
40
- S.literal("*"),
41
- S.schema(s => (s.m(S.string))),
42
- S.schema(s => (s.m(S.array(S.string))))
40
+ let resourcesSchema = Sury.union([
41
+ Sury.literal("*"),
42
+ Sury.$schema(s => (s.m(Sury.string))),
43
+ Sury.$schema(s => (s.m(Sury.array(Sury.string))))
43
44
  ]);
44
45
 
45
- let conditionEntrySchema = S.union([
46
- S.schema(s => (s.m(S.string))),
47
- S.schema(s => (s.m(S.array(S.string))))
46
+ let conditionEntrySchema = Sury.union([
47
+ Sury.$schema(s => (s.m(Sury.string))),
48
+ Sury.$schema(s => (s.m(Sury.array(Sury.string))))
48
49
  ]);
49
50
 
50
- let conditionMapSchema = S.dict(conditionEntrySchema);
51
-
52
- let conditionSchema = S.schema(s => ({
53
- StringEquals: s.m(S.option(conditionMapSchema)),
54
- StringNotEquals: s.m(S.option(conditionMapSchema)),
55
- StringEqualsIgnoreCase: s.m(S.option(conditionMapSchema)),
56
- StringNotEqualsIgnoreCase: s.m(S.option(conditionMapSchema)),
57
- StringLike: s.m(S.option(conditionMapSchema)),
58
- StringNotLike: s.m(S.option(conditionMapSchema)),
59
- NumericEquals: s.m(S.option(conditionMapSchema)),
60
- NumericNotEquals: s.m(S.option(conditionMapSchema)),
61
- NumericLessThan: s.m(S.option(conditionMapSchema)),
62
- NumericLessThanEquals: s.m(S.option(conditionMapSchema)),
63
- NumericGreaterThan: s.m(S.option(conditionMapSchema)),
64
- NumericGreaterThanEquals: s.m(S.option(conditionMapSchema)),
65
- DateEquals: s.m(S.option(conditionMapSchema)),
66
- DateNotEquals: s.m(S.option(conditionMapSchema)),
67
- DateLessThan: s.m(S.option(conditionMapSchema)),
68
- DateLessThanEquals: s.m(S.option(conditionMapSchema)),
69
- DateGreaterThan: s.m(S.option(conditionMapSchema)),
70
- DateGreaterThanEquals: s.m(S.option(conditionMapSchema)),
71
- Bool: s.m(S.option(conditionMapSchema)),
72
- Binary: s.m(S.option(conditionMapSchema)),
73
- ArnEquals: s.m(S.option(conditionMapSchema)),
74
- ArnLike: s.m(S.option(conditionMapSchema)),
75
- ArnNotEquals: s.m(S.option(conditionMapSchema)),
76
- ArnNotLike: s.m(S.option(conditionMapSchema)),
77
- StringEqualsIfExists: s.m(S.option(conditionMapSchema)),
78
- StringNotEqualsIfExists: s.m(S.option(conditionMapSchema)),
79
- StringEqualsIgnoreCaseIfExists: s.m(S.option(conditionMapSchema)),
80
- StringNotEqualsIgnoreCaseIfExists: s.m(S.option(conditionMapSchema)),
81
- StringLikeIfExists: s.m(S.option(conditionMapSchema)),
82
- StringNotLikeIfExists: s.m(S.option(conditionMapSchema)),
83
- NumericEqualsIfExists: s.m(S.option(conditionMapSchema)),
84
- NumericNotEqualsIfExists: s.m(S.option(conditionMapSchema)),
85
- NumericLessThanIfExists: s.m(S.option(conditionMapSchema)),
86
- NumericLessThanEqualsIfExists: s.m(S.option(conditionMapSchema)),
87
- NumericGreaterThanIfExists: s.m(S.option(conditionMapSchema)),
88
- NumericGreaterThanEqualsIfExists: s.m(S.option(conditionMapSchema)),
89
- DateEqualsIfExists: s.m(S.option(conditionMapSchema)),
90
- DateNotEqualsIfExists: s.m(S.option(conditionMapSchema)),
91
- DateLessThanIfExists: s.m(S.option(conditionMapSchema)),
92
- DateLessThanEqualsIfExists: s.m(S.option(conditionMapSchema)),
93
- DateGreaterThanIfExists: s.m(S.option(conditionMapSchema)),
94
- DateGreaterThanEqualsIfExists: s.m(S.option(conditionMapSchema)),
95
- BoolIfExists: s.m(S.option(conditionMapSchema)),
96
- BinaryIfExists: s.m(S.option(conditionMapSchema)),
97
- ArnEqualsIfExists: s.m(S.option(conditionMapSchema)),
98
- ArnLikeIfExists: s.m(S.option(conditionMapSchema)),
99
- ArnNotEqualsIfExists: s.m(S.option(conditionMapSchema)),
100
- ArnNotLikeIfExists: s.m(S.option(conditionMapSchema)),
101
- Null: s.m(S.option(conditionMapSchema))
51
+ let conditionMapSchema = Sury.dict(conditionEntrySchema);
52
+
53
+ let conditionSchema = Sury.$schema(s => ({
54
+ StringEquals: s.m(Sury.$option(conditionMapSchema)),
55
+ StringNotEquals: s.m(Sury.$option(conditionMapSchema)),
56
+ StringEqualsIgnoreCase: s.m(Sury.$option(conditionMapSchema)),
57
+ StringNotEqualsIgnoreCase: s.m(Sury.$option(conditionMapSchema)),
58
+ StringLike: s.m(Sury.$option(conditionMapSchema)),
59
+ StringNotLike: s.m(Sury.$option(conditionMapSchema)),
60
+ NumericEquals: s.m(Sury.$option(conditionMapSchema)),
61
+ NumericNotEquals: s.m(Sury.$option(conditionMapSchema)),
62
+ NumericLessThan: s.m(Sury.$option(conditionMapSchema)),
63
+ NumericLessThanEquals: s.m(Sury.$option(conditionMapSchema)),
64
+ NumericGreaterThan: s.m(Sury.$option(conditionMapSchema)),
65
+ NumericGreaterThanEquals: s.m(Sury.$option(conditionMapSchema)),
66
+ DateEquals: s.m(Sury.$option(conditionMapSchema)),
67
+ DateNotEquals: s.m(Sury.$option(conditionMapSchema)),
68
+ DateLessThan: s.m(Sury.$option(conditionMapSchema)),
69
+ DateLessThanEquals: s.m(Sury.$option(conditionMapSchema)),
70
+ DateGreaterThan: s.m(Sury.$option(conditionMapSchema)),
71
+ DateGreaterThanEquals: s.m(Sury.$option(conditionMapSchema)),
72
+ Bool: s.m(Sury.$option(conditionMapSchema)),
73
+ Binary: s.m(Sury.$option(conditionMapSchema)),
74
+ ArnEquals: s.m(Sury.$option(conditionMapSchema)),
75
+ ArnLike: s.m(Sury.$option(conditionMapSchema)),
76
+ ArnNotEquals: s.m(Sury.$option(conditionMapSchema)),
77
+ ArnNotLike: s.m(Sury.$option(conditionMapSchema)),
78
+ StringEqualsIfExists: s.m(Sury.$option(conditionMapSchema)),
79
+ StringNotEqualsIfExists: s.m(Sury.$option(conditionMapSchema)),
80
+ StringEqualsIgnoreCaseIfExists: s.m(Sury.$option(conditionMapSchema)),
81
+ StringNotEqualsIgnoreCaseIfExists: s.m(Sury.$option(conditionMapSchema)),
82
+ StringLikeIfExists: s.m(Sury.$option(conditionMapSchema)),
83
+ StringNotLikeIfExists: s.m(Sury.$option(conditionMapSchema)),
84
+ NumericEqualsIfExists: s.m(Sury.$option(conditionMapSchema)),
85
+ NumericNotEqualsIfExists: s.m(Sury.$option(conditionMapSchema)),
86
+ NumericLessThanIfExists: s.m(Sury.$option(conditionMapSchema)),
87
+ NumericLessThanEqualsIfExists: s.m(Sury.$option(conditionMapSchema)),
88
+ NumericGreaterThanIfExists: s.m(Sury.$option(conditionMapSchema)),
89
+ NumericGreaterThanEqualsIfExists: s.m(Sury.$option(conditionMapSchema)),
90
+ DateEqualsIfExists: s.m(Sury.$option(conditionMapSchema)),
91
+ DateNotEqualsIfExists: s.m(Sury.$option(conditionMapSchema)),
92
+ DateLessThanIfExists: s.m(Sury.$option(conditionMapSchema)),
93
+ DateLessThanEqualsIfExists: s.m(Sury.$option(conditionMapSchema)),
94
+ DateGreaterThanIfExists: s.m(Sury.$option(conditionMapSchema)),
95
+ DateGreaterThanEqualsIfExists: s.m(Sury.$option(conditionMapSchema)),
96
+ BoolIfExists: s.m(Sury.$option(conditionMapSchema)),
97
+ BinaryIfExists: s.m(Sury.$option(conditionMapSchema)),
98
+ ArnEqualsIfExists: s.m(Sury.$option(conditionMapSchema)),
99
+ ArnLikeIfExists: s.m(Sury.$option(conditionMapSchema)),
100
+ ArnNotEqualsIfExists: s.m(Sury.$option(conditionMapSchema)),
101
+ ArnNotLikeIfExists: s.m(Sury.$option(conditionMapSchema)),
102
+ Null: s.m(Sury.$option(conditionMapSchema))
102
103
  }));
103
104
 
104
- let statementSchema = S.schema(s => ({
105
- Sid: s.m(S.option(S.string)),
106
- Principal: s.m(S.option(principalsSchema)),
107
- NotPrincipal: s.m(S.option(principalsSchema)),
105
+ let statementSchema = Sury.$schema(s => ({
106
+ Sid: s.m(Sury.$option(Sury.string)),
107
+ Principal: s.m(Sury.$option(principalsSchema)),
108
+ NotPrincipal: s.m(Sury.$option(principalsSchema)),
108
109
  Effect: s.m(effectSchema),
109
- Action: s.m(S.option(actionsSchema)),
110
- NotAction: s.m(S.option(actionsSchema)),
111
- Resource: s.m(S.option(resourcesSchema)),
112
- NotResource: s.m(S.option(resourcesSchema)),
113
- Condition: s.m(S.option(conditionSchema))
110
+ Action: s.m(Sury.$option(actionsSchema)),
111
+ NotAction: s.m(Sury.$option(actionsSchema)),
112
+ Resource: s.m(Sury.$option(resourcesSchema)),
113
+ NotResource: s.m(Sury.$option(resourcesSchema)),
114
+ Condition: s.m(Sury.$option(conditionSchema))
114
115
  }));
115
116
 
116
- let policySchema = S.schema(s => ({
117
+ let policySchema = Sury.$schema(s => ({
117
118
  Version: s.m(versionSchema),
118
- Id: s.m(S.option(S.string)),
119
- Statement: s.m(S.array(statementSchema))
119
+ Id: s.m(Sury.$option(Sury.string)),
120
+ Statement: s.m(Sury.array(statementSchema))
120
121
  }));
121
122
 
122
123
  function toJsonString(t) {
123
- return JSON.stringify(S.reverseConvertToJsonOrThrow(t, policySchema), undefined, 1);
124
+ return JSON.stringify(S.decodeOrThrow(t, policySchema, Sury.json), undefined, 1);
124
125
  }
125
126
 
126
127
  function fromJsonString(policyString) {
127
- return S.parseJsonStringOrThrow(policyString, policySchema);
128
+ return S.decodeOrThrow(policyString, Sury.jsonString, policySchema);
128
129
  }
129
130
 
130
131
  function make(versionOpt, id, statements) {