Skip to content

Commit

Permalink
fix: updates the create-user input
Browse files Browse the repository at this point in the history
  • Loading branch information
Maina-Francis committed Dec 19, 2024
1 parent 90ff6e4 commit c4c6f54
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 81 deletions.
18 changes: 1 addition & 17 deletions flows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6449,7 +6449,7 @@ integrations:
method: POST
path: /users
group: Users
input: LatticeCreateUser
input: CreateUser
disable-user:
description: Disables a user in Lattice
endpoint:
Expand All @@ -6472,22 +6472,6 @@ integrations:
firstName: string
lastName: string
email: string
LatticeCreateUser:
firstName: string
lastName: string
email: string
schemas?: string[]
name?:
givenName: string
familyName: string
userName?: string
active?: boolean
emails?: Emails[]
urn:ietf:params:scim:schemas:extension:enterprise:2.0:User?:
department: string
Emails:
type: string
value: string
lever:
actions:
create-note:
Expand Down
20 changes: 1 addition & 19 deletions integrations/lattice-scim/actions/create-user.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,7 @@ _No request parameters_
{
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"schemas?": [
"<string>"
],
"name?": {
"givenName": "<string>",
"familyName": "<string>"
},
"userName?": "<string>",
"active?": "<boolean>",
"emails?": [
{
"type": "<string>",
"value": "<string>"
}
],
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User?": {
"department": "<string>"
}
"email": "<string>"
}
```

Expand Down
8 changes: 4 additions & 4 deletions integrations/lattice-scim/actions/create-user.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { NangoAction, ProxyConfiguration, LatticeCreateUser, User } from '../../models';
import type { NangoAction, ProxyConfiguration, User, CreateUser } from '../../models';
import type { LatticeUser } from '../types';
import { latticeCreateUserSchema } from '../schema.zod.js';
import { createUserSchema } from '../schema.zod.js';

/**
* Executes the create user action by validating input, constructing the request configuration,
* and making the Lattice SCIM API call to create a new user.
*/
export default async function runAction(nango: NangoAction, input: LatticeCreateUser): Promise<User> {
const parsedInput = latticeCreateUserSchema.safeParse(input);
export default async function runAction(nango: NangoAction, input: CreateUser): Promise<User> {
const parsedInput = createUserSchema.safeParse(input);

if (!parsedInput.success) {
for (const error of parsedInput.error.errors) {
Expand Down
16 changes: 1 addition & 15 deletions integrations/lattice-scim/nango.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ integrations:
method: POST
path: /users
group: Users
input: LatticeCreateUser
input: CreateUser
disable-user:
description: Disables a user in Lattice
endpoint:
Expand All @@ -32,17 +32,3 @@ models:
firstName: string
lastName: string
email: string
LatticeCreateUser:
__extends: CreateUser
schemas?: string[]
name?:
givenName: string
familyName: string
userName?: string
active?: boolean
emails?: Emails[]
urn:ietf:params:scim:schemas:extension:enterprise:2.0:User?:
department: string
Emails:
type: string
value: string
26 changes: 0 additions & 26 deletions integrations/lattice-scim/schema.zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,3 @@ export const createUserSchema = z.object({
lastName: z.string(),
email: z.string()
});

export const emailsSchema = z.object({
type: z.string(),
value: z.string()
});

export const latticeCreateUserSchema = z.object({
firstName: z.string(),
lastName: z.string(),
email: z.string(),
schemas: z.array(z.string()).optional(),
name: z
.object({
givenName: z.string(),
familyName: z.string()
})
.optional(),
userName: z.string().optional(),
active: z.boolean().optional(),
emails: z.array(emailsSchema).optional(),
'urn:ietf:params:scim:schemas:extension:enterprise:2.0:User': z
.object({
department: z.string()
})
.optional()
});

0 comments on commit c4c6f54

Please sign in to comment.