@lessly/sdk-app 63.2.0 → 63.2.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.
- package/dist/_types/gen/client.gen.d.ts +29 -1
- package/dist/_types/gen/manifest.gen.d.ts +1 -1
- package/dist/_types/gen/playground/connect.gen.d.ts +3 -0
- package/dist/_types/gen/playground/index.d.ts +3 -0
- package/dist/_types/gen/playground/queryOptions.gen.d.ts +50 -0
- package/dist/_types/gen/types.gen.d.ts +191 -0
- package/dist/chunk-2YAA3AF4.js +10437 -0
- package/dist/chunk-2YAA3AF4.js.map +1 -0
- package/dist/index.cjs +140 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -10297
- package/dist/index.js.map +1 -1
- package/dist/playground/index.cjs +81 -0
- package/dist/playground/index.cjs.map +1 -0
- package/dist/playground/index.d.cts +1 -0
- package/dist/playground/index.d.ts +1 -0
- package/dist/playground/index.js +58 -0
- package/dist/playground/index.js.map +1 -0
- package/docs/recipes/access.md +72 -0
- package/docs/rules.md +29 -0
- package/package.json +12 -2
- package/src/gen/bindings.gen.ts +137 -1
- package/src/gen/client.gen.ts +52 -0
- package/src/gen/manifest.gen.ts +13 -1
- package/src/gen/playground/connect.gen.ts +9 -0
- package/src/gen/playground/index.ts +4 -0
- package/src/gen/playground/queryOptions.gen.ts +86 -0
- package/src/gen/types.gen.ts +226 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../_types/gen/playground/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../_types/gen/playground/index.js';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { wsBindings } from '../chunk-2YAA3AF4.js';
|
|
2
|
+
|
|
3
|
+
// src/gen/playground/queryOptions.gen.ts
|
|
4
|
+
var playgroundAnalyticsOverviewQueryOptions = (sdk, input) => ({
|
|
5
|
+
queryKey: ["playground", "analytics", "overview", input],
|
|
6
|
+
queryFn: () => sdk["playground"]["analytics"]["overview"](input)
|
|
7
|
+
});
|
|
8
|
+
var playgroundBillingEntitlementsQueryOptions = (sdk, input) => ({
|
|
9
|
+
queryKey: ["playground", "billing", "entitlements", input],
|
|
10
|
+
queryFn: () => sdk["playground"]["billing"]["entitlements"](input)
|
|
11
|
+
});
|
|
12
|
+
var playgroundBillingRecordUsageMutationOptions = (sdk) => ({
|
|
13
|
+
mutationKey: ["playground", "billing", "record-usage"],
|
|
14
|
+
mutationFn: (input) => sdk["playground"]["billing"]["record-usage"](input)
|
|
15
|
+
});
|
|
16
|
+
var playgroundClickupCreateTaskMutationOptions = (sdk) => ({
|
|
17
|
+
mutationKey: ["playground", "clickup", "create-task"],
|
|
18
|
+
mutationFn: (input) => sdk["playground"]["clickup"]["create-task"](input)
|
|
19
|
+
});
|
|
20
|
+
var playgroundClickupGetLastWebhookQueryOptions = (sdk, input) => ({
|
|
21
|
+
queryKey: ["playground", "clickup", "get-last-webhook", input],
|
|
22
|
+
queryFn: () => sdk["playground"]["clickup"]["get-last-webhook"](input)
|
|
23
|
+
});
|
|
24
|
+
var playgroundClickupGetOverviewQueryOptions = (sdk, input) => ({
|
|
25
|
+
queryKey: ["playground", "clickup", "get-overview", input],
|
|
26
|
+
queryFn: () => sdk["playground"]["clickup"]["get-overview"](input)
|
|
27
|
+
});
|
|
28
|
+
var playgroundGdriveGetLastChangeQueryOptions = (sdk, input) => ({
|
|
29
|
+
queryKey: ["playground", "gdrive", "get-last-change", input],
|
|
30
|
+
queryFn: () => sdk["playground"]["gdrive"]["get-last-change"](input)
|
|
31
|
+
});
|
|
32
|
+
var playgroundGdriveReadFileQueryOptions = (sdk, input) => ({
|
|
33
|
+
queryKey: ["playground", "gdrive", "read-file", input],
|
|
34
|
+
queryFn: () => sdk["playground"]["gdrive"]["read-file"](input)
|
|
35
|
+
});
|
|
36
|
+
var playgroundGoogleadsReadCustomerQueryOptions = (sdk, input) => ({
|
|
37
|
+
queryKey: ["playground", "googleads", "read-customer", input],
|
|
38
|
+
queryFn: () => sdk["playground"]["googleads"]["read-customer"](input)
|
|
39
|
+
});
|
|
40
|
+
var playgroundLifecycleGetStateQueryOptions = (sdk, input) => ({
|
|
41
|
+
queryKey: ["playground", "lifecycle", "get-state", input],
|
|
42
|
+
queryFn: () => sdk["playground"]["lifecycle"]["get-state"](input)
|
|
43
|
+
});
|
|
44
|
+
var playgroundLifecycleListEventsQueryOptions = (sdk, input) => ({
|
|
45
|
+
queryKey: ["playground", "lifecycle", "list-events", input],
|
|
46
|
+
queryFn: () => sdk["playground"]["lifecycle"]["list-events"](input)
|
|
47
|
+
});
|
|
48
|
+
var playgroundWebhookGetLastQueryOptions = (sdk, input) => ({
|
|
49
|
+
queryKey: ["playground", "webhook", "get-last", input],
|
|
50
|
+
queryFn: () => sdk["playground"]["webhook"]["get-last"](input)
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// src/gen/playground/connect.gen.ts
|
|
54
|
+
var playgroundWsEchoConnect = (sdk, input) => sdk.openStream(wsBindings["playground"]["ws"]["echo"], input);
|
|
55
|
+
|
|
56
|
+
export { playgroundAnalyticsOverviewQueryOptions, playgroundBillingEntitlementsQueryOptions, playgroundBillingRecordUsageMutationOptions, playgroundClickupCreateTaskMutationOptions, playgroundClickupGetLastWebhookQueryOptions, playgroundClickupGetOverviewQueryOptions, playgroundGdriveGetLastChangeQueryOptions, playgroundGdriveReadFileQueryOptions, playgroundGoogleadsReadCustomerQueryOptions, playgroundLifecycleGetStateQueryOptions, playgroundLifecycleListEventsQueryOptions, playgroundWebhookGetLastQueryOptions, playgroundWsEchoConnect };
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
58
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/gen/playground/queryOptions.gen.ts","../../src/gen/playground/connect.gen.ts"],"names":[],"mappings":";;;AA2BO,IAAM,uCAAA,GAA0C,CAAC,GAAA,EAAsB,KAAA,MAA6C;AAAA,EACzH,QAAA,EAAU,CAAC,YAAA,EAAc,WAAA,EAAa,YAAY,KAAK,CAAA;AAAA,EACvD,OAAA,EAAS,MAAM,GAAA,CAAI,YAAY,EAAE,WAAW,CAAA,CAAE,UAAU,CAAA,CAAE,KAAK;AACjE,CAAA;AAEO,IAAM,yCAAA,GAA4C,CAAC,GAAA,EAAsB,KAAA,MAA+C;AAAA,EAC7H,QAAA,EAAU,CAAC,YAAA,EAAc,SAAA,EAAW,gBAAgB,KAAK,CAAA;AAAA,EACzD,OAAA,EAAS,MAAM,GAAA,CAAI,YAAY,EAAE,SAAS,CAAA,CAAE,cAAc,CAAA,CAAE,KAAK;AACnE,CAAA;AAEO,IAAM,2CAAA,GAA8C,CAAC,GAAA,MAA0B;AAAA,EACpF,WAAA,EAAa,CAAC,YAAA,EAAc,SAAA,EAAW,cAAc,CAAA;AAAA,EACrD,UAAA,EAAY,CAAC,KAAA,KAA6C,GAAA,CAAI,YAAY,EAAE,SAAS,CAAA,CAAE,cAAc,CAAA,CAAE,KAAK;AAC9G,CAAA;AAEO,IAAM,0CAAA,GAA6C,CAAC,GAAA,MAA0B;AAAA,EACnF,WAAA,EAAa,CAAC,YAAA,EAAc,SAAA,EAAW,aAAa,CAAA;AAAA,EACpD,UAAA,EAAY,CAAC,KAAA,KAA4C,GAAA,CAAI,YAAY,EAAE,SAAS,CAAA,CAAE,aAAa,CAAA,CAAE,KAAK;AAC5G,CAAA;AAEO,IAAM,2CAAA,GAA8C,CAAC,GAAA,EAAsB,KAAA,MAAiD;AAAA,EACjI,QAAA,EAAU,CAAC,YAAA,EAAc,SAAA,EAAW,oBAAoB,KAAK,CAAA;AAAA,EAC7D,OAAA,EAAS,MAAM,GAAA,CAAI,YAAY,EAAE,SAAS,CAAA,CAAE,kBAAkB,CAAA,CAAE,KAAK;AACvE,CAAA;AAEO,IAAM,wCAAA,GAA2C,CAAC,GAAA,EAAsB,KAAA,MAA8C;AAAA,EAC3H,QAAA,EAAU,CAAC,YAAA,EAAc,SAAA,EAAW,gBAAgB,KAAK,CAAA;AAAA,EACzD,OAAA,EAAS,MAAM,GAAA,CAAI,YAAY,EAAE,SAAS,CAAA,CAAE,cAAc,CAAA,CAAE,KAAK;AACnE,CAAA;AAEO,IAAM,yCAAA,GAA4C,CAAC,GAAA,EAAsB,KAAA,MAA+C;AAAA,EAC7H,QAAA,EAAU,CAAC,YAAA,EAAc,QAAA,EAAU,mBAAmB,KAAK,CAAA;AAAA,EAC3D,OAAA,EAAS,MAAM,GAAA,CAAI,YAAY,EAAE,QAAQ,CAAA,CAAE,iBAAiB,CAAA,CAAE,KAAK;AACrE,CAAA;AAEO,IAAM,oCAAA,GAAuC,CAAC,GAAA,EAAsB,KAAA,MAA0C;AAAA,EACnH,QAAA,EAAU,CAAC,YAAA,EAAc,QAAA,EAAU,aAAa,KAAK,CAAA;AAAA,EACrD,OAAA,EAAS,MAAM,GAAA,CAAI,YAAY,EAAE,QAAQ,CAAA,CAAE,WAAW,CAAA,CAAE,KAAK;AAC/D,CAAA;AAEO,IAAM,2CAAA,GAA8C,CAAC,GAAA,EAAsB,KAAA,MAAiD;AAAA,EACjI,QAAA,EAAU,CAAC,YAAA,EAAc,WAAA,EAAa,iBAAiB,KAAK,CAAA;AAAA,EAC5D,OAAA,EAAS,MAAM,GAAA,CAAI,YAAY,EAAE,WAAW,CAAA,CAAE,eAAe,CAAA,CAAE,KAAK;AACtE,CAAA;AAEO,IAAM,uCAAA,GAA0C,CAAC,GAAA,EAAsB,KAAA,MAA6C;AAAA,EACzH,QAAA,EAAU,CAAC,YAAA,EAAc,WAAA,EAAa,aAAa,KAAK,CAAA;AAAA,EACxD,OAAA,EAAS,MAAM,GAAA,CAAI,YAAY,EAAE,WAAW,CAAA,CAAE,WAAW,CAAA,CAAE,KAAK;AAClE,CAAA;AAEO,IAAM,yCAAA,GAA4C,CAAC,GAAA,EAAsB,KAAA,MAA+C;AAAA,EAC7H,QAAA,EAAU,CAAC,YAAA,EAAc,WAAA,EAAa,eAAe,KAAK,CAAA;AAAA,EAC1D,OAAA,EAAS,MAAM,GAAA,CAAI,YAAY,EAAE,WAAW,CAAA,CAAE,aAAa,CAAA,CAAE,KAAK;AACpE,CAAA;AAEO,IAAM,oCAAA,GAAuC,CAAC,GAAA,EAAsB,KAAA,MAA0C;AAAA,EACnH,QAAA,EAAU,CAAC,YAAA,EAAc,SAAA,EAAW,YAAY,KAAK,CAAA;AAAA,EACrD,OAAA,EAAS,MAAM,GAAA,CAAI,YAAY,EAAE,SAAS,CAAA,CAAE,UAAU,CAAA,CAAE,KAAK;AAC/D,CAAA;;;AC9EO,IAAM,uBAAA,GAA0B,CAAC,GAAA,EAAyB,KAAA,KAC/D,GAAA,CAAI,UAAA,CAAW,UAAA,CAAW,YAAY,CAAA,CAAG,IAAI,CAAA,CAAG,MAAM,GAAI,KAAgC","file":"index.js","sourcesContent":["// AUTOGENERATED by scripts/generate.ts — do not edit.\nimport type { GeneratedClient } from '../client.gen';\nimport type {\n PlaygroundAnalyticsOverviewInput,\n PlaygroundAnalyticsOverviewOutput,\n PlaygroundBillingEntitlementsInput,\n PlaygroundBillingEntitlementsOutput,\n PlaygroundBillingRecordUsageInput,\n PlaygroundClickupCreateTaskInput,\n PlaygroundClickupGetLastWebhookInput,\n PlaygroundClickupGetLastWebhookOutput,\n PlaygroundClickupGetOverviewInput,\n PlaygroundClickupGetOverviewOutput,\n PlaygroundGdriveGetLastChangeInput,\n PlaygroundGdriveGetLastChangeOutput,\n PlaygroundGdriveReadFileInput,\n PlaygroundGdriveReadFileOutput,\n PlaygroundGoogleadsReadCustomerInput,\n PlaygroundGoogleadsReadCustomerOutput,\n PlaygroundLifecycleGetStateInput,\n PlaygroundLifecycleGetStateOutput,\n PlaygroundLifecycleListEventsInput,\n PlaygroundLifecycleListEventsOutput,\n PlaygroundWebhookGetLastInput,\n PlaygroundWebhookGetLastOutput,\n} from '../types.gen';\n\nexport const playgroundAnalyticsOverviewQueryOptions = (sdk: GeneratedClient, input: PlaygroundAnalyticsOverviewInput) => ({\n queryKey: ['playground', 'analytics', 'overview', input] as const,\n queryFn: () => sdk['playground']['analytics']['overview'](input),\n});\n\nexport const playgroundBillingEntitlementsQueryOptions = (sdk: GeneratedClient, input: PlaygroundBillingEntitlementsInput) => ({\n queryKey: ['playground', 'billing', 'entitlements', input] as const,\n queryFn: () => sdk['playground']['billing']['entitlements'](input),\n});\n\nexport const playgroundBillingRecordUsageMutationOptions = (sdk: GeneratedClient) => ({\n mutationKey: ['playground', 'billing', 'record-usage'],\n mutationFn: (input: PlaygroundBillingRecordUsageInput) => sdk['playground']['billing']['record-usage'](input),\n});\n\nexport const playgroundClickupCreateTaskMutationOptions = (sdk: GeneratedClient) => ({\n mutationKey: ['playground', 'clickup', 'create-task'],\n mutationFn: (input: PlaygroundClickupCreateTaskInput) => sdk['playground']['clickup']['create-task'](input),\n});\n\nexport const playgroundClickupGetLastWebhookQueryOptions = (sdk: GeneratedClient, input: PlaygroundClickupGetLastWebhookInput) => ({\n queryKey: ['playground', 'clickup', 'get-last-webhook', input] as const,\n queryFn: () => sdk['playground']['clickup']['get-last-webhook'](input),\n});\n\nexport const playgroundClickupGetOverviewQueryOptions = (sdk: GeneratedClient, input: PlaygroundClickupGetOverviewInput) => ({\n queryKey: ['playground', 'clickup', 'get-overview', input] as const,\n queryFn: () => sdk['playground']['clickup']['get-overview'](input),\n});\n\nexport const playgroundGdriveGetLastChangeQueryOptions = (sdk: GeneratedClient, input: PlaygroundGdriveGetLastChangeInput) => ({\n queryKey: ['playground', 'gdrive', 'get-last-change', input] as const,\n queryFn: () => sdk['playground']['gdrive']['get-last-change'](input),\n});\n\nexport const playgroundGdriveReadFileQueryOptions = (sdk: GeneratedClient, input: PlaygroundGdriveReadFileInput) => ({\n queryKey: ['playground', 'gdrive', 'read-file', input] as const,\n queryFn: () => sdk['playground']['gdrive']['read-file'](input),\n});\n\nexport const playgroundGoogleadsReadCustomerQueryOptions = (sdk: GeneratedClient, input: PlaygroundGoogleadsReadCustomerInput) => ({\n queryKey: ['playground', 'googleads', 'read-customer', input] as const,\n queryFn: () => sdk['playground']['googleads']['read-customer'](input),\n});\n\nexport const playgroundLifecycleGetStateQueryOptions = (sdk: GeneratedClient, input: PlaygroundLifecycleGetStateInput) => ({\n queryKey: ['playground', 'lifecycle', 'get-state', input] as const,\n queryFn: () => sdk['playground']['lifecycle']['get-state'](input),\n});\n\nexport const playgroundLifecycleListEventsQueryOptions = (sdk: GeneratedClient, input: PlaygroundLifecycleListEventsInput) => ({\n queryKey: ['playground', 'lifecycle', 'list-events', input] as const,\n queryFn: () => sdk['playground']['lifecycle']['list-events'](input),\n});\n\nexport const playgroundWebhookGetLastQueryOptions = (sdk: GeneratedClient, input: PlaygroundWebhookGetLastInput) => ({\n queryKey: ['playground', 'webhook', 'get-last', input] as const,\n queryFn: () => sdk['playground']['webhook']['get-last'](input),\n});\n","// AUTOGENERATED by scripts/generate.ts — do not edit.\nimport { wsBindings } from '../bindings.gen';\nimport type { LesslyStream, LesslyStreamOpener } from '../../runtime/types';\nimport type {\n PlaygroundWsEchoInput,\n} from '../types.gen';\n\nexport const playgroundWsEchoConnect = (sdk: LesslyStreamOpener, input: PlaygroundWsEchoInput): LesslyStream =>\n sdk.openStream(wsBindings['playground']!['ws']!['echo']!, input as Record<string, unknown>);\n"]}
|
package/docs/recipes/access.md
CHANGED
|
@@ -395,6 +395,23 @@ explanations. Keyboard reachability (below) is satisfied on the owning control,
|
|
|
395
395
|
and the elements themselves just go inert — `draggable={false}`, `readOnly`,
|
|
396
396
|
`disabled` — with no wrapper of their own.
|
|
397
397
|
|
|
398
|
+
Some surfaces have no such control. A calendar's Month/Week toggle owns the
|
|
399
|
+
*view*, not the move; a board's filter bar owns the filter, not the drop. Do not
|
|
400
|
+
hang the reason on it: the reason names the operation actually gated, and
|
|
401
|
+
`accessReason(app.content.publications.reschedule)` under a control that switches
|
|
402
|
+
weeks explains a gate that control does not hold. Where nothing owns the
|
|
403
|
+
capability, the reason goes on the **surface itself, as one `CardNote`** — the
|
|
404
|
+
same shape as a deferred-save form:
|
|
405
|
+
|
|
406
|
+
```tsx
|
|
407
|
+
<Card title="Schedule">
|
|
408
|
+
<Calendar events={events} draggable={false} />
|
|
409
|
+
{denied && <CardNote>{accessReason(app.content.publications.reschedule)}</CardNote>}
|
|
410
|
+
</Card>
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
One line for the surface, elements inert, no tooltip anywhere on the grid.
|
|
414
|
+
|
|
398
415
|
### Buttons that touch more than one operation
|
|
399
416
|
|
|
400
417
|
Two shapes, and they gate differently. Get this wrong and you either grey out a
|
|
@@ -458,6 +475,25 @@ eventually send. Two failure modes, and both are common:
|
|
|
458
475
|
So: gate the staging control on the staged operation *unless* the upstream
|
|
459
476
|
control is already gated on the same one.
|
|
460
477
|
|
|
478
|
+
A surface-level `CardNote` counts as that upstream gate. If the card already
|
|
479
|
+
carries `accessReason` for the *same* operation, its staging controls are not
|
|
480
|
+
gated on it a second time: the reader has met the sentence before starting, and
|
|
481
|
+
N repetitions of it explain nothing the one line did not.
|
|
482
|
+
|
|
483
|
+
What that removes is the **duplicate explanation, not the disabled state**. The
|
|
484
|
+
staging or submit button stays `disabled` — with no tooltip of its own, because
|
|
485
|
+
the `CardNote` is the explanation — while the draft's own fields and switches
|
|
486
|
+
stay editable (they send nothing; see below). Never re-enable the button
|
|
487
|
+
"because the gateway will refuse anyway": that is precisely the case this rule
|
|
488
|
+
exists against, the caller doing the whole job and meeting the refusal at the end.
|
|
489
|
+
|
|
490
|
+
And gate only what actually writes. Parsing a pasted CSV, rendering a preview,
|
|
491
|
+
editing a local draft — anything that calls no SDK method — is **reading**, and
|
|
492
|
+
gating it is forbidden: it costs the caller a capability nobody denied them.
|
|
493
|
+
This rule covers the control after which a user without the right would reach
|
|
494
|
+
the refusal having already done the work, with no explanation before it. A
|
|
495
|
+
preview they can look at and discard is not that control.
|
|
496
|
+
|
|
461
497
|
### Forms with a deferred save
|
|
462
498
|
|
|
463
499
|
A form the reader fills in and *then* saves is the one case where a hint per
|
|
@@ -552,6 +588,38 @@ frequent and not the user's mistake. Painting it as a crash teaches people to
|
|
|
552
588
|
ignore the colour you need for real failures.
|
|
553
589
|
|
|
554
590
|
|
|
591
|
+
### State keeps the error OBJECT, not its message
|
|
592
|
+
|
|
593
|
+
A refusal is only classifiable while it is still an object. The moment a reducer,
|
|
594
|
+
a queue item or a store slice flattens it to a string — `error: errorMessage(err)`,
|
|
595
|
+
`error: err.message`, `` error: `Upload failed: ${err}` `` — `isAccessDenied` has
|
|
596
|
+
nothing left to read, and a denial by role arrives red from a file that has no
|
|
597
|
+
render site at all. Sweeping your render sites never finds it: the classification
|
|
598
|
+
was lost upstream, in state.
|
|
599
|
+
|
|
600
|
+
So state holds `unknown`, and exactly one shared component classifies it:
|
|
601
|
+
|
|
602
|
+
```tsx
|
|
603
|
+
// before — the refusal is a string by the time anything renders it
|
|
604
|
+
type UploadItem = { id: string; error: string };
|
|
605
|
+
dispatch({ type: 'failed', id, error: errorMessage(err) });
|
|
606
|
+
{item.error && <ErrorState>{item.error}</ErrorState>} // always red
|
|
607
|
+
|
|
608
|
+
// after — the object survives; one component decides the words and the tone
|
|
609
|
+
type UploadItem = { id: string; error: unknown };
|
|
610
|
+
dispatch({ type: 'failed', id, error: err });
|
|
611
|
+
{item.error && <RequestError error={item.error} />} // isAccessDenied → neutral
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
`RequestError` is the same classifier as your shared query state — it calls
|
|
615
|
+
`isAccessDenied(error)` and renders the neutral sentence for a denial, red only
|
|
616
|
+
for everything else. Write it once; give every error in the App one way out.
|
|
617
|
+
|
|
618
|
+
When you audit an App for this, do not comb the render sites. Comb the **state**:
|
|
619
|
+
every reducer, every queue, every store slice, every `useState` whose type says
|
|
620
|
+
`string | null` where an error goes. Content shipped this bug twice — an upload
|
|
621
|
+
queue and a calendar — and both were invisible to a review of the screens.
|
|
622
|
+
|
|
555
623
|
### A refusal inside the kit's `ConfirmDialog`
|
|
556
624
|
|
|
557
625
|
`ConfirmDialog` takes `onError?: (error: unknown) => string` — a string, and the
|
|
@@ -668,4 +736,8 @@ itself with a `role_denied` body (the neutral empty state, not the red one).
|
|
|
668
736
|
| Leave a drag handle or inline edit ungated because it has no button | It is the same write. Set the native inactive state and wrap it. Skipping the gate is a spec'd exception, not a default. |
|
|
669
737
|
| Name the headline operation on a multi-operation button | Name the level and key of the operation that actually blocked it. |
|
|
670
738
|
| Put the reason in a native `title=` on the control | `disabled:pointer-events-none` swallows the hover, and a native tooltip is unreachable by keyboard and by touch. Wrap the control in a `TooltipTrigger`. |
|
|
739
|
+
| Hang a surface's reason on a control that owns a different action | The reason must name the operation actually gated. No owning control means one `CardNote` on the surface. |
|
|
740
|
+
| Gate a staging control the surface's `CardNote` already explains | One explanation for the same operation, not N. |
|
|
741
|
+
| Gate a parse, a preview or a local draft | Nothing is sent, so nothing can be refused. Gating reading takes a capability nobody denied. |
|
|
742
|
+
| Store an error as a string in a reducer, queue or store | `isAccessDenied` needs the object. A flattened refusal arrives red from a file with no render site. |
|
|
671
743
|
| Disable a control because `state === 'error'` | Nothing is known about the role. Stay enabled, say nothing about the role, let the gateway answer. |
|
package/docs/rules.md
CHANGED
|
@@ -405,12 +405,33 @@ wrappers are thirty extra tab stops and one sentence thirty times, not thirty
|
|
|
405
405
|
explanations. Keyboard reachability is satisfied on the owning control; the
|
|
406
406
|
elements themselves just go inert.
|
|
407
407
|
|
|
408
|
+
Where NO control owns the capability — a calendar whose Month/Week toggle owns
|
|
409
|
+
the view and not the move — the App MUST NOT hang the reason on a control that
|
|
410
|
+
owns a DIFFERENT action: the reason names the operation actually gated, and a
|
|
411
|
+
level and key under a week switcher describe a gate that switcher does not hold.
|
|
412
|
+
It MUST instead render ONE `CardNote` with `accessReason(op)` on the surface
|
|
413
|
+
itself, with the elements left in their inactive state (`draggable={false}`) and
|
|
414
|
+
no tooltip among them.
|
|
415
|
+
|
|
408
416
|
A control that STAGES a change — it writes nothing itself, the write is sent
|
|
409
417
|
later by a Save or an Apply — MUST be gated on the operation the staged change
|
|
410
418
|
will send, UNLESS the upstream control that reaches it is already gated on that
|
|
411
419
|
same operation. Never on nothing (the caller does the work and meets the refusal
|
|
412
420
|
later, somewhere else) and never twice in a row.
|
|
413
421
|
|
|
422
|
+
A surface `CardNote` carrying `accessReason` of that SAME operation IS such an
|
|
423
|
+
upstream gate: the staging controls under it MUST NOT be gated again — one
|
|
424
|
+
explanation, not N. What drops is the DUPLICATE EXPLANATION, not the disabled
|
|
425
|
+
state: the staging or submit control stays disabled and carries no tooltip of its
|
|
426
|
+
own (the `CardNote` speaks for it), while the draft's fields and switches stay
|
|
427
|
+
editable. An App MUST NOT re-enable that control "because the gateway will
|
|
428
|
+
refuse" — that is the exact scenario this rule exists against.
|
|
429
|
+
|
|
430
|
+
Anything that sends NOTHING — parsing an upload, rendering a preview, editing a
|
|
431
|
+
local draft — is reading, and the App MUST NOT gate it. This rule reaches only
|
|
432
|
+
the control after which a caller without the right would meet the refusal having
|
|
433
|
+
already done the work and with no explanation before it.
|
|
434
|
+
|
|
414
435
|
A control that performs SEVERAL operations per click is disabled if ANY of them
|
|
415
436
|
is denied. A DISPATCHER control — one operation per click, selected by a mode or
|
|
416
437
|
a switch — MUST instead be gated on the operation it is about to call, and name
|
|
@@ -466,6 +487,14 @@ Two failure modes are worth naming, because both ship regularly:
|
|
|
466
487
|
reason (`role_denied`, `operation_uncatalogued`, `no_tool_permission`) and
|
|
467
488
|
false for every other 403 — a `tenant_blocked` is not a permission problem.
|
|
468
489
|
|
|
490
|
+
State MUST keep the error OBJECT, never a string derived from it. A reducer, a
|
|
491
|
+
queue item or a store slice typed `error: string` has thrown away the only thing
|
|
492
|
+
`isAccessDenied` can read, so a refusal by role arrives red out of a file that
|
|
493
|
+
has no render site at all — and a sweep of render sites never finds it. State
|
|
494
|
+
holds `unknown`; ONE shared component classifies it (`isAccessDenied` → the
|
|
495
|
+
neutral sentence, red for everything else). Audit the reducers, queues and
|
|
496
|
+
stores, not the screens.
|
|
497
|
+
|
|
469
498
|
Pass the generated method rather than a hand-written tool id
|
|
470
499
|
(`app.access.can(app.mail.domain.create)`): the accessor path is a lossy view
|
|
471
500
|
of the tool id, so a literal string can silently drift from the call it gates.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lessly/sdk-app",
|
|
3
|
-
"version": "63.2.
|
|
3
|
+
"version": "63.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"engines": {
|
|
@@ -148,6 +148,16 @@
|
|
|
148
148
|
"default": "./dist/organization/index.cjs"
|
|
149
149
|
}
|
|
150
150
|
},
|
|
151
|
+
"./playground": {
|
|
152
|
+
"import": {
|
|
153
|
+
"types": "./dist/playground/index.d.ts",
|
|
154
|
+
"default": "./dist/playground/index.js"
|
|
155
|
+
},
|
|
156
|
+
"require": {
|
|
157
|
+
"types": "./dist/playground/index.d.cts",
|
|
158
|
+
"default": "./dist/playground/index.cjs"
|
|
159
|
+
}
|
|
160
|
+
},
|
|
151
161
|
"./realtime": {
|
|
152
162
|
"import": {
|
|
153
163
|
"types": "./dist/realtime/index.d.ts",
|
|
@@ -199,5 +209,5 @@
|
|
|
199
209
|
}
|
|
200
210
|
}
|
|
201
211
|
},
|
|
202
|
-
"sdkContentHash": "sha256:
|
|
212
|
+
"sdkContentHash": "sha256:965d6441024647f1461d4e50bedeba9d79dca805ea4668ca8c9ecedefc1c0d0a"
|
|
203
213
|
}
|
package/src/gen/bindings.gen.ts
CHANGED
|
@@ -7116,6 +7116,134 @@ export const bindings: BindingsMap = {
|
|
|
7116
7116
|
}
|
|
7117
7117
|
}
|
|
7118
7118
|
},
|
|
7119
|
+
"playground": {
|
|
7120
|
+
"analytics": {
|
|
7121
|
+
"overview": {
|
|
7122
|
+
"level": "read",
|
|
7123
|
+
"method": "POST",
|
|
7124
|
+
"operationKey": "playground_analytics_overview",
|
|
7125
|
+
"params": [
|
|
7126
|
+
{
|
|
7127
|
+
"in": "body",
|
|
7128
|
+
"name": "limit"
|
|
7129
|
+
}
|
|
7130
|
+
],
|
|
7131
|
+
"path": "/playground/analytics/overview",
|
|
7132
|
+
"readOnly": true
|
|
7133
|
+
}
|
|
7134
|
+
},
|
|
7135
|
+
"billing": {
|
|
7136
|
+
"entitlements": {
|
|
7137
|
+
"level": "read",
|
|
7138
|
+
"method": "POST",
|
|
7139
|
+
"operationKey": "playground_billing_entitlements",
|
|
7140
|
+
"path": "/playground/billing/entitlements",
|
|
7141
|
+
"readOnly": true
|
|
7142
|
+
},
|
|
7143
|
+
"record-usage": {
|
|
7144
|
+
"level": "write",
|
|
7145
|
+
"method": "POST",
|
|
7146
|
+
"operationKey": "playground_billing_record-usage",
|
|
7147
|
+
"params": [
|
|
7148
|
+
{
|
|
7149
|
+
"in": "body",
|
|
7150
|
+
"name": "value"
|
|
7151
|
+
}
|
|
7152
|
+
],
|
|
7153
|
+
"path": "/playground/billing/usage",
|
|
7154
|
+
"readOnly": false
|
|
7155
|
+
}
|
|
7156
|
+
},
|
|
7157
|
+
"clickup": {
|
|
7158
|
+
"create-task": {
|
|
7159
|
+
"level": "write",
|
|
7160
|
+
"method": "POST",
|
|
7161
|
+
"operationKey": "playground_clickup_create-task",
|
|
7162
|
+
"params": [
|
|
7163
|
+
{
|
|
7164
|
+
"in": "body",
|
|
7165
|
+
"name": "listId"
|
|
7166
|
+
},
|
|
7167
|
+
{
|
|
7168
|
+
"in": "body",
|
|
7169
|
+
"name": "name"
|
|
7170
|
+
}
|
|
7171
|
+
],
|
|
7172
|
+
"path": "/playground/clickup/tasks",
|
|
7173
|
+
"readOnly": false
|
|
7174
|
+
},
|
|
7175
|
+
"get-last-webhook": {
|
|
7176
|
+
"level": "read",
|
|
7177
|
+
"method": "GET",
|
|
7178
|
+
"operationKey": "playground_clickup_get-last-webhook",
|
|
7179
|
+
"path": "/playground/clickup/webhooks/last",
|
|
7180
|
+
"readOnly": true
|
|
7181
|
+
},
|
|
7182
|
+
"get-overview": {
|
|
7183
|
+
"level": "read",
|
|
7184
|
+
"method": "GET",
|
|
7185
|
+
"operationKey": "playground_clickup_get-overview",
|
|
7186
|
+
"path": "/playground/clickup/overview",
|
|
7187
|
+
"readOnly": true
|
|
7188
|
+
}
|
|
7189
|
+
},
|
|
7190
|
+
"gdrive": {
|
|
7191
|
+
"get-last-change": {
|
|
7192
|
+
"level": "read",
|
|
7193
|
+
"method": "GET",
|
|
7194
|
+
"operationKey": "playground_gdrive_get-last-change",
|
|
7195
|
+
"path": "/playground/gdrive/changes/last",
|
|
7196
|
+
"readOnly": true
|
|
7197
|
+
},
|
|
7198
|
+
"read-file": {
|
|
7199
|
+
"level": "read",
|
|
7200
|
+
"method": "POST",
|
|
7201
|
+
"operationKey": "playground_gdrive_read-file",
|
|
7202
|
+
"params": [
|
|
7203
|
+
{
|
|
7204
|
+
"in": "body",
|
|
7205
|
+
"name": "fileId"
|
|
7206
|
+
}
|
|
7207
|
+
],
|
|
7208
|
+
"path": "/playground/gdrive/file",
|
|
7209
|
+
"readOnly": true
|
|
7210
|
+
}
|
|
7211
|
+
},
|
|
7212
|
+
"googleads": {
|
|
7213
|
+
"read-customer": {
|
|
7214
|
+
"level": "read",
|
|
7215
|
+
"method": "POST",
|
|
7216
|
+
"operationKey": "playground_googleads_read-customer",
|
|
7217
|
+
"path": "/playground/googleads/customer",
|
|
7218
|
+
"readOnly": true
|
|
7219
|
+
}
|
|
7220
|
+
},
|
|
7221
|
+
"lifecycle": {
|
|
7222
|
+
"get-state": {
|
|
7223
|
+
"level": "read",
|
|
7224
|
+
"method": "GET",
|
|
7225
|
+
"operationKey": "playground_lifecycle_get-state",
|
|
7226
|
+
"path": "/playground/lifecycle/state",
|
|
7227
|
+
"readOnly": true
|
|
7228
|
+
},
|
|
7229
|
+
"list-events": {
|
|
7230
|
+
"level": "read",
|
|
7231
|
+
"method": "GET",
|
|
7232
|
+
"operationKey": "playground_lifecycle_list-events",
|
|
7233
|
+
"path": "/playground/lifecycle/events",
|
|
7234
|
+
"readOnly": true
|
|
7235
|
+
}
|
|
7236
|
+
},
|
|
7237
|
+
"webhook": {
|
|
7238
|
+
"get-last": {
|
|
7239
|
+
"level": "read",
|
|
7240
|
+
"method": "GET",
|
|
7241
|
+
"operationKey": "playground_webhook_get-last",
|
|
7242
|
+
"path": "/playground/webhooks/last",
|
|
7243
|
+
"readOnly": true
|
|
7244
|
+
}
|
|
7245
|
+
}
|
|
7246
|
+
},
|
|
7119
7247
|
"realtime": {
|
|
7120
7248
|
"archive": {
|
|
7121
7249
|
"export": {
|
|
@@ -10297,4 +10425,12 @@ export const bindings: BindingsMap = {
|
|
|
10297
10425
|
}
|
|
10298
10426
|
};
|
|
10299
10427
|
|
|
10300
|
-
export const wsBindings: WsBindingsMap = {
|
|
10428
|
+
export const wsBindings: WsBindingsMap = {
|
|
10429
|
+
"playground": {
|
|
10430
|
+
"ws": {
|
|
10431
|
+
"echo": {
|
|
10432
|
+
"path": "/playground/ws/echo"
|
|
10433
|
+
}
|
|
10434
|
+
}
|
|
10435
|
+
}
|
|
10436
|
+
};
|
package/src/gen/client.gen.ts
CHANGED
|
@@ -769,6 +769,30 @@ import type {
|
|
|
769
769
|
OrganizationXInstallOutput,
|
|
770
770
|
OrganizationYoutubeInstallInput,
|
|
771
771
|
OrganizationYoutubeInstallOutput,
|
|
772
|
+
PlaygroundAnalyticsOverviewInput,
|
|
773
|
+
PlaygroundAnalyticsOverviewOutput,
|
|
774
|
+
PlaygroundBillingEntitlementsInput,
|
|
775
|
+
PlaygroundBillingEntitlementsOutput,
|
|
776
|
+
PlaygroundBillingRecordUsageInput,
|
|
777
|
+
PlaygroundBillingRecordUsageOutput,
|
|
778
|
+
PlaygroundClickupCreateTaskInput,
|
|
779
|
+
PlaygroundClickupCreateTaskOutput,
|
|
780
|
+
PlaygroundClickupGetLastWebhookInput,
|
|
781
|
+
PlaygroundClickupGetLastWebhookOutput,
|
|
782
|
+
PlaygroundClickupGetOverviewInput,
|
|
783
|
+
PlaygroundClickupGetOverviewOutput,
|
|
784
|
+
PlaygroundGdriveGetLastChangeInput,
|
|
785
|
+
PlaygroundGdriveGetLastChangeOutput,
|
|
786
|
+
PlaygroundGdriveReadFileInput,
|
|
787
|
+
PlaygroundGdriveReadFileOutput,
|
|
788
|
+
PlaygroundGoogleadsReadCustomerInput,
|
|
789
|
+
PlaygroundGoogleadsReadCustomerOutput,
|
|
790
|
+
PlaygroundLifecycleGetStateInput,
|
|
791
|
+
PlaygroundLifecycleGetStateOutput,
|
|
792
|
+
PlaygroundLifecycleListEventsInput,
|
|
793
|
+
PlaygroundLifecycleListEventsOutput,
|
|
794
|
+
PlaygroundWebhookGetLastInput,
|
|
795
|
+
PlaygroundWebhookGetLastOutput,
|
|
772
796
|
RealtimeArchiveExportInput,
|
|
773
797
|
RealtimeArchiveExportOutput,
|
|
774
798
|
RealtimeArchiveExportStatusInput,
|
|
@@ -1778,6 +1802,34 @@ export interface GeneratedClient {
|
|
|
1778
1802
|
install: ((input: OrganizationYoutubeInstallInput) => Promise<OrganizationYoutubeInstallOutput>) & Operation;
|
|
1779
1803
|
};
|
|
1780
1804
|
};
|
|
1805
|
+
playground: {
|
|
1806
|
+
analytics: {
|
|
1807
|
+
overview: ((input: PlaygroundAnalyticsOverviewInput) => Promise<PlaygroundAnalyticsOverviewOutput>) & Operation;
|
|
1808
|
+
};
|
|
1809
|
+
billing: {
|
|
1810
|
+
entitlements: ((input: PlaygroundBillingEntitlementsInput) => Promise<PlaygroundBillingEntitlementsOutput>) & Operation;
|
|
1811
|
+
'record-usage': ((input: PlaygroundBillingRecordUsageInput) => Promise<PlaygroundBillingRecordUsageOutput>) & Operation;
|
|
1812
|
+
};
|
|
1813
|
+
clickup: {
|
|
1814
|
+
'create-task': ((input: PlaygroundClickupCreateTaskInput) => Promise<PlaygroundClickupCreateTaskOutput>) & Operation;
|
|
1815
|
+
'get-last-webhook': ((input: PlaygroundClickupGetLastWebhookInput) => Promise<PlaygroundClickupGetLastWebhookOutput>) & Operation;
|
|
1816
|
+
'get-overview': ((input: PlaygroundClickupGetOverviewInput) => Promise<PlaygroundClickupGetOverviewOutput>) & Operation;
|
|
1817
|
+
};
|
|
1818
|
+
gdrive: {
|
|
1819
|
+
'get-last-change': ((input: PlaygroundGdriveGetLastChangeInput) => Promise<PlaygroundGdriveGetLastChangeOutput>) & Operation;
|
|
1820
|
+
'read-file': ((input: PlaygroundGdriveReadFileInput) => Promise<PlaygroundGdriveReadFileOutput>) & Operation;
|
|
1821
|
+
};
|
|
1822
|
+
googleads: {
|
|
1823
|
+
'read-customer': ((input: PlaygroundGoogleadsReadCustomerInput) => Promise<PlaygroundGoogleadsReadCustomerOutput>) & Operation;
|
|
1824
|
+
};
|
|
1825
|
+
lifecycle: {
|
|
1826
|
+
'get-state': ((input: PlaygroundLifecycleGetStateInput) => Promise<PlaygroundLifecycleGetStateOutput>) & Operation;
|
|
1827
|
+
'list-events': ((input: PlaygroundLifecycleListEventsInput) => Promise<PlaygroundLifecycleListEventsOutput>) & Operation;
|
|
1828
|
+
};
|
|
1829
|
+
webhook: {
|
|
1830
|
+
'get-last': ((input: PlaygroundWebhookGetLastInput) => Promise<PlaygroundWebhookGetLastOutput>) & Operation;
|
|
1831
|
+
};
|
|
1832
|
+
};
|
|
1781
1833
|
realtime: {
|
|
1782
1834
|
archive: {
|
|
1783
1835
|
export: ((input: RealtimeArchiveExportInput) => Promise<RealtimeArchiveExportOutput>) & Operation;
|
package/src/gen/manifest.gen.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// AUTOGENERATED by scripts/generate.ts — do not edit.
|
|
2
2
|
import type { ToolLevel } from '../runtime/types';
|
|
3
3
|
|
|
4
|
-
export const namespaces = ['analytics', 'brain', 'consent', 'content', 'deployment', 'mail', 'observe', 'organization', 'realtime', 'support', 'tracking', 'users', 'waitlist'] as const;
|
|
4
|
+
export const namespaces = ['analytics', 'brain', 'consent', 'content', 'deployment', 'mail', 'observe', 'organization', 'playground', 'realtime', 'support', 'tracking', 'users', 'waitlist'] as const;
|
|
5
5
|
|
|
6
6
|
export const operations: Record<string, ToolLevel> = {
|
|
7
7
|
'analytics_catalog_get': 'read',
|
|
@@ -388,6 +388,18 @@ export const operations: Record<string, ToolLevel> = {
|
|
|
388
388
|
'organization_support_threads_list': 'read',
|
|
389
389
|
'organization_x_install': 'read',
|
|
390
390
|
'organization_youtube_install': 'read',
|
|
391
|
+
'playground_analytics_overview': 'read',
|
|
392
|
+
'playground_billing_entitlements': 'read',
|
|
393
|
+
'playground_billing_record-usage': 'write',
|
|
394
|
+
'playground_clickup_create-task': 'write',
|
|
395
|
+
'playground_clickup_get-last-webhook': 'read',
|
|
396
|
+
'playground_clickup_get-overview': 'read',
|
|
397
|
+
'playground_gdrive_get-last-change': 'read',
|
|
398
|
+
'playground_gdrive_read-file': 'read',
|
|
399
|
+
'playground_googleads_read-customer': 'read',
|
|
400
|
+
'playground_lifecycle_get-state': 'read',
|
|
401
|
+
'playground_lifecycle_list-events': 'read',
|
|
402
|
+
'playground_webhook_get-last': 'read',
|
|
391
403
|
'realtime_archive_export': 'admin',
|
|
392
404
|
'realtime_archive_export_status': 'read',
|
|
393
405
|
'realtime_archive_get': 'read',
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// AUTOGENERATED by scripts/generate.ts — do not edit.
|
|
2
|
+
import { wsBindings } from '../bindings.gen';
|
|
3
|
+
import type { LesslyStream, LesslyStreamOpener } from '../../runtime/types';
|
|
4
|
+
import type {
|
|
5
|
+
PlaygroundWsEchoInput,
|
|
6
|
+
} from '../types.gen';
|
|
7
|
+
|
|
8
|
+
export const playgroundWsEchoConnect = (sdk: LesslyStreamOpener, input: PlaygroundWsEchoInput): LesslyStream =>
|
|
9
|
+
sdk.openStream(wsBindings['playground']!['ws']!['echo']!, input as Record<string, unknown>);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// AUTOGENERATED by scripts/generate.ts — do not edit.
|
|
2
|
+
export * from './queryOptions.gen';
|
|
3
|
+
export * from './connect.gen';
|
|
4
|
+
export type { PlaygroundAnalyticsOverviewInput, PlaygroundAnalyticsOverviewOutput, PlaygroundBillingEntitlementsInput, PlaygroundBillingEntitlementsOutput, PlaygroundBillingRecordUsageInput, PlaygroundBillingRecordUsageOutput, PlaygroundClickupCreateTaskInput, PlaygroundClickupCreateTaskOutput, PlaygroundClickupGetLastWebhookInput, PlaygroundClickupGetLastWebhookOutput, PlaygroundClickupGetOverviewInput, PlaygroundClickupGetOverviewOutput, PlaygroundGdriveGetLastChangeInput, PlaygroundGdriveGetLastChangeOutput, PlaygroundGdriveReadFileInput, PlaygroundGdriveReadFileOutput, PlaygroundGoogleadsReadCustomerInput, PlaygroundGoogleadsReadCustomerOutput, PlaygroundLifecycleGetStateInput, PlaygroundLifecycleGetStateOutput, PlaygroundLifecycleListEventsInput, PlaygroundLifecycleListEventsOutput, PlaygroundWebhookGetLastInput, PlaygroundWebhookGetLastOutput, PlaygroundWsEchoInput } from '../types.gen';
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// AUTOGENERATED by scripts/generate.ts — do not edit.
|
|
2
|
+
import type { GeneratedClient } from '../client.gen';
|
|
3
|
+
import type {
|
|
4
|
+
PlaygroundAnalyticsOverviewInput,
|
|
5
|
+
PlaygroundAnalyticsOverviewOutput,
|
|
6
|
+
PlaygroundBillingEntitlementsInput,
|
|
7
|
+
PlaygroundBillingEntitlementsOutput,
|
|
8
|
+
PlaygroundBillingRecordUsageInput,
|
|
9
|
+
PlaygroundClickupCreateTaskInput,
|
|
10
|
+
PlaygroundClickupGetLastWebhookInput,
|
|
11
|
+
PlaygroundClickupGetLastWebhookOutput,
|
|
12
|
+
PlaygroundClickupGetOverviewInput,
|
|
13
|
+
PlaygroundClickupGetOverviewOutput,
|
|
14
|
+
PlaygroundGdriveGetLastChangeInput,
|
|
15
|
+
PlaygroundGdriveGetLastChangeOutput,
|
|
16
|
+
PlaygroundGdriveReadFileInput,
|
|
17
|
+
PlaygroundGdriveReadFileOutput,
|
|
18
|
+
PlaygroundGoogleadsReadCustomerInput,
|
|
19
|
+
PlaygroundGoogleadsReadCustomerOutput,
|
|
20
|
+
PlaygroundLifecycleGetStateInput,
|
|
21
|
+
PlaygroundLifecycleGetStateOutput,
|
|
22
|
+
PlaygroundLifecycleListEventsInput,
|
|
23
|
+
PlaygroundLifecycleListEventsOutput,
|
|
24
|
+
PlaygroundWebhookGetLastInput,
|
|
25
|
+
PlaygroundWebhookGetLastOutput,
|
|
26
|
+
} from '../types.gen';
|
|
27
|
+
|
|
28
|
+
export const playgroundAnalyticsOverviewQueryOptions = (sdk: GeneratedClient, input: PlaygroundAnalyticsOverviewInput) => ({
|
|
29
|
+
queryKey: ['playground', 'analytics', 'overview', input] as const,
|
|
30
|
+
queryFn: () => sdk['playground']['analytics']['overview'](input),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const playgroundBillingEntitlementsQueryOptions = (sdk: GeneratedClient, input: PlaygroundBillingEntitlementsInput) => ({
|
|
34
|
+
queryKey: ['playground', 'billing', 'entitlements', input] as const,
|
|
35
|
+
queryFn: () => sdk['playground']['billing']['entitlements'](input),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const playgroundBillingRecordUsageMutationOptions = (sdk: GeneratedClient) => ({
|
|
39
|
+
mutationKey: ['playground', 'billing', 'record-usage'],
|
|
40
|
+
mutationFn: (input: PlaygroundBillingRecordUsageInput) => sdk['playground']['billing']['record-usage'](input),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export const playgroundClickupCreateTaskMutationOptions = (sdk: GeneratedClient) => ({
|
|
44
|
+
mutationKey: ['playground', 'clickup', 'create-task'],
|
|
45
|
+
mutationFn: (input: PlaygroundClickupCreateTaskInput) => sdk['playground']['clickup']['create-task'](input),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export const playgroundClickupGetLastWebhookQueryOptions = (sdk: GeneratedClient, input: PlaygroundClickupGetLastWebhookInput) => ({
|
|
49
|
+
queryKey: ['playground', 'clickup', 'get-last-webhook', input] as const,
|
|
50
|
+
queryFn: () => sdk['playground']['clickup']['get-last-webhook'](input),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export const playgroundClickupGetOverviewQueryOptions = (sdk: GeneratedClient, input: PlaygroundClickupGetOverviewInput) => ({
|
|
54
|
+
queryKey: ['playground', 'clickup', 'get-overview', input] as const,
|
|
55
|
+
queryFn: () => sdk['playground']['clickup']['get-overview'](input),
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export const playgroundGdriveGetLastChangeQueryOptions = (sdk: GeneratedClient, input: PlaygroundGdriveGetLastChangeInput) => ({
|
|
59
|
+
queryKey: ['playground', 'gdrive', 'get-last-change', input] as const,
|
|
60
|
+
queryFn: () => sdk['playground']['gdrive']['get-last-change'](input),
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export const playgroundGdriveReadFileQueryOptions = (sdk: GeneratedClient, input: PlaygroundGdriveReadFileInput) => ({
|
|
64
|
+
queryKey: ['playground', 'gdrive', 'read-file', input] as const,
|
|
65
|
+
queryFn: () => sdk['playground']['gdrive']['read-file'](input),
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
export const playgroundGoogleadsReadCustomerQueryOptions = (sdk: GeneratedClient, input: PlaygroundGoogleadsReadCustomerInput) => ({
|
|
69
|
+
queryKey: ['playground', 'googleads', 'read-customer', input] as const,
|
|
70
|
+
queryFn: () => sdk['playground']['googleads']['read-customer'](input),
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export const playgroundLifecycleGetStateQueryOptions = (sdk: GeneratedClient, input: PlaygroundLifecycleGetStateInput) => ({
|
|
74
|
+
queryKey: ['playground', 'lifecycle', 'get-state', input] as const,
|
|
75
|
+
queryFn: () => sdk['playground']['lifecycle']['get-state'](input),
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
export const playgroundLifecycleListEventsQueryOptions = (sdk: GeneratedClient, input: PlaygroundLifecycleListEventsInput) => ({
|
|
79
|
+
queryKey: ['playground', 'lifecycle', 'list-events', input] as const,
|
|
80
|
+
queryFn: () => sdk['playground']['lifecycle']['list-events'](input),
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export const playgroundWebhookGetLastQueryOptions = (sdk: GeneratedClient, input: PlaygroundWebhookGetLastInput) => ({
|
|
84
|
+
queryKey: ['playground', 'webhook', 'get-last', input] as const,
|
|
85
|
+
queryFn: () => sdk['playground']['webhook']['get-last'](input),
|
|
86
|
+
});
|