@relyio/sdk 0.18.0 → 0.20.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 (58) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/automations/index.cjs +18 -17
  3. package/dist/automations/index.d.cts +2 -1307
  4. package/dist/automations/index.d.ts +2 -1307
  5. package/dist/automations/index.js +3 -2
  6. package/dist/{chunk-ZAMAR3X2.cjs → chunk-5F3YYPLZ.cjs} +11249 -10771
  7. package/dist/{chunk-ZO6QDYJG.cjs → chunk-5WGMIQBH.cjs} +2 -2
  8. package/dist/{chunk-LSI26ZN2.cjs → chunk-DBYMG6MQ.cjs} +5 -5
  9. package/dist/{chunk-W2A4OTCI.js → chunk-EQUZNVAR.js} +2 -2
  10. package/dist/{chunk-IFKF72VJ.cjs → chunk-K66MBRI4.cjs} +147 -71
  11. package/dist/{chunk-ZHTJ7GXH.js → chunk-L42C4G2S.js} +106 -31
  12. package/dist/{chunk-EDE2H37D.js → chunk-OUR7OUUZ.js} +174 -12
  13. package/dist/{chunk-W7JFHSFM.js → chunk-PZCDJFMA.js} +11249 -10772
  14. package/dist/{chunk-SHSK7UUY.cjs → chunk-UO2QRYKV.cjs} +177 -11
  15. package/dist/{chunk-R6E4HE7R.js → chunk-W2GRVXDG.js} +3 -3
  16. package/dist/client/index.cjs +5 -5
  17. package/dist/client/index.d.cts +4 -4
  18. package/dist/client/index.d.ts +4 -4
  19. package/dist/client/index.js +3 -3
  20. package/dist/{define-content-type-NEQDrvdq.d.cts → define-content-type-C2HnCYYX.d.cts} +1324 -156
  21. package/dist/{define-content-type-fb-WCD5e.d.ts → define-content-type-CVLUusfx.d.ts} +1324 -156
  22. package/dist/dev-handshake/index.cjs +8 -8
  23. package/dist/dev-handshake/index.d.cts +1 -1
  24. package/dist/dev-handshake/index.d.ts +1 -1
  25. package/dist/dev-handshake/index.js +1 -1
  26. package/dist/extensions/index.cjs +26 -6
  27. package/dist/extensions/index.d.cts +3 -791
  28. package/dist/extensions/index.d.ts +3 -791
  29. package/dist/extensions/index.js +24 -4
  30. package/dist/functions/index.cjs +7 -4
  31. package/dist/functions/index.d.cts +2 -4
  32. package/dist/functions/index.d.ts +2 -4
  33. package/dist/functions/index.js +5 -2
  34. package/dist/{index-DwHcL6x5.d.cts → index-BLVNMYUU.d.cts} +142 -79
  35. package/dist/{index-C4LqrNd1.d.ts → index-BY1xU93u.d.ts} +1 -1
  36. package/dist/{index-Dnmt_UOo.d.cts → index-Cmup6HJY.d.cts} +1 -1
  37. package/dist/index-D1fiaQlK.d.ts +2284 -0
  38. package/dist/index-DImzg3ew.d.cts +2284 -0
  39. package/dist/{index-M3luH06A.d.ts → index-IjSyBr8f.d.ts} +142 -79
  40. package/dist/index.cjs +89 -85
  41. package/dist/index.d.cts +64 -15
  42. package/dist/index.d.ts +64 -15
  43. package/dist/index.js +5 -5
  44. package/dist/preview/index.cjs +3 -3
  45. package/dist/preview/index.js +1 -1
  46. package/dist/rich-text/index.d.cts +2 -2
  47. package/dist/rich-text/index.d.ts +2 -2
  48. package/dist/schema/index.cjs +41 -40
  49. package/dist/schema/index.d.cts +948 -118
  50. package/dist/schema/index.d.ts +948 -118
  51. package/dist/schema/index.js +2 -1
  52. package/dist/types/index.d.cts +1 -1
  53. package/dist/types/index.d.ts +1 -1
  54. package/package.json +5 -5
  55. package/dist/define-schema-DZhtvLiK.d.cts +0 -846
  56. package/dist/define-schema-Dlwh6l_J.d.ts +0 -846
  57. package/dist/register-B53i97A9.d.ts +0 -677
  58. package/dist/register-BYCs0FpF.d.cts +0 -677
