first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
import nock from 'nock';
|
||||
|
||||
describe('Google GSuiteAdmin Node - Create Group', () => {
|
||||
beforeEach(() => {
|
||||
nock.disableNetConnect();
|
||||
nock('https://www.googleapis.com/admin')
|
||||
.post('/directory/v1/groups', {
|
||||
email: 'NewOnes22@example.com',
|
||||
name: 'Test',
|
||||
description: 'test',
|
||||
})
|
||||
.reply(200, {
|
||||
kind: 'admin#directory#group',
|
||||
id: '03mzq4wv15cepg2',
|
||||
etag: '"example"',
|
||||
email: 'NewOnes22@example.com',
|
||||
name: 'Test',
|
||||
description: 'test',
|
||||
adminCreated: true,
|
||||
});
|
||||
});
|
||||
|
||||
new NodeTestHarness().setupTests({
|
||||
workflowFiles: ['create.workflow.json'],
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {},
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"typeVersion": 1,
|
||||
"position": [120, 700],
|
||||
"id": "0e76b314-4994-4141-975f-9614c6094c80",
|
||||
"name": "When clicking ‘Execute workflow’"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"resource": "group",
|
||||
"name": "Test",
|
||||
"email": "NewOnes22@example.com",
|
||||
"additionalFields": {
|
||||
"description": "test"
|
||||
}
|
||||
},
|
||||
"type": "n8n-nodes-base.gSuiteAdmin",
|
||||
"typeVersion": 1,
|
||||
"position": [60, 1140],
|
||||
"id": "54a9e564-bff5-4d86-b684-e5cf5b34b48c",
|
||||
"name": "Create Group",
|
||||
"credentials": {
|
||||
"gSuiteAdminOAuth2Api": {
|
||||
"id": "OXfPMaggXFJ0RLkw",
|
||||
"name": "Google Workspace Admin account"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"When clicking ‘Execute workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create Group",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"pinData": {
|
||||
"Create Group": [
|
||||
{
|
||||
"json": {
|
||||
"kind": "admin#directory#group",
|
||||
"id": "03mzq4wv15cepg2",
|
||||
"etag": "\"example\"",
|
||||
"email": "NewOnes22@example.com",
|
||||
"name": "Test",
|
||||
"description": "test",
|
||||
"adminCreated": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
import nock from 'nock';
|
||||
|
||||
describe('Google GSuiteAdmin Node - Delete Group', () => {
|
||||
beforeEach(() => {
|
||||
nock.disableNetConnect();
|
||||
nock('https://www.googleapis.com/admin')
|
||||
.delete('/directory/v1/groups/01302m922pmp3e4')
|
||||
.reply(204, '');
|
||||
});
|
||||
|
||||
new NodeTestHarness().setupTests({
|
||||
workflowFiles: ['delete.workflow.json'],
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {},
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"typeVersion": 1,
|
||||
"position": [120, 700],
|
||||
"id": "0e76b314-4994-4141-975f-9614c6094c80",
|
||||
"name": "When clicking ‘Execute workflow’"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"resource": "group",
|
||||
"operation": "delete",
|
||||
"groupId": {
|
||||
"__rl": true,
|
||||
"value": "01302m922pmp3e4",
|
||||
"mode": "list",
|
||||
"cachedResultName": "new2"
|
||||
}
|
||||
},
|
||||
"type": "n8n-nodes-base.gSuiteAdmin",
|
||||
"typeVersion": 1,
|
||||
"position": [60, 1140],
|
||||
"id": "9d6f8739-8a1b-4b85-9e5c-84a184e6dbaf",
|
||||
"name": "Delete Group",
|
||||
"credentials": {
|
||||
"gSuiteAdminOAuth2Api": {
|
||||
"id": "OXfPMaggXFJ0RLkw",
|
||||
"name": "Google Workspace Admin account"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"When clicking ‘Execute workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Delete Group",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"pinData": {
|
||||
"Delete Group": [
|
||||
{
|
||||
"json": { "success": true }
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
import nock from 'nock';
|
||||
|
||||
describe('Google GSuiteAdmin Node - Get Group', () => {
|
||||
beforeEach(() => {
|
||||
nock.disableNetConnect();
|
||||
nock('https://www.googleapis.com/admin')
|
||||
.get('/directory/v1/groups/01302m922pmp3e4')
|
||||
.reply(200, {
|
||||
kind: 'admin#directory#group',
|
||||
id: '01302m922pmp3e4',
|
||||
etag: '"example"',
|
||||
email: 'new3@example.com',
|
||||
name: 'new2',
|
||||
directMembersCount: '2',
|
||||
description: 'new1',
|
||||
adminCreated: true,
|
||||
aliases: ['new2@example.com', 'new@example.com', 'NewOnes@example.com'],
|
||||
nonEditableAliases: [
|
||||
'NewOnes@example.com.test-google-a.com',
|
||||
'new@example.com.test-google-a.com',
|
||||
'new2@example.com.test-google-a.com',
|
||||
'new3@example.com.test-google-a.com',
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
new NodeTestHarness().setupTests({
|
||||
workflowFiles: ['get.workflow.json'],
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {},
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"typeVersion": 1,
|
||||
"position": [120, 700],
|
||||
"id": "0e76b314-4994-4141-975f-9614c6094c80",
|
||||
"name": "When clicking ‘Execute workflow’"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"resource": "group",
|
||||
"operation": "get",
|
||||
"groupId": {
|
||||
"__rl": true,
|
||||
"value": "01302m922pmp3e4",
|
||||
"mode": "list",
|
||||
"cachedResultName": "new2"
|
||||
}
|
||||
},
|
||||
"type": "n8n-nodes-base.gSuiteAdmin",
|
||||
"typeVersion": 1,
|
||||
"position": [80, 1120],
|
||||
"id": "8d47d64b-80df-479a-8e1d-d63991f5d23b",
|
||||
"name": "Get Group",
|
||||
"credentials": {
|
||||
"gSuiteAdminOAuth2Api": {
|
||||
"id": "OXfPMaggXFJ0RLkw",
|
||||
"name": "Google Workspace Admin account"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"When clicking ‘Execute workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Group",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"pinData": {
|
||||
"Get Group": [
|
||||
{
|
||||
"json": {
|
||||
"kind": "admin#directory#group",
|
||||
"id": "01302m922pmp3e4",
|
||||
"etag": "\"example\"",
|
||||
"email": "new3@example.com",
|
||||
"name": "new2",
|
||||
"directMembersCount": "2",
|
||||
"description": "new1",
|
||||
"adminCreated": true,
|
||||
"aliases": ["new2@example.com", "new@example.com", "NewOnes@example.com"],
|
||||
"nonEditableAliases": [
|
||||
"NewOnes@example.com.test-google-a.com",
|
||||
"new@example.com.test-google-a.com",
|
||||
"new2@example.com.test-google-a.com",
|
||||
"new3@example.com.test-google-a.com"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
import nock from 'nock';
|
||||
|
||||
describe('Google GSuiteAdmin Node - Get All Groups', () => {
|
||||
beforeEach(() => {
|
||||
nock.disableNetConnect();
|
||||
nock('https://www.googleapis.com/admin')
|
||||
.get('/directory/v1/groups')
|
||||
.query({
|
||||
customer: 'my_customer',
|
||||
maxResults: '100',
|
||||
})
|
||||
.reply(200, {
|
||||
kind: 'admin#directory#groups',
|
||||
etag: '"test_etag"',
|
||||
groups: [
|
||||
{
|
||||
kind: 'admin#directory#group',
|
||||
id: '01x0gk373c9z46j',
|
||||
etag: '"example"',
|
||||
email: 'newoness@example.com',
|
||||
name: 'NewOness',
|
||||
directMembersCount: '1',
|
||||
description: 'test',
|
||||
adminCreated: true,
|
||||
nonEditableAliases: ['NewOness@example.com.test-google-a.com'],
|
||||
},
|
||||
{
|
||||
kind: 'admin#directory#group',
|
||||
id: '01tuee742txc3k4',
|
||||
etag: '"example"',
|
||||
email: 'newonesss@example.com',
|
||||
name: 'NewOne3',
|
||||
directMembersCount: '0',
|
||||
description: 'test',
|
||||
adminCreated: true,
|
||||
nonEditableAliases: ['NewOnesss@example.com.test-google-a.com'],
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
new NodeTestHarness().setupTests({
|
||||
workflowFiles: ['getAll.workflow.json'],
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {},
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"typeVersion": 1,
|
||||
"position": [120, 700],
|
||||
"id": "0e76b314-4994-4141-975f-9614c6094c80",
|
||||
"name": "When clicking ‘Execute workflow’"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"resource": "group",
|
||||
"operation": "getAll",
|
||||
"returnAll": true,
|
||||
"filter": {}
|
||||
},
|
||||
"type": "n8n-nodes-base.gSuiteAdmin",
|
||||
"typeVersion": 1,
|
||||
"position": [100, 1120],
|
||||
"id": "30263040-3578-4ce6-b19c-f665b85ca301",
|
||||
"name": "Get Many",
|
||||
"credentials": {
|
||||
"gSuiteAdminOAuth2Api": {
|
||||
"id": "OXfPMaggXFJ0RLkw",
|
||||
"name": "Google Workspace Admin account"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"When clicking ‘Execute workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Many",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"pinData": {
|
||||
"Get Many": [
|
||||
{
|
||||
"json": {
|
||||
"kind": "admin#directory#group",
|
||||
"id": "01x0gk373c9z46j",
|
||||
"etag": "\"example\"",
|
||||
"email": "newoness@example.com",
|
||||
"name": "NewOness",
|
||||
"directMembersCount": "1",
|
||||
"description": "test",
|
||||
"adminCreated": true,
|
||||
"nonEditableAliases": ["NewOness@example.com.test-google-a.com"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"json": {
|
||||
"kind": "admin#directory#group",
|
||||
"id": "01tuee742txc3k4",
|
||||
"etag": "\"example\"",
|
||||
"email": "newonesss@example.com",
|
||||
"name": "NewOne3",
|
||||
"directMembersCount": "0",
|
||||
"description": "test",
|
||||
"adminCreated": true,
|
||||
"nonEditableAliases": ["NewOnesss@example.com.test-google-a.com"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
import nock from 'nock';
|
||||
|
||||
describe('Google GSuiteAdmin Node - Update Group', () => {
|
||||
beforeEach(() => {
|
||||
nock.disableNetConnect();
|
||||
nock('https://www.googleapis.com/admin')
|
||||
.put('/directory/v1/groups/01302m922p525286')
|
||||
.reply(200, {
|
||||
kind: 'admin#directory#group',
|
||||
id: '01302m922p525286',
|
||||
etag: '"example"',
|
||||
email: 'new3@example.com',
|
||||
name: 'new2',
|
||||
description: 'new1',
|
||||
adminCreated: true,
|
||||
aliases: ['new@example.com', 'NewOnes@example.com', 'new2@example.com'],
|
||||
nonEditableAliases: [
|
||||
'NewOnes@example.com.test-google-a.com',
|
||||
'new@example.com.test-google-a.com',
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
new NodeTestHarness().setupTests({
|
||||
workflowFiles: ['update.workflow.json'],
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {},
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"typeVersion": 1,
|
||||
"position": [120, 700],
|
||||
"id": "0e76b314-4994-4141-975f-9614c6094c80",
|
||||
"name": "When clicking ‘Execute workflow’"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"resource": "group",
|
||||
"operation": "update",
|
||||
"groupId": {
|
||||
"__rl": true,
|
||||
"value": "01302m922p525286",
|
||||
"mode": "list",
|
||||
"cachedResultName": "new"
|
||||
},
|
||||
"updateFields": {
|
||||
"description": "new1",
|
||||
"email": "new3@example.com",
|
||||
"name": "new2"
|
||||
}
|
||||
},
|
||||
"type": "n8n-nodes-base.gSuiteAdmin",
|
||||
"typeVersion": 1,
|
||||
"position": [80, 1100],
|
||||
"id": "013eec82-8d52-4485-88eb-d9caf112d539",
|
||||
"name": "Update Group",
|
||||
"credentials": {
|
||||
"gSuiteAdminOAuth2Api": {
|
||||
"id": "OXfPMaggXFJ0RLkw",
|
||||
"name": "Google Workspace Admin account"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"When clicking ‘Execute workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Update Group",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"pinData": {
|
||||
"Update Group": [
|
||||
{
|
||||
"json": {
|
||||
"kind": "admin#directory#group",
|
||||
"id": "01302m922p525286",
|
||||
"etag": "\"example\"",
|
||||
"email": "new3@example.com",
|
||||
"name": "new2",
|
||||
"description": "new1",
|
||||
"adminCreated": true,
|
||||
"aliases": ["new@example.com", "NewOnes@example.com", "new2@example.com"],
|
||||
"nonEditableAliases": [
|
||||
"NewOnes@example.com.test-google-a.com",
|
||||
"new@example.com.test-google-a.com"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user