@vibesdotdev/integrations-notion 0.0.0-stage → 1.0.0-rc.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 (139) hide show
  1. package/LICENSE +126 -0
  2. package/README.md +142 -2
  3. package/dist/client/helper.d.ts +16 -0
  4. package/dist/client/helper.d.ts.map +1 -0
  5. package/dist/client/helper.js +17 -0
  6. package/dist/client/helper.js.map +1 -0
  7. package/dist/client/index.d.ts +3 -0
  8. package/dist/client/index.d.ts.map +1 -0
  9. package/dist/client/index.js +3 -0
  10. package/dist/client/index.js.map +1 -0
  11. package/dist/client/runtime-client.d.ts +89 -0
  12. package/dist/client/runtime-client.d.ts.map +1 -0
  13. package/dist/client/runtime-client.js +130 -0
  14. package/dist/client/runtime-client.js.map +1 -0
  15. package/dist/docs/integrations-notion.docs.descriptor.d.ts +19 -0
  16. package/dist/docs/integrations-notion.docs.descriptor.d.ts.map +1 -0
  17. package/dist/docs/integrations-notion.docs.descriptor.js +62 -0
  18. package/dist/docs/integrations-notion.docs.descriptor.js.map +1 -0
  19. package/dist/index.d.ts +23 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +28 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/integrations-notion.plugin.d.ts +19 -0
  24. package/dist/integrations-notion.plugin.d.ts.map +1 -0
  25. package/dist/integrations-notion.plugin.js +37 -0
  26. package/dist/integrations-notion.plugin.js.map +1 -0
  27. package/dist/notion/index.d.ts +12 -0
  28. package/dist/notion/index.d.ts.map +1 -0
  29. package/dist/notion/index.js +13 -0
  30. package/dist/notion/index.js.map +1 -0
  31. package/dist/notion/notion-client.d.ts +119 -0
  32. package/dist/notion/notion-client.d.ts.map +1 -0
  33. package/dist/notion/notion-client.js +438 -0
  34. package/dist/notion/notion-client.js.map +1 -0
  35. package/dist/notion/notion-implementation.d.ts +72 -0
  36. package/dist/notion/notion-implementation.d.ts.map +1 -0
  37. package/dist/notion/notion-implementation.js +222 -0
  38. package/dist/notion/notion-implementation.js.map +1 -0
  39. package/dist/notion/notion-schemas.d.ts +2 -0
  40. package/dist/notion/notion-schemas.d.ts.map +1 -0
  41. package/dist/notion/notion-schemas.js +2 -0
  42. package/dist/notion/notion-schemas.js.map +1 -0
  43. package/dist/notion/system.integration.notion.descriptor.d.ts +69 -0
  44. package/dist/notion/system.integration.notion.descriptor.d.ts.map +1 -0
  45. package/dist/notion/system.integration.notion.descriptor.js +109 -0
  46. package/dist/notion/system.integration.notion.descriptor.js.map +1 -0
  47. package/dist/notion.catalog.plugin.d.ts +78 -0
  48. package/dist/notion.catalog.plugin.d.ts.map +1 -0
  49. package/dist/notion.catalog.plugin.js +21 -0
  50. package/dist/notion.catalog.plugin.js.map +1 -0
  51. package/dist/notion.client.plugin.d.ts +3 -0
  52. package/dist/notion.client.plugin.d.ts.map +1 -0
  53. package/dist/notion.client.plugin.js +49 -0
  54. package/dist/notion.client.plugin.js.map +1 -0
  55. package/dist/schemas/json.d.ts +6 -0
  56. package/dist/schemas/json.d.ts.map +1 -0
  57. package/dist/schemas/json.js +4 -0
  58. package/dist/schemas/json.js.map +1 -0
  59. package/dist/schemas/notion.d.ts +221 -0
  60. package/dist/schemas/notion.d.ts.map +1 -0
  61. package/dist/schemas/notion.js +130 -0
  62. package/dist/schemas/notion.js.map +1 -0
  63. package/dist/schemas/oauth.d.ts +63 -0
  64. package/dist/schemas/oauth.d.ts.map +1 -0
  65. package/dist/schemas/oauth.js +15 -0
  66. package/dist/schemas/oauth.js.map +1 -0
  67. package/dist/schemas/operations.d.ts +556 -0
  68. package/dist/schemas/operations.d.ts.map +1 -0
  69. package/dist/schemas/operations.js +39 -0
  70. package/dist/schemas/operations.js.map +1 -0
  71. package/dist/schemas/sync.d.ts +32 -0
  72. package/dist/schemas/sync.d.ts.map +1 -0
  73. package/dist/schemas/sync.js +12 -0
  74. package/dist/schemas/sync.js.map +1 -0
  75. package/dist/schemas/tools.d.ts +239 -0
  76. package/dist/schemas/tools.d.ts.map +1 -0
  77. package/dist/schemas/tools.js +93 -0
  78. package/dist/schemas/tools.js.map +1 -0
  79. package/dist/schemas/vendor.d.ts +150 -0
  80. package/dist/schemas/vendor.d.ts.map +1 -0
  81. package/dist/schemas/vendor.js +31 -0
  82. package/dist/schemas/vendor.js.map +1 -0
  83. package/dist/server/oauth.d.ts +17 -0
  84. package/dist/server/oauth.d.ts.map +1 -0
  85. package/dist/server/oauth.js +64 -0
  86. package/dist/server/oauth.js.map +1 -0
  87. package/dist/sync/knowledge.notion.sync-mapping.descriptor.d.ts +15 -0
  88. package/dist/sync/knowledge.notion.sync-mapping.descriptor.d.ts.map +1 -0
  89. package/dist/sync/knowledge.notion.sync-mapping.descriptor.js +15 -0
  90. package/dist/sync/knowledge.notion.sync-mapping.descriptor.js.map +1 -0
  91. package/dist/sync/knowledge.notion.sync-mapping.impl.d.ts +13 -0
  92. package/dist/sync/knowledge.notion.sync-mapping.impl.d.ts.map +1 -0
  93. package/dist/sync/knowledge.notion.sync-mapping.impl.js +27 -0
  94. package/dist/sync/knowledge.notion.sync-mapping.impl.js.map +1 -0
  95. package/dist/sync/notion-record-projection.d.ts +16 -0
  96. package/dist/sync/notion-record-projection.d.ts.map +1 -0
  97. package/dist/sync/notion-record-projection.js +50 -0
  98. package/dist/sync/notion-record-projection.js.map +1 -0
  99. package/dist/sync/notion.sync-endpoint.descriptor.d.ts +14 -0
  100. package/dist/sync/notion.sync-endpoint.descriptor.d.ts.map +1 -0
  101. package/dist/sync/notion.sync-endpoint.descriptor.js +10 -0
  102. package/dist/sync/notion.sync-endpoint.descriptor.js.map +1 -0
  103. package/dist/sync/notion.sync-endpoint.impl.d.ts +55 -0
  104. package/dist/sync/notion.sync-endpoint.impl.d.ts.map +1 -0
  105. package/dist/sync/notion.sync-endpoint.impl.js +557 -0
  106. package/dist/sync/notion.sync-endpoint.impl.js.map +1 -0
  107. package/dist/sync/projects.notion.sync-mapping.descriptor.d.ts +15 -0
  108. package/dist/sync/projects.notion.sync-mapping.descriptor.d.ts.map +1 -0
  109. package/dist/sync/projects.notion.sync-mapping.descriptor.js +15 -0
  110. package/dist/sync/projects.notion.sync-mapping.descriptor.js.map +1 -0
  111. package/dist/sync/projects.notion.sync-mapping.impl.d.ts +13 -0
  112. package/dist/sync/projects.notion.sync-mapping.impl.d.ts.map +1 -0
  113. package/dist/sync/projects.notion.sync-mapping.impl.js +26 -0
  114. package/dist/sync/projects.notion.sync-mapping.impl.js.map +1 -0
  115. package/dist/sync/work.notion.sync-mapping.descriptor.d.ts +15 -0
  116. package/dist/sync/work.notion.sync-mapping.descriptor.d.ts.map +1 -0
  117. package/dist/sync/work.notion.sync-mapping.descriptor.js +15 -0
  118. package/dist/sync/work.notion.sync-mapping.descriptor.js.map +1 -0
  119. package/dist/sync/work.notion.sync-mapping.impl.d.ts +13 -0
  120. package/dist/sync/work.notion.sync-mapping.impl.d.ts.map +1 -0
  121. package/dist/sync/work.notion.sync-mapping.impl.js +63 -0
  122. package/dist/sync/work.notion.sync-mapping.impl.js.map +1 -0
  123. package/dist/tools/descriptors.d.ts +781 -0
  124. package/dist/tools/descriptors.d.ts.map +1 -0
  125. package/dist/tools/descriptors.js +129 -0
  126. package/dist/tools/descriptors.js.map +1 -0
  127. package/dist/tools/impl.d.ts +12 -0
  128. package/dist/tools/impl.d.ts.map +1 -0
  129. package/dist/tools/impl.js +61 -0
  130. package/dist/tools/impl.js.map +1 -0
  131. package/dist/tools/index.d.ts +3 -0
  132. package/dist/tools/index.d.ts.map +1 -0
  133. package/dist/tools/index.js +3 -0
  134. package/dist/tools/index.js.map +1 -0
  135. package/dist/tools/schemas.d.ts +2 -0
  136. package/dist/tools/schemas.d.ts.map +1 -0
  137. package/dist/tools/schemas.js +2 -0
  138. package/dist/tools/schemas.js.map +1 -0
  139. package/package.json +105 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../src/server/oauth.ts"],"names":[],"mappings":"AAAA,OAAO,E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
