pull:初次提交

This commit is contained in:
Yep_Q
2025-09-08 04:48:28 +08:00
parent 5c0619656d
commit f64f498365
11751 changed files with 1953723 additions and 0 deletions

View File

@@ -0,0 +1,216 @@
import type { INodeProperties } from 'n8n-workflow';
export const activityOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['activity'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create an activity for a member',
action: 'Create an activity',
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many activities',
action: 'Get many activities',
},
],
default: 'create',
},
];
export const activityFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* activity:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Workspace Name or ID',
name: 'workspaceId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getWorkspaces',
},
default: 'Deprecated',
required: true,
displayOptions: {
show: {
resource: ['activity'],
operation: ['create'],
},
},
},
{
displayName: 'Member ID',
name: 'memberId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['activity'],
operation: ['create'],
},
},
},
{
displayName: 'Title',
name: 'title',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['activity'],
operation: ['create'],
},
},
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
resource: ['activity'],
operation: ['create'],
},
},
default: {},
options: [
{
displayName: 'Activity Type Name or ID',
name: 'activityType',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getActivityTypes',
},
default: 'Deprecated',
description:
'A user-defined way to group activities of the same nature. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Description',
name: 'description',
type: 'string',
default: '',
description: 'A description of the activity; displayed in the timeline',
},
{
displayName: 'Key',
name: 'key',
type: 'string',
default: '',
description: 'Supply a key that must be unique or leave blank to have one generated',
},
{
displayName: 'Link',
name: 'link',
type: 'string',
default: '',
description: 'A URL for the activity; displayed in the timeline',
},
{
displayName: 'Link Text',
name: 'linkText',
type: 'string',
default: '',
description: 'The text for the timeline link',
},
{
displayName: 'Occurred At',
name: 'occurredAt',
type: 'dateTime',
default: '',
description: 'The date and time the activity occurred; defaults to now',
},
],
},
/* -------------------------------------------------------------------------- */
/* activity:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Workspace Name or ID',
name: 'workspaceId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getWorkspaces',
},
default: 'Deprecated',
required: true,
displayOptions: {
show: {
resource: ['activity'],
operation: ['getAll'],
},
},
},
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
operation: ['getAll'],
resource: ['activity'],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
operation: ['getAll'],
resource: ['activity'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
maxValue: 500,
},
default: 100,
description: 'Max number of results to return',
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource: ['activity'],
operation: ['getAll'],
},
},
options: [
{
displayName: 'Member ID',
name: 'memberId',
type: 'string',
default: '',
description: 'When set the post will be filtered by the member ID',
},
],
},
];

View File

@@ -0,0 +1,119 @@
import type {
JsonObject,
IExecuteFunctions,
IHookFunctions,
ILoadOptionsFunctions,
IDataObject,
IHttpRequestMethods,
IRequestOptions,
} from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';
import type { IRelation } from './Interfaces';
export async function orbitApiRequest(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
method: IHttpRequestMethods,
resource: string,
body: any = {},
qs: IDataObject = {},
uri?: string,
option: IDataObject = {},
): Promise<any> {
try {
const credentials = await this.getCredentials('orbitApi');
let options: IRequestOptions = {
headers: {
Authorization: `Bearer ${credentials.accessToken}`,
},
method,
qs,
body,
uri: uri || `https://app.orbit.love/api/v1${resource}`,
json: true,
};
options = Object.assign({}, options, option);
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
export function resolveIdentities(responseData: IRelation) {
const identities: IDataObject = {};
for (const data of responseData.included) {
identities[data.id as string] = data;
}
if (!Array.isArray(responseData.data)) {
responseData.data = [responseData.data];
}
for (let i = 0; i < responseData.data.length; i++) {
for (let y = 0; y < responseData.data[i].relationships.identities.data.length; y++) {
//@ts-ignore
responseData.data[i].relationships.identities.data[y] =
identities[responseData.data[i].relationships.identities.data[y].id];
}
}
}
export function resolveMember(responseData: IRelation) {
const members: IDataObject = {};
for (const data of responseData.included) {
members[data.id as string] = data;
}
if (!Array.isArray(responseData.data)) {
responseData.data = [responseData.data];
}
for (let i = 0; i < responseData.data.length; i++) {
//@ts-ignore
responseData.data[i].relationships.member.data =
//@ts-ignore
members[responseData.data[i].relationships.member.data.id];
}
}
/**
* Make an API request to paginated flow endpoint
* and return all results
*/
export async function orbitApiRequestAllItems(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
propertyName: string,
method: IHttpRequestMethods,
resource: string,
body: any = {},
query: IDataObject = {},
): Promise<any> {
const returnData: IDataObject[] = [];
let responseData;
query.page = 1;
do {
responseData = await orbitApiRequest.call(this, method, resource, body, query);
returnData.push.apply(returnData, responseData[propertyName] as IDataObject[]);
if (query.resolveIdentities === true) {
resolveIdentities(responseData as IRelation);
}
if (query.resolveMember === true) {
resolveMember(responseData as IRelation);
}
query.page++;
const limit = query.limit as number | undefined;
if (limit && returnData.length >= limit) {
return returnData;
}
} while (responseData.data.length !== 0);
return returnData;
}

