@grantjs/schema 1.18.11 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grantjs/schema",
3
- "version": "1.18.11",
3
+ "version": "1.19.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -151,6 +151,7 @@ export const EVENT_TYPES = [
151
151
  'user.updated',
152
152
  'user.deleted',
153
153
  'project.user_updated',
154
+ 'project.user_email_changed',
154
155
  'api_key.deleted',
155
156
  'tag.created',
156
157
  'tag.updated',
@@ -226,6 +227,7 @@ export const EVENT_CATALOG: Readonly<Record<EventType, EventCatalogEntry>> = {
226
227
  'user.updated': webhookOnly('membership'),
227
228
  'user.deleted': webhookOnly('membership'),
228
229
  'project.user_updated': webhookOnly('membership'),
230
+ 'project.user_email_changed': webhookOnly('membership'),
229
231
  'api_key.deleted': webhookOnly('security'),
230
232
  'tag.created': webhookOnly('iam'),
231
233
  'tag.updated': webhookOnly('iam'),
@@ -2174,6 +2174,20 @@ export type GetUsersListQuery = {
2174
2174
  };
2175
2175
  };
2176
2176
 
2177
+ export type SetProjectUserEmailMutationVariables = Exact<{
2178
+ input: Types.SetProjectUserEmailInput;
2179
+ }>;
2180
+
2181
+ export type SetProjectUserEmailMutation = {
2182
+ setProjectUserEmail: {
2183
+ id: string;
2184
+ name: string;
2185
+ metadata: Record<string, unknown>;
2186
+ createdAt: Date;
2187
+ updatedAt: Date;
2188
+ };
2189
+ };
2190
+
2177
2191
  export type UpdateUserMutationVariables = Exact<{
2178
2192
  id: string | number;
2179
2193
  input: Types.UpdateUserInput;
@@ -11155,6 +11169,52 @@ export const GetUsersListDocument = {
11155
11169
  },
11156
11170
  ],
11157
11171
  } as unknown as DocumentNode<GetUsersListQuery, GetUsersListQueryVariables>;