+ id: string;
7
+ kind: "sync/mapping";
8
+ profile: "knowledge.notion";
9
+ version: "1";
10
+ name: string;
11
+ description: string;
12
+ enabled: true;
13
+ };
14
+ export default descriptor;
15
+ //# sourceMappingURL=knowledge.notion.sync-mapping.descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge.notion.sync-mapping.descriptor.d.ts","sourceRoot":"","sources":["../../src/sync/knowledge.notion.sync-mapping.descriptor.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,6BAA6B;;;CAGV,CAAC;AAEjC,QAAA,MAAM,UAAU;;;;;;;;CASiB,CAAC;AAElC,eAAe,UAAU,CAAC"}
@@ -0,0 +1,15 @@
1
+ export const KNOWLEDGE_NOTION_SYNC_MAPPING = {
2
+ profile: 'knowledge.notion',
3
+ version: '1'
4
+ };
5
+ const descriptor = {
6
+ id: 'knowledge.notion@1',
7
+ kind: 'sync/mapping',
8
+ profile: KNOWLEDGE_NOTION_SYNC_MAPPING.profile,
9
+ version: KNOWLEDGE_NOTION_SYNC_MAPPING.version,
10
+ name: 'Knowledge to Notion projection',
11
+ description: 'Normalizes Knowledge records and Notion pages to the version-1 title and content-text contract.',
12
+ enabled: true
13
+ };
14
+ export default descriptor;
15
+ //# sourceMappingURL=knowledge.notion.sync-mapping.descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge.notion.sync-mapping.descriptor.js","sourceRoot":"","sources":["../../src/sync/knowledge.notion.sync-mapping.descriptor.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC5C,OAAO,EAAE,kBAAkB;IAC3B,OAAO,EAAE,GAAG;CACmB,CAAC;AAEjC,MAAM,UAAU,GAAG;IAClB,EAAE,EAAE,oBAAoB;IACxB,IAAI,EAAE,cAAuB;IAC7B,OAAO,EAAE,6BAA6B,CAAC,OAAO;IAC9C,OAAO,EAAE,6BAA6B,CAAC,OAAO;IAC9C,IAAI,EAAE,gCAAgC;IACtC,WAAW,EACV,iGAAiG;IAClG,OAAO,EAAE,IAAI;CACmB,CAAC;AAElC,eAAe,UAAU,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { SyncMappingImplementation } from '@vibesdotdev/sync/mapping';
2
+ declare class KnowledgeNotionSyncMapping implements SyncMappingImplementation {
3
+ toCanonical(input: Parameters<SyncMappingImplementation['toCanonical']>[0]): {
4
+ canonicalKey: string;
5
+ data: Record<string, string>;
6
+ };
7
+ fromCanonical(input: Parameters<SyncMappingImplementation['fromCanonical']>[0]): {
8
+ data: Record<string, string>;
9
+ };
10
+ }
11
+ declare const _default: import("@vibesdotdev/kernel").RuntimeImplementationWrapper<typeof KnowledgeNotionSyncMapping>;
12
+ export default _default;
13
+ //# sourceMappingURL=knowledge.notion.sync-mapping.impl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge.notion.sync-mapping.impl.d.ts","sourceRoot":"","sources":["../../src/sync/knowledge.notion.sync-mapping.impl.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAS3E,cAAM,0BAA2B,YAAW,yBAAyB;IACpE,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC,yBAAyB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;;;;IAO1E,aAAa,CAAC,KAAK,EAAE,UAAU,CAAC,yBAAyB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;;;CAK9E;;AAED,wBAIG"}
@@ -0,0 +1,27 @@
1
+ import { JsonObjectSchema } from "../schemas/json.js";
2
+ import { contract } from "../schemas/operations.js";
3
+ import { createRuntimeImplementation } from '@vibesdotdev/kernel';
4
+ import { projectNotionRecord } from "./notion-record-projection.js";
5
+ const knowledgeProjection = (data, canonicalKey) => projectNotionRecord(contract(JsonObjectSchema).parse(data), canonicalKey, {
6
+ profile: 'Knowledge to Notion',
7
+ requireContent: true
8
+ });
9
+ class KnowledgeNotionSyncMapping {
10
+ toCanonical(input) {
11
+ return {
12
+ canonicalKey: input.record.canonicalKey,
13
+ data: knowledgeProjection(input.record.data, input.record.canonicalKey)
14
+ };
15
+ }
16
+ fromCanonical(input) {
17
+ return {
18
+ data: knowledgeProjection(input.record.data, input.record.canonicalKey)
19
+ };
20
+ }
21
+ }
22
+ export default createRuntimeImplementation({
23
+ kind: 'sync/mapping',
24
+ id: 'knowledge.notion@1',
25
+ implementation: KnowledgeNotionSyncMapping
26
+ });
27
+ //# sourceMappingURL=knowledge.notion.sync-mapping.impl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge.notion.sync-mapping.impl.js","sourceRoot":"","sources":["../../src/sync/knowledge.notion.sync-mapping.impl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,mBAAmB,GAAG,CAAC,IAAoB,EAAE,YAAoB,EAAE,EAAE,CAC1E,mBAAmB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE;IACzE,OAAO,EAAE,qBAAqB;IAC9B,cAAc,EAAE,IAAI;CACpB,CAAC,CAAC;AAEJ,MAAM,0BAA0B;IAC/B,WAAW,CAAC,KAA8D;QACzE,OAAO;YACN,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,YAAY;YACvC,IAAI,EAAE,mBAAmB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC;SACvE,CAAC;IACH,CAAC;IAED,aAAa,CAAC,KAAgE;QAC7E,OAAO;YACN,IAAI,EAAE,mBAAmB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC;SACvE,CAAC;IACH,CAAC;CACD;AAED,eAAe,2BAA2B,CAAC;IAC1C,IAAI,EAAE,cAAc;IACpB,EAAE,EAAE,oBAAoB;IACxB,cAAc,EAAE,0BAA0B;CAC1C,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { SyncRecordData } from '../schemas/sync.ts';
2
+ import type { SemanticRecord } from '../schemas/sync.ts';
3
+ type OptionalSemanticField = 'contentType' | 'projectId' | 'status' | 'priority';
4
+ export declare function projectNotionRecord(data: SyncRecordData, canonicalKey: string, options: {
5
+ profile: string;
6
+ requireContent?: boolean;
7
+ optionalFields?: readonly OptionalSemanticField[];
8
+ }): SemanticRecord;
9
+ /**
10
+ * Mapping output is complete semantic state, not PATCH intent. Preserve an
11
+ * explicit empty-string clear only when the destination currently owns text;
12
+ * otherwise an omitted optional field remains omitted and hashes canonically.
13
+ */
14
+ export declare function clearDestinationContentWhenSourceOmitsIt(projected: SemanticRecord, destinationData: SyncRecordData): SemanticRecord;
15
+ export {};
16
+ //# sourceMappingURL=notion-record-projection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notion-record-projection.d.ts","sourceRoot":"","sources":["../../src/sync/notion-record-projection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,KAAK,qBAAqB,GAAG,aAAa,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;AAWjF,wBAAgB,mBAAmB,CAClC,IAAI,EAAE,cAAc,EACpB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE;IACR,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAC;CAClD,GACC,cAAc,CAmBhB;AAED;;;;GAIG;AACH,wBAAgB,wCAAwC,CACvD,SAAS,EAAE,cAAc,EACzB,eAAe,EAAE,cAAc,GAC7B,cAAc,CAShB"}
@@ -0,0 +1,50 @@
1
+ import * as z from 'zod/v4';
2
+ import { JsonObjectSchema } from "../schemas/json.js";
3
+ import { contract } from "../schemas/operations.js";
4
+ import { CapabilityError } from '@vibesdotdev/kernel';
5
+ function nonEmptyString(record, keys) {
6
+ for (const key of keys) {
7
+ const value = record[key];
8
+ const parsed = z.string().trim().min(1).safeParse(value);
9
+ if (parsed.success)
10
+ return parsed.data;
11
+ }
12
+ return undefined;
13
+ }
14
+ export function projectNotionRecord(data, canonicalKey, options) {
15
+ const record = contract(JsonObjectSchema).parse(data);
16
+ const title = nonEmptyString(record, ['title', 'name']) ?? canonicalKey;
17
+ const contentText = nonEmptyString(record, ['contentText', 'description', 'content']);
18
+ if (options.requireContent && !contentText) {
19
+ throw new CapabilityError(`${options.profile} mapping requires non-empty 'contentText'.`, 'INVALID_INPUT', { reason: 'notion-mapping-content-required' });
20
+ }
21
+ const projected = {
22
+ title
23
+ };
24
+ if (contentText)
25
+ projected.contentText = contentText;
26
+ for (const field of options.optionalFields ?? []) {
27
+ const value = nonEmptyString(record, [field]);
28
+ if (value)
29
+ projected[field] = value;
30
+ }
31
+ return projected;
32
+ }
33
+ /**
34
+ * Mapping output is complete semantic state, not PATCH intent. Preserve an
35
+ * explicit empty-string clear only when the destination currently owns text;
36
+ * otherwise an omitted optional field remains omitted and hashes canonically.
37
+ */
38
+ export function clearDestinationContentWhenSourceOmitsIt(projected, destinationData) {
39
+ if (Object.hasOwn(projected, 'contentText'))
40
+ return projected;
41
+ const destination = contract(JsonObjectSchema.optional()).parse(destinationData);
42
+ if (!destination)
43
+ return projected;
44
+ const hasContent = ['contentText', 'description', 'content'].some((key) => {
45
+ const value = destination[key];
46
+ return z.string().trim().min(1).safeParse(value).success;
47
+ });
48
+ return hasContent ? { ...projected, contentText: '' } : projected;
49
+ }
50
+ //# sourceMappingURL=notion-record-projection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notion-record-projection.js","sourceRoot":"","sources":["../../src/sync/notion-record-projection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAmB,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAItD,SAAS,cAAc,CAAC,MAAkB,EAAE,IAAuB;IAClE,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC1D,IAAI,MAAM,CAAC,OAAO;YAAE,OAAO,MAAM,CAAC,IAAI,CAAC;IACvC,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,mBAAmB,CAClC,IAAoB,EACpB,YAAoB,EACpB,OAIC;IAED,MAAM,MAAM,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,IAAI,YAAY,CAAC;IACxE,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,aAAa,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC;IACtF,IAAI,OAAO,CAAC,cAAc,IAAI,CAAC,WAAW,EAAE,CAAC;QAC5C,MAAM,IAAI,eAAe,CACxB,GAAG,OAAO,CAAC,OAAO,4CAA4C,EAC9D,eAAe,EAAE,EAAC,MAAM,EAA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
4
+ resourceType: string;
5
+ provider: string;
6
+ capabilities: {
7
+ pull: boolean;
8
+ push: boolean;
9
+ delete: boolean;
10
+ };
11
+ enabled: boolean;
12
+ };
13
+ export default _default;
14
+ //# sourceMappingURL=notion.sync-endpoint.descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notion.sync-endpoint.descriptor.d.ts","sourceRoot":"","sources":["../../src/sync/notion.sync-endpoint.descriptor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,wBAOG"}
@@ -0,0 +1,10 @@
1
+ import { createRuntimeAsset } from '@vibesdotdev/kernel/factory';
2
+ export default createRuntimeAsset({
3
+ id: 'sync.endpoint.notion.pages',
4
+ kind: 'sync/endpoint',
5
+ resourceType: 'notion-page',
6
+ provider: 'notion',
7
+ capabilities: { pull: true, push: true, delete: true },
8
+ enabled: true
9
+ });
10
+ //# sourceMappingURL=notion.sync-endpoint.descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notion.sync-endpoint.descriptor.js","sourceRoot":"","sources":["../../src/sync/notion.sync-endpoint.descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAGjE,eAAe,kBAAkB,CAAyB;IACzD,EAAE,EAAE,4BAA4B;IAChC,IAAI,EAAE,eAAe;IACrB,YAAY,EAAE,aAAa;IAC3B,QAAQ,EAAE,QAAQ;IAClB,YAAY,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IACtD,OAAO,EAAE,IAAI;CACb,CAAC,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { CapabilityError } from '@vibesdotdev/kernel';
2
+ import { type JsonObject } from '../schemas/json.ts';
3
+ import type { KindContext, RuntimeDescriptor, VibesRuntime } from '@vibesdotdev/kernel';
4
+ import type { SyncApplyResult, SyncEndpointApplyInput, SyncEndpointImplementation, SyncEndpointPullInput } from '@vibesdotdev/sync/projection';
5
+ import type { CreateNotionPageInput, NotionDataSource, NotionPage, NotionPullOptions, NotionPullResult, UpdateNotionPageInput } from '../notion/notion-schemas.ts';
6
+ export interface NotionSyncClientPort {
7
+ pull(options: NotionPullOptions): Promise<NotionPullResult>;
8
+ dataSources: {
9
+ get(dataSourceId: string): Promise<NotionDataSource | null>;
10
+ query(input: {
11
+ dataSourceId: string;
12
+ filter: JsonObject;
13
+ pageSize: number;
14
+ }): Promise<{
15
+ pages: NotionPage[];
16
+ hasMore: boolean;
17
+ nextCursor?: string;
18
+ }>;
19
+ };
20
+ pages: {
21
+ get(pageId: string): Promise<NotionPage | null>;
22
+ create(input: CreateNotionPageInput): Promise<NotionPage>;
23
+ update(pageId: string, input: UpdateNotionPageInput): Promise<NotionPage>;
24
+ };
25
+ }
26
+ export type ResolveNotionSyncClient = () => Promise<NotionSyncClientPort>;
27
+ export declare class NotionSyncEndpoint implements SyncEndpointImplementation {
28
+ private readonly resolveClient;
29
+ private pageIdsByScope;
30
+ private completedOperations;
31
+ constructor(resolveClient: ResolveNotionSyncClient);
32
+ pull(input: SyncEndpointPullInput): Promise<{
33
+ records: {
34
+ id: string;
35
+ canonicalKey: string;
36
+ revision: string;
37
+ contentHash: string;
38
+ updatedAt: string;
39
+ deleted: boolean;
40
+ data: unknown;
41
+ metadata: Record<string, unknown>;
42
+ }[];
43
+ cursor: string | undefined;
44
+ hasMore: boolean;
45
+ }>;
46
+ apply(input: SyncEndpointApplyInput): Promise<Array<SyncApplyResult & {
47
+ cause?: CapabilityError;
48
+ }>>;
49
+ }
50
+ declare class RuntimeNotionSyncEndpoint extends NotionSyncEndpoint {
51
+ constructor(_descriptor: RuntimeDescriptor, context: KindContext<VibesRuntime>);
52
+ }
53
+ declare const _default: import("@vibesdotdev/kernel").RuntimeImplementationWrapper<typeof RuntimeNotionSyncEndpoint>;
54
+ export default _default;
55
+ //# sourceMappingURL=notion.sync-endpoint.impl.d.ts.map
@@ -0,0 +1 @@
1
+ {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