View File

@@ -0,0 +1,21 @@
import type { IDataObject } from 'n8n-workflow';
export interface IData {
data: [
{
id: string;
},
];
}
export interface IRelation {
data: [
{
relationships: {
identities: IData;
member: IData;
};
},
];
included: IDataObject[];
}

View File

@@ -0,0 +1,762 @@
import type { INodeProperties } from 'n8n-workflow';
export const memberOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['member'],
},
},
options: [
{
name: 'Create or Update',
value: 'upsert',
description: 'Create a new member, or update the current one if it already exists (upsert)',
action: 'Create or update a member',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a member',
action: 'Delete a member',
},
{
name: 'Get',
value: 'get',
description: 'Get a member',
action: 'Get a member',
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many members in a workspace',
action: 'Get many members',
},
{
name: 'Lookup',
value: 'lookup',
description: 'Lookup a member by identity',
action: 'Lookup a member',
},
{
name: 'Update',
value: 'update',
description: 'Update a member',
action: 'Update a member',
},
],
default: 'get',
},
];
export const memberFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* member:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Workspace Name or ID',
name: 'workspaceId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getWorkspaces',
},
default: 'Deprecated',
required: true,
displayOptions: {
show: {
resource: ['member'],
operation: ['delete'],
},
},
},
{
displayName: 'Member ID',
name: 'memberId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['member'],
operation: ['delete'],
},
},
},
/* -------------------------------------------------------------------------- */
/* member:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Workspace Name or ID',
name: 'workspaceId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getWorkspaces',
},
default: 'Deprecated',
required: true,
displayOptions: {
show: {
resource: ['member'],
operation: ['get'],
},
},
},
{
displayName: 'Member ID',
name: 'memberId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['member'],
operation: ['get'],
},
},
},
{
displayName: 'Resolve Identities',
name: 'resolveIdentities',
type: 'boolean',
displayOptions: {
show: {
operation: ['get'],
resource: ['member'],
},
},
default: false,
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
description:
'By default, the response just includes the reference of the identity. When set to true the identities will be resolved automatically.',
},
/* -------------------------------------------------------------------------- */
/* member:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Workspace Name or ID',
name: 'workspaceId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getWorkspaces',
},
default: 'Deprecated',
required: true,
displayOptions: {
show: {
resource: ['member'],
operation: ['getAll'],
},
},
},
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
operation: ['getAll'],
resource: ['member'],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
operation: ['getAll'],
resource: ['member'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
maxValue: 500,
},
default: 100,
description: 'Max number of results to return',
},
{
displayName: 'Resolve Identities',
name: 'resolveIdentities',
type: 'boolean',
displayOptions: {
show: {
operation: ['getAll'],
resource: ['member'],
},
},
default: false,
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
description:
'By default, the response just includes the reference of the identity. When set to true the identities will be resolved automatically.',
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add option',
default: {},
displayOptions: {
show: {
resource: ['member'],
operation: ['getAll'],
},
},
options: [
{
displayName: 'Sort By',
name: 'sort',
type: 'string',
default: '',
description: 'Name of the field the response will be sorted by',
},
{
displayName: 'Sort Direction',
name: 'direction',
type: 'options',
options: [
{
name: 'ASC',
value: 'ASC',
},
{
name: 'DESC',
value: 'DESC',
},
],
default: '',
},
],
},
/* -------------------------------------------------------------------------- */
/* member:lookup */
/* -------------------------------------------------------------------------- */
{
displayName: 'Workspace Name or ID',
name: 'workspaceId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getWorkspaces',
},
default: 'Deprecated',
required: true,
displayOptions: {
show: {
resource: ['member'],
operation: ['lookup'],
},
},
},
{
displayName: 'Source',
name: 'source',
type: 'options',
options: [
{
name: 'Discourse',
value: 'discourse',
},
{
name: 'Email',
value: 'email',
},
{
name: 'GitHub',
value: 'github',
},
{
name: 'Twitter',
value: 'twitter',
},
],
default: '',
required: true,
displayOptions: {
show: {
resource: ['member'],
operation: ['lookup'],
},
},
description:
"Set to github, twitter, email, discourse or the source of any identities you've manually created",
},
{
displayName: 'Search By',
name: 'searchBy',
type: 'options',
options: [
{
name: 'Username',
value: 'username',
},
{
name: 'ID',
value: 'id',
},
],
default: '',
required: true,
displayOptions: {
show: {
resource: ['member'],
operation: ['lookup'],
source: ['discourse', 'github', 'twitter'],
},
},
},
{
displayName: 'ID',
name: 'id',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['member'],
operation: ['lookup'],
searchBy: ['id'],
source: ['discourse', 'github', 'twitter'],
},
},
description: 'The username at the source',
},
{
displayName: 'Username',
name: 'username',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['member'],
operation: ['lookup'],
searchBy: ['username'],
source: ['discourse', 'github', 'twitter'],
},
},
description: 'The username at the source',
},
{
displayName: 'Email',
name: 'email',
type: 'string',
placeholder: 'name@email.com',
default: '',
required: true,
displayOptions: {
show: {
resource: ['member'],
operation: ['lookup'],
source: ['email'],
},
},
description: 'The email address',
},
{
displayName: 'Host',
name: 'host',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['member'],
operation: ['lookup'],
source: ['discourse'],
},
},
},
/* -------------------------------------------------------------------------- */
/* member:update */
/* -------------------------------------------------------------------------- */
{
displayName: 'Workspace Name or ID',
name: 'workspaceId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getWorkspaces',
},
default: 'Deprecated',
required: true,
displayOptions: {
show: {
resource: ['member'],
operation: ['update'],
},
},
},
{
displayName: 'Member ID',
name: 'memberId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['member'],
operation: ['update'],
},
},
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
resource: ['member'],
operation: ['update'],
},
},
default: {},
options: [
{
displayName: 'Bio',
name: 'bio',
type: 'string',
default: '',
},
{
displayName: 'Birthday',
name: 'birthday',
type: 'dateTime',
default: '',
},
{
displayName: 'Company',
name: 'company',
type: 'string',
default: '',
},
{
displayName: 'Location',
name: 'location',
type: 'string',
default: '',
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
},
{
displayName: 'Pronouns',
name: 'pronouns',
type: 'string',
default: '',
},
{
displayName: 'Shipping Address',
name: 'shippingAddress',
type: 'string',
default: '',
},
{
displayName: 'Slug',
name: 'slug',
type: 'string',
default: '',
},
{
displayName: 'Tags to Add',
name: 'tagsToAdd',
type: 'string',
default: '',
description: 'Adds tags to member; comma-separated string or array',
},
{
displayName: 'Tag List',
name: 'tagList',
type: 'string',
default: '',
description: 'Replaces all tags for the member; comma-separated string or array',
},
{
displayName: 'T-Shirt',
name: 'tShirt',
type: 'string',
default: '',
},
{
displayName: 'Teammate',
name: 'teammate',
type: 'boolean',
default: false,
},
{
displayName: 'URL',
name: 'url',
type: 'string',
default: '',
},
],
},
/* -------------------------------------------------------------------------- */
/* member:upsert */
/* -------------------------------------------------------------------------- */
{
displayName: 'Workspace Name or ID',
name: 'workspaceId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getWorkspaces',
},
default: 'Deprecated',
required: true,
displayOptions: {
show: {
resource: ['member'],
operation: ['upsert'],
},
},
},
{
displayName: 'Identity',
name: 'identityUi',
type: 'fixedCollection',
description:
'The identity is used to find the member. If no member exists, a new member will be created and linked to the provided identity.',
typeOptions: {
multipleValues: false,
},
placeholder: 'Add Identity',
default: {},
displayOptions: {
show: {
resource: ['member'],
operation: ['upsert'],
},
},
options: [
{
displayName: 'Identity',
name: 'identityValue',
values: [
{
displayName: 'Source',
name: 'source',
type: 'options',
options: [
{
name: 'Discourse',
value: 'discourse',
},
{
name: 'Email',
value: 'email',
},
{
name: 'GitHub',
value: 'github',
},
{
name: 'Twitter',
value: 'twitter',
},
],
default: '',
description:
"Set to github, twitter, email, discourse or the source of any identities you've manually created",
},
{
displayName: 'Search By',
name: 'searchBy',
type: 'options',
options: [
{
name: 'Username',
value: 'username',
},
{
name: 'ID',
value: 'id',
},
],
default: '',
required: true,
displayOptions: {
show: {
source: ['discourse', 'github', 'twitter'],
},
},
},
{
displayName: 'ID',
name: 'id',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
searchBy: ['id'],
source: ['discourse', 'github', 'twitter'],
},
},
description: 'The username at the source',
},
{
displayName: 'Username',
name: 'username',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
searchBy: ['username'],
source: ['discourse', 'github', 'twitter'],
},
},
description: 'The username at the source',
},
{
displayName: 'Email',
name: 'email',
type: 'string',
placeholder: 'name@email.com',
default: '',
required: true,
displayOptions: {
show: {
source: ['email'],
},
},
},
{
displayName: 'Host',
name: 'host',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
source: ['discourse'],
},
},
},
],
},
],
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
resource: ['member'],
operation: ['upsert'],
},
},
default: {},
options: [
{
displayName: 'Bio',
name: 'bio',
type: 'string',
default: '',
},
{
displayName: 'Birthday',
name: 'birthday',
type: 'dateTime',
default: '',
},
{
displayName: 'Company',
name: 'company',
type: 'string',
default: '',
},
{
displayName: 'Location',
name: 'location',
type: 'string',
default: '',
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
},
{
displayName: 'Pronouns',
name: 'pronouns',
type: 'string',
default: '',
},
{
displayName: 'Shipping Address',
name: 'shippingAddress',
type: 'string',
default: '',
},
{
displayName: 'Slug',
name: 'slug',
type: 'string',
default: '',
},
{
displayName: 'Tags to Add',
name: 'tagsToAdd',
type: 'string',
default: '',
description: 'Adds tags to member; comma-separated string or array',
},
{
displayName: 'Tag List',
name: 'tagList',
type: 'string',
default: '',
description: 'Replaces all tags for the member; comma-separated string or array',
},
{
displayName: 'T-Shirt',
name: 'tShirt',
type: 'string',
default: '',
},
{
displayName: 'Teammate',
name: 'teammate',
type: 'boolean',
default: false,
},
{
displayName: 'URL',
name: 'url',
type: 'string',
default: '',
},
],
},
];

