@grantjs/schema 1.0.0 → 1.1.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.
Files changed (77) hide show
  1. package/package.json +8 -8
  2. package/src/cdm/cdm-export-sections.ts +22 -0
  3. package/src/generated/graphql.ts +1656 -46
  4. package/src/generated/resolvers.ts +727 -0
  5. package/src/index.ts +11 -10
  6. package/src/operations/auth/login.graphql +2 -0
  7. package/src/operations/auth/setupMfa.graphql +7 -0
  8. package/src/operations/auth/verifyMfa.graphql +7 -0
  9. package/src/operations/auth/verifyMfaRecoveryCode.graphql +7 -0
  10. package/src/operations/me/createMyMfaEnrollment.graphql +7 -0
  11. package/src/operations/me/generateMyMfaRecoveryCodes.graphql +3 -0
  12. package/src/operations/me/me.graphql +1 -0
  13. package/src/operations/me/myMfaDevices.graphql +10 -0
  14. package/src/operations/me/myMfaRecoveryCodeStatus.graphql +6 -0
  15. package/src/operations/me/removeMyMfaDevice.graphql +5 -0
  16. package/src/operations/me/setMyPrimaryMfaDevice.graphql +6 -0
  17. package/src/operations/me/verifyMyMfaEnrollment.graphql +5 -0
  18. package/src/operations/organizations/getOrganizations.graphql +1 -0
  19. package/src/operations/organizations/updateOrganization.graphql +1 -0
  20. package/src/operations/projects/cancel-project-sync.graphql +17 -0
  21. package/src/operations/projects/project-sync-job.graphql +37 -0
  22. package/src/operations/projects/project-sync-jobs.graphql +40 -0
  23. package/src/operations/projects/start-project-export.graphql +20 -0
  24. package/src/operations/projects/start-project-sync.graphql +17 -0
  25. package/src/operations/resources/createResource.graphql +6 -0
  26. package/src/schema/auth/inputs/verify-mfa-recovery-code.graphql +3 -0
  27. package/src/schema/auth/inputs/verify-mfa.graphql +3 -0
  28. package/src/schema/auth/mutations/setup-mfa.graphql +3 -0
  29. package/src/schema/auth/mutations/verify-mfa-recovery-code.graphql +3 -0
  30. package/src/schema/auth/mutations/verify-mfa.graphql +3 -0
  31. package/src/schema/auth/types/login-response.graphql +5 -0
  32. package/src/schema/auth/types/mfa-setup-response.graphql +5 -0
  33. package/src/schema/auth/types/mfa-verify-response.graphql +5 -0
  34. package/src/schema/me/inputs/generate-my-mfa-recovery-codes.graphql +3 -0
  35. package/src/schema/me/inputs/remove-my-mfa-device.graphql +3 -0
  36. package/src/schema/me/inputs/set-my-primary-mfa-device.graphql +3 -0
  37. package/src/schema/me/inputs/verify-my-mfa-enrollment.graphql +3 -0
  38. package/src/schema/me/mutations/create-my-mfa-enrollment.graphql +3 -0
  39. package/src/schema/me/mutations/generate-my-mfa-recovery-codes.graphql +3 -0
  40. package/src/schema/me/mutations/remove-my-mfa-device.graphql +3 -0
  41. package/src/schema/me/mutations/set-my-primary-mfa-device.graphql +3 -0
  42. package/src/schema/me/mutations/verify-my-mfa-enrollment.graphql +3 -0
  43. package/src/schema/me/queries/my-mfa-devices.graphql +3 -0
  44. package/src/schema/me/queries/my-mfa-recovery-code-status.graphql +3 -0
  45. package/src/schema/me/types/me-response.graphql +1 -0
  46. package/src/schema/me/types/mfa-device.graphql +8 -0
  47. package/src/schema/me/types/mfa-enrollment.graphql +5 -0
  48. package/src/schema/me/types/mfa-recovery-code-status.graphql +4 -0
  49. package/src/schema/me/types/mfa-verify-result.graphql +3 -0
  50. package/src/schema/organization-users/inputs/add-organization-user.graphql +1 -0
  51. package/src/schema/organization-users/types/organization-user.graphql +1 -0
  52. package/src/schema/organizations/inputs/update-organization.graphql +1 -0
  53. package/src/schema/organizations/types/organization.graphql +1 -0
  54. package/src/schema/permissions/inputs/create-permission.graphql +1 -0
  55. package/src/schema/permissions/inputs/update-permission.graphql +1 -0
  56. package/src/schema/permissions/types/permission.graphql +1 -0
  57. package/src/schema/project-user-api-keys/inputs/add-project-user-api-key.graphql +4 -0
  58. package/src/schema/project-users/inputs/add-project-user.graphql +1 -0
  59. package/src/schema/project-users/types/project-user.graphql +3 -0
  60. package/src/schema/projects/inputs/project-sync-job-sort.graphql +4 -0
  61. package/src/schema/projects/inputs/start-project-export.graphql +31 -0
  62. package/src/schema/projects/inputs/sync-project-cdm.graphql +132 -0
  63. package/src/schema/projects/mutations/cancel-project-sync.graphql +9 -0
  64. package/src/schema/projects/mutations/start-project-export.graphql +12 -0
  65. package/src/schema/projects/mutations/start-project-sync.graphql +15 -0
  66. package/src/schema/projects/queries/project-sync-job.graphql +7 -0
  67. package/src/schema/projects/queries/project-sync-jobs.graphql +17 -0
  68. package/src/schema/projects/types/project-sync-job-page.graphql +8 -0
  69. package/src/schema/projects/types/project-sync-job-sortable-field.graphql +7 -0
  70. package/src/schema/projects/types/project-sync-job.graphql +53 -0
  71. package/src/schema/projects/types/sync-project-result.graphql +27 -0
  72. package/src/schema/resources/inputs/create-resource.graphql +2 -0
  73. package/src/schema/resources/inputs/update-resource.graphql +1 -0
  74. package/src/schema/resources/types/resource.graphql +2 -0
  75. package/src/schema/tags/inputs/create-tag.graphql +1 -0
  76. package/src/schema/tags/inputs/update-tag.graphql +1 -0
  77. package/src/schema/tags/types/tag.graphql +1 -0