@@ -1,37 +1,37 @@
1
1
  'use strict';
2
2
 
3
- var chunkZO6QDYJG_cjs = require('../chunk-ZO6QDYJG.cjs');
3
+ var chunk5WGMIQBH_cjs = require('../chunk-5WGMIQBH.cjs');
4
4
  require('../chunk-L6DXCKVQ.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "DEV_CONTEXT_DIR", {
9
9
  enumerable: true,
10
- get: function () { return chunkZO6QDYJG_cjs.DEV_CONTEXT_DIR; }
10
+ get: function () { return chunk5WGMIQBH_cjs.DEV_CONTEXT_DIR; }
11
11
  });
12
12
  Object.defineProperty(exports, "DEV_CONTEXT_FILE", {
13
13
  enumerable: true,
14
- get: function () { return chunkZO6QDYJG_cjs.DEV_CONTEXT_FILE; }
14
+ get: function () { return chunk5WGMIQBH_cjs.DEV_CONTEXT_FILE; }
15
15
  });
16
16
  Object.defineProperty(exports, "DEV_CONTEXT_FILENAME", {
17
17
  enumerable: true,
18
- get: function () { return chunkZO6QDYJG_cjs.DEV_CONTEXT_FILENAME; }
18
+ get: function () { return chunk5WGMIQBH_cjs.DEV_CONTEXT_FILENAME; }
19
19
  });
20
20
  Object.defineProperty(exports, "DEV_ENV", {
21
21
  enumerable: true,
22
- get: function () { return chunkZO6QDYJG_cjs.DEV_ENV; }
22
+ get: function () { return chunk5WGMIQBH_cjs.DEV_ENV; }
23
23
  });
24
24
  Object.defineProperty(exports, "buildDevEnv", {
25
25
  enumerable: true,
26
- get: function () { return chunkZO6QDYJG_cjs.buildDevEnv; }
26
+ get: function () { return chunk5WGMIQBH_cjs.buildDevEnv; }
27
27
  });
28
28
  Object.defineProperty(exports, "parseDevContextFile", {
29
29
  enumerable: true,
30
- get: function () { return chunkZO6QDYJG_cjs.parseDevContextFile; }
30
+ get: function () { return chunk5WGMIQBH_cjs.parseDevContextFile; }
31
31
  });
32
32
  Object.defineProperty(exports, "parseDevEnv", {
33
33
  enumerable: true,
34
- get: function () { return chunkZO6QDYJG_cjs.parseDevEnv; }
34
+ get: function () { return chunk5WGMIQBH_cjs.parseDevEnv; }
35
35
  });
36
36
  //# sourceMappingURL=index.cjs.map
37
37
  //# sourceMappingURL=index.cjs.map
