@lessly/sdk-app 60.0.0 → 61.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1,3 @@
1
- export declare const namespaces: readonly ["analytics", "brain", "consent", "content", "deployment", "mail", "observe", "organization", "playground", "realtime", "support", "tracking", "users", "waitlist"];
1
+ import type { ToolLevel } from '../runtime/types.js';
2
+ export declare const namespaces: readonly ["analytics", "brain", "consent", "content", "deployment", "mail", "observe", "organization", "realtime", "support", "tracking", "users", "waitlist"];
3
+ export declare const operations: Record<string, ToolLevel>;
@@ -90626,7 +90626,6 @@ export interface OrganizationProductListAccessOutput {
90626
90626
  orgRoles: {
90627
90627
  id: string;
90628
90628
  name: string;
90629
- description: (string | null);
90630
90629
  }[];
90631
90630
  canManage: boolean;
90632
90631
  inherited: {
@@ -90977,197 +90976,6 @@ export interface OrganizationSupportThreadsListOutput {
90977
90976
  lastMessagePreview: (string | null);
90978
90977
  }[];
90979
90978
  }
90980
- export interface PlaygroundAnalyticsOverviewInput {
90981
- /**
90982
- * Max records per entity in recent[]; omit for the endpoint default
90983
- */
90984
- limit?: number;
90985
- }
90986
- export interface PlaygroundAnalyticsOverviewOutput {
90987
- ok: boolean;
90988
- minted: boolean;
90989
- overview?: unknown;
90990
- http_status: number;
90991
- }
90992
- export interface PlaygroundBillingEntitlementsInput {
90993
- }
90994
- export interface PlaygroundBillingEntitlementsOutput {
90995
- ok: boolean;
90996
- minted: boolean;
90997
- http_status: number;
90998
- entitlements?: unknown;
90999
- }
91000
- export interface PlaygroundBillingRecordUsageInput {
91001
- /**
91002
- * Quantity of events to record against playground-events (SUM); defaults to 1
91003
- */
91004
- value?: number;
91005
- }
91006
- export interface PlaygroundBillingRecordUsageOutput {
91007
- minted: boolean;
91008
- accepted: (number | null);
91009
- recorded: boolean;
91010
- duplicates: (number | null);
91011
- http_status: number;
91012
- }
91013
- export interface PlaygroundClickupCreateTaskInput {
91014
- /**
91015
- * Task title; defaults to a fixture label
91016
- */
91017
- name?: string;
91018
- /**
91019
- * ClickUp list id; falls back to CLICKUP_TEST_LIST_ID
91020
- */
91021
- listId?: string;
91022
- }
91023
- export interface PlaygroundClickupCreateTaskOutput {
91024
- minted: boolean;
91025
- task_id: (string | null);
91026
- list_status: number;
91027
- vend_status: number;
91028
- clickup_status: number;
91029
- installation_count: number;
91030
- }
91031
- export interface PlaygroundClickupGetLastWebhookInput {
91032
- }
91033
- export type PlaygroundClickupGetLastWebhookOutput = ({
91034
- payload: string;
91035
- event_id: string;
91036
- provider: string;
91037
- verified: boolean;
91038
- product_id: string;
91039
- occurred_at: string;
91040
- connector_id: string;
91041
- clickup_event: (string | null);
91042
- receipt_count: number;
91043
- } | {
91044
- found: false;
91045
- });
91046
- export interface PlaygroundClickupGetOverviewInput {
91047
- }
91048
- export interface PlaygroundClickupGetOverviewOutput {
91049
- team: ({
91050
- teamId: string;
91051
- teamName: string;
91052
- } | null);
91053
- lists: PlaygroundClickupGetOverviewOutputItems[];
91054
- tasks: {
91055
- id: string;
91056
- name: string;
91057
- status: (string | null);
91058
- }[];
91059
- minted: boolean;
91060
- spaces: PlaygroundClickupGetOverviewOutputItems[];
91061
- list_status: number;
91062
- vend_status: number;
91063
- lists_status: number;
91064
- tasks_status: number;
91065
- spaces_status: number;
91066
- folders_status: number;
91067
- installation_count: number;
91068
- }
91069
- export interface PlaygroundClickupGetOverviewOutputItems {
91070
- id: string;
91071
- name: string;
91072
- }
91073
- export interface PlaygroundGdriveGetLastChangeInput {
91074
- }
91075
- export type PlaygroundGdriveGetLastChangeOutput = ({
91076
- file_id: string;
91077
- removed: boolean;
91078
- file_name: (string | null);
91079
- mime_type: (string | null);
91080
- product_id: string;
91081
- occurred_at: string;
91082
- connector_id: string;
91083
- resource_state: string;
91084
- } | {
91085
- found: false;
91086
- });
91087
- export interface PlaygroundGdriveReadFileInput {
91088
- /**
91089
- * Drive file id; falls back to GDRIVE_TEST_FILE_ID, then the first picked file
91090
- */
91091
- fileId?: string;
91092
- }
91093
- export interface PlaygroundGdriveReadFileOutput {
91094
- minted: boolean;
91095
- file_id: (string | null);
91096
- file_name: (string | null);
91097
- mime_type: (string | null);
91098
- file_count: number;
91099
- get_status: number;
91100
- list_status: number;
91101
- vend_status: number;
91102
- content_bytes: (number | null);
91103
- }
91104
- export interface PlaygroundGoogleadsReadCustomerInput {
91105
- }
91106
- export interface PlaygroundGoogleadsReadCustomerOutput {
91107
- minted: boolean;
91108
- vended: boolean;
91109
- customer_id: (string | null);
91110
- vend_status: number;
91111
- result_count: number;
91112
- search_status: number;
91113
- login_customer_id: (string | null);
91114
- }
91115
- export interface PlaygroundLifecycleGetStateInput {
91116
- }
91117
- export interface PlaygroundLifecycleGetStateOutput {
91118
- blocked: boolean;
91119
- archived: boolean;
91120
- productId: string;
91121
- lastBlockTransition: ({
91122
- eventId: string;
91123
- eventName: string;
91124
- productId: string;
91125
- occurredAt: string;
91126
- recordedAt: string;
91127
- receiptCount: number;
91128
- organizationId: string;
91129
- cascadedFromOrg: boolean;
91130
- } | null);
91131
- lastArchiveTransition: ({
91132
- eventId: string;
91133
- eventName: string;
91134
- productId: string;
91135
- occurredAt: string;
91136
- recordedAt: string;
91137
- receiptCount: number;
91138
- organizationId: string;
91139
- cascadedFromOrg: boolean;
91140
- } | null);
91141
- }
91142
- export interface PlaygroundLifecycleListEventsInput {
91143
- }
91144
- export type PlaygroundLifecycleListEventsOutput = {
91145
- eventId: string;
91146
- eventName: string;
91147
- productId: string;
91148
- occurredAt: string;
91149
- recordedAt: string;
91150
- receiptCount: number;
91151
- organizationId: string;
91152
- cascadedFromOrg: boolean;
91153
- }[];
91154
- export interface PlaygroundWebhookGetLastInput {
91155
- }
91156
- export type PlaygroundWebhookGetLastOutput = ({
91157
- payload?: unknown;
91158
- event_id: string;
91159
- provider: string;
91160
- verified: boolean;
91161
- product_id: string;
91162
- occurred_at: string;
91163
- connector_id: string;
91164
- delivery_count: number;
91165
- } | {
91166
- found: false;
91167
- });
91168
- export interface PlaygroundWsEchoInput {
91169
- }
91170
- export type PlaygroundWsEchoOutput = unknown;
91171
90979
  export interface RealtimeArchiveExportInput {
91172
90980
  /**
91173
90981
  * Only entries with ts <= to_ts (epoch ms)
@@ -2,6 +2,6 @@ export { createLesslyApp } from './runtime/createLesslyApp.js';
2
2
  export type { LesslyClientBase } from './runtime/createLesslyApp.js';
3
3
  export { connectStream } from './runtime/connectStream.js';
4
4
  export { LesslyApiError } from './runtime/errors.js';
5
- export type { LesslyAppOptions, HttpMethod, Binding, BindingsMap, ParamSpec, ParamIn } from './runtime/types.js';
5
+ export type { LesslyAppOptions, HttpMethod, Binding, BindingsMap, ParamSpec, ParamIn, ToolLevel, Operation, } from './runtime/types.js';
6
6
  export type { WsBinding, WsBindingsMap, LesslyStream, LesslyStreamOpener, StreamCloseInfo, StreamData, WebSocketCtor, WebSocketLike, } from './runtime/types.js';
7
7
  export type { GeneratedClient } from './gen/client.gen.js';
@@ -1,9 +1,9 @@
1
- import type { Binding, LesslyAppOptions } from './types.js';
1
+ import type { RouteSpec, LesslyAppOptions } from './types.js';
2
2
  export interface ResolvedRequest {
3
3
  path: string;
4
4
  query: Record<string, unknown>;
5
5
  body: Record<string, unknown> | undefined;
6
6
  }
7
- export declare function resolveRequest(binding: Binding, input?: Record<string, unknown>): ResolvedRequest;
7
+ export declare function resolveRequest(binding: RouteSpec, input?: Record<string, unknown>): ResolvedRequest;
8
8
  export declare function buildUrl(baseUrl: string, path: string, query: Record<string, unknown>): string;
9
- export declare function executeRequest(opts: LesslyAppOptions, binding: Binding, input?: Record<string, unknown>): Promise<unknown>;
9
+ export declare function executeRequest(opts: LesslyAppOptions, binding: RouteSpec, input?: Record<string, unknown>): Promise<unknown>;
@@ -4,12 +4,41 @@ export interface ParamSpec {
4
4
  name: string;
5
5
  in: ParamIn;
6
6
  }
7
- export interface Binding {
7
+ /**
8
+ * The access level a tool requires, as declared by the platform catalog. Ordered by increasing
9
+ * privilege — a caller granted `admin` implicitly satisfies `write` and `read` — but that ordering
10
+ * is the access check's business; this SDK only transports the value it was given.
11
+ */
12
+ export type ToolLevel = 'read' | 'write' | 'admin';
13
+ /**
14
+ * The identity of a catalog operation, carried by both a `Binding` and every generated method.
15
+ * `operationKey` is the catalog tool name verbatim (`mail_domains_create`), which is what an
16
+ * access decision keys on — the accessor path (`sdk.mail.domains.create`) is a derived, LOSSY view
17
+ * of it (a hyphenated resource joins several id segments) and must never be reconstructed by a
18
+ * caller.
19
+ */
20
+ export interface Operation {
21
+ readonly operationKey: string;
22
+ readonly level: ToolLevel;
23
+ }
24
+ /**
25
+ * Everything the request layer needs to turn an input object into a URL and a method — and
26
+ * NOTHING else. Split out of `Binding` when `Binding` grew `operationKey`/`level`: routing has no
27
+ * business knowing an operation's identity or access level, and `connectStream` (which builds a
28
+ * GET-shaped route from a `WsBinding`) would otherwise have to fabricate both.
29
+ */
30
+ export interface RouteSpec {
8
31
  method: HttpMethod;
9
32
  path: string;
10
- readOnly: boolean;
11
33
  params?: ParamSpec[];
12
34
  }
35
+ /** A REST route plus the catalog identity of the operation it serves. */
36
+ export interface Binding extends RouteSpec {
37
+ readOnly: boolean;
38
+ /** Catalog tool name, e.g. `mail_domains_create` — the key an access decision is made on. */
39
+ operationKey: string;
40
+ level: ToolLevel;
41
+ }
13
42
  /**
14
43
  * The streaming counterpart of `Binding`: the upgrade route of a ws-bound tool. No method (an
15
44
  * upgrade is always a GET) and no `readOnly` (a socket is neither a read nor a write — the tool's