@lessly/sdk-app 29.0.0 → 30.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.
Files changed (55) hide show
  1. package/README.md +3 -1
  2. package/dist/analytics/index.d.cts +1 -1
  3. package/dist/analytics/index.d.ts +1 -1
  4. package/dist/brain/index.cjs +5 -0
  5. package/dist/brain/index.cjs.map +1 -1
  6. package/dist/brain/index.d.cts +6 -2
  7. package/dist/brain/index.d.ts +6 -2
  8. package/dist/brain/index.js +5 -1
  9. package/dist/brain/index.js.map +1 -1
  10. package/dist/{client.gen-QlwjPsPF.d.cts → client.gen-C6_mJktu.d.cts} +119 -217
  11. package/dist/{client.gen-QlwjPsPF.d.ts → client.gen-C6_mJktu.d.ts} +119 -217
  12. package/dist/consent/index.d.cts +1 -1
  13. package/dist/consent/index.d.ts +1 -1
  14. package/dist/deployment/index.d.cts +1 -1
  15. package/dist/deployment/index.d.ts +1 -1
  16. package/dist/index.cjs +45 -105
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +1 -1
  19. package/dist/index.d.ts +1 -1
  20. package/dist/index.js +45 -105
  21. package/dist/index.js.map +1 -1
  22. package/dist/mail/index.d.cts +2 -2
  23. package/dist/mail/index.d.ts +2 -2
  24. package/dist/organization/index.cjs +5 -0
  25. package/dist/organization/index.cjs.map +1 -1
  26. package/dist/organization/index.d.cts +6 -2
  27. package/dist/organization/index.d.ts +6 -2
  28. package/dist/organization/index.js +5 -1
  29. package/dist/organization/index.js.map +1 -1
  30. package/dist/realtime/index.d.cts +1 -1
  31. package/dist/realtime/index.d.ts +1 -1
  32. package/dist/tracking/index.d.cts +1 -1
  33. package/dist/tracking/index.d.ts +1 -1
  34. package/dist/users/index.d.cts +1 -1
  35. package/dist/users/index.d.ts +1 -1
  36. package/dist/waitlist/index.d.cts +1 -1
  37. package/dist/waitlist/index.d.ts +1 -1
  38. package/docs/recipes/sdk-usage.md +8 -0
  39. package/package.json +2 -7
  40. package/src/gen/bindings.gen.ts +36 -104
  41. package/src/gen/brain/index.ts +1 -1
  42. package/src/gen/brain/queryOptions.gen.ts +7 -0
  43. package/src/gen/client.gen.ts +8 -52
  44. package/src/gen/manifest.gen.ts +1 -1
  45. package/src/gen/organization/index.ts +1 -1
  46. package/src/gen/organization/queryOptions.gen.ts +6 -0
  47. package/src/gen/types.gen.ts +118 -220
  48. package/dist/playground/index.cjs +0 -66
  49. package/dist/playground/index.cjs.map +0 -1
  50. package/dist/playground/index.d.cts +0 -52
  51. package/dist/playground/index.d.ts +0 -52
  52. package/dist/playground/index.js +0 -53
  53. package/dist/playground/index.js.map +0 -1
  54. package/src/gen/playground/index.ts +0 -3
  55. package/src/gen/playground/queryOptions.gen.ts +0 -86
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { G as GeneratedClient } from './client.gen-QlwjPsPF.cjs';
1
+ import { G as GeneratedClient } from './client.gen-C6_mJktu.cjs';
2
2
 
3
3
  type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
4
4
  type ParamIn = 'path' | 'query' | 'body';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { G as GeneratedClient } from './client.gen-QlwjPsPF.js';
1
+ import { G as GeneratedClient } from './client.gen-C6_mJktu.js';
2
2
 
3
3
  type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
4
4
  type ParamIn = 'path' | 'query' | 'body';
package/dist/index.js CHANGED
@@ -87,7 +87,15 @@ async function executeRequest(opts, binding, input) {
87
87
  if (body !== void 0) headers.set("Content-Type", "application/json");
88
88
  if (MUTATING.has(binding.method)) {
89
89
  const token = (opts.getCsrfToken ?? readCsrfCookie)();
90
- if (token) headers.set("X-CSRF-Token", token);
90
+ if (!token) {
91
+ throw new LesslyApiError(
92
+ 0,
93
+ "csrf_cookie_missing",
94
+ `CSRF cookie "lessly_csrf" is missing; the session must be re-established before mutating requests (${binding.method} ${binding.path}).`,
95
+ null
96
+ );
97
+ }
98
+ headers.set("X-CSRF-Token", token);
91
99
  }
92
100
  const requestInit = { method: binding.method, headers, credentials: "include" };
93
101
  if (body !== void 0) requestInit.body = JSON.stringify(body);
@@ -795,6 +803,19 @@ var bindings = {
795
803
  "path": "/brain/restores/:restoreId",
796
804
  "readOnly": true
797
805
  }
806
+ },
807
+ "usage": {
808
+ "report": {
809
+ "method": "GET",
810
+ "params": [
811
+ {
812
+ "in": "query",
813
+ "name": "days"
814
+ }
815
+ ],
816
+ "path": "/brain/usage/report",
817
+ "readOnly": true
818
+ }
798
819
  }