@@ -52,7 +52,7 @@ declare const DEV_ENV: {
52
52
  interface DevContext {
53
53
  /** Ephemeral sandbox dataset the app should read (`X-RelyIO-Dataset`). */
54
54
  datasetId: string;
55
- /** Scoped read-only preview key for the sandbox dataset (`X-API-Key`). */
55
+ /** Scoped preview key for the sandbox dataset: drafts, and writes to that dataset alone (REL-4048) (`X-API-Key`). */
56
56
  previewApiKey: string;
57
57
  /** Sandbox branch id — informational to the SDK; `relyio promote` identifies the sandbox by it. */
58
58
  branchId: string;
@@ -52,7 +52,7 @@ declare const DEV_ENV: {
52
52
  interface DevContext {
53
53
  /** Ephemeral sandbox dataset the app should read (`X-RelyIO-Dataset`). */
54
54
  datasetId: string;
55
- /** Scoped read-only preview key for the sandbox dataset (`X-API-Key`). */
55
+ /** Scoped preview key for the sandbox dataset: drafts, and writes to that dataset alone (REL-4048) (`X-API-Key`). */
56
56
  previewApiKey: string;
57
57
  /** Sandbox branch id — informational to the SDK; `relyio promote` identifies the sandbox by it. */
58
58
  branchId: string;
@@ -1,4 +1,4 @@
1
- export { DEV_CONTEXT_DIR, DEV_CONTEXT_FILE, DEV_CONTEXT_FILENAME, DEV_ENV, buildDevEnv, parseDevContextFile, parseDevEnv } from '../chunk-W2A4OTCI.js';
1
+ export { DEV_CONTEXT_DIR, DEV_CONTEXT_FILE, DEV_CONTEXT_FILENAME, DEV_ENV, buildDevEnv, parseDevContextFile, parseDevEnv } from '../chunk-EQUZNVAR.js';
2
2
  import '../chunk-DI6KFDBO.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -1,15 +1,27 @@
1
1
  'use strict';
2
2
 
3
- var chunkLSI26ZN2_cjs = require('../chunk-LSI26ZN2.cjs');
4
- require('../chunk-ZAMAR3X2.cjs');
5
- var chunkSHSK7UUY_cjs = require('../chunk-SHSK7UUY.cjs');
3
+ var chunkDBYMG6MQ_cjs = require('../chunk-DBYMG6MQ.cjs');
4
+ var chunk5F3YYPLZ_cjs = require('../chunk-5F3YYPLZ.cjs');
5
+ var chunkUO2QRYKV_cjs = require('../chunk-UO2QRYKV.cjs');
6
6
  var chunkL6DXCKVQ_cjs = require('../chunk-L6DXCKVQ.cjs');
7
7
 
8
8
  /* RelyIO SDK - Built with ❤️ by the RelyIO Team */
9
9
 
10
10
  // src/extensions/index.ts
11
11
  var DECLARED = "declared";
12
- var SURFACES = chunkSHSK7UUY_cjs.EXTENSION_SURFACES;
12
+ var SURFACES = chunkUO2QRYKV_cjs.EXTENSION_SURFACES;
13
+ function fieldKindBuilder(slug, name, kind) {
14
+ return (options = {}) => {
15
+ const ui = options.ui;
16
+ const widget = typeof ui === "object" && ui !== null ? ui : {};
17
+ return chunk5F3YYPLZ_cjs.keyedField("reference", {
18
+ ...options,
19
+ to: kind.base.to,
20
+ ui: { ...widget, [chunkUO2QRYKV_cjs.CONTRIBUTED_FIELD_KIND_OPTION]: chunkUO2QRYKV_cjs.contributedFieldKindName(slug, name) }
21
+ });
22
+ };
23
+ }
24
+ chunkL6DXCKVQ_cjs.__name(fieldKindBuilder, "fieldKindBuilder");
13
25
  function handleOf(slug) {
14
26
  const surface = SURFACES[slug];
15
27
  if (surface === void 0) {
@@ -27,9 +39,17 @@ function handleOf(slug) {
27
39
  ...Object.fromEntries(
28
40
  Object.entries(surface.triggers).map(([name, { trigger }]) => [
29
41
  name,
30
- (options) => chunkLSI26ZN2_cjs.extensionTrigger(slug, trigger, options)
42
+ (options) => chunkDBYMG6MQ_cjs.extensionTrigger(slug, trigger, options)
31
43
  ])
32
- )
44
+ ),
45
+ ...Object.fromEntries(
46
+ Object.entries(surface.fieldKinds).map(([name, kind]) => [
47
+ name,
48
+ fieldKindBuilder(slug, name, kind)
49
+ ])
50
+ ),
51
+ // Its Managed Record types, by name: `clerk.user` is `'clerkUser'` (REL-3863)
52
+ ...surface.recordTypes
33
53
  };
34
54
  }
35
55
  chunkL6DXCKVQ_cjs.__name(handleOf, "handleOf");