@lessly/sdk-app 87.0.0 → 87.1.0

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/index.cjs CHANGED
@@ -35,11 +35,15 @@ function isAccessDenied(err) {
35
35
  }
36
36
 
37
37
  // src/runtime/csrf.ts
38
- var CSRF_COOKIE = "lessly_csrf";
38
+ var CSRF_COOKIES = ["lepsto_csrf", "lessly_csrf"];
39
39
  function readCsrfCookie() {
40
40
  if (typeof document === "undefined" || !document) return null;
41
- const match = document.cookie.match(new RegExp(`(?:^|; )${CSRF_COOKIE}=([^;]*)`));
42
- return match ? decodeURIComponent(match[1]) : null;
41
+ for (const name of CSRF_COOKIES) {
42
+ const match = document.cookie.match(new RegExp(`(?:^|; )${name}=([^;]*)`));
43
+ const value = match ? decodeURIComponent(match[1]) : "";
44
+ if (value) return value;
45
+ }
46
+ return null;
43
47
  }
44
48
 
45
49
  // src/runtime/request.ts
@@ -125,7 +129,7 @@ async function executeRequest(opts, binding, input) {
125
129
  throw new LesslyApiError(
126
130
  0,
127
131
  "csrf_cookie_missing",
128
- `CSRF cookie "lessly_csrf" is missing; the session must be re-established before mutating requests (${binding.method} ${binding.path}).`,
132
+ `CSRF cookie "lepsto_csrf" (or the legacy "lessly_csrf") is missing; the session must be re-established before mutating requests (${binding.method} ${binding.path}).`,
129
133
  null
130
134
  );
131
135
  }
@@ -7483,6 +7487,213 @@ var bindings = {
7483
7487
  }
7484
7488
  }
7485
7489
  },