11172
+ export const SetProjectUserEmailDocument = {
11173
+ kind: 'Document',
11174
+ definitions: [
11175
+ {
11176
+ kind: 'OperationDefinition',
11177
+ operation: 'mutation',
11178
+ name: { kind: 'Name', value: 'SetProjectUserEmail' },
11179
+ variableDefinitions: [
11180
+ {
11181
+ kind: 'VariableDefinition',
11182
+ variable: { kind: 'Variable', name: { kind: 'Name', value: 'input' } },
11183
+ type: {
11184
+ kind: 'NonNullType',
11185
+ type: { kind: 'NamedType', name: { kind: 'Name', value: 'SetProjectUserEmailInput' } },
11186
+ },
11187
+ },
11188
+ ],
11189
+ selectionSet: {
11190
+ kind: 'SelectionSet',
11191
+ selections: [
11192
+ {
11193
+ kind: 'Field',
11194
+ name: { kind: 'Name', value: 'setProjectUserEmail' },
11195
+ arguments: [
11196
+ {
11197
+ kind: 'Argument',
11198
+ name: { kind: 'Name', value: 'input' },
11199
+ value: { kind: 'Variable', name: { kind: 'Name', value: 'input' } },
11200
+ },
11201
+ ],
11202
+ selectionSet: {
11203
+ kind: 'SelectionSet',
11204
+ selections: [
11205
+ { kind: 'Field', name: { kind: 'Name', value: 'id' } },
11206
+ { kind: 'Field', name: { kind: 'Name', value: 'name' } },
11207
+ { kind: 'Field', name: { kind: 'Name', value: 'metadata' } },
11208
+ { kind: 'Field', name: { kind: 'Name', value: 'createdAt' } },
11209
+ { kind: 'Field', name: { kind: 'Name', value: 'updatedAt' } },
11210
+ ],
11211
+ },
11212
+ },
11213
+ ],
11214
+ },
11215
+ },
11216
+ ],
11217
+ } as unknown as DocumentNode<SetProjectUserEmailMutation, SetProjectUserEmailMutationVariables>;
11158
11218
  export const UpdateUserDocument = {
11159
11219
  kind: 'Document',
11160
11220
  definitions: [
@@ -501,6 +501,7 @@ export type ResolversTypes = ResolversObject<{
501
501
  SessionExportData: ResolverTypeWrapper<Types.SessionExportData>;
502
502
  SetMyNotificationPreferenceInput: Types.SetMyNotificationPreferenceInput;
503
503
  SetMyPrimaryMfaDeviceInput: Types.SetMyPrimaryMfaDeviceInput;
504
+ SetProjectUserEmailInput: Types.SetProjectUserEmailInput;
504
505
  SigningKey: ResolverTypeWrapper<Types.SigningKey>;
505
506
  SortOrder: Types.SortOrder;
506
507
  StartProjectExportInput: Types.StartProjectExportInput;
@@ -883,6 +884,7 @@ export type ResolversParentTypes = ResolversObject<{
883
884
  SessionExportData: Types.SessionExportData;
884
885
  SetMyNotificationPreferenceInput: Types.SetMyNotificationPreferenceInput;
885
886
  SetMyPrimaryMfaDeviceInput: Types.SetMyPrimaryMfaDeviceInput;
887
+ SetProjectUserEmailInput: Types.SetProjectUserEmailInput;
886
888
  SigningKey: Types.SigningKey;
887
889
  StartProjectExportInput: Types.StartProjectExportInput;
888
890
  String: Types.Scalars['String']['output'];
@@ -1960,6 +1962,12 @@ export type MutationResolvers<
1960
1962
  ContextType,
1961
1963
  RequireFields<Types.MutationSetMyPrimaryMfaDeviceArgs, 'input'>
1962
1964
  >;
1965
+ setProjectUserEmail?: Resolver<
1966
+ ResolversTypes['User'],
1967
+ ParentType,
1968
+ ContextType,
1969
+ RequireFields<Types.MutationSetProjectUserEmailArgs, 'input'>
1970
+ >;
1963
1971
  setupMfa?: Resolver<ResolversTypes['MfaSetupResponse'], ParentType, ContextType>;
1964
1972
  startProjectExport?: Resolver<
1965
1973
  ResolversTypes['ProjectSyncJob'],
@@ -757,6 +757,11 @@ export type CreateUserAuthenticationMethodInput = {
757
757
  };
758
758
 
759
759
  export type CreateUserInput = {
760
+ /**
761
+ * Optional. Project-scope create only. Stores an unverified Email authentication method.
762
+ * A provider can only be linked to one user account (no sharing), and a user can only have one method per provider (no duplicates).
763
+ */
764
+ email?: InputMaybe<Scalars['String']['input']>;
760
765
  groupIds?: InputMaybe<Array<Scalars['ID']['input']>>;
761
766
  metadata?: InputMaybe<Scalars['JSON']['input']>;
762
767
  name: Scalars['String']['input'];
@@ -1285,6 +1290,11 @@ export type Mutation = {
1285
1290
  setMyNotificationPreference: NotificationPreference;
1286
1291
  setMyPrimaryAuthenticationMethod: UserAuthenticationMethod;
1287
1292
  setMyPrimaryMfaDevice: MfaDevice;
1293
+ /**
1294
+ * Set or replace a project member's Email authentication method as unverified.
1295
+ * `project.user_email_changed` carries ids only, never the address.
1296
+ */
1297
+ setProjectUserEmail: User;
1288
1298
  setupMfa: MfaSetupResponse;
1289
1299
  /**
1290
1300
  * Enqueue an asynchronous CDM **export** job for the given project. The worker
@@ -1647,6 +1657,10 @@ export type MutationSetMyPrimaryMfaDeviceArgs = {
1647
1657
  input: SetMyPrimaryMfaDeviceInput;
1648
1658
  };
1649
1659
 
1660
+ export type MutationSetProjectUserEmailArgs = {
1661
+ input: SetProjectUserEmailInput;
1662
+ };
1663
+
1650
1664
  export type MutationStartProjectExportArgs = {
1651
1665
  id: Scalars['ID']['input'];
1652
1666
  input: StartProjectExportInput;
@@ -3541,6 +3555,16 @@ export type SetMyPrimaryMfaDeviceInput = {
3541
3555
  factorId: Scalars['ID']['input'];
3542
3556
  };
3543
3557
 
3558
+ export type SetProjectUserEmailInput = {
3559
+ /**
3560
+ * Unverified Email authentication method. Project-scope only.
3561
+ * A provider can only be linked to one user account (no sharing), and a user can only have one method per provider (no duplicates).
3562
+ */
3563
+ email: Scalars['String']['input'];
3564
+ scope: Scope;
3565
+ userId: Scalars['ID']['input'];
3566
+ };
3567
+
3544
3568
  /**
3545
3569
  * Signing key for a scope (e.g. project). Used for RS256 API key tokens; public key is exposed in JWKS.
3546
3570
  * Only project scopes (accountProject, organizationProject) have manageable keys; system key is internal.
@@ -0,0 +1,9 @@
1
+ mutation SetProjectUserEmail($input: SetProjectUserEmailInput!) {
2
+ setProjectUserEmail(input: $input) {
3
+ id
4
+ name
5
+ metadata
6
+ createdAt
7
+ updatedAt
8
+ }
9
+ }
@@ -8,4 +8,9 @@ input CreateUserInput {
8
8
  permissionIds: [ID!]
9
9
  scope: Scope!
10
10
  primaryTagId: ID
11
+ """
12
+ Optional. Project-scope create only. Stores an unverified Email authentication method.
13
+ A provider can only be linked to one user account (no sharing), and a user can only have one method per provider (no duplicates).
14
+ """
15
+ email: String
11
16
  }
@@ -0,0 +1,9 @@
1
+ input SetProjectUserEmailInput {
2
+ userId: ID!
3
+ """
4
+ Unverified Email authentication method. Project-scope only.
5
+ A provider can only be linked to one user account (no sharing), and a user can only have one method per provider (no duplicates).
6
+ """
7
+ email: String!
8
+ scope: Scope!
9
+ }
@@ -0,0 +1,7 @@
1
+ extend type Mutation {
2
+ """
3
+ Set or replace a project member's Email authentication method as unverified.
4
+ `project.user_email_changed` carries ids only, never the address.
5
+ """
6
+ setProjectUserEmail(input: SetProjectUserEmailInput!): User!
7
+ }
@@ -51,10 +51,11 @@ describe('operation documents', () => {
51
51
  // 135 after project OAuth connections: get/upsert/clear (three operation documents).
52
52
  // 136 after closed-install: AuthSignupPolicyDocument (publicSignupEnabled, bootstrapOpen).
53
53
  // 137 after CDM imports by reference: RequestProjectSyncUploadUrlDocument.
54
+ // 138 after operator-set-email: SetProjectUserEmailDocument.
54
55
  // Updating this number is the point of the pin, not a nuisance: every change
55
56
  // to it should be a line in a commit message.
56
57
  it('finds every document under src/operations', () => {
57
- expect(files).toHaveLength(137);
58
+ expect(files).toHaveLength(138);
58
59
  });
59
60
 
60
61
  it.each(files.map((f) => [relative(process.cwd(), f), f]))('%s validates', (_label, file) => {