@gnosticdev/highlevel-sdk
Version:
SDK for the HighLevel API
527 lines (524 loc) • 15.3 kB
text/typescript
declare const ScopesSchema: {
businesses: {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
calendars: {
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'calendars/groups': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'calendars/resources': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'calendars/events': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
campaigns: {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
contacts: {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
conversations: {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'conversations/message': {
readonly: ({
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
} | {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly [""];
})[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
forms: {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
invoices: {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'invoices/schedule': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'invoices/template': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
links: {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
locations: {
readonly: ({
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account", "Agency"];
} | {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
})[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Agency"];
}[];
};
'locations/customValues': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'locations/customFields': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'locations/tags': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'locations/templates': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'locations/tasks': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
medias: {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'funnels/redirect': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'funnels/page': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'funnels/funnel': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'funnels/pagecount': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
opportunities: {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'payments/integration': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'payments/orders': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'payments/transactions': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'payments/subscriptions': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
products: {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'products/prices': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
oauth: {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Agency"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Agency"];
}[];
};
'saas/location': {
write: ({
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Agency"];
} | {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account", "Agency"];
})[];
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account", "Agency"];
}[];
};
'saas/company': {
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account", "Agency"];
}[];
};
snapshots: {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Agency"];
}[];
};
'socialplanner/account': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'socialplanner/csv': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'socialplanner/category': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'socialplanner/oauth': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'socialplanner/post': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
'socialplanner/tag': {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
surveys: {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
users: {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account", "Agency"];
}[];
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account", "Agency"];
}[];
};
workflows: {
readonly: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
courses: {
write: {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly ["Sub-Account"];
}[];
};
};
type AccessType = 'Sub-Account' | 'Agency';
type Scopes = typeof ScopesSchema;
/**
* An endpoint with permission levels for a given access type.
*/
type Endpoint<TAccessType extends AccessType> = {
methodAndEndpoint: string;
webhookEvents: string;
accessType: readonly TAccessType[];
};
/**
* A permission level for a scope name. Pass in a scope name to get the available permissions.
* @example
* ```ts
* type T = Permission<'businesses'>
* ```
*/
type Permission<TScopes extends keyof Scopes> = keyof Scopes[TScopes] & string;
/**
* A scope with permission level for a given access type.
* @example `businesses.readonly`, `locations.write`
*/
type ScopeLiterals<TAccessType extends AccessType> = {
[K in FilteredScopeNames<TAccessType>]: `${K}.${Permission<K>}`;
}[FilteredScopeNames<TAccessType>];
type HighLevelScopes<T extends AccessType> = ScopeLiterals<T> | ScopeLiterals<T>[] | (string & {});
/**
* The access type available for a given scope name and permission level.
*/
type ScopeAccess<TScopes extends keyof Scopes, TPermission extends Permission<TScopes>> = TPermission extends keyof Scopes[TScopes] ? Scopes[TScopes][TPermission] extends Endpoint<infer TAccess>[] ? TAccess : never : never;
/**
* A scope name for a given access type.
* @example `businesses`, `locations`
*/
type FilteredScopeNames<T extends AccessType> = {
[K in keyof Scopes]: ScopeAccess<K, Permission<K>> extends infer TAccess ? TAccess extends T ? K : TAccess extends readonly T[] ? K : never : never;
}[keyof Scopes];
export type { AccessType as A, HighLevelScopes as H, ScopeLiterals as S };