package/src/index.ts CHANGED
@@ -1,12 +1,5 @@
1
+ export * from './cdm/cdm-export-sections';
1
2
  export * from './generated/graphql';
2
- export type {
3
- ProjectAppPublicInfo,
4
- ProjectAppScopeInfo,
5
- ProjectConsentInfo,
6
- ProjectConsentInfoUser,
7
- ProjectConsentRedirectResult,
8
- } from './project-oauth.types';
9
-
10
3
  export type {
11
4
  AccountResolvers,
12
5
  GroupResolvers,
@@ -14,17 +7,25 @@ export type {
14
7
  OrganizationInvitationResolvers,
15
8
  OrganizationResolvers,
16
9
  PermissionResolvers,
17
- ProjectResolvers,
18
10
  ProjectAppResolvers,
11
+ ProjectResolvers,
19
12
  QueryResolvers,
20
13
  RequireFields,
21
14
  Resolver,
22
- ResolverTypeWrapper,
23
15
  Resolvers,
24
16
  ResolversObject,
25
17
  ResolversParentTypes,
26
18
  ResolversTypes,
19
+ ResolverTypeWrapper,
20
+ ResourceResolvers,
27
21
  RoleResolvers,
28
22
  TagResolvers,
29
23
  UserResolvers,
30
24
  } from './generated/resolvers';
25
+ export type {
26
+ ProjectAppPublicInfo,
27
+ ProjectAppScopeInfo,
28
+ ProjectConsentInfo,
29
+ ProjectConsentInfoUser,
30
+ ProjectConsentRedirectResult,
31
+ } from './project-oauth.types';
@@ -2,6 +2,8 @@ mutation Login($input: LoginInput!) {
2
2
  login(input: $input) {
3
3
  accessToken
4
4
  refreshToken
5
+ mfaVerified
6
+ requiresMfaStepUp
5
7
  requiresEmailVerification
6
8
  verificationExpiry
7
9
  email
@@ -0,0 +1,7 @@
1
+ mutation SetupMfa {
2
+ setupMfa {
3
+ factorId
4
+ secret
5
+ otpAuthUrl
6
+ }
7
+ }
@@ -0,0 +1,7 @@
1
+ mutation VerifyMfa($input: VerifyMfaInput!) {
2
+ verifyMfa(input: $input) {
3
+ accessToken
4
+ refreshToken
5
+ mfaVerified
6
+ }
7
+ }
@@ -0,0 +1,7 @@
1
+ mutation VerifyMfaRecoveryCode($input: VerifyMfaRecoveryCodeInput!) {
2
+ verifyMfaRecoveryCode(input: $input) {
3
+ accessToken
4
+ refreshToken
5
+ mfaVerified
6
+ }
7
+ }
@@ -0,0 +1,7 @@
1
+ mutation CreateMyMfaEnrollment {
2
+ createMyMfaEnrollment {
3
+ factorId
4
+ secret
5
+ otpAuthUrl
6
+ }
7
+ }
@@ -0,0 +1,3 @@
1
+ mutation GenerateMyMfaRecoveryCodes($input: GenerateMyMfaRecoveryCodesInput) {
2
+ generateMyMfaRecoveryCodes(input: $input)
3
+ }
@@ -15,6 +15,7 @@ query Me {
15
15
  updatedAt
16
16
  }
17
17
  }
18
+ mfaVerified
18
19
  requiresEmailVerification
19
20
  verificationExpiry
20
21
  email
@@ -0,0 +1,10 @@
1
+ query MyMfaDevices {
2
+ myMfaDevices {
3
+ id
4
+ name
5
+ isPrimary
6
+ isEnabled
7
+ createdAt
8
+ lastUsedAt
9
+ }
10
+ }
@@ -0,0 +1,6 @@
1
+ query MyMfaRecoveryCodeStatus {
2
+ myMfaRecoveryCodeStatus {
3
+ activeCount
4
+ lastGeneratedAt
5
+ }
6
+ }
@@ -0,0 +1,5 @@
1
+ mutation RemoveMyMfaDevice($input: RemoveMyMfaDeviceInput!) {
2
+ removeMyMfaDevice(input: $input) {
3
+ success
4
+ }
5
+ }
@@ -0,0 +1,6 @@
1
+ mutation SetMyPrimaryMfaDevice($input: SetMyPrimaryMfaDeviceInput!) {
2
+ setMyPrimaryMfaDevice(input: $input) {
3
+ id
4
+ isPrimary
5
+ }
6
+ }
@@ -0,0 +1,5 @@
1
+ mutation VerifyMyMfaEnrollment($input: VerifyMyMfaEnrollmentInput!) {
2
+ verifyMyMfaEnrollment(input: $input) {
3
+ success
4
+ }
5
+ }
@@ -18,6 +18,7 @@ query GetOrganizations(
18
18
  id
19
19
  name
20
20
  slug
21
+ requireMfaForSensitiveActions
21
22
  createdAt
22
23
  updatedAt
23
24
  tags {
@@ -3,6 +3,7 @@ mutation UpdateOrganization($id: ID!, $input: UpdateOrganizationInput!) {
3
3
  id
4
4
  name
5
5
  slug
6
+ requireMfaForSensitiveActions
6
7
  createdAt
7
8
  updatedAt
8
9
  }
@@ -0,0 +1,17 @@
1
+ mutation CancelProjectSync($id: ID!, $scope: Scope!, $jobId: ID!) {
2
+ cancelProjectSync(id: $id, scope: $scope, jobId: $jobId) {
3
+ id
4
+ projectId
5
+ status
6
+ cdmVersion
7
+ jobName
8
+ operation
9
+ modeStrategy
10
+ warnings
11
+ errorMessage
12
+ enqueuedAt
13
+ startedAt
14
+ completedAt
15
+ cancelledAt
16
+ }
17
+ }
@@ -0,0 +1,37 @@
1
+ query ProjectSyncJob($id: ID!, $scope: Scope!, $jobId: ID!) {
2
+ projectSyncJob(id: $id, scope: $scope, jobId: $jobId) {
3
+ id
4
+ projectId
5
+ status
6
+ cdmVersion
7
+ jobName
8
+ operation
9
+ modeStrategy
10
+ result {
11
+ projectId
12
+ importId
13
+ rolesCreated
14
+ groupsCreated
15
+ roleGroupsLinked
16
+ groupPermissionsLinked
17
+ projectRolesLinked
18
+ projectGroupsLinked
19
+ projectPermissionsLinked
20
+ projectResourcesLinked
21
+ projectUsersEnsured
22
+ usersCreated
23
+ userRolesAssigned
24
+ projectUserApiKeysCreated
25
+ warnings
26
+ }
27
+ warnings
28
+ errorMessage
29
+ enqueuedAt
30
+ startedAt
31
+ completedAt
32
+ cancelledAt
33
+ hasSnapshot
34
+ snapshotTakenAt
35
+ snapshotSizeBytes
36
+ }
37
+ }
@@ -0,0 +1,40 @@
1
+ query ProjectSyncJobs(
2
+ $id: ID!
3
+ $scope: Scope!
4
+ $page: Int
5
+ $limit: Int
6
+ $search: String
7
+ $sort: ProjectSyncJobSortInput
8
+ $status: ProjectSyncJobStatus
9
+ ) {
10
+ projectSyncJobs(
11
+ id: $id
12
+ scope: $scope
13
+ page: $page
14
+ limit: $limit
15
+ search: $search
16
+ sort: $sort
17
+ status: $status
18
+ ) {
19
+ jobs {
20
+ id
21
+ projectId
22
+ status
23
+ cdmVersion
24
+ jobName
25
+ operation
26
+ modeStrategy
27
+ warnings
28
+ errorMessage
29
+ enqueuedAt
30
+ startedAt
31
+ completedAt
32
+ cancelledAt
33
+ hasSnapshot
34
+ snapshotTakenAt
35
+ snapshotSizeBytes
36
+ }
37
+ totalCount
38
+ hasNextPage
39
+ }
40
+ }
@@ -0,0 +1,20 @@
1
+ mutation StartProjectExport($id: ID!, $scope: Scope!, $input: StartProjectExportInput!) {
2
+ startProjectExport(id: $id, scope: $scope, input: $input) {
3
+ id
4
+ projectId
5
+ status
6
+ cdmVersion
7
+ jobName
8
+ operation
9
+ modeStrategy
10
+ warnings
11
+ errorMessage
12
+ enqueuedAt
13
+ startedAt
14
+ completedAt
15
+ cancelledAt
16
+ hasSnapshot
17
+ snapshotTakenAt
18
+ snapshotSizeBytes
19
+ }
20
+ }
@@ -0,0 +1,17 @@
1
+ mutation StartProjectSync($id: ID!, $scope: Scope!, $input: SyncProjectInput!) {
2
+ startProjectSync(id: $id, scope: $scope, input: $input) {
3
+ id
4
+ projectId
5
+ status
6
+ cdmVersion
7
+ jobName
8
+ operation
9
+ modeStrategy
10
+ warnings
11
+ errorMessage
12
+ enqueuedAt
13
+ startedAt
14
+ completedAt
15
+ cancelledAt
16
+ }
17
+ }
@@ -8,5 +8,11 @@ mutation CreateResource($input: CreateResourceInput!) {
8
8
  isActive
9
9
  createdAt
10
10
  updatedAt
11
+ permissions {
12
+ id
13
+ name
14
+ action
15
+ resourceId
16
+ }
11
17
  }
12
18
  }
@@ -0,0 +1,3 @@
1
+ input VerifyMfaRecoveryCodeInput {
2
+ code: String!
3
+ }
@@ -0,0 +1,3 @@
1
+ input VerifyMfaInput {
2
+ code: String!
3
+ }
@@ -0,0 +1,3 @@
1
+ extend type Mutation {
2
+ setupMfa: MfaSetupResponse!
3
+ }
@@ -0,0 +1,3 @@
1
+ extend type Mutation {
2
+ verifyMfaRecoveryCode(input: VerifyMfaRecoveryCodeInput!): MfaVerifyResponse!
3
+ }
@@ -0,0 +1,3 @@
1
+ extend type Mutation {
2
+ verifyMfa(input: VerifyMfaInput!): MfaVerifyResponse!
3
+ }
@@ -2,6 +2,11 @@ type LoginResponse {
2
2
  accounts: [Account!]!
3
3
  accessToken: String!
4
4
  refreshToken: String!
5
+ mfaVerified: Boolean
6
+ """
7
+ When true, the client should complete MFA before expecting full API access (see AUTH_MIN_AAL_AT_LOGIN).
8
+ """
9
+ requiresMfaStepUp: Boolean
5
10
  requiresEmailVerification: Boolean
6
11
  verificationExpiry: Date
7
12
  email: String
@@ -0,0 +1,5 @@
1
+ type MfaSetupResponse {
2
+ factorId: ID!
3
+ secret: String!
4
+ otpAuthUrl: String!
5
+ }
@@ -0,0 +1,5 @@
1
+ type MfaVerifyResponse {
2
+ accessToken: String!
3
+ refreshToken: String!
4
+ mfaVerified: Boolean!
5
+ }
@@ -0,0 +1,3 @@
1
+ input GenerateMyMfaRecoveryCodesInput {
2
+ factorId: ID
3
+ }
@@ -0,0 +1,3 @@
1
+ input RemoveMyMfaDeviceInput {
2
+ factorId: ID!
3
+ }
@@ -0,0 +1,3 @@
1
+ input SetMyPrimaryMfaDeviceInput {
2
+ factorId: ID!
3
+ }
@@ -0,0 +1,3 @@
1
+ input VerifyMyMfaEnrollmentInput {
2
+ code: String!
3
+ }
@@ -0,0 +1,3 @@
1
+ extend type Mutation {
2
+ createMyMfaEnrollment: MfaEnrollment!
3
+ }
@@ -0,0 +1,3 @@
1
+ extend type Mutation {
2
+ generateMyMfaRecoveryCodes(input: GenerateMyMfaRecoveryCodesInput): [String!]!
3
+ }
@@ -0,0 +1,3 @@
1
+ extend type Mutation {
2
+ removeMyMfaDevice(input: RemoveMyMfaDeviceInput!): MfaVerifyResult!
3
+ }
@@ -0,0 +1,3 @@
1
+ extend type Mutation {
2
+ setMyPrimaryMfaDevice(input: SetMyPrimaryMfaDeviceInput!): MfaDevice!
3
+ }
@@ -0,0 +1,3 @@
1
+ extend type Mutation {
2
+ verifyMyMfaEnrollment(input: VerifyMyMfaEnrollmentInput!): MfaVerifyResult!
3
+ }
@@ -0,0 +1,3 @@
1
+ extend type Query {
2
+ myMfaDevices: [MfaDevice!]!
3
+ }
@@ -0,0 +1,3 @@
1
+ extend type Query {
2
+ myMfaRecoveryCodeStatus: MfaRecoveryCodeStatus!
3
+ }
@@ -1,5 +1,6 @@
1
1
  type MeResponse {
2
2
  accounts: [Account!]!
3
+ mfaVerified: Boolean
3
4
  requiresEmailVerification: Boolean
4
5
  verificationExpiry: Date
5
6
  email: String
@@ -0,0 +1,8 @@
1
+ type MfaDevice {
2
+ id: ID!
3
+ name: String!
4
+ isPrimary: Boolean!
5
+ isEnabled: Boolean!
6
+ createdAt: Date!
7
+ lastUsedAt: Date
8
+ }
@@ -0,0 +1,5 @@
1
+ type MfaEnrollment {
2
+ factorId: ID!
3
+ secret: String!
4
+ otpAuthUrl: String!
5
+ }
@@ -0,0 +1,4 @@
1
+ type MfaRecoveryCodeStatus {
2
+ activeCount: Int!
3
+ lastGeneratedAt: Date
4
+ }
@@ -0,0 +1,3 @@
1
+ type MfaVerifyResult {
2
+ success: Boolean!
3
+ }
@@ -1,4 +1,5 @@
1
1
  input AddOrganizationUserInput {
2
2
  organizationId: ID!
3
3
  userId: ID!
4
+ roleId: ID!
4
5
  }
@@ -2,6 +2,7 @@ type OrganizationUser implements Auditable {
2
2
  id: ID!
3
3
  organizationId: ID!
4
4
  userId: ID!
5
+ roleId: ID!
5
6
  organization: Organization
6
7
  user: User
7
8
  createdAt: Date!
@@ -1,4 +1,5 @@
1
1
  input UpdateOrganizationInput {
2
2
  scope: Scope!
3
3
  name: String
4
+ requireMfaForSensitiveActions: Boolean
4
5
  }
@@ -2,6 +2,7 @@ type Organization implements Auditable {
2
2
  id: ID!
3
3
  name: String!
4
4
  slug: String!
5
+ requireMfaForSensitiveActions: Boolean!
5
6
  projects: [Project!]
6
7
  roles: [Role!]
7
8
  groups: [Group!]
@@ -7,4 +7,5 @@ input CreatePermissionInput {
7
7
  tagIds: [ID!]
8
8
  scope: Scope!
9
9
  primaryTagId: ID
10
+ metadata: JSON
10
11
  }
@@ -7,4 +7,5 @@ input UpdatePermissionInput {
7
7
  condition: JSON
8
8
  tagIds: [ID!]
9
9
  primaryTagId: ID
10
+ metadata: JSON
10
11
  }
@@ -6,6 +6,7 @@ type Permission implements Auditable {
6
6
  resourceId: ID
7
7
  resource: Resource
8
8
  condition: JSON
9
+ metadata: JSON!
9
10
  tags: [Tag!]
10
11
  createdAt: Date!
11
12
  updatedAt: Date!
@@ -2,4 +2,8 @@ input AddProjectUserApiKeyInput {
2
2
  projectId: ID!
3
3
  userId: ID!
4
4
  apiKeyId: ID!
5
+ """
6
+ Optional pivot metadata (e.g. CDM `cdmImport` / `cdmSource`); omit for normal API creates.
7
+ """
8
+ metadata: JSON
5
9
  }
@@ -1,4 +1,5 @@
1
1
  input AddProjectUserInput {
2
2
  projectId: ID!
3
3
  userId: ID!
4
+ metadata: JSON
4
5
  }
@@ -2,6 +2,9 @@ type ProjectUser implements Auditable {
2
2
  id: ID!
3
3
  projectId: ID!
4
4
  userId: ID!
5
+ metadata: JSON!
6
+ displayName: String
7
+ pictureUrl: String
5
8
  project(organizationId: ID!): Project
6
9
  user: User
7
10
  createdAt: Date!
@@ -0,0 +1,4 @@
1
+ input ProjectSyncJobSortInput {
2
+ field: ProjectSyncJobSortableField!
3
+ order: SortOrder!
4
+ }
@@ -0,0 +1,31 @@
1
+ """
2
+ Parameters for enqueueing an asynchronous CDM **export** job. The worker
3
+ materialises a `SyncProjectInput` document and stores it in the job `snapshot`
4
+ column; this input is persisted as the job `payload` (export options only).
5
+ """
6
+ input StartProjectExportInput {
7
+ """
8
+ CDM document version (only `1` is supported).
9
+ """
10
+ version: Int!
11
+ """
12
+ Optional stable idempotency / display name (same column as import `SyncProjectInput.id`).
13
+ When set, an active job for the same `(project, operation=EXPORT, jobName)` is returned
14
+ instead of creating a new one.
15
+ """
16
+ jobName: String
17
+ """
18
+ Subset of CDM slices to export; omit or empty for a full project export.
19
+ """
20
+ sections: [String!]
21
+ """
22
+ When `users` are exported, whether to emit CDM-managed project user API key rows
23
+ (identity only). Omit = default true (full export behaviour).
24
+ """
25
+ includeUserApiKeys: Boolean
26
+ """
27
+ Embedded in the exported CDM document `mode` block for re-import.
28
+ Does not change export execution (snapshot is always read-only).
29
+ """
30
+ mode: CdmModeInput
31
+ }