@dxos/functions 0.7.4 → 0.7.5-main.937ce75

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 (84) hide show
  1. package/dist/lib/browser/chunk-5YMUMLKR.mjs +168 -0
  2. package/dist/lib/browser/chunk-5YMUMLKR.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-B3FGASHJ.mjs +125 -0
  4. package/dist/lib/browser/chunk-B3FGASHJ.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-Y2OPAP26.mjs → chunk-LNWYDAJH.mjs} +2 -2
  6. package/dist/lib/browser/chunk-XRCXIG74.mjs +12 -0
  7. package/dist/lib/browser/edge/index.mjs +21 -0
  8. package/dist/lib/browser/index.mjs +26 -3
  9. package/dist/lib/browser/index.mjs.map +1 -1
  10. package/dist/lib/browser/meta.json +1 -1
  11. package/dist/lib/browser/testing/index.mjs +5 -3
  12. package/dist/lib/browser/testing/index.mjs.map +1 -1
  13. package/dist/lib/browser/{types.mjs → types/index.mjs} +9 -2
  14. package/dist/lib/browser/types/index.mjs.map +7 -0
  15. package/dist/lib/node/{chunk-CCULBUSE.cjs → chunk-GR7UUM3W.cjs} +15 -15
  16. package/dist/lib/node/chunk-JEQ2X3Z6.cjs +34 -0
  17. package/dist/lib/node/chunk-JEQ2X3Z6.cjs.map +7 -0
  18. package/dist/lib/node/chunk-XVI7DQF5.cjs +195 -0
  19. package/dist/lib/node/chunk-XVI7DQF5.cjs.map +7 -0
  20. package/dist/lib/node/chunk-ZDG466QT.cjs +151 -0
  21. package/dist/lib/node/chunk-ZDG466QT.cjs.map +7 -0
  22. package/dist/lib/node/edge/index.cjs +42 -0
  23. package/dist/lib/node/edge/index.cjs.map +7 -0
  24. package/dist/lib/node/index.cjs +37 -15
  25. package/dist/lib/node/index.cjs.map +1 -1
  26. package/dist/lib/node/meta.json +1 -1
  27. package/dist/lib/node/testing/index.cjs +11 -10
  28. package/dist/lib/node/testing/index.cjs.map +1 -1
  29. package/dist/lib/node/{types.cjs → types/index.cjs} +16 -9
  30. package/dist/lib/node/types/index.cjs.map +7 -0
  31. package/dist/lib/node-esm/chunk-BODWNC7C.mjs +168 -0
  32. package/dist/lib/node-esm/chunk-BODWNC7C.mjs.map +7 -0
  33. package/dist/lib/node-esm/chunk-CN74WOTT.mjs +125 -0
  34. package/dist/lib/node-esm/chunk-CN74WOTT.mjs.map +7 -0
  35. package/dist/lib/node-esm/chunk-DHGBFXSZ.mjs +12 -0
  36. package/dist/lib/node-esm/chunk-DHGBFXSZ.mjs.map +7 -0
  37. package/dist/lib/node-esm/{chunk-GGGGWYP6.mjs → chunk-LLKTW5AA.mjs} +2 -2
  38. package/dist/lib/node-esm/edge/index.mjs +21 -0
  39. package/dist/lib/node-esm/edge/index.mjs.map +7 -0
  40. package/dist/lib/node-esm/index.mjs +26 -3
  41. package/dist/lib/node-esm/index.mjs.map +1 -1
  42. package/dist/lib/node-esm/meta.json +1 -1
  43. package/dist/lib/node-esm/testing/index.mjs +5 -3
  44. package/dist/lib/node-esm/testing/index.mjs.map +1 -1
  45. package/dist/lib/node-esm/{types.mjs → types/index.mjs} +9 -2
  46. package/dist/lib/node-esm/types/index.mjs.map +7 -0
  47. package/dist/types/src/edge/functions.d.ts +25 -0
  48. package/dist/types/src/edge/functions.d.ts.map +1 -0
  49. package/dist/types/src/edge/index.d.ts +2 -0
  50. package/dist/types/src/edge/index.d.ts.map +1 -0
  51. package/dist/types/src/index.d.ts +1 -0
  52. package/dist/types/src/index.d.ts.map +1 -1
  53. package/dist/types/src/testing/types.d.ts +3 -5
  54. package/dist/types/src/testing/types.d.ts.map +1 -1
  55. package/dist/types/src/translations.d.ts +9 -0
  56. package/dist/types/src/translations.d.ts.map +1 -0
  57. package/dist/types/src/types/index.d.ts +3 -0
  58. package/dist/types/src/types/index.d.ts.map +1 -0
  59. package/dist/types/src/types/schema.d.ts +62 -0
  60. package/dist/types/src/types/schema.d.ts.map +1 -0
  61. package/dist/types/src/{types.d.ts → types/types.d.ts} +76 -75
  62. package/dist/types/src/types/types.d.ts.map +1 -0
  63. package/dist/types/tsconfig.tsbuildinfo +1 -0
  64. package/package.json +27 -20
  65. package/src/edge/functions.ts +116 -0
  66. package/src/edge/index.ts +5 -0
  67. package/src/index.ts +1 -0
  68. package/src/translations.ts +15 -0
  69. package/src/types/index.ts +6 -0
  70. package/src/types/schema.ts +48 -0
  71. package/src/{types.ts → types/types.ts} +8 -0
  72. package/dist/lib/browser/chunk-N5D5R4Q4.mjs +0 -129
  73. package/dist/lib/browser/chunk-N5D5R4Q4.mjs.map +0 -7
  74. package/dist/lib/node/chunk-JMJCJ3SA.cjs +0 -156
  75. package/dist/lib/node/chunk-JMJCJ3SA.cjs.map +0 -7
  76. package/dist/lib/node/types.cjs.map +0 -7
  77. package/dist/lib/node-esm/chunk-2NACE6MJ.mjs +0 -129
  78. package/dist/lib/node-esm/chunk-2NACE6MJ.mjs.map +0 -7
  79. package/dist/types/src/types.d.ts.map +0 -1
  80. /package/dist/lib/browser/{chunk-Y2OPAP26.mjs.map → chunk-LNWYDAJH.mjs.map} +0 -0
  81. /package/dist/lib/browser/{types.mjs.map → chunk-XRCXIG74.mjs.map} +0 -0
  82. /package/dist/lib/{node-esm/types.mjs.map → browser/edge/index.mjs.map} +0 -0
  83. /package/dist/lib/node/{chunk-CCULBUSE.cjs.map → chunk-GR7UUM3W.cjs.map} +0 -0
  84. /package/dist/lib/node-esm/{chunk-GGGGWYP6.mjs.map → chunk-LLKTW5AA.mjs.map} +0 -0
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { AST, OptionsAnnotationId, RawObject, S, TypedObject } from '@dxos/echo-schema';\n\n/**\n * Type discriminator for TriggerType.\n * Every spec has a type field of type TriggerKind that we can use to understand which type we're working with.\n * https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions\n */\nexport enum TriggerKind {\n Timer = 'timer',\n Webhook = 'webhook',\n Subscription = 'subscription',\n}\n\n// TODO(burdon): Rename prop kind.\nconst typeLiteralAnnotations = { [AST.TitleAnnotationId]: 'Type' };\n\n/**\n * Cron timer.\n */\nconst TimerTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Timer).annotations(typeLiteralAnnotations),\n cron: S.String.annotations({\n [AST.TitleAnnotationId]: 'Cron',\n [AST.ExamplesAnnotationId]: ['0 0 * * *'],\n }),\n}).pipe(S.mutable);\n\nexport type TimerTrigger = S.Schema.Type<typeof TimerTriggerSchema>;\n\n/**\n * Webhook.\n */\nconst WebhookTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Webhook).annotations(typeLiteralAnnotations),\n method: S.optional(\n S.String.annotations({\n [AST.TitleAnnotationId]: 'Method',\n [OptionsAnnotationId]: ['GET', 'POST'],\n }),\n ),\n port: S.optional(\n S.Number.annotations({\n [AST.TitleAnnotationId]: 'Port',\n }),\n ),\n}).pipe(S.mutable);\n\nexport type WebhookTrigger = S.Schema.Type<typeof WebhookTriggerSchema>;\n\n// TODO(burdon): Use ECHO definition (from https://github.com/dxos/dxos/pull/8233).\nconst QuerySchema = S.Struct({\n type: S.optional(S.String.annotations({ [AST.TitleAnnotationId]: 'Type' })),\n props: S.optional(S.Record({ key: S.String, value: S.Any })),\n}).annotations({ [AST.TitleAnnotationId]: 'Query' });\n\n/**\n * Subscription.\n */\nconst SubscriptionTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Subscription).annotations(typeLiteralAnnotations),\n // TODO(burdon): Define query DSL (from ECHO). Reconcile with Table.Query.\n filter: QuerySchema,\n options: S.optional(\n S.Struct({\n // Watch changes to object (not just creation).\n deep: S.optional(S.Boolean.annotations({ [AST.TitleAnnotationId]: 'Nested' })),\n // Debounce changes (delay in ms).\n delay: S.optional(S.Number.annotations({ [AST.TitleAnnotationId]: 'Delay' })),\n }).annotations({ [AST.TitleAnnotationId]: 'Options' }),\n ),\n}).pipe(S.mutable);\n\nexport type SubscriptionTrigger = S.Schema.Type<typeof SubscriptionTriggerSchema>;\n\n/**\n * Trigger schema (discriminated union).\n */\nexport const TriggerSchema = S.Union(\n //\n TimerTriggerSchema,\n WebhookTriggerSchema,\n SubscriptionTriggerSchema,\n).annotations({\n [AST.TitleAnnotationId]: 'Trigger',\n});\n\nexport type TriggerType = S.Schema.Type<typeof TriggerSchema>;\n\n/**\n * Function trigger.\n */\nexport const FunctionTriggerSchema = S.Struct({\n // TODO(burdon): What type does this reference.\n function: S.optional(S.String.annotations({ [AST.TitleAnnotationId]: 'Function' })),\n\n enabled: S.optional(S.Boolean.annotations({ [AST.TitleAnnotationId]: 'Enabled' })),\n\n // TODO(burdon): Flatten entire schema.\n spec: S.optional(TriggerSchema),\n\n // TODO(burdon): Get meta from function.\n // The `meta` property is merged into the event data passed to the function.\n meta: S.optional(S.mutable(S.Record({ key: S.String, value: S.Any }))),\n});\n\nexport type FunctionTriggerType = S.Schema.Type<typeof FunctionTriggerSchema>;\n\n/**\n * Function trigger.\n */\nexport class FunctionTrigger extends TypedObject({\n typename: 'dxos.org/type/FunctionTrigger',\n version: '0.1.0',\n})(FunctionTriggerSchema.fields) {}\n\n/**\n * Function definition.\n * @deprecated (Use dxos.org/type/Function)\n */\n// TODO(burdon): Reconcile with FunctionType.\nexport class FunctionDef extends TypedObject({\n typename: 'dxos.org/type/FunctionDef',\n version: '0.1.0',\n})({\n uri: S.String,\n description: S.optional(S.String),\n route: S.String,\n handler: S.String,\n}) {}\n\n/**\n * Function manifest file.\n */\nexport const FunctionManifestSchema = S.Struct({\n functions: S.optional(S.mutable(S.Array(RawObject(FunctionDef)))),\n triggers: S.optional(S.mutable(S.Array(RawObject(FunctionTrigger)))),\n});\n\nexport type FunctionManifest = S.Schema.Type<typeof FunctionManifestSchema>;\n\nexport const FUNCTION_TYPES = [FunctionDef, FunctionTrigger];\n"],
5
- "mappings": ";;;;;;;;;AAIA,SAASA,KAAKC,qBAAqBC,W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AI;AAKG,IAAMuC,yBAAyB7C,EAAEC,OAAO;EAC7C6C,WAAW9C,EAAEY,SAASZ,EAAES,QAAQT,EAAE+C,MAAMC,UAAUR,WAAAA,CAAAA,CAAAA,CAAAA;EAClDS,UAAUjD,EAAEY,SAASZ,EAAES,QAAQT,EAAE+C,MAAMC,UAAUb,eAAAA,CAAAA,CAAAA,CAAAA;AACnD,CAAA;AAIO,IAAMe,iBAAiB;EAACV;EAAaL;;",
6
- "names": ["AST", "OptionsAnnotationId", "RawObject", "S", "TypedObject", "TriggerKind", "typeLiteralAnnotations", "AST", "TitleAnnotationId", "TimerTriggerSchema", "S", "Struct", "type", "Literal", "annotations", "cron", "String", "ExamplesAnnotationId", "pipe", "mutable", "WebhookTriggerSchema", "method", "optional", "OptionsAnnotationId", "port", "Number", "QuerySchema", "props", "Record", "key", "value", "Any", "SubscriptionTriggerSchema", "filter", "options", "deep", "Boolean", "delay", "TriggerSchema", "Union", "FunctionTriggerSchema", "function", "enabled", "spec", "meta", "FunctionTrigger", "TypedObject", "typename", "version", "fields", "FunctionDef", "uri", "description", "route", "handler", "FunctionManifestSchema", "functions", "Array", "RawObject", "triggers", "FUNCTION_TYPES"]
7
- }
@@ -1,156 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_JMJCJ3SA_exports = {};
20
- __export(chunk_JMJCJ3SA_exports, {
21
- FUNCTION_TYPES: () => FUNCTION_TYPES,
22
- FunctionDef: () => FunctionDef,
23
- FunctionManifestSchema: () => FunctionManifestSchema,
24
- FunctionTrigger: () => FunctionTrigger,
25
- FunctionTriggerSchema: () => FunctionTriggerSchema,
26
- TriggerKind: () => TriggerKind,
27
- TriggerSchema: () => TriggerSchema,
28
- __require: () => __require
29
- });
30
- module.exports = __toCommonJS(chunk_JMJCJ3SA_exports);
31
- var import_echo_schema = require("@dxos/echo-schema");
32
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
33
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
34
- }) : x)(function(x) {
35
- if (typeof require !== "undefined") return require.apply(this, arguments);
36
- throw Error('Dynamic require of "' + x + '" is not supported');
37
- });
38
- var TriggerKind;
39
- (function(TriggerKind2) {
40
- TriggerKind2["Timer"] = "timer";
41
- TriggerKind2["Webhook"] = "webhook";
42
- TriggerKind2["Subscription"] = "subscription";
43
- })(TriggerKind || (TriggerKind = {}));
44
- var typeLiteralAnnotations = {
45
- [import_echo_schema.AST.TitleAnnotationId]: "Type"
46
- };
47
- var TimerTriggerSchema = import_echo_schema.S.Struct({
48
- type: import_echo_schema.S.Literal("timer").annotations(typeLiteralAnnotations),
49
- cron: import_echo_schema.S.String.annotations({
50
- [import_echo_schema.AST.TitleAnnotationId]: "Cron",
51
- [import_echo_schema.AST.ExamplesAnnotationId]: [
52
- "0 0 * * *"
53
- ]
54
- })
55
- }).pipe(import_echo_schema.S.mutable);
56
- var WebhookTriggerSchema = import_echo_schema.S.Struct({
57
- type: import_echo_schema.S.Literal("webhook").annotations(typeLiteralAnnotations),
58
- method: import_echo_schema.S.optional(import_echo_schema.S.String.annotations({
59
- [import_echo_schema.AST.TitleAnnotationId]: "Method",
60
- [import_echo_schema.OptionsAnnotationId]: [
61
- "GET",
62
- "POST"
63
- ]
64
- })),
65
- port: import_echo_schema.S.optional(import_echo_schema.S.Number.annotations({
66
- [import_echo_schema.AST.TitleAnnotationId]: "Port"
67
- }))
68
- }).pipe(import_echo_schema.S.mutable);
69
- var QuerySchema = import_echo_schema.S.Struct({
70
- type: import_echo_schema.S.optional(import_echo_schema.S.String.annotations({
71
- [import_echo_schema.AST.TitleAnnotationId]: "Type"
72
- })),
73
- props: import_echo_schema.S.optional(import_echo_schema.S.Record({
74
- key: import_echo_schema.S.String,
75
- value: import_echo_schema.S.Any
76
- }))
77
- }).annotations({
78
- [import_echo_schema.AST.TitleAnnotationId]: "Query"
79
- });
80
- var SubscriptionTriggerSchema = import_echo_schema.S.Struct({
81
- type: import_echo_schema.S.Literal("subscription").annotations(typeLiteralAnnotations),
82
- // TODO(burdon): Define query DSL (from ECHO). Reconcile with Table.Query.
83
- filter: QuerySchema,
84
- options: import_echo_schema.S.optional(import_echo_schema.S.Struct({
85
- // Watch changes to object (not just creation).
86
- deep: import_echo_schema.S.optional(import_echo_schema.S.Boolean.annotations({
87
- [import_echo_schema.AST.TitleAnnotationId]: "Nested"
88
- })),
89
- // Debounce changes (delay in ms).
90
- delay: import_echo_schema.S.optional(import_echo_schema.S.Number.annotations({
91
- [import_echo_schema.AST.TitleAnnotationId]: "Delay"
92
- }))
93
- }).annotations({
94
- [import_echo_schema.AST.TitleAnnotationId]: "Options"
95
- }))
96
- }).pipe(import_echo_schema.S.mutable);
97
- var TriggerSchema = import_echo_schema.S.Union(
98
- //
99
- TimerTriggerSchema,
100
- WebhookTriggerSchema,
101
- SubscriptionTriggerSchema
102
- ).annotations({
103
- [import_echo_schema.AST.TitleAnnotationId]: "Trigger"
104
- });
105
- var FunctionTriggerSchema = import_echo_schema.S.Struct({
106
- // TODO(burdon): What type does this reference.
107
- function: import_echo_schema.S.optional(import_echo_schema.S.String.annotations({
108
- [import_echo_schema.AST.TitleAnnotationId]: "Function"
109
- })),
110
- enabled: import_echo_schema.S.optional(import_echo_schema.S.Boolean.annotations({
111
- [import_echo_schema.AST.TitleAnnotationId]: "Enabled"
112
- })),
113
- // TODO(burdon): Flatten entire schema.
114
- spec: import_echo_schema.S.optional(TriggerSchema),
115
- // TODO(burdon): Get meta from function.
116
- // The `meta` property is merged into the event data passed to the function.
117
- meta: import_echo_schema.S.optional(import_echo_schema.S.mutable(import_echo_schema.S.Record({
118
- key: import_echo_schema.S.String,
119
- value: import_echo_schema.S.Any
120
- })))
121
- });
122
- var FunctionTrigger = class extends (0, import_echo_schema.TypedObject)({
123
- typename: "dxos.org/type/FunctionTrigger",
124
- version: "0.1.0"
125
- })(FunctionTriggerSchema.fields) {
126
- };
127
- var FunctionDef = class extends (0, import_echo_schema.TypedObject)({
128
- typename: "dxos.org/type/FunctionDef",
129
- version: "0.1.0"
130
- })({
131
- uri: import_echo_schema.S.String,
132
- description: import_echo_schema.S.optional(import_echo_schema.S.String),
133
- route: import_echo_schema.S.String,
134
- handler: import_echo_schema.S.String
135
- }) {
136
- };
137
- var FunctionManifestSchema = import_echo_schema.S.Struct({
138
- functions: import_echo_schema.S.optional(import_echo_schema.S.mutable(import_echo_schema.S.Array((0, import_echo_schema.RawObject)(FunctionDef)))),
139
- triggers: import_echo_schema.S.optional(import_echo_schema.S.mutable(import_echo_schema.S.Array((0, import_echo_schema.RawObject)(FunctionTrigger))))
140
- });
141
- var FUNCTION_TYPES = [
142
- FunctionDef,
143
- FunctionTrigger
144
- ];
145
- // Annotate the CommonJS export names for ESM import in node:
146
- 0 && (module.exports = {
147
- FUNCTION_TYPES,
148
- FunctionDef,
149
- FunctionManifestSchema,
150
- FunctionTrigger,
151
- FunctionTriggerSchema,
152
- TriggerKind,
153
- TriggerSchema,
154
- __require
155
- });
156
- //# sourceMappingURL=chunk-JMJCJ3SA.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { AST, OptionsAnnotationId, RawObject, S, TypedObject } from '@dxos/echo-schema';\n\n/**\n * Type discriminator for TriggerType.\n * Every spec has a type field of type TriggerKind that we can use to understand which type we're working with.\n * https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions\n */\nexport enum TriggerKind {\n Timer = 'timer',\n Webhook = 'webhook',\n Subscription = 'subscription',\n}\n\n// TODO(burdon): Rename prop kind.\nconst typeLiteralAnnotations = { [AST.TitleAnnotationId]: 'Type' };\n\n/**\n * Cron timer.\n */\nconst TimerTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Timer).annotations(typeLiteralAnnotations),\n cron: S.String.annotations({\n [AST.TitleAnnotationId]: 'Cron',\n [AST.ExamplesAnnotationId]: ['0 0 * * *'],\n }),\n}).pipe(S.mutable);\n\nexport type TimerTrigger = S.Schema.Type<typeof TimerTriggerSchema>;\n\n/**\n * Webhook.\n */\nconst WebhookTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Webhook).annotations(typeLiteralAnnotations),\n method: S.optional(\n S.String.annotations({\n [AST.TitleAnnotationId]: 'Method',\n [OptionsAnnotationId]: ['GET', 'POST'],\n }),\n ),\n port: S.optional(\n S.Number.annotations({\n [AST.TitleAnnotationId]: 'Port',\n }),\n ),\n}).pipe(S.mutable);\n\nexport type WebhookTrigger = S.Schema.Type<typeof WebhookTriggerSchema>;\n\n// TODO(burdon): Use ECHO definition (from https://github.com/dxos/dxos/pull/8233).\nconst QuerySchema = S.Struct({\n type: S.optional(S.String.annotations({ [AST.TitleAnnotationId]: 'Type' })),\n props: S.optional(S.Record({ key: S.String, value: S.Any })),\n}).annotations({ [AST.TitleAnnotationId]: 'Query' });\n\n/**\n * Subscription.\n */\nconst SubscriptionTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Subscription).annotations(typeLiteralAnnotations),\n // TODO(burdon): Define query DSL (from ECHO). Reconcile with Table.Query.\n filter: QuerySchema,\n options: S.optional(\n S.Struct({\n // Watch changes to object (not just creation).\n deep: S.optional(S.Boolean.annotations({ [AST.TitleAnnotationId]: 'Nested' })),\n // Debounce changes (delay in ms).\n delay: S.optional(S.Number.annotations({ [AST.TitleAnnotationId]: 'Delay' })),\n }).annotations({ [AST.TitleAnnotationId]: 'Options' }),\n ),\n}).pipe(S.mutable);\n\nexport type SubscriptionTrigger = S.Schema.Type<typeof SubscriptionTriggerSchema>;\n\n/**\n * Trigger schema (discriminated union).\n */\nexport const TriggerSchema = S.Union(\n //\n TimerTriggerSchema,\n WebhookTriggerSchema,\n SubscriptionTriggerSchema,\n).annotations({\n [AST.TitleAnnotationId]: 'Trigger',\n});\n\nexport type TriggerType = S.Schema.Type<typeof TriggerSchema>;\n\n/**\n * Function trigger.\n */\nexport const FunctionTriggerSchema = S.Struct({\n // TODO(burdon): What type does this reference.\n function: S.optional(S.String.annotations({ [AST.TitleAnnotationId]: 'Function' })),\n\n enabled: S.optional(S.Boolean.annotations({ [AST.TitleAnnotationId]: 'Enabled' })),\n\n // TODO(burdon): Flatten entire schema.\n spec: S.optional(TriggerSchema),\n\n // TODO(burdon): Get meta from function.\n // The `meta` property is merged into the event data passed to the function.\n meta: S.optional(S.mutable(S.Record({ key: S.String, value: S.Any }))),\n});\n\nexport type FunctionTriggerType = S.Schema.Type<typeof FunctionTriggerSchema>;\n\n/**\n * Function trigger.\n */\nexport class FunctionTrigger extends TypedObject({\n typename: 'dxos.org/type/FunctionTrigger',\n version: '0.1.0',\n})(FunctionTriggerSchema.fields) {}\n\n/**\n * Function definition.\n * @deprecated (Use dxos.org/type/Function)\n */\n// TODO(burdon): Reconcile with FunctionType.\nexport class FunctionDef extends TypedObject({\n typename: 'dxos.org/type/FunctionDef',\n version: '0.1.0',\n})({\n uri: S.String,\n description: S.optional(S.String),\n route: S.String,\n handler: S.String,\n}) {}\n\n/**\n * Function manifest file.\n */\nexport const FunctionManifestSchema = S.Struct({\n functions: S.optional(S.mutable(S.Array(RawObject(FunctionDef)))),\n triggers: S.optional(S.mutable(S.Array(RawObject(FunctionTrigger)))),\n});\n\nexport type FunctionManifest = S.Schema.Type<typeof FunctionManifestSchema>;\n\nexport const FUNCTION_TYPES = [FunctionDef, FunctionTrigger];\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAAoE;;;;;;;;UAOxDA,cAAAA;;;;GAAAA,gBAAAA,cAAAA,CAAAA,EAAAA;AAOZ,IAAMC,yBAAyB;EAAE,CAACC,uBAAIC,iBAAiB,GAAG;AAAO;AAKjE,IAAMC,qBAAqBC,qBAAEC,OAAO;EAClCC,MAAMF,qBAAEG,QAAO,OAAA,EAAoBC,YAAYR,sBAAAA;EAC/CS,MAAML,qBAAEM,OAAOF,YAAY;IACzB,CAACP,uBAAIC,iBAAiB,GAAG;IACzB,CAACD,uBAAIU,oBAAoB,GAAG;MAAC;;EAC/B,CAAA;AACF,CAAA,EAAGC,KAAKR,qBAAES,OAAO;AAOjB,IAAMC,uBAAuBV,qBAAEC,OAAO;EACpCC,MAAMF,qBAAEG,QAAO,SAAA,EAAsBC,YAAYR,sBAAAA;EACjDe,QAAQX,qBAAEY,SACRZ,qBAAEM,OAAOF,YAAY;IACnB,CAACP,uBAAIC,iBAAiB,GAAG;IACzB,CAACe,sCAAAA,GAAsB;MAAC;MAAO;;EACjC,CAAA,CAAA;EAEFC,MAAMd,qBAAEY,SACNZ,qBAAEe,OAAOX,YAAY;IACnB,CAACP,uBAAIC,iBAAiB,GAAG;EAC3B,CAAA,CAAA;AAEJ,CAAA,EAAGU,KAAKR,qBAAES,OAAO;AAKjB,IAAMO,cAAchB,qBAAEC,OAAO;EAC3BC,MAAMF,qBAAEY,SAASZ,qBAAEM,OAAOF,YAAY;IAAE,CAACP,uBAAIC,iBAAiB,GAAG;EAAO,CAAA,CAAA;EACxEmB,OAAOjB,qBAAEY,SAASZ,qBAAEkB,OAAO;IAAEC,KAAKnB,qBAAEM;IAAQc,OAAOpB,qBAAEqB;EAAI,CAAA,CAAA;AAC3D,CAAA,EAA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AAM,EAAA;AAAG;AAO3B,IAAMC,cAAN,kBAA0BJ,gCAAY;EAC3CC,UAAU;EACVC,SAAS;AACX,CAAA,EAAG;EACDG,KAAKzC,qBAAEM;EACPoC,aAAa1C,qBAAEY,SAASZ,qBAAEM,MAAM;EAChCqC,OAAO3C,qBAAEM;EACTsC,SAAS5C,qBAAEM;AACb,CAAA,EAAA;AAAI;AAKG,IAAMuC,yBAAyB7C,qBAAEC,OAAO;EAC7C6C,WAAW9C,qBAAEY,SAASZ,qBAAES,QAAQT,qBAAE+C,UAAMC,8BAAUR,WAAAA,CAAAA,CAAAA,CAAAA;EAClDS,UAAUjD,qBAAEY,SAASZ,qBAAES,QAAQT,qBAAE+C,UAAMC,8BAAUb,eAAAA,CAAAA,CAAAA,CAAAA;AACnD,CAAA;AAIO,IAAMe,iBAAiB;EAACV;EAAaL;;",
6
- "names": ["TriggerKind", "typeLiteralAnnotations", "AST", "TitleAnnotationId", "TimerTriggerSchema", "S", "Struct", "type", "Literal", "annotations", "cron", "String", "ExamplesAnnotationId", "pipe", "mutable", "WebhookTriggerSchema", "method", "optional", "OptionsAnnotationId", "port", "Number", "QuerySchema", "props", "Record", "key", "value", "Any", "SubscriptionTriggerSchema", "filter", "options", "deep", "Boolean", "delay", "TriggerSchema", "Union", "FunctionTriggerSchema", "function", "enabled", "spec", "meta", "FunctionTrigger", "TypedObject", "typename", "version", "fields", "FunctionDef", "uri", "description", "route", "handler", "FunctionManifestSchema", "functions", "Array", "RawObject", "triggers", "FUNCTION_TYPES"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["types.cjs"],
4
- "sourcesContent": ["import {\n FUNCTION_TYPES,\n FunctionDef,\n FunctionManifestSchema,\n FunctionTrigger,\n FunctionTriggerSchema,\n TriggerKind,\n TriggerSchema\n} from \"./chunk-JMJCJ3SA.cjs\";\nexport {\n FUNCTION_TYPES,\n FunctionDef,\n FunctionManifestSchema,\n FunctionTrigger,\n FunctionTriggerSchema,\n TriggerKind,\n TriggerSchema\n};\n//# sourceMappingURL=types.cjs.map\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAQO;",
6
- "names": []
7
- }
@@ -1,129 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
3
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
4
- }) : x)(function(x) {
5
- if (typeof require !== "undefined") return require.apply(this, arguments);
6
- throw Error('Dynamic require of "' + x + '" is not supported');
7
- });
8
-
9
- // packages/core/functions/src/types.ts
10
- import { AST, OptionsAnnotationId, RawObject, S, TypedObject } from "@dxos/echo-schema";
11
- var TriggerKind;
12
- (function(TriggerKind2) {
13
- TriggerKind2["Timer"] = "timer";
14
- TriggerKind2["Webhook"] = "webhook";
15
- TriggerKind2["Subscription"] = "subscription";
16
- })(TriggerKind || (TriggerKind = {}));
17
- var typeLiteralAnnotations = {
18
- [AST.TitleAnnotationId]: "Type"
19
- };
20
- var TimerTriggerSchema = S.Struct({
21
- type: S.Literal("timer").annotations(typeLiteralAnnotations),
22
- cron: S.String.annotations({
23
- [AST.TitleAnnotationId]: "Cron",
24
- [AST.ExamplesAnnotationId]: [
25
- "0 0 * * *"
26
- ]
27
- })
28
- }).pipe(S.mutable);
29
- var WebhookTriggerSchema = S.Struct({
30
- type: S.Literal("webhook").annotations(typeLiteralAnnotations),
31
- method: S.optional(S.String.annotations({
32
- [AST.TitleAnnotationId]: "Method",
33
- [OptionsAnnotationId]: [
34
- "GET",
35
- "POST"
36
- ]
37
- })),
38
- port: S.optional(S.Number.annotations({
39
- [AST.TitleAnnotationId]: "Port"
40
- }))
41
- }).pipe(S.mutable);
42
- var QuerySchema = S.Struct({
43
- type: S.optional(S.String.annotations({
44
- [AST.TitleAnnotationId]: "Type"
45
- })),
46
- props: S.optional(S.Record({
47
- key: S.String,
48
- value: S.Any
49
- }))
50
- }).annotations({
51
- [AST.TitleAnnotationId]: "Query"
52
- });
53
- var SubscriptionTriggerSchema = S.Struct({
54
- type: S.Literal("subscription").annotations(typeLiteralAnnotations),
55
- // TODO(burdon): Define query DSL (from ECHO). Reconcile with Table.Query.
56
- filter: QuerySchema,
57
- options: S.optional(S.Struct({
58
- // Watch changes to object (not just creation).
59
- deep: S.optional(S.Boolean.annotations({
60
- [AST.TitleAnnotationId]: "Nested"
61
- })),
62
- // Debounce changes (delay in ms).
63
- delay: S.optional(S.Number.annotations({
64
- [AST.TitleAnnotationId]: "Delay"
65
- }))
66
- }).annotations({
67
- [AST.TitleAnnotationId]: "Options"
68
- }))
69
- }).pipe(S.mutable);
70
- var TriggerSchema = S.Union(
71
- //
72
- TimerTriggerSchema,
73
- WebhookTriggerSchema,
74
- SubscriptionTriggerSchema
75
- ).annotations({
76
- [AST.TitleAnnotationId]: "Trigger"
77
- });
78
- var FunctionTriggerSchema = S.Struct({
79
- // TODO(burdon): What type does this reference.
80
- function: S.optional(S.String.annotations({
81
- [AST.TitleAnnotationId]: "Function"
82
- })),
83
- enabled: S.optional(S.Boolean.annotations({
84
- [AST.TitleAnnotationId]: "Enabled"
85
- })),
86
- // TODO(burdon): Flatten entire schema.
87
- spec: S.optional(TriggerSchema),
88
- // TODO(burdon): Get meta from function.
89
- // The `meta` property is merged into the event data passed to the function.
90
- meta: S.optional(S.mutable(S.Record({
91
- key: S.String,
92
- value: S.Any
93
- })))
94
- });
95
- var FunctionTrigger = class extends TypedObject({
96
- typename: "dxos.org/type/FunctionTrigger",
97
- version: "0.1.0"
98
- })(FunctionTriggerSchema.fields) {
99
- };
100
- var FunctionDef = class extends TypedObject({
101
- typename: "dxos.org/type/FunctionDef",
102
- version: "0.1.0"
103
- })({
104
- uri: S.String,
105
- description: S.optional(S.String),
106
- route: S.String,
107
- handler: S.String
108
- }) {
109
- };
110
- var FunctionManifestSchema = S.Struct({
111
- functions: S.optional(S.mutable(S.Array(RawObject(FunctionDef)))),
112
- triggers: S.optional(S.mutable(S.Array(RawObject(FunctionTrigger))))
113
- });
114
- var FUNCTION_TYPES = [
115
- FunctionDef,
116
- FunctionTrigger
117
- ];
118
-
119
- export {
120
- __require,
121
- TriggerKind,
122
- TriggerSchema,
123
- FunctionTriggerSchema,
124
- FunctionTrigger,
125
- FunctionDef,
126
- FunctionManifestSchema,
127
- FUNCTION_TYPES
128
- };
129
- //# sourceMappingURL=chunk-2NACE6MJ.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { AST, OptionsAnnotationId, RawObject, S, TypedObject } from '@dxos/echo-schema';\n\n/**\n * Type discriminator for TriggerType.\n * Every spec has a type field of type TriggerKind that we can use to understand which type we're working with.\n * https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions\n */\nexport enum TriggerKind {\n Timer = 'timer',\n Webhook = 'webhook',\n Subscription = 'subscription',\n}\n\n// TODO(burdon): Rename prop kind.\nconst typeLiteralAnnotations = { [AST.TitleAnnotationId]: 'Type' };\n\n/**\n * Cron timer.\n */\nconst TimerTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Timer).annotations(typeLiteralAnnotations),\n cron: S.String.annotations({\n [AST.TitleAnnotationId]: 'Cron',\n [AST.ExamplesAnnotationId]: ['0 0 * * *'],\n }),\n}).pipe(S.mutable);\n\nexport type TimerTrigger = S.Schema.Type<typeof TimerTriggerSchema>;\n\n/**\n * Webhook.\n */\nconst WebhookTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Webhook).annotations(typeLiteralAnnotations),\n method: S.optional(\n S.String.annotations({\n [AST.TitleAnnotationId]: 'Method',\n [OptionsAnnotationId]: ['GET', 'POST'],\n }),\n ),\n port: S.optional(\n S.Number.annotations({\n [AST.TitleAnnotationId]: 'Port',\n }),\n ),\n}).pipe(S.mutable);\n\nexport type WebhookTrigger = S.Schema.Type<typeof WebhookTriggerSchema>;\n\n// TODO(burdon): Use ECHO definition (from https://github.com/dxos/dxos/pull/8233).\nconst QuerySchema = S.Struct({\n type: S.optional(S.String.annotations({ [AST.TitleAnnotationId]: 'Type' })),\n props: S.optional(S.Record({ key: S.String, value: S.Any })),\n}).annotations({ [AST.TitleAnnotationId]: 'Query' });\n\n/**\n * Subscription.\n */\nconst SubscriptionTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Subscription).annotations(typeLiteralAnnotations),\n // TODO(burdon): Define query DSL (from ECHO). Reconcile with Table.Query.\n filter: QuerySchema,\n options: S.optional(\n S.Struct({\n // Watch changes to object (not just creation).\n deep: S.optional(S.Boolean.annotations({ [AST.TitleAnnotationId]: 'Nested' })),\n // Debounce changes (delay in ms).\n delay: S.optional(S.Number.annotations({ [AST.TitleAnnotationId]: 'Delay' })),\n }).annotations({ [AST.TitleAnnotationId]: 'Options' }),\n ),\n}).pipe(S.mutable);\n\nexport type SubscriptionTrigger = S.Schema.Type<typeof SubscriptionTriggerSchema>;\n\n/**\n * Trigger schema (discriminated union).\n */\nexport const TriggerSchema = S.Union(\n //\n TimerTriggerSchema,\n WebhookTriggerSchema,\n SubscriptionTriggerSchema,\n).annotations({\n [AST.TitleAnnotationId]: 'Trigger',\n});\n\nexport type TriggerType = S.Schema.Type<typeof TriggerSchema>;\n\n/**\n * Function trigger.\n */\nexport const FunctionTriggerSchema = S.Struct({\n // TODO(burdon): What type does this reference.\n function: S.optional(S.String.annotations({ [AST.TitleAnnotationId]: 'Function' })),\n\n enabled: S.optional(S.Boolean.annotations({ [AST.TitleAnnotationId]: 'Enabled' })),\n\n // TODO(burdon): Flatten entire schema.\n spec: S.optional(TriggerSchema),\n\n // TODO(burdon): Get meta from function.\n // The `meta` property is merged into the event data passed to the function.\n meta: S.optional(S.mutable(S.Record({ key: S.String, value: S.Any }))),\n});\n\nexport type FunctionTriggerType = S.Schema.Type<typeof FunctionTriggerSchema>;\n\n/**\n * Function trigger.\n */\nexport class FunctionTrigger extends TypedObject({\n typename: 'dxos.org/type/FunctionTrigger',\n version: '0.1.0',\n})(FunctionTriggerSchema.fields) {}\n\n/**\n * Function definition.\n * @deprecated (Use dxos.org/type/Function)\n */\n// TODO(burdon): Reconcile with FunctionType.\nexport class FunctionDef extends TypedObject({\n typename: 'dxos.org/type/FunctionDef',\n version: '0.1.0',\n})({\n uri: S.String,\n description: S.optional(S.String),\n route: S.String,\n handler: S.String,\n}) {}\n\n/**\n * Function manifest file.\n */\nexport const FunctionManifestSchema = S.Struct({\n functions: S.optional(S.mutable(S.Array(RawObject(FunctionDef)))),\n triggers: S.optional(S.mutable(S.Array(RawObject(FunctionTrigger)))),\n});\n\nexport type FunctionManifest = S.Schema.Type<typeof FunctionManifestSchema>;\n\nexport const FUNCTION_TYPES = [FunctionDef, FunctionTrigger];\n"],
5
- "mappings": ";;;;;;;;;AAIA,SAASA,KAAKC,qBAAqBC,WAAWC,GAAGC,mBAAmB;;UAOxDC,cAAAA;;;;GAAAA,gBAAAA,cAAAA,CAAAA,EAAAA;AAOZ,IAAMC,yBAAyB;EAAE,CAACC,IAAIC,iBAAiB,GAAG;AAAO;AAKjE,IAAMC,qBAAqBC,EAAEC,OAAO;EAClCC,MAAMF,EAAEG,QAAO,OAAA,EAAoBC,YAAYR,sBAAAA;EAC/CS,MAAML,EAAEM,OAAOF,YAAY;IACzB,CAACP,IAAIC,iBAAiB,GAAG;IACzB,CAACD,IAAIU,oBAAoB,GAAG;MAAC;;EAC/B,CAAA;AACF,CAAA,EAAGC,KAAKR,EAAES,OAAO;AAOjB,IAAMC,uBAAuBV,EAAEC,OAAO;EACpCC,MAAMF,EAAEG,QAAO,SAAA,EAAsBC,YAAYR,sBAAAA;EACjDe,QAAQX,EAAEY,SACRZ,EAAEM,OAAOF,YAAY;IACnB,CAACP,IAAIC,iBAAiB,GAAG;IACzB,CAACe,mB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,iBAAiB,GAAG;EAAW,CAAA,CAAA;EAEhFkC,SAAShC,EAAEY,SAASZ,EAAE0B,QAAQtB,YAAY;IAAE,CAACP,IAAIC,iBAAiB,GAAG;EAAU,CAAA,CAAA;;EAG/EmC,MAAMjC,EAAEY,SAASgB,aAAAA;;;EAIjBM,MAAMlC,EAAEY,SAASZ,EAAES,QAAQT,EAAEkB,OAAO;IAAEC,KAAKnB,EAAEM;IAAQc,OAAOpB,EAAEqB;EAAI,CAAA,CAAA,CAAA;AACpE,CAAA;AAOO,IAAMc,kBAAN,cAA8BC,YAAY;EAC/CC,UAAU;EACVC,SAAS;AACX,CAAA,EAAGR,sBAAsBS,MAAM,EAAA;AAAG;AAO3B,IAAMC,cAAN,cAA0BJ,YAAY;EAC3CC,UAAU;EACVC,SAAS;AACX,CAAA,EAAG;EACDG,KAAKzC,EAAEM;EACPoC,aAAa1C,EAAEY,SAASZ,EAAEM,MAAM;EAChCqC,OAAO3C,EAAEM;EACTsC,SAAS5C,EAAEM;AACb,CAAA,EAAA;AAAI;AAKG,IAAMuC,yBAAyB7C,EAAEC,OAAO;EAC7C6C,WAAW9C,EAAEY,SAASZ,EAAES,QAAQT,EAAE+C,MAAMC,UAAUR,WAAAA,CAAAA,CAAAA,CAAAA;EAClDS,UAAUjD,EAAEY,SAASZ,EAAES,QAAQT,EAAE+C,MAAMC,UAAUb,eAAAA,CAAAA,CAAAA,CAAAA;AACnD,CAAA;AAIO,IAAMe,iBAAiB;EAACV;EAAaL;;",
6
- "names": ["AST", "OptionsAnnotationId", "RawObject", "S", "TypedObject", "TriggerKind", "typeLiteralAnnotations", "AST", "TitleAnnotationId", "TimerTriggerSchema", "S", "Struct", "type", "Literal", "annotations", "cron", "String", "ExamplesAnnotationId", "pipe", "mutable", "WebhookTriggerSchema", "method", "optional", "OptionsAnnotationId", "port", "Number", "QuerySchema", "props", "Record", "key", "value", "Any", "SubscriptionTriggerSchema", "filter", "options", "deep", "Boolean", "delay", "TriggerSchema", "Union", "FunctionTriggerSchema", "function", "enabled", "spec", "meta", "FunctionTrigger", "TypedObject", "typename", "version", "fields", "FunctionDef", "uri", "description", "route", "handler", "FunctionManifestSchema", "functions", "Array", "RawObject", "triggers", "FUNCTION_TYPES"]
7
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAuC,CAAC,EAAe,MAAM,mBAAmB,CAAC;AAExF;;;;GAIG;AACH,oBAAY,WAAW;IACrB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,YAAY,iBAAiB;CAC9B;AAKD;;GAEG;AACH,QAAA,MAAM,kBAAkB;;;GAMN,CAAC;AAEnB,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE;;GAEG;AACH,QAAA,MAAM,oBAAoB;;;;GAaR,CAAC;AAEnB,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAQxE;;GAEG;AACH,QAAA,MAAM,yBAAyB;;;;;;;;;;GAYb,CAAC;AAEnB,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAElF;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;KAOxB,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,aAAa,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;EAYhC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,qBAAqB,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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