@invoiceleaf/integration-sdk 1.0.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 (50) hide show
  1. package/README.md +317 -0
  2. package/dist/context/IntegrationContext.d.ts +102 -0
  3. package/dist/context/IntegrationContext.d.ts.map +1 -0
  4. package/dist/context/IntegrationContext.js +2 -0
  5. package/dist/context/IntegrationContext.js.map +1 -0
  6. package/dist/context/index.d.ts +3 -0
  7. package/dist/context/index.d.ts.map +1 -0
  8. package/dist/context/index.js +3 -0
  9. package/dist/context/index.js.map +1 -0
  10. package/dist/context/types.d.ts +109 -0
  11. package/dist/context/types.d.ts.map +1 -0
  12. package/dist/context/types.js +5 -0
  13. package/dist/context/types.js.map +1 -0
  14. package/dist/helpers/defineHandler.d.ts +116 -0
  15. package/dist/helpers/defineHandler.d.ts.map +1 -0
  16. package/dist/helpers/defineHandler.js +42 -0
  17. package/dist/helpers/defineHandler.js.map +1 -0
  18. package/dist/helpers/defineIntegration.d.ts +32 -0
  19. package/dist/helpers/defineIntegration.d.ts.map +1 -0
  20. package/dist/helpers/defineIntegration.js +69 -0
  21. package/dist/helpers/defineIntegration.js.map +1 -0
  22. package/dist/index.d.ts +33 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +36 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/types/actions.d.ts +41 -0
  27. package/dist/types/actions.d.ts.map +1 -0
  28. package/dist/types/actions.js +2 -0
  29. package/dist/types/actions.js.map +1 -0
  30. package/dist/types/index.d.ts +6 -0
  31. package/dist/types/index.d.ts.map +1 -0
  32. package/dist/types/index.js +6 -0
  33. package/dist/types/index.js.map +1 -0
  34. package/dist/types/manifest.d.ts +71 -0
  35. package/dist/types/manifest.d.ts.map +1 -0
  36. package/dist/types/manifest.js +2 -0
  37. package/dist/types/manifest.js.map +1 -0
  38. package/dist/types/schema.d.ts +88 -0
  39. package/dist/types/schema.d.ts.map +1 -0
  40. package/dist/types/schema.js +2 -0
  41. package/dist/types/schema.js.map +1 -0
  42. package/dist/types/triggers.d.ts +54 -0
  43. package/dist/types/triggers.d.ts.map +1 -0
  44. package/dist/types/triggers.js +2 -0
  45. package/dist/types/triggers.js.map +1 -0
  46. package/dist/types/ui.d.ts +180 -0
  47. package/dist/types/ui.d.ts.map +1 -0
  48. package/dist/types/ui.js +2 -0
  49. package/dist/types/ui.js.map +1 -0
  50. package/package.json +54 -0
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Helper function to define a handler with type safety.
3
+ *
4
+ * @example
5
+ * ```typescript
6
+ * interface ExportInput {
7
+ * fromDate: string;
8
+ * toDate: string;
9
+ * format: 'csv' | 'xml';
10
+ * }
11
+ *
12
+ * interface ExportOutput {
13
+ * exportId: string;
14
+ * documentCount: number;
15
+ * }
16
+ *
17
+ * export const exportToDATEV = defineHandler<ExportInput, ExportOutput>(
18
+ * async (input, context) => {
19
+ * context.logger.info('Starting export', { fromDate: input.fromDate });
20
+ *
21
+ * const documents = await context.data.listDocuments({
22
+ * fromDate: input.fromDate,
23
+ * toDate: input.toDate,
24
+ * });
25
+ *
26
+ * const exportResult = await context.data.createExport({
27
+ * format: input.format,
28
+ * documentIds: documents.items.map(d => d.id),
29
+ * });
30
+ *
31
+ * return {
32
+ * exportId: exportResult.id,
33
+ * documentCount: documents.items.length,
34
+ * };
35
+ * }
36
+ * );
37
+ * ```
38
+ */
39
+ export function defineHandler(handler) {
40
+ return handler;
41
+ }
42
+ //# sourceMappingURL=defineHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defineHandler.js","sourceRoot":"","sources":["../../src/helpers/defineHandler.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,UAAU,aAAa,CAC3B,OAAyC;IAEzC,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { IntegrationManifest } from '../types/manifest.js';
2
+ /**
3
+ * Helper function to define an integration manifest with type safety.
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * const manifest = defineIntegration({
8
+ * id: 'datev-export',
9
+ * name: 'DATEV Export',
10
+ * version: '1.0.0',
11
+ * dataAccess: ['documents', 'companies'],
12
+ * triggers: [
13
+ * {
14
+ * id: 'export-monthly',
15
+ * name: 'Monthly Export',
16
+ * type: 'schedule',
17
+ * handler: 'onMonthlyExport',
18
+ * schedule: '0 2 1 * *', // 2 AM on 1st of month
19
+ * }
20
+ * ],
21
+ * actions: [
22
+ * {
23
+ * id: 'export-now',
24
+ * name: 'Export Now',
25
+ * handler: 'exportToDATEV',
26
+ * }
27
+ * ]
28
+ * });
29
+ * ```
30
+ */
31
+ export declare function defineIntegration(manifest: IntegrationManifest): IntegrationManifest;
32
+ //# sourceMappingURL=defineIntegration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defineIntegration.d.ts","sourceRoot":"","sources":["../../src/helpers/defineIntegration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,mBAAmB,CA6CpF"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Helper function to define an integration manifest with type safety.
3
+ *
4
+ * @example
5
+ * ```typescript
6
+ * const manifest = defineIntegration({
7
+ * id: 'datev-export',
8
+ * name: 'DATEV Export',
9
+ * version: '1.0.0',
10
+ * dataAccess: ['documents', 'companies'],
11
+ * triggers: [
12
+ * {
13
+ * id: 'export-monthly',
14
+ * name: 'Monthly Export',
15
+ * type: 'schedule',
16
+ * handler: 'onMonthlyExport',
17
+ * schedule: '0 2 1 * *', // 2 AM on 1st of month
18
+ * }
19
+ * ],
20
+ * actions: [
21
+ * {
22
+ * id: 'export-now',
23
+ * name: 'Export Now',
24
+ * handler: 'exportToDATEV',
25
+ * }
26
+ * ]
27
+ * });
28
+ * ```
29
+ */
30
+ export function defineIntegration(manifest) {
31
+ // Validate required fields
32
+ if (!manifest.id) {
33
+ throw new Error('Integration manifest must have an id');
34
+ }
35
+ if (!manifest.name) {
36
+ throw new Error('Integration manifest must have a name');
37
+ }
38
+ if (!manifest.version) {
39
+ throw new Error('Integration manifest must have a version');
40
+ }
41
+ if (!manifest.dataAccess || manifest.dataAccess.length === 0) {
42
+ throw new Error('Integration manifest must declare dataAccess');
43
+ }
44
+ if (!manifest.triggers || manifest.triggers.length === 0) {
45
+ if (!manifest.actions || manifest.actions.length === 0) {
46
+ throw new Error('Integration must have at least one trigger or action');
47
+ }
48
+ }
49
+ // Validate trigger handlers
50
+ for (const trigger of manifest.triggers || []) {
51
+ if (!trigger.id) {
52
+ throw new Error('Trigger must have an id');
53
+ }
54
+ if (!trigger.handler) {
55
+ throw new Error(`Trigger ${trigger.id} must have a handler`);
56
+ }
57
+ }
58
+ // Validate action handlers
59
+ for (const action of manifest.actions || []) {
60
+ if (!action.id) {
61
+ throw new Error('Action must have an id');
62
+ }
63
+ if (!action.handler) {
64
+ throw new Error(`Action ${action.id} must have a handler`);
65
+ }
66
+ }
67
+ return manifest;
68
+ }
69
+ //# sourceMappingURL=defineIntegration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defineIntegration.js","sourceRoot":"","sources":["../../src/helpers/defineIntegration.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAA6B;IAC7D,2BAA2B;IAC3B,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,C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OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @invoiceleaf/integration-sdk
3
+ *
4
+ * SDK for building InvoiceLeaf integrations.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * import { defineIntegration, IntegrationContext } from '@invoiceleaf/integration-sdk';
9
+ *
10
+ * const manifest = defineIntegration({
11
+ * id: 'my-integration',
12
+ * name: 'My Integration',
13
+ * version: '1.0.0',
14
+ * dataAccess: ['documents', 'companies'],
15
+ * triggers: [...],
16
+ * actions: [...]
17
+ * });
18
+ *
19
+ * export async function onDocumentCreated(
20
+ * input: { documentId: string },
21
+ * context: IntegrationContext
22
+ * ) {
23
+ * const doc = await context.data.getDocument(input.documentId);
24
+ * context.logger.info('Document created', { doc });
25
+ * return { success: true };
26
+ * }
27
+ * ```
28
+ */
29
+ export * from './types/index.js';
30
+ export * from './context/index.js';
31
+ export { defineIntegration } from './helpers/defineIntegration.js';
32
+ export { defineHandler } from './helpers/defineHandler.js';
33
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,cAAc,kBAAkB,CAAC;AAGjC,cAAc,oBAAoB,CAAC;AAGnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @invoiceleaf/integration-sdk
3
+ *
4
+ * SDK for building InvoiceLeaf integrations.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * import { defineIntegration, IntegrationContext } from '@invoiceleaf/integration-sdk';
9
+ *
10
+ * const manifest = defineIntegration({
11
+ * id: 'my-integration',
12
+ * name: 'My Integration',
13
+ * version: '1.0.0',
14
+ * dataAccess: ['documents', 'companies'],
15
+ * triggers: [...],
16
+ * actions: [...]
17
+ * });
18
+ *
19
+ * export async function onDocumentCreated(
20
+ * input: { documentId: string },
21
+ * context: IntegrationContext
22
+ * ) {
23
+ * const doc = await context.data.getDocument(input.documentId);
24
+ * context.logger.info('Document created', { doc });
25
+ * return { success: true };
26
+ * }
27
+ * ```
28
+ */
29
+ // Types
30
+ export * from './types/index.js';
31
+ // Context
32
+ export * from './context/index.js';
33
+ // Helpers
34
+ export { defineIntegration } from './helpers/defineIntegration.js';
35
+ export { defineHandler } from './helpers/defineHandler.js';
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,QAAQ;AACR,cAAc,kBAAkB,CAAC;AAEjC,UAAU;AACV,cAAc,oBAAoB,CAAC;AAEnC,UAAU;AACV,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,41 @@
1
+ import type { JsonSchema } from './schema.js';
2
+ /**
3
+ * Action definition - defines callable operations.
4
+ */
5
+ export interface ActionDefinition {
6
+ /** Unique identifier */
7
+ id: string;
8
+ /** Display name */
9
+ name: string;
10
+ /** Description */
11
+ description?: string;
12
+ /** Handler function name in the module */
13
+ handler: string;
14
+ /** Input schema */
15
+ inputSchema?: JsonSchema;
16
+ /** Output schema */
17
+ outputSchema?: JsonSchema;
18
+ /** Whether this action should be hidden from UI */
19
+ internal?: boolean;
20
+ }
21
+ /**
22
+ * Export definition - defines export formats.
23
+ */
24
+ export interface ExportDefinition {
25
+ /** Unique identifier */
26
+ id: string;
27
+ /** Display name */
28
+ name: string;
29
+ /** Description */
30
+ description?: string;
31
+ /** File format */
32
+ format: ExportFormat;
33
+ /** Handler function name */
34
+ handler: string;
35
+ /** File extension */
36
+ extension?: string;
37
+ /** MIME type */
38
+ mimeType?: string;
39
+ }
40
+ export type ExportFormat = 'csv' | 'xml' | 'json' | 'pdf' | 'xlsx' | 'custom';
41
+ //# sourceMappingURL=actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/types/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IAEX,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IAEb,kBAAkB;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAEhB,mBAAmB;IACnB,WAAW,CAAC,EAAE,UAAU,CAAC;IAEzB,oBAAoB;IACpB,YAAY,CAAC,EAAE,UAAU,CAAC;IAE1B,mDAAmD;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IAEX,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IAEb,kBAAkB;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,kBAAkB;IAClB,MAAM,EAAE,YAAY,CAAC;IAErB,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC;IAEhB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,gBAAgB;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/types/actions.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export * from './manifest.js';
2
+ export * from './triggers.js';
3
+ export * from './actions.js';
4
+ export * from './ui.js';
5
+ export * from './schema.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './manifest.js';
2
+ export * from './triggers.js';
3
+ export * from './actions.js';
4
+ export * from './ui.js';
5
+ export * from './schema.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
@@ -0,0 +1,71 @@
1
+ import type { TriggerDefinition } from './triggers.js';
2
+ import type { ActionDefinition, ExportDefinition } from './actions.js';
3
+ import type { PageDefinition } from './ui.js';
4
+ import type { JsonSchema } from './schema.js';
5
+ /**
6
+ * Integration Manifest - the main definition file for an integration.
7
+ */
8
+ export interface IntegrationManifest {
9
+ /** Unique identifier for the integration (slug format) */
10
+ id: string;
11
+ /** Display name */
12
+ name: string;
13
+ /** Semantic version */
14
+ version: string;
15
+ /** Short description (max 200 chars) */
16
+ description?: string;
17
+ /** Long description (markdown supported) */
18
+ longDescription?: string;
19
+ /** Icon URL or emoji */
20
+ icon?: string;
21
+ /** Categories for marketplace */
22
+ categories?: IntegrationCategory[];
23
+ /** Data types this integration accesses */
24
+ dataAccess: DataAccessType[];
25
+ /** External service authentication configurations */
26
+ externalAuth?: ExternalAuthConfig[];
27
+ /** Trigger definitions */
28
+ triggers: TriggerDefinition[];
29
+ /** Action definitions */
30
+ actions: ActionDefinition[];
31
+ /** Custom UI pages */
32
+ pages?: PageDefinition[];
33
+ /** Export format definitions */
34
+ exports?: ExportDefinition[];
35
+ /** User configuration schema */
36
+ configSchema?: JsonSchema;
37
+ /** Resource limits */
38
+ limits?: ResourceLimits;
39
+ }
40
+ export type IntegrationCategory = 'accounting' | 'analytics' | 'automation' | 'communication' | 'crm' | 'export' | 'file-storage' | 'payment' | 'tax' | 'other';
41
+ export type DataAccessType = 'documents' | 'companies' | 'categories' | 'tags' | 'exports' | 'spaces';
42
+ export interface ExternalAuthConfig {
43
+ /** Provider identifier */
44
+ provider: string;
45
+ /** Display name */
46
+ name: string;
47
+ /** Auth type */
48
+ type: 'oauth2' | 'oauth2.1' | 'api_key';
49
+ /** OAuth2 configuration */
50
+ oauth?: {
51
+ authorizeUrl: string;
52
+ tokenUrl: string;
53
+ scopes: string[];
54
+ pkceRequired?: boolean;
55
+ };
56
+ /** API key configuration */
57
+ apiKey?: {
58
+ headerName: string;
59
+ prefix?: string;
60
+ instructions?: string;
61
+ };
62
+ }
63
+ export interface ResourceLimits {
64
+ /** Rate limit per hour */
65
+ rateLimit?: number;
66
+ /** Execution timeout in seconds */
67
+ timeoutSeconds?: number;
68
+ /** Memory limit in MB */
69
+ memoryMb?: number;
70
+ }
71
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/types/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,U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;IAEb,gBAAgB;IAChB,IAAI,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;IAExC,2BAA2B;IAC3B,KAAK,CAAC,EAAE;QACN,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB,CAAC;IAEF,4BAA4B;IAC5B,MAAM,CAAC,EAAE;QACP,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,mCAAmC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/types/manifest.ts"],"names":[],"mappings":""}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * JSON Schema subset for form generation and validation.
3
+ */
4
+ export interface JsonSchema {
5
+ /** Schema type */
6
+ type?: JsonSchemaType;
7
+ /** Display title */
8
+ title?: string;
9
+ /** Description */
10
+ description?: string;
11
+ /** Default value */
12
+ default?: unknown;
13
+ /** Object properties */
14
+ properties?: Record<string, JsonSchemaProperty>;
15
+ /** Required property names */
16
+ required?: string[];
17
+ /** Array items schema */
18
+ items?: JsonSchema;
19
+ /** Additional properties allowed */
20
+ additionalProperties?: boolean | JsonSchema;
21
+ /** Pattern properties */
22
+ patternProperties?: Record<string, JsonSchema>;
23
+ /** Minimum properties */
24
+ minProperties?: number;
25
+ /** Maximum properties */
26
+ maxProperties?: number;
27
+ /** Property order */
28
+ propertyOrder?: string[];
29
+ /** Schema reference */
30
+ $ref?: string;
31
+ /** Schema definitions */
32
+ definitions?: Record<string, JsonSchema>;
33
+ /** Any of schemas */
34
+ anyOf?: JsonSchema[];
35
+ /** One of schemas */
36
+ oneOf?: JsonSchema[];
37
+ /** All of schemas */
38
+ allOf?: JsonSchema[];
39
+ /** Not schema */
40
+ not?: JsonSchema;
41
+ /** If-then-else */
42
+ if?: JsonSchema;
43
+ then?: JsonSchema;
44
+ else?: JsonSchema;
45
+ }
46
+ export interface JsonSchemaProperty extends JsonSchema {
47
+ /** String format */
48
+ format?: JsonSchemaFormat;
49
+ /** Enum values */
50
+ enum?: (string | number | boolean)[];
51
+ /** Enum display names */
52
+ enumNames?: string[];
53
+ /** Minimum length (string) */
54
+ minLength?: number;
55
+ /** Maximum length (string) */
56
+ maxLength?: number;
57
+ /** Regex pattern (string) */
58
+ pattern?: string;
59
+ /** Minimum value (number) */
60
+ minimum?: number;
61
+ /** Maximum value (number) */
62
+ maximum?: number;
63
+ /** Exclusive minimum (number) */
64
+ exclusiveMinimum?: number;
65
+ /** Exclusive maximum (number) */
66
+ exclusiveMaximum?: number;
67
+ /** Multiple of (number) */
68
+ multipleOf?: number;
69
+ /** Minimum items (array) */
70
+ minItems?: number;
71
+ /** Maximum items (array) */
72
+ maxItems?: number;
73
+ /** Unique items (array) */
74
+ uniqueItems?: boolean;
75
+ /** Read-only field */
76
+ readOnly?: boolean;
77
+ /** Write-only field */
78
+ writeOnly?: boolean;
79
+ /** Constant value */
80
+ const?: unknown;
81
+ /** Content media type */
82
+ contentMediaType?: string;
83
+ /** Content encoding */
84
+ contentEncoding?: string;
85
+ }
86
+ export type JsonSchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null';
87
+ export type JsonSchemaFormat = 'date' | 'time' | 'date-time' | 'email' | 'uri' | 'uri-reference' | 'hostname' | 'ipv4' | 'ipv6' | 'uuid' | 'textarea' | 'password' | 'color' | 'file';
88
+ //# sourceMappingURL=schema.d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Q,GACR,SAAS,GACT,SAAS,GACT,QAAQ,GACR,OAAO,GACP,MAAM,CAAC;AAEX,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,MAAM,GACN,WAAW,GACX,OAAO,GACP,KAAK,GACL,eAAe,GACf,UAAU,GACV,MAAM,GACN,MAAM,GACN,MAAM,GACN,UAAU,GACV,UAAU,GACV,OAAO,GACP,MAAM,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/types/schema.ts"],"names":[],"mappings":""}
@@ -0,0 +1,54 @@
1
+ import type { JsonSchema } from './schema.js';
2
+ /**
3
+ * Trigger definition - defines when the integration runs.
4
+ */
5
+ export interface TriggerDefinition {
6
+ /** Unique identifier */
7
+ id: string;
8
+ /** Display name */
9
+ name: string;
10
+ /** Description */
11
+ description?: string;
12
+ /** Trigger type */
13
+ type: TriggerType;
14
+ /** Handler function name in the module */
15
+ handler: string;
16
+ /** Event types to listen for (for 'event' type) */
17
+ events?: EventType[];
18
+ /** Cron expression (for 'schedule' type) */
19
+ schedule?: string;
20
+ /** Webhook configuration (for 'webhook' type) */
21
+ webhook?: WebhookConfig;
22
+ /** User action configuration (for 'user_action' type) */
23
+ userAction?: UserActionConfig;
24
+ /** Input schema */
25
+ inputSchema?: JsonSchema;
26
+ /** Output schema */
27
+ outputSchema?: JsonSchema;
28
+ }
29
+ export type TriggerType = 'webhook' | 'event' | 'schedule' | 'user_action';
30
+ export type EventType = 'document.created' | 'document.updated' | 'document.processed' | 'document.deleted' | 'company.created' | 'company.updated' | 'company.deleted' | 'export.completed' | 'space.member.added' | 'space.member.removed';
31
+ export interface WebhookConfig {
32
+ /** Path for the webhook endpoint */
33
+ path?: string;
34
+ /** HTTP methods to accept */
35
+ methods?: ('GET' | 'POST' | 'PUT' | 'DELETE')[];
36
+ /** Signature verification */
37
+ signature?: {
38
+ header: string;
39
+ algorithm: 'hmac-sha256' | 'hmac-sha1';
40
+ secretConfigKey: string;
41
+ };
42
+ }
43
+ export interface UserActionConfig {
44
+ /** Label for the action button */
45
+ label: string;
46
+ /** Icon (emoji or icon name) */
47
+ icon?: string;
48
+ /** Where the action appears */
49
+ placement: ActionPlacement[];
50
+ /** Confirmation message */
51
+ confirmMessage?: string;
52
+ }
53
+ export type ActionPlacement = 'document-list' | 'document-detail' | 'company-list' | 'company-detail' | 'settings' | 'toolbar';
54
+ //# sourceMappingURL=triggers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../../src/types/triggers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IAEX,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IAEb,kBAAkB;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,mBAAmB;IACnB,IAAI,EAAE,WAAW,CAAC;IAElB,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAEhB,mDAAmD;IACnD,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IAErB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,iDAAiD;IACjD,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB,yDAAyD;IACzD,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAE9B,mBAAmB;IACnB,WAAW,CAAC,EAAE,UAAU,CAAC;IAEzB,oBAAoB;IACpB,YAAY,CAAC,EAAE,UAAU,CAAC;CAC3B;AAED,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,CAAC;AAE3E,MAAM,MAAM,SAAS,GACjB,kBAAkB,GAClB,kBAAkB,GAClB,oBAAoB,GACpB,kBAAkB,GAClB,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,kBAAkB,GAClB,oBAAoB,GACpB,sBAAsB,CAAC;AAE3B,MAAM,WAAW,aAAa;IAC5B,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,6BAA6B;IAC7B,OAAO,CAAC,EAAE,CAAC,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC,EAAE,CAAC;IAEhD,6BAA6B;IAC7B,SAAS,CAAC,EAAE;QACV,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,aAAa,GAAG,WAAW,CAAC;QACvC,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AAED,MAAM,WAAW,gBAAgB;IAC/B,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IAEd,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,+BAA+B;IAC/B,SAAS,EAAE,eAAe,EAAE,CAAC;IAE7B,2BAA2B;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,MAAM,eAAe,GACvB,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,gBAAgB,GAChB,UAAU,GACV,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=triggers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triggers.js","sourceRoot":"","sources":["../../src/types/triggers.ts"],"names":[],"mappings":""}