View File

@@ -0,0 +1,225 @@
import type { INodeProperties } from 'n8n-workflow';
export const noteOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['note'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a note',
action: 'Create a note',
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many notes for a member',
action: 'Get many notes',
},
{
name: 'Update',
value: 'update',
description: 'Update a note',
action: 'Update a note',
},
],
default: 'create',
},
];
export const noteFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* note:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Workspace Name or ID',
name: 'workspaceId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getWorkspaces',
},
default: 'Deprecated',
required: true,
displayOptions: {
show: {
resource: ['note'],
operation: ['create'],
},
},
},
{
displayName: 'Member ID',
name: 'memberId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['note'],
operation: ['create'],
},
},
},
{
displayName: 'Note',
name: 'note',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['note'],
operation: ['create'],
},
},
},
/* -------------------------------------------------------------------------- */
/* note:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Workspace Name or ID',
name: 'workspaceId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getWorkspaces',
},
default: 'Deprecated',
required: true,
displayOptions: {
show: {
resource: ['note'],
operation: ['getAll'],
},
},
},
{
displayName: 'Member ID',
name: 'memberId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['note'],
operation: ['getAll'],
},
},
},
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
operation: ['getAll'],
resource: ['note'],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
operation: ['getAll'],
resource: ['note'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
maxValue: 500,
},
default: 100,
description: 'Max number of results to return',
},
{
displayName: 'Resolve Member',
name: 'resolveMember',
type: 'boolean',
displayOptions: {
show: {
operation: ['getAll'],
resource: ['note'],
},
},
default: false,
},
/* -------------------------------------------------------------------------- */
/* note:update */
/* -------------------------------------------------------------------------- */
{
displayName: 'Workspace Name or ID',
name: 'workspaceId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getWorkspaces',
},
default: 'Deprecated',
required: true,
displayOptions: {
show: {
resource: ['note'],
operation: ['update'],
},
},
},
{
displayName: 'Member ID',
name: 'memberId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['note'],
operation: ['update'],
},
},
},
{
displayName: 'Note ID',
name: 'noteId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['note'],
operation: ['update'],
},
},
},
{
displayName: 'Note',
name: 'note',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['note'],
operation: ['update'],
},
},
},
];

