integrate-sdk 0.8.31 → 0.8.35

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.
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Trigger Utilities
3
+ * Helper functions for trigger pre-processing
4
+ */
5
+ import type { TriggerStatus } from './types.js';
6
+ /**
7
+ * Generate a unique trigger ID using nanoid
8
+ * Format: trig_{12-character-nanoid}
9
+ *
10
+ * @returns Unique trigger ID
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * const id = generateTriggerId();
15
+ * // Returns: "trig_abc123xyz789"
16
+ * ```
17
+ */
18
+ export declare function generateTriggerId(): string;
19
+ /**
20
+ * Extract provider name from tool name
21
+ * Tool names follow the pattern: {provider}_{action}
22
+ *
23
+ * @param toolName - Full tool name (e.g., "gmail_send_email")
24
+ * @returns Provider name (e.g., "gmail")
25
+ *
26
+ * @example
27
+ * ```typescript
28
+ * extractProviderFromToolName("gmail_send_email"); // "gmail"
29
+ * extractProviderFromToolName("github_create_issue"); // "github"
30
+ * extractProviderFromToolName("notion_create_page"); // "notion"
31
+ * ```
32
+ */
33
+ export declare function extractProviderFromToolName(toolName: string): string;
34
+ /**
35
+ * Result of status transition validation
36
+ */
37
+ export type StatusTransitionResult = {
38
+ valid: true;
39
+ } | {
40
+ valid: false;
41
+ error: string;
42
+ };
43
+ /**
44
+ * Validate status transitions for pause/resume operations
45
+ *
46
+ * Rules:
47
+ * - Can only pause triggers with status 'active'
48
+ * - Can only resume triggers with status 'paused'
49
+ *
50
+ * @param currentStatus - Current trigger status
51
+ * @param targetStatus - Desired target status
52
+ * @returns Validation result with error message if invalid
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * validateStatusTransition('active', 'paused'); // { valid: true }
57
+ * validateStatusTransition('paused', 'active'); // { valid: true }
58
+ * validateStatusTransition('completed', 'paused'); // { valid: false, error: "..." }
59
+ * ```
60
+ */
61
+ export declare function validateStatusTransition(currentStatus: TriggerStatus, targetStatus: TriggerStatus): StatusTransitionResult;
62
+ /**
63
+ * Calculate whether more results are available for pagination
64
+ *
65
+ * @param offset - Current pagination offset (number of items skipped)
66
+ * @param returnedCount - Number of items returned in current page
67
+ * @param total - Total number of items available
68
+ * @returns True if more results are available
69
+ *
70
+ * @example
71
+ * ```typescript
72
+ * calculateHasMore(0, 10, 25); // true (showing 0-9 of 25)
73
+ * calculateHasMore(10, 10, 25); // true (showing 10-19 of 25)
74
+ * calculateHasMore(20, 5, 25); // false (showing 20-24 of 25)
75
+ * ```
76
+ */
77
+ export declare function calculateHasMore(offset: number, returnedCount: number, total: number): boolean;
78
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/triggers/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGpE;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAC9B;IAAE,KAAK,EAAE,IAAI,CAAA;CAAE,GACf;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,aAAa,GAC1B,sBAAsB,CAkBxB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,GACZ,OAAO,CAET"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "integrate-sdk",
3
- "version": "0.8.31",
3
+ "version": "0.8.35",
4
4
  "description": "Type-safe 3rd party integration SDK for the Integrate MCP server",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -8,12 +8,12 @@
8
8
  "types": "./dist/index.d.ts",
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "https://github.com/integratedotdev/integrate-sdk.git"
11
+ "url": "https://github.com/integratedotdev/typescript-sdk.git"
12
12
  },
13
13
  "bugs": {
14
- "url": "https://github.com/integratedotdev/integrate-sdk/issues"
14
+ "url": "https://github.com/integratedotdev/typescript-sdk/issues"
15
15
  },
16
- "homepage": "https://github.com/integratedotdev/integrate-sdk#readme",
16
+ "homepage": "https://github.com/integratedotdev/typescript-sdk#readme",
17
17
  "exports": {
18
18
  ".": {
19
19
  "types": "./dist/index.d.ts",
@@ -84,6 +84,7 @@
84
84
  "author": "",
85
85
  "license": "MIT",
86
86
  "dependencies": {
87
+ "nanoid": "^3.3.7",
87
88
  "zod": "^3.23.8"
88
89
  },
89
90
  "devDependencies": {
@@ -124,4 +125,4 @@
124
125
  "simple-git-hooks": {
125
126
  "pre-commit": "./scripts/check-version.sh"
126
127
  }
127
- }
128
+ }