7490
+ "playground": {
7491
+ "analytics": {
7492
+ "overview": {
7493
+ "level": "read",
7494
+ "method": "POST",
7495
+ "operationKey": "playground_analytics_overview",
7496
+ "params": [
7497
+ {
7498
+ "in": "body",
7499
+ "name": "limit"
7500
+ }
7501
+ ],
7502
+ "path": "/playground/analytics/overview",
7503
+ "readOnly": true
7504
+ }
7505
+ },
7506
+ "billing": {
7507
+ "entitlements": {
7508
+ "level": "read",
7509
+ "method": "POST",
7510
+ "operationKey": "playground_billing_entitlements",
7511
+ "path": "/playground/billing/entitlements",
7512
+ "readOnly": true
7513
+ },
7514
+ "record-usage": {
7515
+ "level": "write",
7516
+ "method": "POST",
7517
+ "operationKey": "playground_billing_record-usage",
7518
+ "params": [
7519
+ {
7520
+ "in": "body",
7521
+ "name": "value"
7522
+ }
7523
+ ],
7524
+ "path": "/playground/billing/usage",
7525
+ "readOnly": false
7526
+ }
7527
+ },
7528
+ "clickup": {
7529
+ "create-task": {
7530
+ "level": "write",
7531
+ "method": "POST",
7532
+ "operationKey": "playground_clickup_create-task",
7533
+ "params": [
7534
+ {
7535
+ "in": "body",
7536
+ "name": "listId"
7537
+ },
7538
+ {
7539
+ "in": "body",
7540
+ "name": "name"
7541
+ }
7542
+ ],
7543
+ "path": "/playground/clickup/tasks",
7544
+ "readOnly": false
7545
+ },
7546
+ "get-last-webhook": {
7547
+ "level": "read",
7548
+ "method": "GET",
7549
+ "operationKey": "playground_clickup_get-last-webhook",
7550
+ "path": "/playground/clickup/webhooks/last",
7551
+ "readOnly": true
7552
+ },
7553
+ "get-overview": {
7554
+ "level": "read",
7555
+ "method": "GET",
7556
+ "operationKey": "playground_clickup_get-overview",
7557
+ "path": "/playground/clickup/overview",
7558
+ "readOnly": true
7559
+ }
7560
+ },
7561
+ "echo": {
7562
+ "ping": {
7563
+ "level": "read",
7564
+ "method": "POST",
7565
+ "operationKey": "playground_echo_ping",
7566
+ "params": [
7567
+ {
7568
+ "in": "body",
7569
+ "name": "message"
7570
+ }
7571
+ ],
7572
+ "path": "/playground/echo/ping",
7573
+ "readOnly": true
7574
+ }
7575
+ },
7576
+ "gdrive": {
7577
+ "get-last-change": {
7578
+ "level": "read",
7579
+ "method": "GET",
7580
+ "operationKey": "playground_gdrive_get-last-change",
7581
+ "path": "/playground/gdrive/changes/last",
7582
+ "readOnly": true
7583
+ },
7584
+ "read-file": {
7585
+ "level": "read",
7586
+ "method": "POST",
7587
+ "operationKey": "playground_gdrive_read-file",
7588
+ "params": [
7589
+ {
7590
+ "in": "body",
7591
+ "name": "fileId"
7592
+ }
7593
+ ],
7594
+ "path": "/playground/gdrive/file",
7595
+ "readOnly": true
7596
+ }
7597
+ },
7598
+ "googleads": {
7599
+ "read-customer": {
7600
+ "level": "read",
7601
+ "method": "POST",
7602
+ "operationKey": "playground_googleads_read-customer",
7603
+ "path": "/playground/googleads/customer",
7604
+ "readOnly": true
7605
+ }
7606
+ },
7607
+ "lifecycle": {
7608
+ "get-state": {
7609
+ "level": "read",
7610
+ "method": "GET",
7611
+ "operationKey": "playground_lifecycle_get-state",
7612
+ "path": "/playground/lifecycle/state",
7613
+ "readOnly": true
7614
+ },
7615
+ "list-events": {
7616
+ "level": "read",
7617
+ "method": "GET",
7618
+ "operationKey": "playground_lifecycle_list-events",
7619
+ "path": "/playground/lifecycle/events",
7620
+ "readOnly": true
7621
+ }
7622
+ },
7623
+ "webhook": {
7624
+ "get-last": {
7625
+ "level": "read",
7626
+ "method": "GET",
7627
+ "operationKey": "playground_webhook_get-last",
7628
+ "path": "/playground/webhooks/last",
7629
+ "readOnly": true
7630
+ }
7631
+ },
7632
+ "workflow": {
7633
+ "echo": {
7634
+ "level": "write",
7635
+ "method": "POST",
7636
+ "operationKey": "playground_workflow_echo",
7637
+ "params": [
7638
+ {
7639
+ "in": "body",
7640
+ "name": "note"
7641
+ },
7642
+ {
7643
+ "in": "body",
7644
+ "name": "tags"
7645
+ }
7646
+ ],
7647
+ "path": "/playground/workflow/echo",
7648
+ "readOnly": false
7649
+ },
7650
+ "echo-list": {
7651
+ "level": "read",
7652
+ "method": "GET",
7653
+ "operationKey": "playground_workflow_echo-list",
7654
+ "path": "/playground/workflow/echoes",
7655
+ "readOnly": true
7656
+ },
7657
+ "ping": {
7658
+ "level": "write",
7659
+ "method": "POST",
7660
+ "operationKey": "playground_workflow_ping",
7661
+ "params": [
7662
+ {
7663
+ "in": "body",
7664
+ "name": "kind"
7665
+ }
7666
+ ],
7667
+ "path": "/playground/workflow/ping",
7668
+ "readOnly": false
7669
+ },
7670
+ "subjects-list": {
7671
+ "level": "read",
7672
+ "method": "GET",
7673
+ "operationKey": "playground_workflow_subjects-list",
7674
+ "params": [
7675
+ {
7676
+ "in": "query",
7677
+ "name": "last_activity_before"
7678
+ },
7679
+ {
7680
+ "in": "query",
7681
+ "name": "last_activity_after"
7682
+ },
7683
+ {
7684
+ "in": "query",
7685
+ "name": "limit"
7686
+ },
7687
+ {
7688
+ "in": "query",
7689
+ "name": "cursor"
7690
+ }
7691
+ ],
7692
+ "path": "/playground/workflow/subjects",
7693
+ "readOnly": true
7694
+ }
7695
+ }
7696
+ },
7486
7697
  "realtime": {
7487
7698
  "archive": {
7488
7699
  "export": {
@@ -11053,7 +11264,7 @@ var bindings = {
11053
11264
  "readOnly": true
11054
11265
  },
11055
11266
  "set": {
11056
- "level": "write",
11267
+ "level": "admin",
11057
11268
  "method": "POST",
11058
11269
  "operationKey": "workflow_killswitch_set",
11059
11270
  "params": [
@@ -11363,7 +11574,7 @@ var bindings = {
11363
11574
  },
11364
11575
  "wait-list": {
11365
11576
  "all": {
11366
- "level": "read",
11577
+ "level": "admin",
11367
11578
  "method": "GET",
11368
11579
  "operationKey": "workflow_wait_list_all",
11369
11580
  "params": [
@@ -11783,6 +11994,23 @@ var operations = {
11783
11994
  "organization_support_threads_list": "read",
11784
11995
  "organization_x_install": "read",
11785
11996
  "organization_youtube_install": "read",
11997
+ "playground_analytics_overview": "read",
11998
+ "playground_billing_entitlements": "read",
11999
+ "playground_billing_record-usage": "write",
12000
+ "playground_clickup_create-task": "write",
12001
+ "playground_clickup_get-last-webhook": "read",
12002
+ "playground_clickup_get-overview": "read",
12003
+ "playground_echo_ping": "read",
12004
+ "playground_gdrive_get-last-change": "read",
12005
+ "playground_gdrive_read-file": "read",
12006
+ "playground_googleads_read-customer": "read",
12007
+ "playground_lifecycle_get-state": "read",
12008
+ "playground_lifecycle_list-events": "read",
12009
+ "playground_webhook_get-last": "read",
12010
+ "playground_workflow_echo": "write",
12011
+ "playground_workflow_echo-list": "read",
12012
+ "playground_workflow_ping": "write",
12013
+ "playground_workflow_subjects-list": "read",
11786
12014
  "realtime_archive_export": "admin",
11787
12015
  "realtime_archive_export_status": "read",
11788
12016
  "realtime_archive_get": "read",
@@ -11968,7 +12196,7 @@ var operations = {
11968
12196
  "workflow_health_list": "read",
11969
12197
  "workflow_health_ping": "read",
11970
12198
  "workflow_killswitch_get": "read",
11971
- "workflow_killswitch_set": "write",
12199
+ "workflow_killswitch_set": "admin",
11972
12200
  "workflow_run_cancel": "write",
11973
12201
  "workflow_run_get": "read",
11974
12202
  "workflow_run_list": "read",
@@ -11983,7 +12211,7 @@ var operations = {
11983
12211
  "workflow_version_list": "read",
11984
12212
  "workflow_wait_get": "read",
11985
12213
  "workflow_wait_list": "read",
11986
- "workflow_wait_list_all": "read",
12214
+ "workflow_wait_list_all": "admin",
11987
12215
  "workflow_wait_resolve": "write"
11988
12216
  };
11989
12217
  var compositions = {
@@ -12055,6 +12283,9 @@ var compositions = {
12055
12283
  "mail_template_publish": { "label": "Publish template", "options": { "id": "mail_template_list" } },
12056
12284
  "mail_template_update": { "label": "Update template", "options": { "id": "mail_template_list" } },
12057
12285
  "mail_usage_get": { "label": "Get usage" },
12286
+ "playground_workflow_echo": { "pii": ["input.note", "output.note"], "label": "Store workflow echo", "completion_event": "playground/workflow.echoed" },
12287
+ "playground_workflow_ping": { "label": "Fire workflow ping", "completion_event": "playground/workflow.ping" },
12288
+ "playground_workflow_subjects-list": { "pii": ["output.items[].display_name"], "label": "List workflow subjects" },
12058
12289
  "support_agent_create": { "pii": ["input.lesslyUserId", "output.lesslyUserId"], "label": "Create agent" },
12059
12290
  "support_agent_get": { "pii": ["output.lesslyUserId"], "label": "Get agent", "options": { "id": "support_agent_list" } },
12060
12291
  "support_agent_list": { "pii": ["output.agents[].lesslyUserId"], "label": "List agents" },