Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(integration): Lattice user provisioning #154

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ vitest.setup.ts
globals.d.ts
integrations/linkedin/proxy/video-upload.ts
integrations/linkedin/nango-integrations/linkedin/proxy/video-upload.ts
integrations/*-sandbox
integrations/*-sandbox
14 changes: 4 additions & 10 deletions .github/workflows/push-flows-to-nango-repo.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Push flows and docs to Nango repo
name: Push flows to Nango repo

on:
push:
Expand Down Expand Up @@ -57,17 +57,12 @@ jobs:
echo "Copying flows.yaml into the nango repository."
cp flows.yaml nango/packages/shared/flows.yaml
echo "flows.yaml file copied."
echo "Updating documentation snippets"
cd nango
npm ci
npm run docs:generate

- name: Debug - status on nango after copying
- name: Debug - Log nango directory contents
if: steps.changes.outputs.any_changed == 'true'
working-directory: nango
run: |
echo "Status of nango directory after copying flows.yaml:"
git status
echo "Contents of nango directory after copying flows.yaml:"
ls nango/

- name: Get Commit Details
if: steps.changes.outputs.any_changed == 'true'
Expand Down Expand Up @@ -97,7 +92,6 @@ jobs:

# Add the changes
git add packages/shared/flows.yaml
git add docs-v2/snippets/

# Get commit details from the previous step
COMMIT_MESSAGE="${{ steps.commit_details.outputs.commit_message }}"
Expand Down
4 changes: 0 additions & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@ node ./scripts/flows.js
npm run generate:tests --pre_commit=true
git add ./integrations/*/tests/*.test.ts
git add ./flows.yaml

npm run generate:readmes
git add ./integrations/**/*.md

npx lint-staged --allow-empty
44 changes: 0 additions & 44 deletions LICENSE

This file was deleted.

1 change: 0 additions & 1 deletion LICENSE_SHORT

This file was deleted.

66 changes: 66 additions & 0 deletions flows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6422,6 +6422,72 @@ integrations:
firstName: string
lastName: string
email: string
lattice:
syncs:
users:
runs: every day
description: Fetches a list of users from Lattice
output: User
sync_type: full
track_deletes: true
endpoint:
method: GET
path: /users
group: Users
models:
User:
id: string
email: string
firstName: string
lastName: string
lattice-scim:
actions:
create-user:
description: Creates a user in Lattice
output: User
endpoint:
method: POST
path: /users
group: Users
input: LatticeCreateUser
disable-user:
description: Disables a user in Lattice
endpoint:
method: DELETE
path: /users
group: Users
output: SuccessResponse
input: IdEntity
models:
IdEntity:
id: string
SuccessResponse:
success: boolean
User:
id: string
email: string
firstName: string
lastName: string
CreateUser:
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
1 change: 1 addition & 0 deletions integrations/avalara-sandbox/schema.zod.ts
1 change: 1 addition & 0 deletions integrations/bill-sandbox/schema.zod.ts
1 change: 1 addition & 0 deletions integrations/docusign-sandbox/schema.zod.ts
1 change: 0 additions & 1 deletion integrations/front/actions/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export default async function runAction(nango: NangoAction, input: SingleConvers
paginate: {
type: 'link',
response_path: '_results',
limit_name_in_request: 'limit',
link_path_in_response_body: 'next',
limit: 100
}
Expand Down
5 changes: 2 additions & 3 deletions integrations/front/nango.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
integrations:
front:
syncs:
conversations:
list-conversations:
runs: every day
description: List the conversations in the company in reverse chronological order.
output: Conversation
endpoint:
method: GET
path: /conversations
group: Conversations
track_deletes: true
sync_type: full
version: 1.0.2
version: 1.0.1
actions:
conversation:
description: List the messages in a conversation in reverse chronological order (newest first).
Expand Down
45 changes: 45 additions & 0 deletions integrations/front/tests/front-list-conversations.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { vi, expect, it, describe } from 'vitest';

import fetchData from '../syncs/list-conversations.js';

describe('front list-conversations tests', () => {
const nangoMock = new global.vitest.NangoSyncMock({
dirname: __dirname,
name: 'list-conversations',
Model: 'Conversation'
});

const models = 'Conversation'.split(',');
const batchSaveSpy = vi.spyOn(nangoMock, 'batchSave');

it('should get, map correctly the data and batchSave the result', async () => {
await fetchData(nangoMock);

for (const model of models) {
const expectedBatchSaveData = await nangoMock.getBatchSaveData(model);

const spiedData = batchSaveSpy.mock.calls.flatMap((call) => {
if (call[1] === model) {
return call[0];
}

return [];
});

const spied = JSON.parse(JSON.stringify(spiedData));

expect(spied).toStrictEqual(expectedBatchSaveData);
}
});

it('should get, map correctly the data and batchDelete the result', async () => {
await fetchData(nangoMock);

for (const model of models) {
const batchDeleteData = await nangoMock.getBatchDeleteData(model);
if (batchDeleteData && batchDeleteData.length > 0) {
expect(nangoMock.batchDelete).toHaveBeenCalledWith(batchDeleteData, model);
}
}
});
});
114 changes: 0 additions & 114 deletions integrations/github-app/schema.zod.ts

This file was deleted.

4 changes: 2 additions & 2 deletions integrations/google-drive/nango.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ integrations:
Sync the metadata of a specified file or folders from Google Drive,
handling both individual files and nested folders.
Metadata required to filter on a particular folder, or file(s). Metadata
fields should be `{"files": ["<some-id>"]}` OR
`{"folders": ["<some-id>"]}`. The ID should be able to be provided
fields should be {"files": ["<some-id>"]} OR
{"folders": ["<some-id>"]}. The ID should be able to be provided
by using the Google Picker API
(https://developers.google.com/drive/picker/guides/overview)
and using the ID field provided by the response
Expand Down
Loading
Loading