2023-01-27 03:22:44 -08:00
import type {
2023-03-09 09:13:15 -08:00
IExecuteFunctions ,
2020-11-03 14:33:10 -08:00
ILoadOptionsFunctions ,
INodeExecutionData ,
INodePropertyOptions ,
INodeType ,
INodeTypeDescription ,
} from 'n8n-workflow' ;
2024-07-10 00:30:49 -07:00
import { NodeApiError } from 'n8n-workflow' ;
2020-11-03 14:33:10 -08:00
2022-08-17 08:50:24 -07:00
import { activityFields , activityOperations } from './ActivityDescription' ;
2020-11-03 14:33:10 -08:00
2022-08-17 08:50:24 -07:00
import { memberFields , memberOperations } from './MemberDescription' ;
2020-11-03 14:33:10 -08:00
2022-08-17 08:50:24 -07:00
import { noteFields , noteOperations } from './NoteDescription' ;
2020-11-03 14:33:10 -08:00
2022-08-17 08:50:24 -07:00
import { postFields , postOperations } from './PostDescription' ;
2020-11-03 14:33:10 -08:00
export class Orbit implements INodeType {
description : INodeTypeDescription = {
displayName : 'Orbit' ,
name : 'orbit' ,
2024-06-06 04:34:30 -07:00
icon : { light : 'file:orbit.svg' , dark : 'file:orbit.dark.svg' } ,
2020-11-03 14:33:10 -08:00
group : [ 'output' ] ,
version : 1 ,
subtitle : '={{$parameter["operation"] + ": " + $parameter["resource"]}}' ,
description : 'Consume Orbit API' ,
2024-07-10 00:30:49 -07:00
hidden : true ,
2020-11-03 14:33:10 -08:00
defaults : {
name : 'Orbit' ,
} ,
inputs : [ 'main' ] ,
outputs : [ 'main' ] ,
credentials : [
{
name : 'orbitApi' ,
required : true ,
} ,
] ,
properties : [
2024-07-10 00:30:49 -07:00
{
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 : '' ,
} ,
2020-11-03 14:33:10 -08:00
{
displayName : 'Resource' ,
name : 'resource' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-11-03 14:33:10 -08:00
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 : {
2022-08-17 08:50:24 -07:00
async getWorkspaces ( this : ILoadOptionsFunctions ) : Promise < INodePropertyOptions [ ] > {
2024-07-10 00:30:49 -07:00
return [ { name : 'Deprecated' , value : 'Deprecated' } ] ;
2020-11-03 14:33:10 -08:00
} ,
2022-08-17 08:50:24 -07:00
async getActivityTypes ( this : ILoadOptionsFunctions ) : Promise < INodePropertyOptions [ ] > {
2024-07-10 00:30:49 -07:00
return [ { name : 'Deprecated' , value : 'Deprecated' } ] ;
2020-11-03 14:33:10 -08:00
} ,
} ,
} ;
async execute ( this : IExecuteFunctions ) : Promise < INodeExecutionData [ ] [ ] > {
2024-07-10 00:30:49 -07:00
throw new NodeApiError ( this . getNode ( ) , {
message : 'Service is deprecated, From July 11th Orbit will no longer function.' ,
level : 'warning' ,
} ) ;
2020-11-03 14:33:10 -08:00
}
}