799
820
  },
800
821
  "consent": {
@@ -3939,6 +3960,29 @@ var bindings = {
3939
3960
  ],
3940
3961
  "path": "/governance/api/v1/products/:productId/domains/:domainId",
3941
3962
  "readOnly": false
3963
+ },
3964
+ "set-mode": {
3965
+ "method": "PUT",
3966
+ "params": [
3967
+ {
3968
+ "in": "path",
3969
+ "name": "productId"
3970
+ },
3971
+ {
3972
+ "in": "path",
3973
+ "name": "domainId"
3974
+ },
3975
+ {
3976
+ "in": "body",
3977
+ "name": "mode"
3978
+ },
3979
+ {
3980
+ "in": "body",
3981
+ "name": "providerConnectorId"
3982
+ }
3983
+ ],
3984
+ "path": "/governance/api/v1/products/:productId/domains/:domainId/mode",
3985
+ "readOnly": false
3942
3986
  }
3943
3987
  },
3944
3988
  "extensions": {
@@ -4533,110 +4577,6 @@ var bindings = {
4533
4577
  }
4534
4578
  }
4535
4579
  },
4536
- "playground": {
4537
- "analytics": {
4538
- "overview": {
4539
- "method": "POST",
4540
- "params": [
4541
- {
4542
- "in": "body",
4543
- "name": "limit"
4544
- }
4545
- ],
4546
- "path": "/playground/analytics/overview",
4547
- "readOnly": true
4548
- }
4549
- },
4550
- "billing": {
4551
- "entitlements": {
4552
- "method": "POST",
4553
- "path": "/playground/billing/entitlements",
4554
- "readOnly": true
4555
- },
4556
- "record-usage": {
4557
- "method": "POST",
4558
- "params": [
4559
- {
4560
- "in": "body",
4561
- "name": "value"
4562
- }
4563
- ],
4564
- "path": "/playground/billing/usage",
4565
- "readOnly": false
4566
- }
4567
- },
4568
- "clickup": {
4569
- "create-task": {
4570
- "method": "POST",
4571
- "params": [
4572
- {
4573
- "in": "body",
4574
- "name": "listId"
4575
- },
4576
- {
4577
- "in": "body",
4578
- "name": "name"
4579
- }
4580
- ],
4581
- "path": "/playground/clickup/tasks",
4582
- "readOnly": false
4583
- },
4584
- "get-last-webhook": {
4585
- "method": "GET",
4586
- "path": "/playground/clickup/webhooks/last",
4587
- "readOnly": true
4588
- },
4589
- "get-overview": {
4590
- "method": "GET",
4591
- "path": "/playground/clickup/overview",
4592
- "readOnly": true
4593
- }
4594
- },
4595
- "gdrive": {
4596
- "get-last-change": {
4597
- "method": "GET",
4598
- "path": "/playground/gdrive/changes/last",
4599
- "readOnly": true
4600
- },
4601
- "read-file": {
4602
- "method": "POST",
4603
- "params": [
4604
- {
4605
- "in": "body",
4606
- "name": "fileId"
4607
- }
4608
- ],
4609
- "path": "/playground/gdrive/file",
4610
- "readOnly": true
4611
- }
4612
- },
4613
- "googleads": {
4614
- "read-customer": {
4615
- "method": "POST",
4616
- "path": "/playground/googleads/customer",
4617
- "readOnly": true
4618
- }
4619
- },
4620
- "lifecycle": {
4621
- "get-state": {
4622
- "method": "GET",
4623
- "path": "/playground/lifecycle/state",
4624
- "readOnly": true
4625
- },
4626
- "list-events": {
4627
- "method": "GET",
4628
- "path": "/playground/lifecycle/events",
4629
- "readOnly": true
4630
- }
4631
- },
4632
- "webhook": {
4633
- "get-last": {
4634
- "method": "GET",
4635
- "path": "/playground/webhooks/last",
4636
- "readOnly": true
4637
- }
4638
- }
4639
- },
4640
4580
  "realtime": {
4641
4581
  "archive": {
4642
4582
  "export": {