@aws-amplify/data-schema 0.18.1 → 0.18.2

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.
@@ -8,11 +8,11 @@ const __data = Symbol('data');
8
8
  *
9
9
  * This list should not be used if you need to restrict available providers
10
10
  * according to an auth strategcy. E.g., `public` auth can only be facilitated
11
- * by `apiKey` and `iam` providers.
11
+ * by `apiKey` and `identityPool` providers.
12
12
  */
13
13
  exports.Providers = [
14
14
  'apiKey',
15
- 'iam',
15
+ 'identityPool',
16
16
  'userPools',
17
17
  'oidc',
18
18
  'function',
@@ -20,11 +20,11 @@ exports.Providers = [
20
20
  /**
21
21
  * The subset of auth providers that can facilitate `public` auth.
22
22
  */
23
- exports.PublicProviders = ['apiKey', 'iam'];
23
+ exports.PublicProviders = ['apiKey', 'identityPool'];
24
24
  /**
25
25
  * The subset of auth providers that can facilitate `private` auth.
26
26
  */
27
- exports.PrivateProviders = ['userPools', 'oidc', 'iam'];
27
+ exports.PrivateProviders = ['userPools', 'oidc', 'identityPool'];
28
28
  /**
29
29
  * The subset of auth providers that can facilitate `owner` auth.
30
30
  */
@@ -116,7 +116,7 @@ function authData(defaults, builderMethods) {
116
116
  }
117
117
  /**
118
118
  * Defines an authorization rule for your data models and fields. First choose an authorization strategy (`public`,
119
- * `private`, `owner`, `group`, or `custom`), then choose an auth provider (`apiKey`, `iam`, `userPools`, `oidc`, or `function`)
119
+ * `private`, `owner`, `group`, or `custom`), then choose an auth provider (`apiKey`, `identitypool`, `userPools`, `oidc`, or `function`)
120
120
  * and optionally use `.to(...)` to specify the operations that can be performed against your data models and fields.
121
121
  */
122
122
  exports.allow = {
@@ -133,21 +133,21 @@ exports.allow = {
133
133
  });
134
134
  },
135
135
  /**
136
- * Authorize unauthenticated users by using IAM based authorization.
136
+ * Authorize unauthenticated users by using IDENTITYPOOL based authorization.
137
137
  * @returns an authorization rule for unauthenticated users
138
138
  */
139
139
  guest() {
140
140
  return authData({
141
141
  strategy: 'public',
142
- provider: 'iam',
142
+ provider: 'identityPool',
143
143
  }, {
144
144
  to,
145
145
  });
146
146
  },
147
147
  /**
148
- * Authorize authenticated users. By default, `.private()` uses an Amazon Cognito user pool based authorization. You can additionally
149
- * use `.authenticated("iam")` or `.authenticated("oidc")` to use IAM or OIDC based authorization for authenticated users.
150
- * @param provider the authentication provider - supports "userPools", "iam", or "oidc"
148
+ * Authorize authenticated users. By default, `.authenticated()` uses an Amazon Cognito user pool based authorization. You can additionally
149
+ * use `.authenticated("identityPool")` or `.authenticated("oidc")` to use identityPool or OIDC based authorization for authenticated users.
150
+ * @param provider the authentication provider - supports "userPools", "identityPool", or "oidc"
151
151
  * @returns an authorization rule for authenticated users
152
152
  */
153
153
  authenticated(provider) {
@@ -171,7 +171,7 @@ exports.allow = {
171
171
  * To change the specific claim that should be used as the user identifier within the owner field, chain the
172
172
  * `.identityClaim(...)` method.
173
173
  *
174
- * @param provider the authentication provider - supports "userPools", "iam", or "oidc"
174
+ * @param provider the authentication provider - supports "userPools", "identityPool", or "oidc"
175
175
  * @returns an authorization rule for authenticated users
176
176
  */
177
177
  owner(provider) {
@@ -195,7 +195,7 @@ exports.allow = {
195
195
  * `.identityClaim(...)` method.
196
196
  *
197
197
  * @param ownerField the field that contains the owner information
198
- * @param provider the authentication provider - supports "userPools", "iam", or "oidc"
198
+ * @param provider the authentication provider - supports "userPools", "identityPool", or "oidc"
199
199
  * @returns an authorization rule for authenticated users
200
200
  */
201
201
  ownerDefinedIn(ownerField, provider) {
@@ -223,7 +223,7 @@ exports.allow = {
223
223
  * `.identityClaim(...)` method.
224
224
  *
225
225
  * @param ownersField the field that contains the owners information
226
- * @param provider the authentication provider - supports "userPools", "iam", or "oidc"
226
+ * @param provider the authentication provider - supports "userPools", "identityPool", or "oidc"
227
227
  * @returns an authorization rule for authenticated users
228
228
  */
229
229
  ownersDefinedIn(ownersField, provider) {
@@ -366,19 +366,19 @@ exports.allowForCustomOperations = {
366
366
  }, {});
367
367
  },
368
368
  /**
369
- * Authorize unauthenticated users by using IAM based authorization.
369
+ * Authorize unauthenticated users by using identityPool based authorization.
370
370
  * @returns an authorization rule for unauthenticated users
371
371
  */
372
372
  guest() {
373
373
  return authData({
374
374
  strategy: 'public',
375
- provider: 'iam',
375
+ provider: 'identityPool',
376
376
  }, {});
377
377
  },
378
378
  /**
379
379
  * Authorize authenticated users. By default, `.private()` uses an Amazon Cognito user pool based authorization. You can additionally
380
- * use `.authenticated("iam")` or `.authenticated("oidc")` to use IAM or OIDC based authorization for authenticated users.
381
- * @param provider the authentication provider - supports "userPools", "iam", or "oidc"
380
+ * use `.authenticated("identityPool")` or `.authenticated("oidc")` to use Identity Pool or OIDC based authorization for authenticated users.
381
+ * @param provider the authentication provider - supports "userPools", "identityPool", or "oidc"
382
382
  * @returns an authorization rule for authenticated users
383
383
  */
384
384
  authenticated(provider) {
@@ -1 +1 @@
1
- {"version":3,"file":"Authorization.js","sources":["../../src/Authorization.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.accessSchemaData = exports.accessData = exports.allowForCustomOperations = exports.allow = exports.ResourceOperations = exports.Operations = exports.Strategies = exports.CustomProviders = exports.GroupProviders = exports.OwnerProviders = exports.PrivateProviders = exports.PublicProviders = exports.Providers = void 0;\nconst __data = Symbol('data');\n/**\n * All possible providers.\n *\n * This list should not be used if you need to restrict available providers\n * according to an auth strategcy. E.g., `public` auth can only be facilitated\n * by `apiKey` and `iam` providers.\n */\nexports.Providers = [\n 'apiKey',\n 'iam',\n 'userPools',\n 'oidc',\n 'function',\n];\n/**\n * The subset of auth providers that can facilitate `public` auth.\n */\nexports.PublicProviders = ['apiKey', 'iam'];\n/**\n * The subset of auth providers that can facilitate `private` auth.\n */\nexports.PrivateProviders = ['userPools', 'oidc', 'iam'];\n/**\n * The subset of auth providers that can facilitate `owner` auth.\n */\nexports.OwnerProviders = ['userPools', 'oidc'];\n/**\n * The subset of auth providers that can facilitate `group` auth.\n */\nexports.GroupProviders = ['userPools', 'oidc'];\n/**\n * The subset of auth providers that can facilitate `custom` auth.\n */\nexports.CustomProviders = ['function'];\nexports.Strategies = [\n 'public',\n 'private',\n 'owner',\n 'groups',\n 'custom',\n];\n/**\n * The operations that can be performed against an API.\n */\nexports.Operations = [\n 'create',\n 'update',\n 'delete',\n 'read',\n 'get',\n 'list',\n 'sync',\n 'listen',\n 'search',\n];\n/**\n * The operations that can be performed against an API by a Lambda function.\n */\nexports.ResourceOperations = ['query', 'mutate', 'listen'];\n/**\n * Creates a shallow copy of an object with an individual field pruned away.\n *\n * @param original The original object to prune.\n * @param without The field to prune.\n * @returns The pruned object.\n */\nfunction omit(original, without) {\n const pruned = { ...original };\n delete pruned[without];\n return pruned;\n}\nfunction to(operations) {\n this[__data].operations = operations;\n return omit(this, 'to');\n}\n/**\n * Specifies a property of the identity JWT to use in place of `sub::username`\n * as the value to match against the owner field for authorization.\n *\n * @param this Authorization object to operate against.\n * @param property A property of identity JWT.\n * @returns A copy of the Authorization object with the claim attached.\n */\nfunction identityClaim(property) {\n this[__data].identityClaim = property;\n return omit(this, 'identityClaim');\n}\nfunction withClaimIn(property) {\n this[__data].groupClaim = property;\n return omit(this, 'withClaimIn');\n}\nfunction validateProvider(needle, haystack) {\n if (needle && !haystack.includes(needle)) {\n throw new Error(`Invalid provider (${needle}) given!`);\n }\n}\nfunction authData(defaults, builderMethods) {\n return {\n [__data]: {\n strategy: 'public',\n provider: undefined,\n operations: undefined,\n groupOrOwnerField: undefined,\n multiOwner: false,\n identityClaim: undefined,\n groups: undefined,\n ...defaults,\n },\n ...builderMethods,\n };\n}\n/**\n * Defines an authorization rule for your data models and fields. First choose an authorization strategy (`public`,\n * `private`, `owner`, `group`, or `custom`), then choose an auth provider (`apiKey`, `iam`, `userPools`, `oidc`, or `function`)\n * and optionally use `.to(...)` to specify the operations that can be performed against your data models and fields.\n */\nexports.allow = {\n /**\n * Authorize unauthenticated users by using API key based authorization.\n * @returns an authorization rule for unauthenticated users\n */\n publicApiKey() {\n return authData({\n strategy: 'public',\n provider: 'apiKey',\n }, {\n to,\n });\n },\n /**\n * Authorize unauthenticated users by using IAM based authorization.\n * @returns an authorization rule for unauthenticated users\n */\n guest() {\n return authData({\n strategy: 'public',\n provider: 'iam',\n }, {\n to,\n });\n },\n /**\n * Authorize authenticated users. By default, `.private()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.authenticated(\"iam\")` or `.authenticated(\"oidc\")` to use IAM or OIDC based authorization for authenticated users.\n * @param provider the authentication provider - supports \"userPools\", \"iam\", or \"oidc\"\n * @returns an authorization rule for authenticated users\n */\n authenticated(provider) {\n validateProvider(provider, exports.PrivateProviders);\n return authData({\n strategy: 'private',\n provider,\n }, {\n to,\n });\n },\n /**\n * Authorize access on a per-user (owner) basis. By setting owner-based authorization, a new `owner: a.string()`\n * field will be added to the model to store which user \"owns\" the item. Upon item creation, the \"owner field\" is\n * auto-populated with the authenticated user's information. If you want to specify which field should be used as\n * the owner field, you can use the `ownerDefinedIn` builder function instead.\n *\n * By default, `.owner()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.owner(\"oidc\")` to use OIDC based authentication to designate the owner.\n *\n * To change the specific claim that should be used as the user identifier within the owner field, chain the\n * `.identityClaim(...)` method.\n *\n * @param provider the authentication provider - supports \"userPools\", \"iam\", or \"oidc\"\n * @returns an authorization rule for authenticated users\n */\n owner(provider) {\n validateProvider(provider, exports.OwnerProviders);\n return authData({\n strategy: 'owner',\n provider,\n groupOrOwnerField: 'owner',\n }, {\n to,\n identityClaim,\n });\n },\n /**\n * Authorize access on a per-user (owner) basis with specifying which field should be used as the owner field.\n *\n * By default, `.owner()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.ownerDefinedIn(\"owner\", \"oidc\")` to use OIDC based authentication to designate the owner.\n *\n * To change the specific claim that should be used as the user identifier within the owner field, chain the\n * `.identityClaim(...)` method.\n *\n * @param ownerField the field that contains the owner information\n * @param provider the authentication provider - supports \"userPools\", \"iam\", or \"oidc\"\n * @returns an authorization rule for authenticated users\n */\n ownerDefinedIn(ownerField, provider) {\n validateProvider(provider, exports.OwnerProviders);\n return authData({\n strategy: 'owner',\n provider,\n groupOrOwnerField: ownerField,\n }, {\n to,\n identityClaim,\n });\n },\n /**\n * Authorize access for multi-user / multi-owner access. By setting multi-owner-based authorization, a new `owners: a.string().array()`\n * field will be added to the model to store which users \"own\" the item. Upon item creation, the \"owners field\" is\n * auto-populated with the authenticated user's information. To grant other users access to the item, append their user identifier into the `owners` array.\n *\n * You can specify which field should be used as the owners field by passing the `ownersField` parameter.\n *\n * By default, `.ownersDefinedIn()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.ownersDefinedIn(\"owners\", \"oidc\")` to use OIDC based authentication to designate the owner.\n *\n * To change the specific claim that should be used as the user identifier within the owners field, chain the\n * `.identityClaim(...)` method.\n *\n * @param ownersField the field that contains the owners information\n * @param provider the authentication provider - supports \"userPools\", \"iam\", or \"oidc\"\n * @returns an authorization rule for authenticated users\n */\n ownersDefinedIn(ownersField, provider) {\n validateProvider(provider, exports.OwnerProviders);\n return authData({\n strategy: 'owner',\n provider,\n groupOrOwnerField: ownersField,\n multiOwner: true,\n }, {\n to,\n identityClaim,\n });\n },\n /**\n * Authorize a specific user group. Provide the name of the specific user group to have access.\n *\n * By default, `.group()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.group(\"group-name\", \"oidc\")` to use OIDC based authentication to designate the user group.\n *\n * To change the specific claim that should be used as the user group identifier, chain the\n * `.withClaimIn(...)` method.\n * @param group the name of the group to authorize\n * @param provider the authentication provider - supports \"userPools\" or \"oidc\"\n * @returns an authorization rule to grant access by a specific group\n */\n group(group, provider) {\n return authData({\n strategy: 'groups',\n provider,\n groups: [group],\n }, {\n to,\n withClaimIn,\n });\n },\n /**\n * Authorize multiple specific user groups. Provide the names of the specific user groups to have access.\n *\n * By default, `.groups()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.groups([\"group-a\", \"group-b\"], \"oidc\")` to use OIDC based authentication to designate the user group.\n *\n * To change the specific claim that should be used as the user group identifier, chain the\n * `.withClaimIn(...)` method.\n * @param groups the names of the group to authorize defined as an array\n * @param provider the authentication provider - supports \"userPools\" or \"oidc\"\n * @returns an authorization rule to grant access by a specific group\n */\n groups(groups, provider) {\n return authData({\n strategy: 'groups',\n provider,\n groups,\n }, {\n to,\n withClaimIn,\n });\n },\n /**\n * Authorize if a user is part of a group defined in a data model field.\n *\n * By default, `.groupDefinedIn()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.groupDefinedIn(\"field-name\", \"oidc\")` to use OIDC based authentication to designate the user group.\n *\n * To change the specific claim that should be used as the user group identifier within the groups field, chain the\n * `.withClaimIn(...)` method.\n * @param groupsField the field that should store the authorized user group information\n * @param provider the authentication provider - supports \"userPools\" or \"oidc\"\n * @returns an authorization rule to grant access by a specific group\n */\n groupDefinedIn(groupsField, provider) {\n return authData({\n strategy: 'groups',\n provider,\n groupOrOwnerField: groupsField,\n }, {\n to,\n withClaimIn,\n });\n },\n /**\n * Authorize if a user is part of a one of the groups defined in a data model field.\n *\n * By default, `.groupsDefinedIn()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.groupsDefinedIn(\"field-name\", \"oidc\")` to use OIDC based authentication to designate the user group.\n *\n * To change the specific claim that should be used as the user group identifier within the groups field, chain the\n * `.withClaimIn(...)` method.\n * @param groupsField the field that should store the list of authorized user groups\n * @param provider the authentication provider - supports \"userPools\" or \"oidc\"\n * @returns an authorization rule to grant access by a specific group\n */\n groupsDefinedIn(groupsField, provider) {\n return authData({\n strategy: 'groups',\n provider,\n groupOrOwnerField: groupsField,\n multiOwner: true,\n }, {\n to,\n withClaimIn,\n });\n },\n custom(provider) {\n return authData({\n strategy: 'custom',\n provider,\n }, {\n to,\n });\n },\n resource(fn) {\n return resourceAuthData(fn, {\n to: resourceTo,\n });\n },\n};\n/**\n * This is a copy of the {@link allow} defined above, with modifications for custom operations.\n *\n * Removed builder methods:\n *\n * * `owner`\n * * `ownerDefinedIn`\n * * `ownersDefinedIn`\n * * `groupDefinedIn`\n * * `groupsDefinedIn`\n * * `resource`\n * * `.to()` builder method from each available rule builder\n */\nexports.allowForCustomOperations = {\n /**\n * Authorize unauthenticated users by using API key based authorization.\n * @returns an authorization rule for unauthenticated users\n */\n publicApiKey() {\n return authData({\n strategy: 'public',\n provider: 'apiKey',\n }, {});\n },\n /**\n * Authorize unauthenticated users by using IAM based authorization.\n * @returns an authorization rule for unauthenticated users\n */\n guest() {\n return authData({\n strategy: 'public',\n provider: 'iam',\n }, {});\n },\n /**\n * Authorize authenticated users. By default, `.private()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.authenticated(\"iam\")` or `.authenticated(\"oidc\")` to use IAM or OIDC based authorization for authenticated users.\n * @param provider the authentication provider - supports \"userPools\", \"iam\", or \"oidc\"\n * @returns an authorization rule for authenticated users\n */\n authenticated(provider) {\n validateProvider(provider, exports.PrivateProviders);\n return authData({\n strategy: 'private',\n provider,\n }, {});\n },\n /**\n * Authorize a specific user group. Provide the name of the specific user group to have access.\n *\n * By default, `.group()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.group(\"group-name\", \"oidc\")` to use OIDC based authentication to designate the user group.\n *\n * @param group the name of the group to authorize\n * @param provider the authentication provider - supports \"userPools\" or \"oidc\"\n * @returns an authorization rule to grant access by a specific group\n */\n group(group, provider) {\n return authData({\n strategy: 'groups',\n provider,\n groups: [group],\n }, {});\n },\n /**\n * Authorize multiple specific user groups. Provide the names of the specific user groups to have access.\n *\n * By default, `.groups()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.groups([\"group-a\", \"group-b\"], \"oidc\")` to use OIDC based authentication to designate the user group.\n *\n * @param groups the names of the group to authorize defined as an array\n * @param provider the authentication provider - supports \"userPools\" or \"oidc\"\n * @returns an authorization rule to grant access by a specific group\n */\n groups(groups, provider) {\n return authData({\n strategy: 'groups',\n provider,\n groups,\n }, {});\n },\n custom(provider) {\n return authData({\n strategy: 'custom',\n provider,\n }, {});\n },\n};\nfunction resourceTo(operations) {\n this[__data].operations = operations;\n return omit(this, 'to');\n}\nfunction resourceAuthData(resource, builderMethods) {\n return {\n [__data]: {\n strategy: 'resource',\n resource,\n },\n ...builderMethods,\n };\n}\nconst accessData = (authorization) => authorization[__data];\nexports.accessData = accessData;\n// TODO: delete when we make resource auth available at each level in the schema (model, field)\nconst accessSchemaData = (authorization) => authorization[__data];\nexports.accessSchemaData = accessSchemaData;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC,CAAC;AACtU,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC,SAAS,GAAG;AACpB,IAAI,QAAQ;AACZ,IAAI,KAAK;AACT,IAAI,WAAW;AACf,IAAI,MAAM;AACV,IAAI,UAAU;AACd,CAAC,CAAC;AACF;AACA;AACA;AACA,OAAO,CAAC,eAAe,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AAC5C;AACA;AACA;AACA,OAAO,CAAC,gBAAgB,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AACxD;AACA;AACA;AACA,OAAO,CAAC,cAAc,GAAG,CAAC,WAAW,E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AAI,OAAO;AACX,QAAQ,CAAC,MAAM,GAAG;AAClB,YAAY,QAAQ,EAAE,UAAU;AAChC,YAAY,QAAQ;AACpB,SAAS;AACT,QAAQ,GAAG,cAAc;AACzB,KAAK,CAAC;AACN,CAAC;AACD,MAAM,UAAU,GAAG,CAAC,aAAa,KAAK,aAAa,CAAC,MAAM,CAAC,CAAC;AAC5D,OAAO,CAAC,UAAU,GAAG,UAAU,CAAC;AAChC;AACA,MAAM,gBAAgB,GAAG,CAAC,aAAa,KAAK,aAAa,CAAC,MAAM,CAAC,CAAC;AAClE,OAAO,CAAC,gBAAgB,GAAG,gBAAgB;;"}
1
+ {"version":3,"file":"Authorization.js","sources":["../../src/Authorization.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.accessSchemaData = exports.accessData = exports.allowForCustomOperations = exports.allow = exports.ResourceOperations = exports.Operations = exports.Strategies = exports.CustomProviders = exports.GroupProviders = exports.OwnerProviders = exports.PrivateProviders = exports.PublicProviders = exports.Providers = void 0;\nconst __data = Symbol('data');\n/**\n * All possible providers.\n *\n * This list should not be used if you need to restrict available providers\n * according to an auth strategcy. E.g., `public` auth can only be facilitated\n * by `apiKey` and `identityPool` providers.\n */\nexports.Providers = [\n 'apiKey',\n 'identityPool',\n 'userPools',\n 'oidc',\n 'function',\n];\n/**\n * The subset of auth providers that can facilitate `public` auth.\n */\nexports.PublicProviders = ['apiKey', 'identityPool'];\n/**\n * The subset of auth providers that can facilitate `private` auth.\n */\nexports.PrivateProviders = ['userPools', 'oidc', 'identityPool'];\n/**\n * The subset of auth providers that can facilitate `owner` auth.\n */\nexports.OwnerProviders = ['userPools', 'oidc'];\n/**\n * The subset of auth providers that can facilitate `group` auth.\n */\nexports.GroupProviders = ['userPools', 'oidc'];\n/**\n * The subset of auth providers that can facilitate `custom` auth.\n */\nexports.CustomProviders = ['function'];\nexports.Strategies = [\n 'public',\n 'private',\n 'owner',\n 'groups',\n 'custom',\n];\n/**\n * The operations that can be performed against an API.\n */\nexports.Operations = [\n 'create',\n 'update',\n 'delete',\n 'read',\n 'get',\n 'list',\n 'sync',\n 'listen',\n 'search',\n];\n/**\n * The operations that can be performed against an API by a Lambda function.\n */\nexports.ResourceOperations = ['query', 'mutate', 'listen'];\n/**\n * Creates a shallow copy of an object with an individual field pruned away.\n *\n * @param original The original object to prune.\n * @param without The field to prune.\n * @returns The pruned object.\n */\nfunction omit(original, without) {\n const pruned = { ...original };\n delete pruned[without];\n return pruned;\n}\nfunction to(operations) {\n this[__data].operations = operations;\n return omit(this, 'to');\n}\n/**\n * Specifies a property of the identity JWT to use in place of `sub::username`\n * as the value to match against the owner field for authorization.\n *\n * @param this Authorization object to operate against.\n * @param property A property of identity JWT.\n * @returns A copy of the Authorization object with the claim attached.\n */\nfunction identityClaim(property) {\n this[__data].identityClaim = property;\n return omit(this, 'identityClaim');\n}\nfunction withClaimIn(property) {\n this[__data].groupClaim = property;\n return omit(this, 'withClaimIn');\n}\nfunction validateProvider(needle, haystack) {\n if (needle && !haystack.includes(needle)) {\n throw new Error(`Invalid provider (${needle}) given!`);\n }\n}\nfunction authData(defaults, builderMethods) {\n return {\n [__data]: {\n strategy: 'public',\n provider: undefined,\n operations: undefined,\n groupOrOwnerField: undefined,\n multiOwner: false,\n identityClaim: undefined,\n groups: undefined,\n ...defaults,\n },\n ...builderMethods,\n };\n}\n/**\n * Defines an authorization rule for your data models and fields. First choose an authorization strategy (`public`,\n * `private`, `owner`, `group`, or `custom`), then choose an auth provider (`apiKey`, `identitypool`, `userPools`, `oidc`, or `function`)\n * and optionally use `.to(...)` to specify the operations that can be performed against your data models and fields.\n */\nexports.allow = {\n /**\n * Authorize unauthenticated users by using API key based authorization.\n * @returns an authorization rule for unauthenticated users\n */\n publicApiKey() {\n return authData({\n strategy: 'public',\n provider: 'apiKey',\n }, {\n to,\n });\n },\n /**\n * Authorize unauthenticated users by using IDENTITYPOOL based authorization.\n * @returns an authorization rule for unauthenticated users\n */\n guest() {\n return authData({\n strategy: 'public',\n provider: 'identityPool',\n }, {\n to,\n });\n },\n /**\n * Authorize authenticated users. By default, `.authenticated()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.authenticated(\"identityPool\")` or `.authenticated(\"oidc\")` to use identityPool or OIDC based authorization for authenticated users.\n * @param provider the authentication provider - supports \"userPools\", \"identityPool\", or \"oidc\"\n * @returns an authorization rule for authenticated users\n */\n authenticated(provider) {\n validateProvider(provider, exports.PrivateProviders);\n return authData({\n strategy: 'private',\n provider,\n }, {\n to,\n });\n },\n /**\n * Authorize access on a per-user (owner) basis. By setting owner-based authorization, a new `owner: a.string()`\n * field will be added to the model to store which user \"owns\" the item. Upon item creation, the \"owner field\" is\n * auto-populated with the authenticated user's information. If you want to specify which field should be used as\n * the owner field, you can use the `ownerDefinedIn` builder function instead.\n *\n * By default, `.owner()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.owner(\"oidc\")` to use OIDC based authentication to designate the owner.\n *\n * To change the specific claim that should be used as the user identifier within the owner field, chain the\n * `.identityClaim(...)` method.\n *\n * @param provider the authentication provider - supports \"userPools\", \"identityPool\", or \"oidc\"\n * @returns an authorization rule for authenticated users\n */\n owner(provider) {\n validateProvider(provider, exports.OwnerProviders);\n return authData({\n strategy: 'owner',\n provider,\n groupOrOwnerField: 'owner',\n }, {\n to,\n identityClaim,\n });\n },\n /**\n * Authorize access on a per-user (owner) basis with specifying which field should be used as the owner field.\n *\n * By default, `.owner()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.ownerDefinedIn(\"owner\", \"oidc\")` to use OIDC based authentication to designate the owner.\n *\n * To change the specific claim that should be used as the user identifier within the owner field, chain the\n * `.identityClaim(...)` method.\n *\n * @param ownerField the field that contains the owner information\n * @param provider the authentication provider - supports \"userPools\", \"identityPool\", or \"oidc\"\n * @returns an authorization rule for authenticated users\n */\n ownerDefinedIn(ownerField, provider) {\n validateProvider(provider, exports.OwnerProviders);\n return authData({\n strategy: 'owner',\n provider,\n groupOrOwnerField: ownerField,\n }, {\n to,\n identityClaim,\n });\n },\n /**\n * Authorize access for multi-user / multi-owner access. By setting multi-owner-based authorization, a new `owners: a.string().array()`\n * field will be added to the model to store which users \"own\" the item. Upon item creation, the \"owners field\" is\n * auto-populated with the authenticated user's information. To grant other users access to the item, append their user identifier into the `owners` array.\n *\n * You can specify which field should be used as the owners field by passing the `ownersField` parameter.\n *\n * By default, `.ownersDefinedIn()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.ownersDefinedIn(\"owners\", \"oidc\")` to use OIDC based authentication to designate the owner.\n *\n * To change the specific claim that should be used as the user identifier within the owners field, chain the\n * `.identityClaim(...)` method.\n *\n * @param ownersField the field that contains the owners information\n * @param provider the authentication provider - supports \"userPools\", \"identityPool\", or \"oidc\"\n * @returns an authorization rule for authenticated users\n */\n ownersDefinedIn(ownersField, provider) {\n validateProvider(provider, exports.OwnerProviders);\n return authData({\n strategy: 'owner',\n provider,\n groupOrOwnerField: ownersField,\n multiOwner: true,\n }, {\n to,\n identityClaim,\n });\n },\n /**\n * Authorize a specific user group. Provide the name of the specific user group to have access.\n *\n * By default, `.group()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.group(\"group-name\", \"oidc\")` to use OIDC based authentication to designate the user group.\n *\n * To change the specific claim that should be used as the user group identifier, chain the\n * `.withClaimIn(...)` method.\n * @param group the name of the group to authorize\n * @param provider the authentication provider - supports \"userPools\" or \"oidc\"\n * @returns an authorization rule to grant access by a specific group\n */\n group(group, provider) {\n return authData({\n strategy: 'groups',\n provider,\n groups: [group],\n }, {\n to,\n withClaimIn,\n });\n },\n /**\n * Authorize multiple specific user groups. Provide the names of the specific user groups to have access.\n *\n * By default, `.groups()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.groups([\"group-a\", \"group-b\"], \"oidc\")` to use OIDC based authentication to designate the user group.\n *\n * To change the specific claim that should be used as the user group identifier, chain the\n * `.withClaimIn(...)` method.\n * @param groups the names of the group to authorize defined as an array\n * @param provider the authentication provider - supports \"userPools\" or \"oidc\"\n * @returns an authorization rule to grant access by a specific group\n */\n groups(groups, provider) {\n return authData({\n strategy: 'groups',\n provider,\n groups,\n }, {\n to,\n withClaimIn,\n });\n },\n /**\n * Authorize if a user is part of a group defined in a data model field.\n *\n * By default, `.groupDefinedIn()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.groupDefinedIn(\"field-name\", \"oidc\")` to use OIDC based authentication to designate the user group.\n *\n * To change the specific claim that should be used as the user group identifier within the groups field, chain the\n * `.withClaimIn(...)` method.\n * @param groupsField the field that should store the authorized user group information\n * @param provider the authentication provider - supports \"userPools\" or \"oidc\"\n * @returns an authorization rule to grant access by a specific group\n */\n groupDefinedIn(groupsField, provider) {\n return authData({\n strategy: 'groups',\n provider,\n groupOrOwnerField: groupsField,\n }, {\n to,\n withClaimIn,\n });\n },\n /**\n * Authorize if a user is part of a one of the groups defined in a data model field.\n *\n * By default, `.groupsDefinedIn()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.groupsDefinedIn(\"field-name\", \"oidc\")` to use OIDC based authentication to designate the user group.\n *\n * To change the specific claim that should be used as the user group identifier within the groups field, chain the\n * `.withClaimIn(...)` method.\n * @param groupsField the field that should store the list of authorized user groups\n * @param provider the authentication provider - supports \"userPools\" or \"oidc\"\n * @returns an authorization rule to grant access by a specific group\n */\n groupsDefinedIn(groupsField, provider) {\n return authData({\n strategy: 'groups',\n provider,\n groupOrOwnerField: groupsField,\n multiOwner: true,\n }, {\n to,\n withClaimIn,\n });\n },\n custom(provider) {\n return authData({\n strategy: 'custom',\n provider,\n }, {\n to,\n });\n },\n resource(fn) {\n return resourceAuthData(fn, {\n to: resourceTo,\n });\n },\n};\n/**\n * This is a copy of the {@link allow} defined above, with modifications for custom operations.\n *\n * Removed builder methods:\n *\n * * `owner`\n * * `ownerDefinedIn`\n * * `ownersDefinedIn`\n * * `groupDefinedIn`\n * * `groupsDefinedIn`\n * * `resource`\n * * `.to()` builder method from each available rule builder\n */\nexports.allowForCustomOperations = {\n /**\n * Authorize unauthenticated users by using API key based authorization.\n * @returns an authorization rule for unauthenticated users\n */\n publicApiKey() {\n return authData({\n strategy: 'public',\n provider: 'apiKey',\n }, {});\n },\n /**\n * Authorize unauthenticated users by using identityPool based authorization.\n * @returns an authorization rule for unauthenticated users\n */\n guest() {\n return authData({\n strategy: 'public',\n provider: 'identityPool',\n }, {});\n },\n /**\n * Authorize authenticated users. By default, `.private()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.authenticated(\"identityPool\")` or `.authenticated(\"oidc\")` to use Identity Pool or OIDC based authorization for authenticated users.\n * @param provider the authentication provider - supports \"userPools\", \"identityPool\", or \"oidc\"\n * @returns an authorization rule for authenticated users\n */\n authenticated(provider) {\n validateProvider(provider, exports.PrivateProviders);\n return authData({\n strategy: 'private',\n provider,\n }, {});\n },\n /**\n * Authorize a specific user group. Provide the name of the specific user group to have access.\n *\n * By default, `.group()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.group(\"group-name\", \"oidc\")` to use OIDC based authentication to designate the user group.\n *\n * @param group the name of the group to authorize\n * @param provider the authentication provider - supports \"userPools\" or \"oidc\"\n * @returns an authorization rule to grant access by a specific group\n */\n group(group, provider) {\n return authData({\n strategy: 'groups',\n provider,\n groups: [group],\n }, {});\n },\n /**\n * Authorize multiple specific user groups. Provide the names of the specific user groups to have access.\n *\n * By default, `.groups()` uses an Amazon Cognito user pool based authorization. You can additionally\n * use `.groups([\"group-a\", \"group-b\"], \"oidc\")` to use OIDC based authentication to designate the user group.\n *\n * @param groups the names of the group to authorize defined as an array\n * @param provider the authentication provider - supports \"userPools\" or \"oidc\"\n * @returns an authorization rule to grant access by a specific group\n */\n groups(groups, provider) {\n return authData({\n strategy: 'groups',\n provider,\n groups,\n }, {});\n },\n custom(provider) {\n return authData({\n strategy: 'custom',\n provider,\n }, {});\n },\n};\nfunction resourceTo(operations) {\n this[__data].operations = operations;\n return omit(this, 'to');\n}\nfunction resourceAuthData(resource, builderMethods) {\n return {\n [__data]: {\n strategy: 'resource',\n resource,\n },\n ...builderMethods,\n };\n}\nconst accessData = (authorization) => authorization[__data];\nexports.accessData = accessData;\n// TODO: delete when we make resource auth available at each level in the schema (model, field)\nconst accessSchemaData = (authorization) => authorization[__data];\nexports.accessSchemaData = accessSchemaData;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC,CAAC;AACtU,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC,SAAS,GAAG;AACpB,IAAI,QAAQ;AACZ,IAAI,cAAc;AAClB,IAAI,WAAW;AACf,IAAI,MAAM;AACV,IAAI,UAAU;AACd,CAAC,CAAC;AACF;AACA;AACA;AACA,OAAO,CAAC,eAAe,GAAG,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;AACrD;AACA;AACA;AACA,OAAO,CAAC,gBAAgB,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;AACjE;AACA;AACA;AACA,OAAO,CAAC,cAAc,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AAC/C;AACA;AACA;AACA,OAAO,CAAC,cAAc,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AAC/C;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,GAAG,cAAc;AACzB,KAAK,CAAC;AACN,CAAC;AACD,MAAM,UAAU,GAAG,CAAC,aAAa,KAAK,aAAa,CAAC,MAAM,CAAC,CAAC;AAC5D,OAAO,CAAC,UAAU,GAAG,UAAU,CAAC;AAChC;AACA,MAAM,gBAAgB,GAAG,CAAC,aAAa,KAAK,aAAa,CAAC,MAAM,CAAC,CAAC;AAClE,OAAO,CAAC,gBAAgB,GAAG,gBAAgB;;"}
@@ -378,7 +378,9 @@ function calculateAuth(authorization) {
378
378
  };
379
379
  }
380
380
  if (rule.provider) {
381
- ruleParts.push(`provider: ${rule.provider}`);
381
+ // identityPool maps to iam in the transform
382
+ const provider = rule.provider === 'identityPool' ? 'iam' : rule.provider;
383
+ ruleParts.push(`provider: ${provider}`);
382
384
  }
383
385
  if (rule.operations) {
384
386
  ruleParts.push(`operations: [${rule.operations.join(', ')}]`);
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaProcessor.js","sources":["../../src/SchemaProcessor.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.processSchema = void 0;\nconst tslib_1 = require(\"tslib\");\nconst ModelField_1 = require(\"./ModelField\");\nconst Authorization_1 = require(\"./Authorization\");\nconst CustomOperation_1 = require(\"./CustomOperation\");\nconst util_1 = require(\"./util\");\nconst Handler_1 = require(\"./Handler\");\nconst os = tslib_1.__importStar(require(\"os\"));\nconst path = tslib_1.__importStar(require(\"path\"));\nfunction isInternalModel(model) {\n if (model.data &&\n !isCustomType(model) &&\n !isCustomOperation(model)) {\n return true;\n }\n return false;\n}\nfunction isEnumType(data) {\n if (data?.type === 'enum') {\n return true;\n }\n return false;\n}\nfunction isCustomType(data) {\n if (data?.data?.type === 'customType') {\n return true;\n }\n return false;\n}\nfunction isCustomOperation(type) {\n if (CustomOperation_1.CustomOperationNames.includes(type?.data?.typeName)) {\n return true;\n }\n return false;\n}\nfunction isModelFieldDef(data) {\n return data?.fieldType === 'model';\n}\nfunction isScalarFieldDef(data) {\n return data?.fieldType !== 'model';\n}\nfunction isRefFieldDef(data) {\n return data?.type === 'ref';\n}\nfunction isModelField(field) {\n return isModelFieldDef(field?.data);\n}\nfunction dataSourceIsRef(dataSource) {\n return (typeof dataSource !== 'string' &&\n dataSource?.data &&\n dataSource.data.type === 'ref');\n}\nfunction isScalarField(field) {\n return isScalarFieldDef(field?.data);\n}\nfunction isRefField(field) {\n return isRefFieldDef(field?.data);\n}\nfunction scalarFieldToGql(fieldDef, identifier, secondaryIndexes = []) {\n const { fieldType, required, array, arrayRequired, default: _default, } = fieldDef;\n let field = fieldType;\n if (identifier !== undefined) {\n field += '!';\n if (identifier.length > 1) {\n const [_pk, ...sk] = identifier;\n field += ` @primaryKey(sortKeyFields: [${sk\n .map((sk) => `\"${sk}\"`)\n .join(', ')}])`;\n }\n else {\n field += ' @primaryKey';\n }\n for (const index of secondaryIndexes) {\n field += ` ${index}`;\n }\n return field;\n }\n if (required === true) {\n field += '!';\n }\n if (array) {\n field = `[${field}]`;\n if (arrayRequired === true) {\n field += '!';\n }\n }\n if (_default !== undefined) {\n field += ` @default(value: \"${_default?.toString()}\")`;\n }\n for (const index of secondaryIndexes) {\n field += ` ${index}`;\n }\n return field;\n}\nfunction modelFieldToGql(fieldDef) {\n const { type, relatedModel, array, valueRequired, arrayRequired, references, } = fieldDef;\n let field = relatedModel;\n if (valueRequired === true) {\n field += '!';\n }\n if (array) {\n field = `[${field}]`;\n }\n if (arrayRequired === true) {\n field += '!';\n }\n if (references && Array.isArray(references) && references.length > 0) {\n field += ` @${type}(references: [${references.map((s) => `\"${String(s)}\"`)}])`;\n }\n else {\n field += ` @${type}`;\n }\n return field;\n}\nfunction refFieldToGql(fieldDef) {\n const { link, valueRequired, array, arrayRequired } = fieldDef;\n let field = link;\n if (valueRequired === true) {\n field += '!';\n }\n if (array === true) {\n field = `[${field}]`;\n }\n if (arrayRequired === true) {\n field += '!';\n }\n return field;\n}\nfunction transformFunctionHandler(handlers, functionFieldName) {\n let gqlHandlerContent = '';\n const lambdaFunctionDefinition = {};\n handlers.forEach((handler, idx) => {\n const handlerData = (0, Handler_1.getHandlerData)(handler);\n if (typeof handlerData === 'string') {\n gqlHandlerContent += `@function(name: \"${handlerData}\") `;\n }\n else if (typeof handlerData.getInstance === 'function') {\n const fnName = `Fn${capitalize(functionFieldName)}${idx === 0 ? '' : `${idx + 1}`}`;\n lambdaFunctionDefinition[fnName] = handlerData;\n gqlHandlerContent += `@function(name: \"${fnName}\") `;\n }\n else {\n throw new Error(`Invalid value specified for ${functionFieldName} handler.function(). Expected: defineFunction or string.`);\n }\n });\n return { gqlHandlerContent, lambdaFunctionDefinition };\n}\nfunction customOperationToGql(typeName, typeDef, authorization, isCustom = false, databaseType, getRefType) {\n const { arguments: fieldArgs, typeName: opType, returnType, functionRef, handlers, subscriptionSource, } = typeDef.data;\n let callSignature = typeName;\n const implicitModels = [];\n const { authString } = isCustom\n ? calculateCustomAuth(authorization)\n : calculateAuth(authorization);\n /**\n *\n * @param returnType The return type from the `data` field of a customer operation.\n * @param refererTypeName The type the refers {@link returnType} by `a.ref()`.\n * @param shouldAddCustomTypeToImplicitModels A flag indicates wether it should push\n * the return type resolved CustomType to the `implicitModels` list.\n * @returns\n */\n const resolveReturnTypeNameFromReturnType = (returnType, { refererTypeName, shouldAddCustomTypeToImplicitModels = true, }) => {\n if (isRefField(returnType)) {\n return refFieldToGql(returnType?.data);\n }\n else if (isCustomType(returnType)) {\n const returnTypeName = `${capitalize(refererTypeName)}ReturnType`;\n if (shouldAddCustomTypeToImplicitModels) {\n implicitModels.push([returnTypeName, returnType]);\n }\n return returnTypeName;\n }\n else if (isScalarField(returnType)) {\n return scalarFieldToGql(returnType?.data);\n }\n else {\n throw new Error(`Unrecognized return type on ${typeName}`);\n }\n };\n let returnTypeName;\n if (opType === 'Subscription' && returnType === null) {\n // up to this point, we've validated that each subscription resource resolves\n // the same return type, so it's safe to use subscriptionSource[0] here.\n const { type, def } = getRefType(subscriptionSource[0].data.link, typeName);\n if (type === 'CustomOperation') {\n returnTypeName = resolveReturnTypeNameFromReturnType(def.data.returnType, {\n refererTypeName: subscriptionSource[0].data.link,\n shouldAddCustomTypeToImplicitModels: false,\n });\n }\n else {\n returnTypeName = refFieldToGql(subscriptionSource[0].data);\n }\n }\n else {\n returnTypeName = resolveReturnTypeNameFromReturnType(returnType, {\n refererTypeName: typeName,\n });\n }\n if (Object.keys(fieldArgs).length > 0) {\n const { gqlFields, models } = processFields(typeName, fieldArgs, {}, {});\n callSignature += `(${gqlFields.join(', ')})`;\n implicitModels.push(...models);\n }\n const handler = handlers && handlers[0];\n const brand = handler && (0, util_1.getBrand)(handler);\n let gqlHandlerContent = '';\n let lambdaFunctionDefinition = {};\n let customSqlDataSourceStrategy;\n if (isFunctionHandler(handlers)) {\n ({ gqlHandlerContent, lambdaFunctionDefinition } = transformFunctionHandler(handlers, typeName));\n }\n else if (functionRef) {\n gqlHandlerContent = `@function(name: \"${functionRef}\") `;\n }\n else if (databaseType === 'sql' && handler && brand === 'inlineSql') {\n gqlHandlerContent = `@sql(statement: ${escapeGraphQlString(String((0, Handler_1.getHandlerData)(handler)))}) `;\n customSqlDataSourceStrategy = {\n typeName: opType,\n fieldName: typeName,\n };\n }\n else if (isSqlReferenceHandler(handlers)) {\n const handlerData = (0, Handler_1.getHandlerData)(handlers[0]);\n const entry = resolveEntryPath(handlerData, 'Could not determine import path to construct absolute code path for sql reference handler. Consider using an absolute path instead.');\n const reference = typeof entry === 'string' ? entry : entry.relativePath;\n customSqlDataSourceStrategy = {\n typeName: opType,\n fieldName: typeName,\n entry,\n };\n gqlHandlerContent = `@sql(reference: \"${reference}\") `;\n }\n if (opType === 'Subscription') {\n const subscriptionSources = subscriptionSource\n .flatMap((source) => {\n const refTarget = source.data.link;\n const { type } = getRefType(refTarget, typeName);\n if (type === 'CustomOperation') {\n return refTarget;\n }\n if (type === 'Model') {\n return source.data.mutationOperations.map(\n // capitalize explicitly in case customer used lowercase model name\n (op) => `${op}${capitalize(refTarget)}`);\n }\n })\n .join('\", \"');\n gqlHandlerContent += `@aws_subscribe(mutations: [\"${subscriptionSources}\"]) `;\n }\n const gqlField = `${callSignature}: ${returnTypeName} ${gqlHandlerContent}${authString}`;\n return {\n gqlField,\n models: implicitModels,\n lambdaFunctionDefinition,\n customSqlDataSourceStrategy,\n };\n}\n/**\n * Escape a string that will be used inside of a graphql string.\n * @param str The input string to be escaped\n * @returns The string with special charactars escaped\n */\nfunction escapeGraphQlString(str) {\n return JSON.stringify(str);\n}\n/**\n * Tests whether two ModelField definitions are in conflict.\n *\n * This is a shallow check intended to catch conflicts between defined fields\n * and fields implied by authorization rules. Hence, it only compares type\n * and plurality.\n *\n * @param left\n * @param right\n * @returns\n */\nfunction areConflicting(left, right) {\n // These are the only props we care about for this comparison, because the others\n // (required, arrayRequired, etc) are not specified on auth or FK directives.\n const relevantProps = ['array', 'fieldType'];\n for (const prop of relevantProps) {\n if (left.data[prop] !== right.data[prop]) {\n return true;\n }\n }\n return false;\n}\n/**\n * Merges one field defition object onto an existing one, performing\n * validation (conflict detection) along the way.\n *\n * @param existing An existing field map\n * @param additions A field map to merge in\n */\nfunction addFields(existing, additions) {\n for (const [k, addition] of Object.entries(additions)) {\n if (!existing[k]) {\n existing[k] = addition;\n }\n else if (areConflicting(existing[k], addition)) {\n throw new Error(`Field ${k} defined twice with conflicting definitions.`);\n }\n else {\n // fields are defined on both sides, but match.\n }\n }\n}\n/**\n * Validate that no implicit fields are used by the model definition\n *\n * @param existing An existing field map\n * @param implicitFields A field map inferred from other schema usage\n *\n * @throws An error when an undefined field is used or when a field is used in a way that conflicts with its generated definition\n */\nfunction validateStaticFields(existing, implicitFields) {\n if (implicitFields === undefined) {\n return;\n }\n for (const [k, field] of Object.entries(implicitFields)) {\n if (!existing[k]) {\n throw new Error(`Field ${k} isn't defined.`);\n }\n else if (areConflicting(existing[k], field)) {\n throw new Error(`Field ${k} defined twice with conflicting definitions.`);\n }\n }\n}\n/**\n * Validate that no implicit fields conflict with explicitly defined fields.\n *\n * @param existing An existing field map\n * @param implicitFields A field map inferred from other schema usage\n *\n * @throws An error when an undefined field is used or when a field is used in a way that conflicts with its generated definition\n */\nfunction validateImpliedFields(existing, implicitFields) {\n if (implicitFields === undefined) {\n return;\n }\n for (const [k, field] of Object.entries(implicitFields)) {\n if (existing[k] && areConflicting(existing[k], field)) {\n throw new Error(`Implicit field ${k} conflicts with the explicit field definition.`);\n }\n }\n}\n/**\n * Given a list of authorization rules, produces a set of the implied owner and/or\n * group fields, along with the associated graphql `@auth` string directive.\n *\n * This is intended to be called for each model and field to collect the implied\n * fields and directives from that individual \"item's\" auth rules.\n *\n * The computed directives are intended to be appended to the graphql field definition.\n *\n * The computed fields will be used to confirm no conflicts between explicit field definitions\n * and implicit auth fields.\n *\n * @param authorization A list of authorization rules.\n * @returns\n */\nfunction calculateAuth(authorization) {\n const authFields = {};\n const rules = [];\n for (const entry of authorization) {\n const rule = (0, Authorization_1.accessData)(entry);\n const ruleParts = [];\n if (rule.strategy) {\n ruleParts.push([`allow: ${rule.strategy}`]);\n }\n else {\n return {\n authFields,\n authString: '',\n };\n }\n if (rule.provider) {\n ruleParts.push(`provider: ${rule.provider}`);\n }\n if (rule.operations) {\n ruleParts.push(`operations: [${rule.operations.join(', ')}]`);\n }\n if (rule.groupOrOwnerField) {\n // directive attribute, depending whether it's owner or group auth\n if (rule.strategy === 'groups') {\n // does this need to be escaped?\n ruleParts.push(`groupsField: \"${rule.groupOrOwnerField}\"`);\n }\n else {\n // does this need to be escaped?\n ruleParts.push(`ownerField: \"${rule.groupOrOwnerField}\"`);\n }\n // model field dep, type of which depends on whether multiple owner/group\n // is required.\n if (rule.multiOwner) {\n addFields(authFields, { [rule.groupOrOwnerField]: (0, ModelField_1.string)().array() });\n }\n else {\n addFields(authFields, { [rule.groupOrOwnerField]: (0, ModelField_1.string)() });\n }\n }\n if (rule.groups) {\n // does `group` need to be escaped?\n ruleParts.push(`groups: [${rule.groups.map((group) => `\"${group}\"`).join(', ')}]`);\n }\n // identityClaim\n if (rule.identityClaim) {\n // does this need to be escaped?\n ruleParts.push(`identityClaim: \"${rule.identityClaim}\"`);\n }\n // groupClaim\n if (rule.groupClaim) {\n // does this need to be escaped?\n ruleParts.push(`groupClaim: \"${rule.groupClaim}\"`);\n }\n rules.push(`{${ruleParts.join(', ')}}`);\n }\n const authString = rules.length > 0 ? `@auth(rules: [${rules.join(',\\n ')}])` : '';\n return { authString, authFields };\n}\nfunction validateCustomAuthRule(rule) {\n if (rule.groups && rule.provider === 'oidc') {\n throw new Error('OIDC group auth is not supported with a.handler.custom');\n }\n}\nfunction getCustomAuthProvider(rule) {\n const strategyDict = {\n public: {\n default: '@aws_api_key',\n apiKey: '@aws_api_key',\n iam: '@aws_iam',\n },\n private: {\n default: '@aws_cognito_user_pools',\n userPools: '@aws_cognito_user_pools',\n oidc: '@aws_oidc',\n iam: '@aws_iam',\n },\n groups: {\n default: '@aws_cognito_user_pools',\n userPools: '@aws_cognito_user_pools',\n },\n custom: {\n default: '@aws_lambda',\n function: '@aws_lambda',\n },\n };\n const stratProviders = strategyDict[rule.strategy];\n if (stratProviders === undefined) {\n throw new Error(`Unsupported auth strategy for custom handlers: ${rule.strategy}`);\n }\n const provider = rule.provider || 'default';\n const stratProvider = stratProviders[provider];\n if (stratProvider === undefined) {\n throw new Error(`Unsupported provider for custom handlers: ${rule.provider}`);\n }\n return stratProvider;\n}\nfunction calculateCustomAuth(authorization) {\n const rules = [];\n for (const entry of authorization) {\n const rule = (0, Authorization_1.accessData)(entry);\n validateCustomAuthRule(rule);\n const provider = getCustomAuthProvider(rule);\n if (rule.groups) {\n // example: (cognito_groups: [\"Bloggers\", \"Readers\"])\n rules.push(`${provider}(cognito_groups: [${rule.groups\n .map((group) => `\"${group}\"`)\n .join(', ')}])`);\n }\n else {\n rules.push(provider);\n }\n }\n const authString = rules.join(' ');\n return { authString };\n}\nfunction capitalize(s) {\n return `${s[0].toUpperCase()}${s.slice(1)}`;\n}\nfunction processFieldLevelAuthRules(fields, authFields) {\n const fieldLevelAuthRules = {};\n for (const [fieldName, fieldDef] of Object.entries(fields)) {\n const fieldAuth = fieldDef?.data?.authorization || [];\n const { authString, authFields: fieldAuthField } = calculateAuth(fieldAuth);\n if (authString)\n fieldLevelAuthRules[fieldName] = authString;\n if (fieldAuthField) {\n addFields(authFields, fieldAuthField);\n }\n }\n return fieldLevelAuthRules;\n}\nfunction processFields(typeName, fields, impliedFields, fieldLevelAuthRules, identifier, partitionKey, secondaryIndexes = {}) {\n const gqlFields = [];\n const models = [];\n validateImpliedFields(fields, impliedFields);\n for (const [fieldName, fieldDef] of Object.entries(fields)) {\n const fieldAuth = fieldLevelAuthRules[fieldName]\n ? ` ${fieldLevelAuthRules[fieldName]}`\n : '';\n if (isModelField(fieldDef)) {\n gqlFields.push(`${fieldName}: ${modelFieldToGql(fieldDef.data)}${fieldAuth}`);\n }\n else if (isScalarField(fieldDef)) {\n if (fieldName === partitionKey) {\n gqlFields.push(`${fieldName}: ${scalarFieldToGql(fieldDef.data, identifier, secondaryIndexes[fieldName])}${fieldAuth}`);\n }\n else if (isRefField(fieldDef)) {\n gqlFields.push(`${fieldName}: ${refFieldToGql(fieldDef.data)}${fieldAuth}`);\n }\n else if (isEnumType(fieldDef)) {\n // The inline enum type name should be `<TypeName><FieldName>` to avoid\n // enum type name conflicts\n const enumName = `${capitalize(typeName)}${capitalize(fieldName)}`;\n models.push([enumName, fieldDef]);\n gqlFields.push(`${fieldName}: ${enumName}`);\n }\n else if (isCustomType(fieldDef)) {\n // The inline CustomType name should be `<TypeName><FieldName>` to avoid\n // CustomType name conflicts\n const customTypeName = `${capitalize(typeName)}${capitalize(fieldName)}`;\n models.push([customTypeName, fieldDef]);\n gqlFields.push(`${fieldName}: ${customTypeName}`);\n }\n else {\n gqlFields.push(`${fieldName}: ${scalarFieldToGql(fieldDef.data, undefined, secondaryIndexes[fieldName])}${fieldAuth}`);\n }\n }\n else {\n throw new Error(`Unexpected field definition: ${fieldDef}`);\n }\n }\n return { gqlFields, models };\n}\n/**\n *\n * @param pk - partition key field name\n * @param sk - (optional) array of sort key field names\n * @returns default query field name\n */\nconst secondaryIndexDefaultQueryField = (modelName, pk, sk) => {\n const skName = sk?.length ? 'And' + sk?.map(capitalize).join('And') : '';\n const queryField = `list${capitalize(modelName)}By${capitalize(pk)}${skName}`;\n return queryField;\n};\n/**\n * Given InternalModelIndexType[] returns a map where the key is the model field to be annotated with an @index directive\n * and the value is an array of transformed Amplify @index directives with all supplied attributes\n */\nconst transformedSecondaryIndexesForModel = (modelName, secondaryIndexes) => {\n const indexDirectiveWithAttributes = (partitionKey, sortKeys, indexName, queryField) => {\n if (!sortKeys.length && !indexName && !queryField) {\n return `@index(queryField: \"${secondaryIndexDefaultQueryField(modelName, partitionKey)}\")`;\n }\n const attributes = [];\n if (indexName) {\n attributes.push(`name: \"${indexName}\"`);\n }\n if (sortKeys.length) {\n attributes.push(`sortKeyFields: [${sortKeys.map((sk) => `\"${sk}\"`).join(', ')}]`);\n }\n if (queryField) {\n attributes.push(`queryField: \"${queryField}\"`);\n }\n else {\n attributes.push(`queryField: \"${secondaryIndexDefaultQueryField(modelName, partitionKey, sortKeys)}\"`);\n }\n return `@index(${attributes.join(', ')})`;\n };\n return secondaryIndexes.reduce((acc, { data: { partitionKey, sortKeys, indexName, queryField } }) => {\n acc[partitionKey] = acc[partitionKey] || [];\n acc[partitionKey].push(indexDirectiveWithAttributes(partitionKey, sortKeys, indexName, queryField));\n return acc;\n }, {});\n};\nconst ruleIsResourceAuth = (authRule) => {\n const data = (0, Authorization_1.accessSchemaData)(authRule);\n return data.strategy === 'resource';\n};\n/**\n * Separates out lambda resource auth rules from remaining schema rules.\n *\n * @param authRules schema auth rules\n */\nconst extractFunctionSchemaAccess = (authRules) => {\n const schemaAuth = [];\n const functionSchemaAccess = [];\n const defaultActions = [\n 'query',\n 'mutate',\n 'listen',\n ];\n for (const rule of authRules) {\n if (ruleIsResourceAuth(rule)) {\n const ruleData = (0, Authorization_1.accessSchemaData)(rule);\n const fnAccess = {\n resourceProvider: ruleData.resource,\n actions: ruleData.operations || defaultActions,\n };\n functionSchemaAccess.push(fnAccess);\n }\n else {\n schemaAuth.push(rule);\n }\n }\n return { schemaAuth, functionSchemaAccess };\n};\n/**\n * Returns a closure for retrieving reference type and definition from schema\n */\nconst getRefTypeForSchema = (schema) => {\n const getRefType = (source, target) => {\n const typeDef = schema.data.types[source];\n if (typeDef === undefined) {\n throw new Error(`Invalid ref. ${target} is referencing ${source} which is not defined in the schema`);\n }\n if (isInternalModel(typeDef)) {\n return { type: 'Model', def: typeDef };\n }\n if (isCustomOperation(typeDef)) {\n return { type: 'CustomOperation', def: typeDef };\n }\n if (isCustomType(typeDef)) {\n return { type: 'CustomType', def: typeDef };\n }\n if (isEnumType(typeDef)) {\n return { type: 'Enum', def: typeDef };\n }\n throw new Error(`Invalid ref. ${target} is referencing ${source} which is neither a Model, Custom Operation, Custom Type, or Enum`);\n };\n return getRefType;\n};\nconst schemaPreprocessor = (schema) => {\n const gqlModels = [];\n const customQueries = [];\n const customMutations = [];\n const customSubscriptions = [];\n const jsFunctions = [];\n const lambdaFunctions = {};\n const customSqlDataSourceStrategies = [];\n const databaseType = schema.data.configuration.database.engine === 'dynamodb'\n ? 'dynamodb'\n : 'sql';\n const staticSchema = schema.data.configuration.database.engine === 'dynamodb' ? false : true;\n const topLevelTypes = Object.entries(schema.data.types);\n const { schemaAuth, functionSchemaAccess } = extractFunctionSchemaAccess(schema.data.authorization);\n const getRefType = getRefTypeForSchema(schema);\n for (const [typeName, typeDef] of topLevelTypes) {\n const mostRelevantAuthRules = typeDef.data?.authorization?.length > 0\n ? typeDef.data.authorization\n : schemaAuth;\n if (!isInternalModel(typeDef)) {\n if (isEnumType(typeDef)) {\n if (typeDef.values.some((value) => /\\s/.test(value))) {\n throw new Error(`Values of the enum type ${typeName} should not contain any whitespace.`);\n }\n const enumType = `enum ${typeName} {\\n ${typeDef.values.join('\\n ')}\\n}`;\n gqlModels.push(enumType);\n }\n else if (isCustomType(typeDef)) {\n const fields = typeDef.data.fields;\n const fieldAuthApplicableFields = Object.fromEntries(Object.entries(fields).filter((pair) => isModelField(pair[1])));\n const authString = '';\n const authFields = {};\n const fieldLevelAuthRules = processFieldLevelAuthRules(fieldAuthApplicableFields, authFields);\n const { gqlFields, models } = processFields(typeName, fields, authFields, fieldLevelAuthRules);\n topLevelTypes.push(...models);\n const joined = gqlFields.join('\\n ');\n const model = `type ${typeName} ${authString}\\n{\\n ${joined}\\n}`;\n gqlModels.push(model);\n }\n else if (isCustomOperation(typeDef)) {\n const { typeName: opType } = typeDef.data;\n const { gqlField, models, jsFunctionForField, lambdaFunctionDefinition, customSqlDataSourceStrategy, } = transformCustomOperations(typeDef, typeName, mostRelevantAuthRules, databaseType, getRefType);\n Object.assign(lambdaFunctions, lambdaFunctionDefinition);\n topLevelTypes.push(...models);\n if (jsFunctionForField) {\n jsFunctions.push(jsFunctionForField);\n }\n if (customSqlDataSourceStrategy) {\n customSqlDataSourceStrategies.push(customSqlDataSourceStrategy);\n }\n switch (opType) {\n case 'Query':\n customQueries.push(gqlField);\n break;\n case 'Mutation':\n customMutations.push(gqlField);\n break;\n case 'Subscription':\n customSubscriptions.push(gqlField);\n break;\n default:\n break;\n }\n }\n }\n else if (staticSchema) {\n const fields = { ...typeDef.data.fields };\n const identifier = typeDef.data.identifier;\n const [partitionKey] = identifier;\n const { authString, authFields } = calculateAuth(mostRelevantAuthRules);\n if (authString == '') {\n throw new Error(`Model \\`${typeName}\\` is missing authorization rules. Add global rules to the schema or ensure every model has its own rules.`);\n }\n const fieldLevelAuthRules = processFieldLevelAuthRules(fields, authFields);\n validateStaticFields(fields, authFields);\n const { gqlFields, models } = processFields(typeName, fields, authFields, fieldLevelAuthRules, identifier, partitionKey);\n topLevelTypes.push(...models);\n const joined = gqlFields.join('\\n ');\n // TODO: update @model(timestamps: null) once a longer term solution gets\n // determined.\n //\n // Context: SQL schema should not be automatically inserted with timestamp fields,\n // passing (timestamps: null) to @model to suppress this behavior as a short\n // term solution.\n const model = `type ${typeName} @model(timestamps: null) ${authString}\\n{\\n ${joined}\\n}`;\n gqlModels.push(model);\n }\n else {\n const fields = typeDef.data.fields;\n const identifier = typeDef.data.identifier;\n const [partitionKey] = identifier;\n const transformedSecondaryIndexes = transformedSecondaryIndexesForModel(typeName, typeDef.data.secondaryIndexes);\n const { authString, authFields } = calculateAuth(mostRelevantAuthRules);\n if (authString == '') {\n throw new Error(`Model \\`${typeName}\\` is missing authorization rules. Add global rules to the schema or ensure every model has its own rules.`);\n }\n const fieldLevelAuthRules = processFieldLevelAuthRules(fields, authFields);\n const { gqlFields, models } = processFields(typeName, fields, authFields, fieldLevelAuthRules, identifier, partitionKey, transformedSecondaryIndexes);\n topLevelTypes.push(...models);\n const joined = gqlFields.join('\\n ');\n const model = `type ${typeName} @model ${authString}\\n{\\n ${joined}\\n}`;\n gqlModels.push(model);\n }\n }\n const customOperations = {\n queries: customQueries,\n mutations: customMutations,\n subscriptions: customSubscriptions,\n };\n gqlModels.push(...generateCustomOperationTypes(customOperations));\n const processedSchema = gqlModels.join('\\n\\n');\n return {\n schema: processedSchema,\n jsFunctions,\n functionSchemaAccess,\n lambdaFunctions,\n customSqlDataSourceStrategies,\n };\n};\nfunction validateCustomOperations(typeDef, typeName, authRules, getRefType) {\n const { functionRef, handlers, typeName: opType, subscriptionSource, } = typeDef.data;\n // TODO: remove `functionRef` after deprecating\n const handlerConfigured = functionRef !== null || handlers?.length;\n const authConfigured = authRules.length > 0;\n if ((authConfigured && !handlerConfigured) ||\n (handlerConfigured && !authConfigured)) {\n // Deploying a custom operation with auth and no handler reference OR\n // with a handler reference but no auth\n // causes the CFN stack to reach an unrecoverable state. Ideally, this should be fixed\n // in the CDK construct, but we're catching it early here as a stopgap\n throw new Error(`Custom operation ${typeName} requires both an authorization rule and a handler reference`);\n }\n // Handlers must all be of the same type\n if (handlers?.length) {\n const configuredHandlers = new Set();\n for (const handler of handlers) {\n configuredHandlers.add((0, util_1.getBrand)(handler));\n }\n if (configuredHandlers.size > 1) {\n const configuredHandlersStr = JSON.stringify(Array.from(configuredHandlers));\n throw new Error(`Field handlers must be of the same type. ${typeName} has been configured with ${configuredHandlersStr}`);\n }\n }\n if (opType !== 'Subscription' && subscriptionSource.length > 0) {\n throw new Error(`The .for() modifier function can only be used with a custom subscription. ${typeName} is not a custom subscription.`);\n }\n if (opType === 'Subscription') {\n if (subscriptionSource.length < 1) {\n throw new Error(`${typeName} is missing a mutation source. Custom subscriptions must reference a mutation source via subscription().for(a.ref('ModelOrOperationName')) `);\n }\n let expectedReturnType;\n for (const source of subscriptionSource) {\n const sourceName = source.data.link;\n const { type, def } = getRefType(sourceName, typeName);\n if (type !== 'Model' && source.data.mutationOperations.length > 0) {\n throw new Error(`Invalid subscription definition. .mutations() modifier can only be used with a Model ref. ${typeName} is referencing ${type}`);\n }\n let resolvedReturnType;\n if (type === 'Model') {\n if (source.data.mutationOperations.length === 0) {\n throw new Error(`Invalid subscription definition. .mutations() modifier must be used with a Model ref subscription source. ${typeName} is referencing ${sourceName} without specifying a mutation`);\n }\n else {\n resolvedReturnType = def;\n }\n }\n if (type === 'CustomOperation') {\n if (def.data.typeName !== 'Mutation') {\n throw new Error(`Invalid subscription definition. .for() can only reference a mutation. ${typeName} is referencing ${sourceName} which is a ${def.data.typeName}`);\n }\n else {\n const returnType = def.data.returnType;\n if (isRefField(returnType)) {\n ({ def: resolvedReturnType } = getRefType(returnType.data.link, typeName));\n }\n else {\n resolvedReturnType = returnType;\n }\n }\n }\n expectedReturnType = expectedReturnType ?? resolvedReturnType;\n // As the return types are resolved from the root `schema` object and they should\n // not be mutated, we compare by references here.\n if (expectedReturnType !== resolvedReturnType) {\n throw new Error(`Invalid subscription definition. .for() can only reference resources that have the same return type. ${typeName} is referencing resources that have different return types.`);\n }\n }\n }\n}\nconst isSqlReferenceHandler = (handler) => {\n return Array.isArray(handler) && (0, util_1.getBrand)(handler[0]) === 'sqlReference';\n};\nconst isCustomHandler = (handler) => {\n return Array.isArray(handler) && (0, util_1.getBrand)(handler[0]) === 'customHandler';\n};\nconst isFunctionHandler = (handler) => {\n return Array.isArray(handler) && (0, util_1.getBrand)(handler[0]) === 'functionHandler';\n};\nconst normalizeDataSourceName = (dataSource) => {\n // default data source\n const noneDataSourceName = 'NONE_DS';\n if (dataSource === undefined) {\n return noneDataSourceName;\n }\n if (dataSourceIsRef(dataSource)) {\n return `${dataSource.data.link}Table`;\n }\n return dataSource;\n};\nconst sanitizeStackTrace = (stackTrace) => {\n // normalize EOL to \\n so that parsing is consistent across platforms\n const normalizedStackTrace = stackTrace.replace(new RegExp(os.EOL), '\\n');\n return (normalizedStackTrace\n .split('\\n')\n .map((line) => line.trim())\n // filters out noise not relevant to the stack trace. All stack trace lines begin with 'at'\n .filter((line) => line.startsWith('at')) || []);\n};\n// copied from the defineFunction path resolution impl:\n// https://github.com/aws-amplify/amplify-backend/blob/main/packages/backend-function/src/get_caller_directory.ts\nconst resolveEntryPath = (data, errorMessage) => {\n if (path.isAbsolute(data.entry)) {\n return data.entry;\n }\n if (!data.stack) {\n throw new Error(errorMessage);\n }\n const stackTraceLines = sanitizeStackTrace(data.stack);\n if (stackTraceLines.length < 2) {\n throw new Error(errorMessage);\n }\n const stackTraceImportLine = stackTraceLines[1]; // the first entry is the file where the error was initialized (our code). The second entry is where the customer called our code which is what we are interested in\n // if entry is relative, compute with respect to the caller directory\n return { relativePath: data.entry, importLine: stackTraceImportLine };\n};\nconst handleCustom = (handlers, opType, typeName) => {\n const transformedHandlers = handlers.map((handler) => {\n const handlerData = (0, Handler_1.getHandlerData)(handler);\n return {\n dataSource: normalizeDataSourceName(handlerData.dataSource),\n entry: resolveEntryPath(handlerData, 'Could not determine import path to construct absolute code path for custom handler. Consider using an absolute path instead.'),\n };\n });\n const jsFn = {\n typeName: opType,\n fieldName: typeName,\n handlers: transformedHandlers,\n };\n return jsFn;\n};\nfunction transformCustomOperations(typeDef, typeName, authRules, databaseType, getRefType) {\n const { typeName: opType, handlers } = typeDef.data;\n let jsFunctionForField = undefined;\n validateCustomOperations(typeDef, typeName, authRules, getRefType);\n if (isCustomHandler(handlers)) {\n jsFunctionForField = handleCustom(handlers, opType, typeName);\n }\n const isCustom = Boolean(jsFunctionForField);\n const { gqlField, models, lambdaFunctionDefinition, customSqlDataSourceStrategy, } = customOperationToGql(typeName, typeDef, authRules, isCustom, databaseType, getRefType);\n return {\n gqlField,\n models,\n jsFunctionForField,\n lambdaFunctionDefinition,\n customSqlDataSourceStrategy,\n };\n}\nfunction generateCustomOperationTypes({ queries, mutations, subscriptions, }) {\n const types = [];\n if (mutations.length > 0) {\n types.push(`type Mutation {\\n ${mutations.join('\\n ')}\\n}`);\n }\n if (queries.length > 0) {\n types.push(`type Query {\\n ${queries.join('\\n ')}\\n}`);\n }\n if (subscriptions.length > 0) {\n types.push(`type Subscription {\\n ${subscriptions.join('\\n ')}\\n}`);\n }\n return types;\n}\n/**\n * Returns API definition from ModelSchema or string schema\n * @param arg - { schema }\n * @returns DerivedApiDefinition that conforms to IAmplifyGraphqlDefinition\n */\nfunction processSchema(arg) {\n const { schema, jsFunctions, functionSchemaAccess, lambdaFunctions, customSqlDataSourceStrategies, } = schemaPreprocessor(arg.schema);\n return {\n schema,\n functionSlots: [],\n jsFunctions,\n functionSchemaAccess,\n lambdaFunctions,\n customSqlDataSourceStrategies,\n };\n}\nexports.processSchema = processSchema;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC;AAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AACjC,MAAM,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAC7C,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACnD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I,CAAC,CAAC,uBAAuB,EAAE,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAC9E,KAAK;AACL,IAAI,OAAO,KAAK,CAAC;AACjB,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,GAAG,EAAE;AAC5B,IAAI,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,oBAAoB,EAAE,eAAe,EAAE,6BAA6B,GAAG,GAAG,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC1I,IAAI,OAAO;AACX,QAAQ,MAAM;AACd,QAAQ,aAAa,EAAE,EAAE;AACzB,QAAQ,WAAW;AACnB,QAAQ,oBAAoB;AAC5B,QAAQ,eAAe;AACvB,QAAQ,6BAA6B;AACrC,KAAK,CAAC;AACN,CAAC;AACD,OAAO,CAAC,aAAa,GAAG,aAAa;;"}
1
+ {"version":3,"file":"SchemaProcessor.js","sources":["../../src/SchemaProcessor.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.processSchema = void 0;\nconst tslib_1 = require(\"tslib\");\nconst ModelField_1 = require(\"./ModelField\");\nconst Authorization_1 = require(\"./Authorization\");\nconst CustomOperation_1 = require(\"./CustomOperation\");\nconst util_1 = require(\"./util\");\nconst Handler_1 = require(\"./Handler\");\nconst os = tslib_1.__importStar(require(\"os\"));\nconst path = tslib_1.__importStar(require(\"path\"));\nfunction isInternalModel(model) {\n if (model.data &&\n !isCustomType(model) &&\n !isCustomOperation(model)) {\n return true;\n }\n return false;\n}\nfunction isEnumType(data) {\n if (data?.type === 'enum') {\n return true;\n }\n return false;\n}\nfunction isCustomType(data) {\n if (data?.data?.type === 'customType') {\n return true;\n }\n return false;\n}\nfunction isCustomOperation(type) {\n if (CustomOperation_1.CustomOperationNames.includes(type?.data?.typeName)) {\n return true;\n }\n return false;\n}\nfunction isModelFieldDef(data) {\n return data?.fieldType === 'model';\n}\nfunction isScalarFieldDef(data) {\n return data?.fieldType !== 'model';\n}\nfunction isRefFieldDef(data) {\n return data?.type === 'ref';\n}\nfunction isModelField(field) {\n return isModelFieldDef(field?.data);\n}\nfunction dataSourceIsRef(dataSource) {\n return (typeof dataSource !== 'string' &&\n dataSource?.data &&\n dataSource.data.type === 'ref');\n}\nfunction isScalarField(field) {\n return isScalarFieldDef(field?.data);\n}\nfunction isRefField(field) {\n return isRefFieldDef(field?.data);\n}\nfunction scalarFieldToGql(fieldDef, identifier, secondaryIndexes = []) {\n const { fieldType, required, array, arrayRequired, default: _default, } = fieldDef;\n let field = fieldType;\n if (identifier !== undefined) {\n field += '!';\n if (identifier.length > 1) {\n const [_pk, ...sk] = identifier;\n field += ` @primaryKey(sortKeyFields: [${sk\n .map((sk) => `\"${sk}\"`)\n .join(', ')}])`;\n }\n else {\n field += ' @primaryKey';\n }\n for (const index of secondaryIndexes) {\n field += ` ${index}`;\n }\n return field;\n }\n if (required === true) {\n field += '!';\n }\n if (array) {\n field = `[${field}]`;\n if (arrayRequired === true) {\n field += '!';\n }\n }\n if (_default !== undefined) {\n field += ` @default(value: \"${_default?.toString()}\")`;\n }\n for (const index of secondaryIndexes) {\n field += ` ${index}`;\n }\n return field;\n}\nfunction modelFieldToGql(fieldDef) {\n const { type, relatedModel, array, valueRequired, arrayRequired, references, } = fieldDef;\n let field = relatedModel;\n if (valueRequired === true) {\n field += '!';\n }\n if (array) {\n field = `[${field}]`;\n }\n if (arrayRequired === true) {\n field += '!';\n }\n if (references && Array.isArray(references) && references.length > 0) {\n field += ` @${type}(references: [${references.map((s) => `\"${String(s)}\"`)}])`;\n }\n else {\n field += ` @${type}`;\n }\n return field;\n}\nfunction refFieldToGql(fieldDef) {\n const { link, valueRequired, array, arrayRequired } = fieldDef;\n let field = link;\n if (valueRequired === true) {\n field += '!';\n }\n if (array === true) {\n field = `[${field}]`;\n }\n if (arrayRequired === true) {\n field += '!';\n }\n return field;\n}\nfunction transformFunctionHandler(handlers, functionFieldName) {\n let gqlHandlerContent = '';\n const lambdaFunctionDefinition = {};\n handlers.forEach((handler, idx) => {\n const handlerData = (0, Handler_1.getHandlerData)(handler);\n if (typeof handlerData === 'string') {\n gqlHandlerContent += `@function(name: \"${handlerData}\") `;\n }\n else if (typeof handlerData.getInstance === 'function') {\n const fnName = `Fn${capitalize(functionFieldName)}${idx === 0 ? '' : `${idx + 1}`}`;\n lambdaFunctionDefinition[fnName] = handlerData;\n gqlHandlerContent += `@function(name: \"${fnName}\") `;\n }\n else {\n throw new Error(`Invalid value specified for ${functionFieldName} handler.function(). Expected: defineFunction or string.`);\n }\n });\n return { gqlHandlerContent, lambdaFunctionDefinition };\n}\nfunction customOperationToGql(typeName, typeDef, authorization, isCustom = false, databaseType, getRefType) {\n const { arguments: fieldArgs, typeName: opType, returnType, functionRef, handlers, subscriptionSource, } = typeDef.data;\n let callSignature = typeName;\n const implicitModels = [];\n const { authString } = isCustom\n ? calculateCustomAuth(authorization)\n : calculateAuth(authorization);\n /**\n *\n * @param returnType The return type from the `data` field of a customer operation.\n * @param refererTypeName The type the refers {@link returnType} by `a.ref()`.\n * @param shouldAddCustomTypeToImplicitModels A flag indicates wether it should push\n * the return type resolved CustomType to the `implicitModels` list.\n * @returns\n */\n const resolveReturnTypeNameFromReturnType = (returnType, { refererTypeName, shouldAddCustomTypeToImplicitModels = true, }) => {\n if (isRefField(returnType)) {\n return refFieldToGql(returnType?.data);\n }\n else if (isCustomType(returnType)) {\n const returnTypeName = `${capitalize(refererTypeName)}ReturnType`;\n if (shouldAddCustomTypeToImplicitModels) {\n implicitModels.push([returnTypeName, returnType]);\n }\n return returnTypeName;\n }\n else if (isScalarField(returnType)) {\n return scalarFieldToGql(returnType?.data);\n }\n else {\n throw new Error(`Unrecognized return type on ${typeName}`);\n }\n };\n let returnTypeName;\n if (opType === 'Subscription' && returnType === null) {\n // up to this point, we've validated that each subscription resource resolves\n // the same return type, so it's safe to use subscriptionSource[0] here.\n const { type, def } = getRefType(subscriptionSource[0].data.link, typeName);\n if (type === 'CustomOperation') {\n returnTypeName = resolveReturnTypeNameFromReturnType(def.data.returnType, {\n refererTypeName: subscriptionSource[0].data.link,\n shouldAddCustomTypeToImplicitModels: false,\n });\n }\n else {\n returnTypeName = refFieldToGql(subscriptionSource[0].data);\n }\n }\n else {\n returnTypeName = resolveReturnTypeNameFromReturnType(returnType, {\n refererTypeName: typeName,\n });\n }\n if (Object.keys(fieldArgs).length > 0) {\n const { gqlFields, models } = processFields(typeName, fieldArgs, {}, {});\n callSignature += `(${gqlFields.join(', ')})`;\n implicitModels.push(...models);\n }\n const handler = handlers && handlers[0];\n const brand = handler && (0, util_1.getBrand)(handler);\n let gqlHandlerContent = '';\n let lambdaFunctionDefinition = {};\n let customSqlDataSourceStrategy;\n if (isFunctionHandler(handlers)) {\n ({ gqlHandlerContent, lambdaFunctionDefinition } = transformFunctionHandler(handlers, typeName));\n }\n else if (functionRef) {\n gqlHandlerContent = `@function(name: \"${functionRef}\") `;\n }\n else if (databaseType === 'sql' && handler && brand === 'inlineSql') {\n gqlHandlerContent = `@sql(statement: ${escapeGraphQlString(String((0, Handler_1.getHandlerData)(handler)))}) `;\n customSqlDataSourceStrategy = {\n typeName: opType,\n fieldName: typeName,\n };\n }\n else if (isSqlReferenceHandler(handlers)) {\n const handlerData = (0, Handler_1.getHandlerData)(handlers[0]);\n const entry = resolveEntryPath(handlerData, 'Could not determine import path to construct absolute code path for sql reference handler. Consider using an absolute path instead.');\n const reference = typeof entry === 'string' ? entry : entry.relativePath;\n customSqlDataSourceStrategy = {\n typeName: opType,\n fieldName: typeName,\n entry,\n };\n gqlHandlerContent = `@sql(reference: \"${reference}\") `;\n }\n if (opType === 'Subscription') {\n const subscriptionSources = subscriptionSource\n .flatMap((source) => {\n const refTarget = source.data.link;\n const { type } = getRefType(refTarget, typeName);\n if (type === 'CustomOperation') {\n return refTarget;\n }\n if (type === 'Model') {\n return source.data.mutationOperations.map(\n // capitalize explicitly in case customer used lowercase model name\n (op) => `${op}${capitalize(refTarget)}`);\n }\n })\n .join('\", \"');\n gqlHandlerContent += `@aws_subscribe(mutations: [\"${subscriptionSources}\"]) `;\n }\n const gqlField = `${callSignature}: ${returnTypeName} ${gqlHandlerContent}${authString}`;\n return {\n gqlField,\n models: implicitModels,\n lambdaFunctionDefinition,\n customSqlDataSourceStrategy,\n };\n}\n/**\n * Escape a string that will be used inside of a graphql string.\n * @param str The input string to be escaped\n * @returns The string with special charactars escaped\n */\nfunction escapeGraphQlString(str) {\n return JSON.stringify(str);\n}\n/**\n * Tests whether two ModelField definitions are in conflict.\n *\n * This is a shallow check intended to catch conflicts between defined fields\n * and fields implied by authorization rules. Hence, it only compares type\n * and plurality.\n *\n * @param left\n * @param right\n * @returns\n */\nfunction areConflicting(left, right) {\n // These are the only props we care about for this comparison, because the others\n // (required, arrayRequired, etc) are not specified on auth or FK directives.\n const relevantProps = ['array', 'fieldType'];\n for (const prop of relevantProps) {\n if (left.data[prop] !== right.data[prop]) {\n return true;\n }\n }\n return false;\n}\n/**\n * Merges one field defition object onto an existing one, performing\n * validation (conflict detection) along the way.\n *\n * @param existing An existing field map\n * @param additions A field map to merge in\n */\nfunction addFields(existing, additions) {\n for (const [k, addition] of Object.entries(additions)) {\n if (!existing[k]) {\n existing[k] = addition;\n }\n else if (areConflicting(existing[k], addition)) {\n throw new Error(`Field ${k} defined twice with conflicting definitions.`);\n }\n else {\n // fields are defined on both sides, but match.\n }\n }\n}\n/**\n * Validate that no implicit fields are used by the model definition\n *\n * @param existing An existing field map\n * @param implicitFields A field map inferred from other schema usage\n *\n * @throws An error when an undefined field is used or when a field is used in a way that conflicts with its generated definition\n */\nfunction validateStaticFields(existing, implicitFields) {\n if (implicitFields === undefined) {\n return;\n }\n for (const [k, field] of Object.entries(implicitFields)) {\n if (!existing[k]) {\n throw new Error(`Field ${k} isn't defined.`);\n }\n else if (areConflicting(existing[k], field)) {\n throw new Error(`Field ${k} defined twice with conflicting definitions.`);\n }\n }\n}\n/**\n * Validate that no implicit fields conflict with explicitly defined fields.\n *\n * @param existing An existing field map\n * @param implicitFields A field map inferred from other schema usage\n *\n * @throws An error when an undefined field is used or when a field is used in a way that conflicts with its generated definition\n */\nfunction validateImpliedFields(existing, implicitFields) {\n if (implicitFields === undefined) {\n return;\n }\n for (const [k, field] of Object.entries(implicitFields)) {\n if (existing[k] && areConflicting(existing[k], field)) {\n throw new Error(`Implicit field ${k} conflicts with the explicit field definition.`);\n }\n }\n}\n/**\n * Given a list of authorization rules, produces a set of the implied owner and/or\n * group fields, along with the associated graphql `@auth` string directive.\n *\n * This is intended to be called for each model and field to collect the implied\n * fields and directives from that individual \"item's\" auth rules.\n *\n * The computed directives are intended to be appended to the graphql field definition.\n *\n * The computed fields will be used to confirm no conflicts between explicit field definitions\n * and implicit auth fields.\n *\n * @param authorization A list of authorization rules.\n * @returns\n */\nfunction calculateAuth(authorization) {\n const authFields = {};\n const rules = [];\n for (const entry of authorization) {\n const rule = (0, Authorization_1.accessData)(entry);\n const ruleParts = [];\n if (rule.strategy) {\n ruleParts.push([`allow: ${rule.strategy}`]);\n }\n else {\n return {\n authFields,\n authString: '',\n };\n }\n if (rule.provider) {\n // identityPool maps to iam in the transform\n const provider = rule.provider === 'identityPool' ? 'iam' : rule.provider;\n ruleParts.push(`provider: ${provider}`);\n }\n if (rule.operations) {\n ruleParts.push(`operations: [${rule.operations.join(', ')}]`);\n }\n if (rule.groupOrOwnerField) {\n // directive attribute, depending whether it's owner or group auth\n if (rule.strategy === 'groups') {\n // does this need to be escaped?\n ruleParts.push(`groupsField: \"${rule.groupOrOwnerField}\"`);\n }\n else {\n // does this need to be escaped?\n ruleParts.push(`ownerField: \"${rule.groupOrOwnerField}\"`);\n }\n // model field dep, type of which depends on whether multiple owner/group\n // is required.\n if (rule.multiOwner) {\n addFields(authFields, { [rule.groupOrOwnerField]: (0, ModelField_1.string)().array() });\n }\n else {\n addFields(authFields, { [rule.groupOrOwnerField]: (0, ModelField_1.string)() });\n }\n }\n if (rule.groups) {\n // does `group` need to be escaped?\n ruleParts.push(`groups: [${rule.groups.map((group) => `\"${group}\"`).join(', ')}]`);\n }\n // identityClaim\n if (rule.identityClaim) {\n // does this need to be escaped?\n ruleParts.push(`identityClaim: \"${rule.identityClaim}\"`);\n }\n // groupClaim\n if (rule.groupClaim) {\n // does this need to be escaped?\n ruleParts.push(`groupClaim: \"${rule.groupClaim}\"`);\n }\n rules.push(`{${ruleParts.join(', ')}}`);\n }\n const authString = rules.length > 0 ? `@auth(rules: [${rules.join(',\\n ')}])` : '';\n return { authString, authFields };\n}\nfunction validateCustomAuthRule(rule) {\n if (rule.groups && rule.provider === 'oidc') {\n throw new Error('OIDC group auth is not supported with a.handler.custom');\n }\n}\nfunction getCustomAuthProvider(rule) {\n const strategyDict = {\n public: {\n default: '@aws_api_key',\n apiKey: '@aws_api_key',\n iam: '@aws_iam',\n },\n private: {\n default: '@aws_cognito_user_pools',\n userPools: '@aws_cognito_user_pools',\n oidc: '@aws_oidc',\n iam: '@aws_iam',\n },\n groups: {\n default: '@aws_cognito_user_pools',\n userPools: '@aws_cognito_user_pools',\n },\n custom: {\n default: '@aws_lambda',\n function: '@aws_lambda',\n },\n };\n const stratProviders = strategyDict[rule.strategy];\n if (stratProviders === undefined) {\n throw new Error(`Unsupported auth strategy for custom handlers: ${rule.strategy}`);\n }\n const provider = rule.provider || 'default';\n const stratProvider = stratProviders[provider];\n if (stratProvider === undefined) {\n throw new Error(`Unsupported provider for custom handlers: ${rule.provider}`);\n }\n return stratProvider;\n}\nfunction calculateCustomAuth(authorization) {\n const rules = [];\n for (const entry of authorization) {\n const rule = (0, Authorization_1.accessData)(entry);\n validateCustomAuthRule(rule);\n const provider = getCustomAuthProvider(rule);\n if (rule.groups) {\n // example: (cognito_groups: [\"Bloggers\", \"Readers\"])\n rules.push(`${provider}(cognito_groups: [${rule.groups\n .map((group) => `\"${group}\"`)\n .join(', ')}])`);\n }\n else {\n rules.push(provider);\n }\n }\n const authString = rules.join(' ');\n return { authString };\n}\nfunction capitalize(s) {\n return `${s[0].toUpperCase()}${s.slice(1)}`;\n}\nfunction processFieldLevelAuthRules(fields, authFields) {\n const fieldLevelAuthRules = {};\n for (const [fieldName, fieldDef] of Object.entries(fields)) {\n const fieldAuth = fieldDef?.data?.authorization || [];\n const { authString, authFields: fieldAuthField } = calculateAuth(fieldAuth);\n if (authString)\n fieldLevelAuthRules[fieldName] = authString;\n if (fieldAuthField) {\n addFields(authFields, fieldAuthField);\n }\n }\n return fieldLevelAuthRules;\n}\nfunction processFields(typeName, fields, impliedFields, fieldLevelAuthRules, identifier, partitionKey, secondaryIndexes = {}) {\n const gqlFields = [];\n const models = [];\n validateImpliedFields(fields, impliedFields);\n for (const [fieldName, fieldDef] of Object.entries(fields)) {\n const fieldAuth = fieldLevelAuthRules[fieldName]\n ? ` ${fieldLevelAuthRules[fieldName]}`\n : '';\n if (isModelField(fieldDef)) {\n gqlFields.push(`${fieldName}: ${modelFieldToGql(fieldDef.data)}${fieldAuth}`);\n }\n else if (isScalarField(fieldDef)) {\n if (fieldName === partitionKey) {\n gqlFields.push(`${fieldName}: ${scalarFieldToGql(fieldDef.data, identifier, secondaryIndexes[fieldName])}${fieldAuth}`);\n }\n else if (isRefField(fieldDef)) {\n gqlFields.push(`${fieldName}: ${refFieldToGql(fieldDef.data)}${fieldAuth}`);\n }\n else if (isEnumType(fieldDef)) {\n // The inline enum type name should be `<TypeName><FieldName>` to avoid\n // enum type name conflicts\n const enumName = `${capitalize(typeName)}${capitalize(fieldName)}`;\n models.push([enumName, fieldDef]);\n gqlFields.push(`${fieldName}: ${enumName}`);\n }\n else if (isCustomType(fieldDef)) {\n // The inline CustomType name should be `<TypeName><FieldName>` to avoid\n // CustomType name conflicts\n const customTypeName = `${capitalize(typeName)}${capitalize(fieldName)}`;\n models.push([customTypeName, fieldDef]);\n gqlFields.push(`${fieldName}: ${customTypeName}`);\n }\n else {\n gqlFields.push(`${fieldName}: ${scalarFieldToGql(fieldDef.data, undefined, secondaryIndexes[fieldName])}${fieldAuth}`);\n }\n }\n else {\n throw new Error(`Unexpected field definition: ${fieldDef}`);\n }\n }\n return { gqlFields, models };\n}\n/**\n *\n * @param pk - partition key field name\n * @param sk - (optional) array of sort key field names\n * @returns default query field name\n */\nconst secondaryIndexDefaultQueryField = (modelName, pk, sk) => {\n const skName = sk?.length ? 'And' + sk?.map(capitalize).join('And') : '';\n const queryField = `list${capitalize(modelName)}By${capitalize(pk)}${skName}`;\n return queryField;\n};\n/**\n * Given InternalModelIndexType[] returns a map where the key is the model field to be annotated with an @index directive\n * and the value is an array of transformed Amplify @index directives with all supplied attributes\n */\nconst transformedSecondaryIndexesForModel = (modelName, secondaryIndexes) => {\n const indexDirectiveWithAttributes = (partitionKey, sortKeys, indexName, queryField) => {\n if (!sortKeys.length && !indexName && !queryField) {\n return `@index(queryField: \"${secondaryIndexDefaultQueryField(modelName, partitionKey)}\")`;\n }\n const attributes = [];\n if (indexName) {\n attributes.push(`name: \"${indexName}\"`);\n }\n if (sortKeys.length) {\n attributes.push(`sortKeyFields: [${sortKeys.map((sk) => `\"${sk}\"`).join(', ')}]`);\n }\n if (queryField) {\n attributes.push(`queryField: \"${queryField}\"`);\n }\n else {\n attributes.push(`queryField: \"${secondaryIndexDefaultQueryField(modelName, partitionKey, sortKeys)}\"`);\n }\n return `@index(${attributes.join(', ')})`;\n };\n return secondaryIndexes.reduce((acc, { data: { partitionKey, sortKeys, indexName, queryField } }) => {\n acc[partitionKey] = acc[partitionKey] || [];\n acc[partitionKey].push(indexDirectiveWithAttributes(partitionKey, sortKeys, indexName, queryField));\n return acc;\n }, {});\n};\nconst ruleIsResourceAuth = (authRule) => {\n const data = (0, Authorization_1.accessSchemaData)(authRule);\n return data.strategy === 'resource';\n};\n/**\n * Separates out lambda resource auth rules from remaining schema rules.\n *\n * @param authRules schema auth rules\n */\nconst extractFunctionSchemaAccess = (authRules) => {\n const schemaAuth = [];\n const functionSchemaAccess = [];\n const defaultActions = [\n 'query',\n 'mutate',\n 'listen',\n ];\n for (const rule of authRules) {\n if (ruleIsResourceAuth(rule)) {\n const ruleData = (0, Authorization_1.accessSchemaData)(rule);\n const fnAccess = {\n resourceProvider: ruleData.resource,\n actions: ruleData.operations || defaultActions,\n };\n functionSchemaAccess.push(fnAccess);\n }\n else {\n schemaAuth.push(rule);\n }\n }\n return { schemaAuth, functionSchemaAccess };\n};\n/**\n * Returns a closure for retrieving reference type and definition from schema\n */\nconst getRefTypeForSchema = (schema) => {\n const getRefType = (source, target) => {\n const typeDef = schema.data.types[source];\n if (typeDef === undefined) {\n throw new Error(`Invalid ref. ${target} is referencing ${source} which is not defined in the schema`);\n }\n if (isInternalModel(typeDef)) {\n return { type: 'Model', def: typeDef };\n }\n if (isCustomOperation(typeDef)) {\n return { type: 'CustomOperation', def: typeDef };\n }\n if (isCustomType(typeDef)) {\n return { type: 'CustomType', def: typeDef };\n }\n if (isEnumType(typeDef)) {\n return { type: 'Enum', def: typeDef };\n }\n throw new Error(`Invalid ref. ${target} is referencing ${source} which is neither a Model, Custom Operation, Custom Type, or Enum`);\n };\n return getRefType;\n};\nconst schemaPreprocessor = (schema) => {\n const gqlModels = [];\n const customQueries = [];\n const customMutations = [];\n const customSubscriptions = [];\n const jsFunctions = [];\n const lambdaFunctions = {};\n const customSqlDataSourceStrategies = [];\n const databaseType = schema.data.configuration.database.engine === 'dynamodb'\n ? 'dynamodb'\n : 'sql';\n const staticSchema = schema.data.configuration.database.engine === 'dynamodb' ? false : true;\n const topLevelTypes = Object.entries(schema.data.types);\n const { schemaAuth, functionSchemaAccess } = extractFunctionSchemaAccess(schema.data.authorization);\n const getRefType = getRefTypeForSchema(schema);\n for (const [typeName, typeDef] of topLevelTypes) {\n const mostRelevantAuthRules = typeDef.data?.authorization?.length > 0\n ? typeDef.data.authorization\n : schemaAuth;\n if (!isInternalModel(typeDef)) {\n if (isEnumType(typeDef)) {\n if (typeDef.values.some((value) => /\\s/.test(value))) {\n throw new Error(`Values of the enum type ${typeName} should not contain any whitespace.`);\n }\n const enumType = `enum ${typeName} {\\n ${typeDef.values.join('\\n ')}\\n}`;\n gqlModels.push(enumType);\n }\n else if (isCustomType(typeDef)) {\n const fields = typeDef.data.fields;\n const fieldAuthApplicableFields = Object.fromEntries(Object.entries(fields).filter((pair) => isModelField(pair[1])));\n const authString = '';\n const authFields = {};\n const fieldLevelAuthRules = processFieldLevelAuthRules(fieldAuthApplicableFields, authFields);\n const { gqlFields, models } = processFields(typeName, fields, authFields, fieldLevelAuthRules);\n topLevelTypes.push(...models);\n const joined = gqlFields.join('\\n ');\n const model = `type ${typeName} ${authString}\\n{\\n ${joined}\\n}`;\n gqlModels.push(model);\n }\n else if (isCustomOperation(typeDef)) {\n const { typeName: opType } = typeDef.data;\n const { gqlField, models, jsFunctionForField, lambdaFunctionDefinition, customSqlDataSourceStrategy, } = transformCustomOperations(typeDef, typeName, mostRelevantAuthRules, databaseType, getRefType);\n Object.assign(lambdaFunctions, lambdaFunctionDefinition);\n topLevelTypes.push(...models);\n if (jsFunctionForField) {\n jsFunctions.push(jsFunctionForField);\n }\n if (customSqlDataSourceStrategy) {\n customSqlDataSourceStrategies.push(customSqlDataSourceStrategy);\n }\n switch (opType) {\n case 'Query':\n customQueries.push(gqlField);\n break;\n case 'Mutation':\n customMutations.push(gqlField);\n break;\n case 'Subscription':\n customSubscriptions.push(gqlField);\n break;\n default:\n break;\n }\n }\n }\n else if (staticSchema) {\n const fields = { ...typeDef.data.fields };\n const identifier = typeDef.data.identifier;\n const [partitionKey] = identifier;\n const { authString, authFields } = calculateAuth(mostRelevantAuthRules);\n if (authString == '') {\n throw new Error(`Model \\`${typeName}\\` is missing authorization rules. Add global rules to the schema or ensure every model has its own rules.`);\n }\n const fieldLevelAuthRules = processFieldLevelAuthRules(fields, authFields);\n validateStaticFields(fields, authFields);\n const { gqlFields, models } = processFields(typeName, fields, authFields, fieldLevelAuthRules, identifier, partitionKey);\n topLevelTypes.push(...models);\n const joined = gqlFields.join('\\n ');\n // TODO: update @model(timestamps: null) once a longer term solution gets\n // determined.\n //\n // Context: SQL schema should not be automatically inserted with timestamp fields,\n // passing (timestamps: null) to @model to suppress this behavior as a short\n // term solution.\n const model = `type ${typeName} @model(timestamps: null) ${authString}\\n{\\n ${joined}\\n}`;\n gqlModels.push(model);\n }\n else {\n const fields = typeDef.data.fields;\n const identifier = typeDef.data.identifier;\n const [partitionKey] = identifier;\n const transformedSecondaryIndexes = transformedSecondaryIndexesForModel(typeName, typeDef.data.secondaryIndexes);\n const { authString, authFields } = calculateAuth(mostRelevantAuthRules);\n if (authString == '') {\n throw new Error(`Model \\`${typeName}\\` is missing authorization rules. Add global rules to the schema or ensure every model has its own rules.`);\n }\n const fieldLevelAuthRules = processFieldLevelAuthRules(fields, authFields);\n const { gqlFields, models } = processFields(typeName, fields, authFields, fieldLevelAuthRules, identifier, partitionKey, transformedSecondaryIndexes);\n topLevelTypes.push(...models);\n const joined = gqlFields.join('\\n ');\n const model = `type ${typeName} @model ${authString}\\n{\\n ${joined}\\n}`;\n gqlModels.push(model);\n }\n }\n const customOperations = {\n queries: customQueries,\n mutations: customMutations,\n subscriptions: customSubscriptions,\n };\n gqlModels.push(...generateCustomOperationTypes(customOperations));\n const processedSchema = gqlModels.join('\\n\\n');\n return {\n schema: processedSchema,\n jsFunctions,\n functionSchemaAccess,\n lambdaFunctions,\n customSqlDataSourceStrategies,\n };\n};\nfunction validateCustomOperations(typeDef, typeName, authRules, getRefType) {\n const { functionRef, handlers, typeName: opType, subscriptionSource, } = typeDef.data;\n // TODO: remove `functionRef` after deprecating\n const handlerConfigured = functionRef !== null || handlers?.length;\n const authConfigured = authRules.length > 0;\n if ((authConfigured && !handlerConfigured) ||\n (handlerConfigured && !authConfigured)) {\n // Deploying a custom operation with auth and no handler reference OR\n // with a handler reference but no auth\n // causes the CFN stack to reach an unrecoverable state. Ideally, this should be fixed\n // in the CDK construct, but we're catching it early here as a stopgap\n throw new Error(`Custom operation ${typeName} requires both an authorization rule and a handler reference`);\n }\n // Handlers must all be of the same type\n if (handlers?.length) {\n const configuredHandlers = new Set();\n for (const handler of handlers) {\n configuredHandlers.add((0, util_1.getBrand)(handler));\n }\n if (configuredHandlers.size > 1) {\n const configuredHandlersStr = JSON.stringify(Array.from(configuredHandlers));\n throw new Error(`Field handlers must be of the same type. ${typeName} has been configured with ${configuredHandlersStr}`);\n }\n }\n if (opType !== 'Subscription' && subscriptionSource.length > 0) {\n throw new Error(`The .for() modifier function can only be used with a custom subscription. ${typeName} is not a custom subscription.`);\n }\n if (opType === 'Subscription') {\n if (subscriptionSource.length < 1) {\n throw new Error(`${typeName} is missing a mutation source. Custom subscriptions must reference a mutation source via subscription().for(a.ref('ModelOrOperationName')) `);\n }\n let expectedReturnType;\n for (const source of subscriptionSource) {\n const sourceName = source.data.link;\n const { type, def } = getRefType(sourceName, typeName);\n if (type !== 'Model' && source.data.mutationOperations.length > 0) {\n throw new Error(`Invalid subscription definition. .mutations() modifier can only be used with a Model ref. ${typeName} is referencing ${type}`);\n }\n let resolvedReturnType;\n if (type === 'Model') {\n if (source.data.mutationOperations.length === 0) {\n throw new Error(`Invalid subscription definition. .mutations() modifier must be used with a Model ref subscription source. ${typeName} is referencing ${sourceName} without specifying a mutation`);\n }\n else {\n resolvedReturnType = def;\n }\n }\n if (type === 'CustomOperation') {\n if (def.data.typeName !== 'Mutation') {\n throw new Error(`Invalid subscription definition. .for() can only reference a mutation. ${typeName} is referencing ${sourceName} which is a ${def.data.typeName}`);\n }\n else {\n const returnType = def.data.returnType;\n if (isRefField(returnType)) {\n ({ def: resolvedReturnType } = getRefType(returnType.data.link, typeName));\n }\n else {\n resolvedReturnType = returnType;\n }\n }\n }\n expectedReturnType = expectedReturnType ?? resolvedReturnType;\n // As the return types are resolved from the root `schema` object and they should\n // not be mutated, we compare by references here.\n if (expectedReturnType !== resolvedReturnType) {\n throw new Error(`Invalid subscription definition. .for() can only reference resources that have the same return type. ${typeName} is referencing resources that have different return types.`);\n }\n }\n }\n}\nconst isSqlReferenceHandler = (handler) => {\n return Array.isArray(handler) && (0, util_1.getBrand)(handler[0]) === 'sqlReference';\n};\nconst isCustomHandler = (handler) => {\n return Array.isArray(handler) && (0, util_1.getBrand)(handler[0]) === 'customHandler';\n};\nconst isFunctionHandler = (handler) => {\n return Array.isArray(handler) && (0, util_1.getBrand)(handler[0]) === 'functionHandler';\n};\nconst normalizeDataSourceName = (dataSource) => {\n // default data source\n const noneDataSourceName = 'NONE_DS';\n if (dataSource === undefined) {\n return noneDataSourceName;\n }\n if (dataSourceIsRef(dataSource)) {\n return `${dataSource.data.link}Table`;\n }\n return dataSource;\n};\nconst sanitizeStackTrace = (stackTrace) => {\n // normalize EOL to \\n so that parsing is consistent across platforms\n const normalizedStackTrace = stackTrace.replace(new RegExp(os.EOL), '\\n');\n return (normalizedStackTrace\n .split('\\n')\n .map((line) => line.trim())\n // filters out noise not relevant to the stack trace. All stack trace lines begin with 'at'\n .filter((line) => line.startsWith('at')) || []);\n};\n// copied from the defineFunction path resolution impl:\n// https://github.com/aws-amplify/amplify-backend/blob/main/packages/backend-function/src/get_caller_directory.ts\nconst resolveEntryPath = (data, errorMessage) => {\n if (path.isAbsolute(data.entry)) {\n return data.entry;\n }\n if (!data.stack) {\n throw new Error(errorMessage);\n }\n const stackTraceLines = sanitizeStackTrace(data.stack);\n if (stackTraceLines.length < 2) {\n throw new Error(errorMessage);\n }\n const stackTraceImportLine = stackTraceLines[1]; // the first entry is the file where the error was initialized (our code). The second entry is where the customer called our code which is what we are interested in\n // if entry is relative, compute with respect to the caller directory\n return { relativePath: data.entry, importLine: stackTraceImportLine };\n};\nconst handleCustom = (handlers, opType, typeName) => {\n const transformedHandlers = handlers.map((handler) => {\n const handlerData = (0, Handler_1.getHandlerData)(handler);\n return {\n dataSource: normalizeDataSourceName(handlerData.dataSource),\n entry: resolveEntryPath(handlerData, 'Could not determine import path to construct absolute code path for custom handler. Consider using an absolute path instead.'),\n };\n });\n const jsFn = {\n typeName: opType,\n fieldName: typeName,\n handlers: transformedHandlers,\n };\n return jsFn;\n};\nfunction transformCustomOperations(typeDef, typeName, authRules, databaseType, getRefType) {\n const { typeName: opType, handlers } = typeDef.data;\n let jsFunctionForField = undefined;\n validateCustomOperations(typeDef, typeName, authRules, getRefType);\n if (isCustomHandler(handlers)) {\n jsFunctionForField = handleCustom(handlers, opType, typeName);\n }\n const isCustom = Boolean(jsFunctionForField);\n const { gqlField, models, lambdaFunctionDefinition, customSqlDataSourceStrategy, } = customOperationToGql(typeName, typeDef, authRules, isCustom, databaseType, getRefType);\n return {\n gqlField,\n models,\n jsFunctionForField,\n lambdaFunctionDefinition,\n customSqlDataSourceStrategy,\n };\n}\nfunction generateCustomOperationTypes({ queries, mutations, subscriptions, }) {\n const types = [];\n if (mutations.length > 0) {\n types.push(`type Mutation {\\n ${mutations.join('\\n ')}\\n}`);\n }\n if (queries.length > 0) {\n types.push(`type Query {\\n ${queries.join('\\n ')}\\n}`);\n }\n if (subscriptions.length > 0) {\n types.push(`type Subscription {\\n ${subscriptions.join('\\n ')}\\n}`);\n }\n return types;\n}\n/**\n * Returns API definition from ModelSchema or string schema\n * @param arg - { schema }\n * @returns DerivedApiDefinition that conforms to IAmplifyGraphqlDefinition\n */\nfunction processSchema(arg) {\n const { schema, jsFunctions, functionSchemaAccess, lambdaFunctions, customSqlDataSourceStrategies, } = schemaPreprocessor(arg.schema);\n return {\n schema,\n functionSlots: [],\n jsFunctions,\n functionSchemaAccess,\n lambdaFunctions,\n customSqlDataSourceStrategies,\n };\n}\nexports.processSchema = processSchema;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC;AAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AACjC,MAAM,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;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