UNPKG

@gnosticdev/highlevel-sdk

Version:
169 lines 8.16 kB
//#region src/v2/scopes/types/scopes.d.ts interface HighLevelAPIScopes { 'Sub-Account': { readonly: { 'blogs/author': ScopeInfo; 'blogs/category': ScopeInfo; 'blogs/check-slug': ScopeInfo; 'blogs/list': ScopeInfo; 'blogs/posts': ScopeInfo; businesses: ScopeInfo; calendars: ScopeInfo; 'calendars/events': ScopeInfo; 'calendars/groups': ScopeInfo; 'calendars/resources': ScopeInfo; campaigns: ScopeInfo; contacts: ScopeInfo; conversations: ScopeInfo; 'conversations/message': ScopeInfo; 'emails/builder': ScopeInfo; 'emails/schedule': ScopeInfo; forms: ScopeInfo; 'funnels/funnel': ScopeInfo; 'funnels/page': ScopeInfo; 'funnels/pagecount': ScopeInfo; 'funnels/redirect': ScopeInfo; invoices: ScopeInfo; 'invoices/schedule': ScopeInfo; 'invoices/template': ScopeInfo; links: ScopeInfo; locations: ScopeInfo; 'locations/customFields': ScopeInfo; 'locations/customValues': ScopeInfo; 'locations/tags': ScopeInfo; 'locations/tasks': ScopeInfo; 'locations/templates': ScopeInfo; medias: ScopeInfo; 'objects/record': ScopeInfo; 'objects/schema': ScopeInfo; opportunities: ScopeInfo; 'payments/integration': ScopeInfo; 'payments/orders': ScopeInfo; 'payments/subscriptions': ScopeInfo; 'payments/transactions': ScopeInfo; products: ScopeInfo; 'products/prices': ScopeInfo; 'socialplanner/account': ScopeInfo; 'socialplanner/category': ScopeInfo; 'socialplanner/csv': ScopeInfo; 'socialplanner/oauth': ScopeInfo; 'socialplanner/post': ScopeInfo; 'socialplanner/tag': ScopeInfo; surveys: ScopeInfo; users: ScopeInfo; workflows: ScopeInfo; }; write: { 'blogs/post': ScopeInfo; 'blogs/post-update': ScopeInfo; businesses: ScopeInfo; calendars: ScopeInfo; 'calendars/events': ScopeInfo; 'calendars/groups': ScopeInfo; 'calendars/resources': ScopeInfo; contacts: ScopeInfo; conversations: ScopeInfo; 'conversations/livechat': ScopeInfo; 'conversations/message': ScopeInfo; courses: ScopeInfo; 'emails/builder': ScopeInfo; 'funnels/redirect': ScopeInfo; invoices: ScopeInfo; 'invoices/schedule': ScopeInfo; 'invoices/template': ScopeInfo; links: ScopeInfo; 'locations/customFields': ScopeInfo; 'locations/customValues': ScopeInfo; 'locations/tags': ScopeInfo; medias: ScopeInfo; 'objects/record': ScopeInfo; opportunities: ScopeInfo; 'payments/integration': ScopeInfo; 'payments/orders': ScopeInfo; products: ScopeInfo; 'products/prices': ScopeInfo; 'saas/company': ScopeInfo; 'saas/location': ScopeInfo; 'socialplanner/account': ScopeInfo; 'socialplanner/csv': ScopeInfo; 'socialplanner/oauth': ScopeInfo; 'socialplanner/post': ScopeInfo; users: ScopeInfo; }; }; Agency: { readonly: { 'emails/schedule': ScopeInfo; locations: ScopeInfo; oauth: ScopeInfo; snapshots: ScopeInfo; users: ScopeInfo; }; write: { locations: ScopeInfo; oauth: ScopeInfo; 'saas/company': ScopeInfo; 'saas/location': ScopeInfo; users: ScopeInfo; }; }; } interface ScopeInfo { endpoints: EndpointRef[]; webhookEvents: WebhookEventName[]; } interface EndpointRef { method: HttpMethod; path: string; } declare const enum HttpMethod { DELETE = "DELETE", GET = "GET", PATCH = "PATCH", POST = "POST", PUT = "PUT" } declare const enum WebhookEventName { CampaignStatusUpdate = "CampaignStatusUpdate", ContactCreate = "ContactCreate", ContactDelete = "ContactDelete", ContactDndUpdate = "ContactDndUpdate", ContactTagUpdate = "ContactTagUpdate", ConversationProviderOutboundMessage = "ConversationProviderOutboundMessage", ConversationUnreadWebhook = "ConversationUnreadWebhook", InboundMessage = "InboundMessage", LocationCreate = "LocationCreate", LocationUpdate = "LocationUpdate", NoteCreate = "NoteCreate", NoteDelete = "NoteDelete", OpportunityCreate = "OpportunityCreate", OpportunityDelete = "OpportunityDelete", OpportunityMonetaryValueUpdate = "OpportunityMonetaryValueUpdate", OpportunityStageUpdate = "OpportunityStageUpdate", TaskCreate = "TaskCreate", TaskDelete = "TaskDelete", 'Webhook Events' = "Webhook Events" } /** * A collection of all available fully qualified scopes (as provided by the API Documentation) grouped by access type. * This is auto-generated from the scopes schema. * @example * ScopesCollection['Sub-Account'] // ['blogs/author.readonly', 'blogs/category.readonly', 'blogs/post.write', ...] * ScopesCollection['Agency'] // ['emails/schedule.readonly', 'locations.readonly', 'locations.write', ...] */ declare const ScopesCollection: { readonly 'Sub-Account': readonly ["blogs/author.readonly", "blogs/category.readonly", "blogs/check-slug.readonly", "blogs/list.readonly", "blogs/posts.readonly", "businesses.readonly", "calendars.readonly", "calendars/events.readonly", "calendars/groups.readonly", "calendars/resources.readonly", "campaigns.readonly", "contacts.readonly", "conversations.readonly", "conversations/message.readonly", "emails/builder.readonly", "emails/schedule.readonly", "forms.readonly", "funnels/funnel.readonly", "funnels/page.readonly", "funnels/pagecount.readonly", "funnels/redirect.readonly", "invoices.readonly", "invoices/schedule.readonly", "invoices/template.readonly", "links.readonly", "locations.readonly", "locations/customFields.readonly", "locations/customValues.readonly", "locations/tags.readonly", "locations/tasks.readonly", "locations/templates.readonly", "medias.readonly", "objects/record.readonly", "objects/schema.readonly", "opportunities.readonly", "payments/integration.readonly", "payments/orders.readonly", "payments/subscriptions.readonly", "payments/transactions.readonly", "products.readonly", "products/prices.readonly", "socialplanner/account.readonly", "socialplanner/category.readonly", "socialplanner/csv.readonly", "socialplanner/oauth.readonly", "socialplanner/post.readonly", "socialplanner/tag.readonly", "surveys.readonly", "users.readonly", "workflows.readonly", "blogs/post.write", "blogs/post-update.write", "businesses.write", "calendars.write", "calendars/events.write", "calendars/groups.write", "calendars/resources.write", "contacts.write", "conversations.write", "conversations/livechat.write", "conversations/message.write", "courses.write", "emails/builder.write", "funnels/redirect.write", "invoices.write", "invoices/schedule.write", "invoices/template.write", "links.write", "locations/customFields.write", "locations/customValues.write", "locations/tags.write", "medias.write", "objects/record.write", "opportunities.write", "payments/integration.write", "payments/orders.write", "products.write", "products/prices.write", "saas/company.write", "saas/location.write", "socialplanner/account.write", "socialplanner/csv.write", "socialplanner/oauth.write", "socialplanner/post.write", "users.write"]; readonly Agency: readonly ["emails/schedule.readonly", "locations.readonly", "oauth.readonly", "snapshots.readonly", "users.readonly", "locations.write", "oauth.write", "saas/company.write", "saas/location.write", "users.write"]; }; //#endregion //#region src/v2/scopes/scope-types.d.ts type AgencyScopes = `${keyof HighLevelAPIScopes['Agency']['readonly']}.readonly` | `${keyof HighLevelAPIScopes['Agency']['write']}.write`; type SubAccountScopes = `${keyof HighLevelAPIScopes['Sub-Account']['readonly']}.readonly` | `${keyof HighLevelAPIScopes['Sub-Account']['write']}.write`; /** * Get the scopes for a given access type. * @param accessType - the access type to get the scopes for */ type Scopes<T extends AccessType> = T extends 'Agency' ? AgencyScopes : SubAccountScopes; type AccessType = 'Sub-Account' | 'Agency'; //#endregion export { SubAccountScopes as i, AgencyScopes as n, Scopes as r, AccessType as t };