View File

@@ -0,0 +1,25 @@
{
"node": "n8n-nodes-base.orbit",
"nodeVersion": "1.0",
"codexVersion": "1.0",
"categories": ["Analytics"],
"resources": {
"credentialDocumentation": [
{
"url": "https://docs.n8n.io/integrations/builtin/credentials/orbit/"
}
],
"primaryDocumentation": [
{
"url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.orbit/"
}
],
"generic": [
{
"label": "Migrating Community Metrics to Orbit using n8n",
"icon": "📈",
"url": "https://n8n.io/blog/migrating-community-metrics-to-orbit-using-n8n/"
}
]
}
}

View File

@@ -0,0 +1,102 @@
import type {
IExecuteFunctions,
ILoadOptionsFunctions,
INodeExecutionData,
INodePropertyOptions,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow';
import { NodeApiError, NodeConnectionTypes } from 'n8n-workflow';
import { activityFields, activityOperations } from './ActivityDescription';
import { memberFields, memberOperations } from './MemberDescription';
import { noteFields, noteOperations } from './NoteDescription';
import { postFields, postOperations } from './PostDescription';
export class Orbit implements INodeType {
description: INodeTypeDescription = {
displayName: 'Orbit',
name: 'orbit',
icon: { light: 'file:orbit.svg', dark: 'file:orbit.dark.svg' },
group: ['output'],
version: 1,
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
description: 'Consume Orbit API',
hidden: true,
defaults: {
name: 'Orbit',
},
inputs: [NodeConnectionTypes.Main],
outputs: [NodeConnectionTypes.Main],
credentials: [
{
name: 'orbitApi',
required: true,
},
],
properties: [
{
displayName:
'Orbit has been shutdown and will no longer function from July 11th, You can read more <a target="_blank" href="https://orbit.love/blog/orbit-is-joining-postman">here</a>.',
name: 'deprecated',
type: 'notice',
default: '',
},
{
displayName: 'Resource',
name: 'resource',
type: 'options',
noDataExpression: true,
options: [
{
name: 'Activity',
value: 'activity',
},
{
name: 'Member',
value: 'member',
},
{
name: 'Note',
value: 'note',
},
{
name: 'Post',
value: 'post',
},
],
default: 'member',
},
// ACTIVITY
...activityOperations,
...activityFields,
// MEMBER
...memberOperations,
...memberFields,
// NOTE
...noteOperations,
...noteFields,
// POST
...postOperations,
...postFields,
],
};
methods = {
loadOptions: {
async getWorkspaces(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
return [{ name: 'Deprecated', value: 'Deprecated' }];
},
async getActivityTypes(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
return [{ name: 'Deprecated', value: 'Deprecated' }];
},
},
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
throw new NodeApiError(this.getNode(), {
message: 'Service is deprecated, From July 11th Orbit will no longer function.',
level: 'warning',
});
}
}

View File

@@ -0,0 +1,232 @@
import type { INodeProperties } from 'n8n-workflow';
export const postOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['post'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a post',
action: 'Create a post',
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many posts',
action: 'Get many posts',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a post',
action: 'Delete a post',
},
],
default: 'create',
},
];
export const postFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* post:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Workspace Name or ID',
name: 'workspaceId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getWorkspaces',
},
default: 'Deprecated',
required: true,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
},
},
},
{
displayName: 'Member ID',
name: 'memberId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
},
},
},
{
displayName: 'URL',
name: 'url',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
},
},
description:
'Supply any URL and Orbit will do its best job to parse out a title, description, and image',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
},
},
default: {},
options: [
{
displayName: 'Occurred At',
name: 'publishedAt',
type: 'dateTime',
default: '',
},
],
},
/* -------------------------------------------------------------------------- */
/* post:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Workspace Name or ID',
name: 'workspaceId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getWorkspaces',
},
default: 'Deprecated',
required: true,
displayOptions: {
show: {
resource: ['post'],
operation: ['getAll'],
},
},
},
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
operation: ['getAll'],
resource: ['post'],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
operation: ['getAll'],
resource: ['post'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
maxValue: 500,
},
default: 100,
description: 'Max number of results to return',
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource: ['post'],
operation: ['getAll'],
},
},
options: [
{
displayName: 'Member ID',
name: 'memberId',
type: 'string',
default: '',
description: 'When set the post will be filtered by the member ID',
},
],
},
/* -------------------------------------------------------------------------- */
/* post:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Workspace Name or ID',
name: 'workspaceId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getWorkspaces',
},
default: 'Deprecated',
required: true,
displayOptions: {
show: {
resource: ['post'],
operation: ['delete'],
},
},
},
{
displayName: 'Member ID',
name: 'memberId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['post'],
operation: ['delete'],
},
},
},
{
displayName: 'Post ID',
name: 'postId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: ['delete'],
resource: ['post'],
},
},
},
];

View File

@@ -0,0 +1,7 @@
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M32.0072 18.0582C31.7128 15.8059 30.8766 13.661 29.5719 11.8121C28.2673 9.96316 26.5342 8.46674 24.5246 7.45423C22.5152 6.44171 20.2908 5.94406 18.0469 6.00499C15.803 6.06592 13.6082 6.68355 11.6552 7.80365C9.70224 8.92376 8.05082 10.5121 6.84599 12.4291C5.64116 14.3461 4.91976 16.5333 4.74516 18.7985C4.57055 21.0637 4.94806 23.3376 5.84456 25.4206C6.74105 27.5036 8.1291 29.3319 9.88679 30.745C11.2325 30.1386 12.7039 29.4305 14.2667 28.6364C12.686 27.8698 11.3429 26.6798 10.3832 25.1953C9.42346 23.7108 8.88371 21.9886 8.82256 20.2156C8.76141 18.4427 9.18106 16.6866 10.0361 15.138C10.8912 13.5893 12.149 12.3073 13.6729 11.431C15.1969 10.5547 16.9289 10.1175 18.6809 10.1671C20.433 10.2166 22.1382 10.7508 23.6115 11.7118C25.0847 12.6728 26.2698 14.0239 27.0382 15.6184C27.8066 17.2129 28.1288 18.99 27.97 20.7568C29.4173 19.8277 30.7706 18.9231 32.0072 18.0582ZM32.1227 19.6311C30.7376 20.6681 29.2027 21.7423 27.5524 22.8257C26.8152 25.1659 25.2294 27.1366 23.1144 28.3409C20.9993 29.5452 18.512 29.8937 16.1532 29.3161C14.3441 30.1964 12.6277 30.9584 11.056 31.5894C13.1465 32.935 15.5581 33.6822 18.0345 33.7516C20.511 33.821 22.9597 33.21 25.1204 31.9834C27.2812 30.7568 29.0733 28.9607 30.3062 26.7857C31.5392 24.6107 32.1669 22.1382 32.1227 19.6311Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M32.8186 8.34357C33.0041 8.34357 33.1855 8.28787 33.3397 8.18353C33.4941 8.07918 33.6143 7.93087 33.6854 7.75735C33.7563 7.58383 33.7749 7.39289 33.7387 7.20869C33.7025 7.02448 33.6132 6.85527 33.482 6.72247C33.3508 6.58967 33.1836 6.49922 33.0016 6.46258C32.8196 6.42594 32.631 6.44475 32.4596 6.51662C32.2881 6.5885 32.1416 6.71021 32.0385 6.86638C31.9354 7.02253 31.8804 7.20614 31.8804 7.39395C31.8802 7.51871 31.9044 7.64226 31.9514 7.75756C31.9985 7.87284 32.0676 7.97759 32.1547 8.06581C32.2419 8.15402 32.3454 8.22397 32.4593 8.27162C32.5732 8.31929 32.6953 8.34374 32.8186 8.34357Z" fill="#00CCF5"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.2505 24.4782C1.49798 24.4782 1.7399 24.4039 1.94562 24.2647C2.15134 24.1254 2.31162 23.9275 2.40616 23.696C2.50069 23.4645 2.52523 23.2098 2.47667 22.9641C2.42811 22.7185 2.30864 22.493 2.13337 22.3162C1.95811 22.1393 1.73493 22.0191 1.49211 21.9706C1.24929 21.9222 0.997737 21.9478 0.769308 22.0443C0.540879 22.1406 0.345844 22.3035 0.208897 22.5121C0.0719509 22.7208 -0.000748013 22.9658 5.80333e-06 23.2164C0.00101389 23.5514 0.133206 23.8723 0.367609 24.1089C0.602012 24.3454 0.919506 24.4782 1.2505 24.4782Z" fill="#00CCF5"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M22.369 17.0226C23.7198 16.267 25.035 15.55 26.3046 14.8882C26.3515 14.9653 26.4023 15.0565 26.4556 15.1593C25.1975 15.8249 23.8823 16.5446 22.5315 17.3014L22.369 17.0226ZM39.914 10.2802C39.3109 9.2226 35.6547 10.3457 30.4801 12.7936C30.5283 12.8746 30.5765 12.9581 30.6222 13.0429C35.5798 10.6541 39.0392 9.50402 39.4785 10.4292C40.1691 11.6397 32.2421 17.5789 21.7812 23.6943C11.3203 29.8095 2.27357 33.7854 1.58294 32.5749C1.18939 31.8553 3.13558 29.8944 4.88373 28.3344C2.36624 30.3904 1.04593 31.9748 1.48011 32.7355C2.46526 34.4638 12.0007 31.065 22.6153 24.8662C33.2299 18.6673 40.9042 12.0085 39.914 10.2802Z" fill="#00CCF5"/>
<path d="M21.1263 18.0274C20.9026 17.6389 20.819 17.1839 20.8897 16.7399C20.9604 16.2959 21.1811 15.8906 21.514 15.5929C21.847 15.2952 22.2717 15.1237 22.7157 15.1075C23.1597 15.0913 23.5954 15.2315 23.9487 15.5041C24.3019 15.7768 24.5508 16.1651 24.6529 16.6027C24.755 17.0403 24.7039 17.5003 24.5084 17.9041C24.313 18.3079 23.9852 18.6305 23.5809 18.8171C23.1767 19.0036 22.7211 19.0424 22.2917 18.9269C22.0472 18.8651 21.8177 18.7534 21.6173 18.5988C21.4169 18.4441 21.2498 18.2497 21.1263 18.0274Z" fill="#FA00E9"/>
</svg>

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -0,0 +1,7 @@
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M32.0072 18.0582C31.7128 15.8059 30.8766 13.661 29.5719 11.8121C28.2673 9.96316 26.5342 8.46674 24.5246 7.45423C22.5152 6.44171 20.2908 5.94406 18.0469 6.00499C15.803 6.06592 13.6082 6.68355 11.6552 7.80365C9.70224 8.92376 8.05082 10.5121 6.84599 12.4291C5.64116 14.3461 4.91976 16.5333 4.74516 18.7985C4.57055 21.0637 4.94806 23.3376 5.84456 25.4206C6.74105 27.5036 8.1291 29.3319 9.88679 30.745C11.2325 30.1386 12.7039 29.4305 14.2667 28.6364C12.686 27.8698 11.3429 26.6798 10.3832 25.1953C9.42346 23.7108 8.88371 21.9886 8.82256 20.2156C8.76141 18.4427 9.18106 16.6866 10.0361 15.138C10.8912 13.5893 12.149 12.3073 13.6729 11.431C15.1969 10.5547 16.9289 10.1175 18.6809 10.1671C20.433 10.2166 22.1382 10.7508 23.6115 11.7118C25.0847 12.6728 26.2698 14.0239 27.0382 15.6184C27.8066 17.2129 28.1288 18.99 27.97 20.7568C29.4173 19.8277 30.7706 18.9231 32.0072 18.0582ZM32.1227 19.6311C30.7376 20.6681 29.2027 21.7423 27.5524 22.8257C26.8152 25.1659 25.2294 27.1366 23.1144 28.3409C20.9993 29.5452 18.512 29.8937 16.1532 29.3161C14.3441 30.1964 12.6277 30.9584 11.056 31.5894C13.1465 32.935 15.5581 33.6822 18.0345 33.7516C20.511 33.821 22.9597 33.21 25.1204 31.9834C27.2812 30.7568 29.0733 28.9607 30.3062 26.7857C31.5392 24.6107 32.1669 22.1382 32.1227 19.6311Z" fill="#1E2124"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M32.8186 8.34357C33.0041 8.34357 33.1855 8.28787 33.3397 8.18353C33.4941 8.07918 33.6143 7.93087 33.6854 7.75735C33.7563 7.58383 33.7749 7.39289 33.7387 7.20869C33.7025 7.02448 33.6132 6.85527 33.482 6.72247C33.3508 6.58967 33.1836 6.49922 33.0016 6.46258C32.8196 6.42594 32.631 6.44475 32.4596 6.51662C32.2881 6.5885 32.1416 6.71021 32.0385 6.86638C31.9354 7.02253 31.8804 7.20614 31.8804 7.39395C31.8802 7.51871 31.9044 7.64226 31.9514 7.75756C31.9985 7.87284 32.0676 7.97759 32.1547 8.06581C32.2419 8.15402 32.3454 8.22397 32.4593 8.27162C32.5732 8.31929 32.6953 8.34374 32.8186 8.34357Z" fill="#00CCF5"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.2505 24.4782C1.49798 24.4782 1.7399 24.4039 1.94562 24.2647C2.15134 24.1254 2.31162 23.9275 2.40616 23.696C2.50069 23.4645 2.52523 23.2098 2.47667 22.9641C2.42811 22.7185 2.30864 22.493 2.13337 22.3162C1.95811 22.1393 1.73493 22.0191 1.49211 21.9706C1.24929 21.9222 0.997737 21.9478 0.769308 22.0443C0.540879 22.1406 0.345844 22.3035 0.208897 22.5121C0.0719509 22.7208 -0.000748013 22.9658 5.80333e-06 23.2164C0.00101389 23.5514 0.133206 23.8723 0.367609 24.1089C0.602012 24.3454 0.919506 24.4782 1.2505 24.4782Z" fill="#00CCF5"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M22.369 17.0226C23.7198 16.267 25.035 15.55 26.3046 14.8882C26.3515 14.9653 26.4023 15.0565 26.4556 15.1593C25.1975 15.8249 23.8823 16.5446 22.5315 17.3014L22.369 17.0226ZM39.914 10.2802C39.3109 9.2226 35.6547 10.3457 30.4801 12.7936C30.5283 12.8746 30.5765 12.9581 30.6222 13.0429C35.5798 10.6541 39.0392 9.50402 39.4785 10.4292C40.1691 11.6397 32.2421 17.5789 21.7812 23.6943C11.3203 29.8095 2.27357 33.7854 1.58294 32.5749C1.18939 31.8553 3.13558 29.8944 4.88373 28.3344C2.36624 30.3904 1.04593 31.9748 1.48011 32.7355C2.46526 34.4638 12.0007 31.065 22.6153 24.8662C33.2299 18.6673 40.9042 12.0085 39.914 10.2802Z" fill="#00CCF5"/>
<path d="M21.1263 18.0274C20.9026 17.6389 20.819 17.1839 20.8897 16.7399C20.9604 16.2959 21.1811 15.8906 21.514 15.5929C21.847 15.2952 22.2717 15.1237 22.7157 15.1075C23.1597 15.0913 23.5954 15.2315 23.9487 15.5041C24.3019 15.7768 24.5508 16.1651 24.6529 16.6027C24.755 17.0403 24.7039 17.5003 24.5084 17.9041C24.313 18.3079 23.9852 18.6305 23.5809 18.8171C23.1767 19.0036 22.7211 19.0424 22.2917 18.9269C22.0472 18.8651 21.8177 18.7534 21.6173 18.5988C21.4169 18.4441 21.2498 18.2497 21.1263 18.0274Z" fill="#FA00E9"/>
</svg>

After

Width:  |  Height:  |  Size: 3.8 KiB