terse-cli 0.2.15 → 0.3.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 (165) hide show
  1. package/dist/commands/deploy.d.ts.map +1 -1
  2. package/dist/commands/deploy.js +4 -3
  3. package/dist/commands/deploy.js.map +1 -1
  4. package/dist/commands/generate.d.ts.map +1 -1
  5. package/dist/commands/generate.js +36 -253
  6. package/dist/commands/generate.js.map +1 -1
  7. package/dist/commands/toolRun.js +1 -1
  8. package/dist/commands/toolRun.js.map +1 -1
  9. package/dist/index.js +1 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/providers/LanguageProvider.d.ts +6 -2
  12. package/dist/providers/LanguageProvider.d.ts.map +1 -1
  13. package/dist/providers/codegenTypes.d.ts +16 -130
  14. package/dist/providers/codegenTypes.d.ts.map +1 -1
  15. package/dist/providers/typescript/TypeScriptProvider.d.ts +2 -2
  16. package/dist/providers/typescript/TypeScriptProvider.d.ts.map +1 -1
  17. package/dist/providers/typescript/TypeScriptProvider.js +53 -4
  18. package/dist/providers/typescript/TypeScriptProvider.js.map +1 -1
  19. package/dist/providers/typescript/attioProjection.d.ts +50 -0
  20. package/dist/providers/typescript/attioProjection.d.ts.map +1 -0
  21. package/dist/providers/typescript/attioProjection.js +358 -0
  22. package/dist/providers/typescript/attioProjection.js.map +1 -0
  23. package/dist/providers/typescript/modules/IntegrationModule.d.ts +82 -0
  24. package/dist/providers/typescript/modules/IntegrationModule.d.ts.map +1 -0
  25. package/dist/providers/typescript/modules/IntegrationModule.js +184 -0
  26. package/dist/providers/typescript/modules/IntegrationModule.js.map +1 -0
  27. package/dist/providers/typescript/modules/attio/AttioModule.d.ts +55 -0
  28. package/dist/providers/typescript/modules/attio/AttioModule.d.ts.map +1 -0
  29. package/dist/providers/typescript/modules/attio/AttioModule.js +163 -0
  30. package/dist/providers/typescript/modules/attio/AttioModule.js.map +1 -0
  31. package/dist/providers/typescript/modules/attio/attioProjection.d.ts +50 -0
  32. package/dist/providers/typescript/modules/attio/attioProjection.d.ts.map +1 -0
  33. package/dist/providers/typescript/modules/attio/attioProjection.js +358 -0
  34. package/dist/providers/typescript/modules/attio/attioProjection.js.map +1 -0
  35. package/dist/providers/typescript/modules/attio/attioToolMethods.d.ts +4 -0
  36. package/dist/providers/typescript/modules/attio/attioToolMethods.d.ts.map +1 -0
  37. package/dist/providers/typescript/modules/attio/attioToolMethods.js +295 -0
  38. package/dist/providers/typescript/modules/attio/attioToolMethods.js.map +1 -0
  39. package/dist/providers/typescript/modules/attio/attioTypes.d.ts +36 -0
  40. package/dist/providers/typescript/modules/attio/attioTypes.d.ts.map +1 -0
  41. package/dist/providers/typescript/modules/attio/attioTypes.js +2 -0
  42. package/dist/providers/typescript/modules/attio/attioTypes.js.map +1 -0
  43. package/dist/providers/typescript/modules/datadog/DatadogModule.d.ts +25 -0
  44. package/dist/providers/typescript/modules/datadog/DatadogModule.d.ts.map +1 -0
  45. package/dist/providers/typescript/modules/datadog/DatadogModule.js +33 -0
  46. package/dist/providers/typescript/modules/datadog/DatadogModule.js.map +1 -0
  47. package/dist/providers/typescript/modules/github/GithubModule.d.ts +44 -0
  48. package/dist/providers/typescript/modules/github/GithubModule.d.ts.map +1 -0
  49. package/dist/providers/typescript/modules/github/GithubModule.js +111 -0
  50. package/dist/providers/typescript/modules/github/GithubModule.js.map +1 -0
  51. package/dist/providers/typescript/modules/gmail/GmailModule.d.ts +17 -0
  52. package/dist/providers/typescript/modules/gmail/GmailModule.d.ts.map +1 -0
  53. package/dist/providers/typescript/modules/gmail/GmailModule.js +30 -0
  54. package/dist/providers/typescript/modules/gmail/GmailModule.js.map +1 -0
  55. package/dist/providers/typescript/modules/hey_reach/HeyReachModule.d.ts +25 -0
  56. package/dist/providers/typescript/modules/hey_reach/HeyReachModule.d.ts.map +1 -0
  57. package/dist/providers/typescript/modules/hey_reach/HeyReachModule.js +33 -0
  58. package/dist/providers/typescript/modules/hey_reach/HeyReachModule.js.map +1 -0
  59. package/dist/providers/typescript/modules/launchdarkly/LaunchDarklyModule.d.ts +26 -0
  60. package/dist/providers/typescript/modules/launchdarkly/LaunchDarklyModule.d.ts.map +1 -0
  61. package/dist/providers/typescript/modules/launchdarkly/LaunchDarklyModule.js +34 -0
  62. package/dist/providers/typescript/modules/launchdarkly/LaunchDarklyModule.js.map +1 -0
  63. package/dist/providers/typescript/modules/linear/LinearModule.d.ts +35 -0
  64. package/dist/providers/typescript/modules/linear/LinearModule.d.ts.map +1 -0
  65. package/dist/providers/typescript/modules/linear/LinearModule.js +48 -0
  66. package/dist/providers/typescript/modules/linear/LinearModule.js.map +1 -0
  67. package/dist/providers/typescript/modules/moduleHelpers.d.ts +23 -0
  68. package/dist/providers/typescript/modules/moduleHelpers.d.ts.map +1 -0
  69. package/dist/providers/typescript/modules/moduleHelpers.js +74 -0
  70. package/dist/providers/typescript/modules/moduleHelpers.js.map +1 -0
  71. package/dist/providers/typescript/modules/notion/NotionModule.d.ts +33 -0
  72. package/dist/providers/typescript/modules/notion/NotionModule.d.ts.map +1 -0
  73. package/dist/providers/typescript/modules/notion/NotionModule.js +44 -0
  74. package/dist/providers/typescript/modules/notion/NotionModule.js.map +1 -0
  75. package/dist/providers/typescript/modules/posthog/PosthogModule.d.ts +30 -0
  76. package/dist/providers/typescript/modules/posthog/PosthogModule.d.ts.map +1 -0
  77. package/dist/providers/typescript/modules/posthog/PosthogModule.js +60 -0
  78. package/dist/providers/typescript/modules/posthog/PosthogModule.js.map +1 -0
  79. package/dist/providers/typescript/modules/registry.d.ts +11 -0
  80. package/dist/providers/typescript/modules/registry.d.ts.map +1 -0
  81. package/dist/providers/typescript/modules/registry.js +37 -0
  82. package/dist/providers/typescript/modules/registry.js.map +1 -0
  83. package/dist/providers/typescript/modules/resend/ResendModule.d.ts +32 -0
  84. package/dist/providers/typescript/modules/resend/ResendModule.d.ts.map +1 -0
  85. package/dist/providers/typescript/modules/resend/ResendModule.js +71 -0
  86. package/dist/providers/typescript/modules/resend/ResendModule.js.map +1 -0
  87. package/dist/providers/typescript/modules/slack/SlackModule.d.ts +32 -0
  88. package/dist/providers/typescript/modules/slack/SlackModule.d.ts.map +1 -0
  89. package/dist/providers/typescript/modules/slack/SlackModule.js +51 -0
  90. package/dist/providers/typescript/modules/slack/SlackModule.js.map +1 -0
  91. package/dist/providers/typescript/modules/snowflake/SnowflakeModule.d.ts +20 -0
  92. package/dist/providers/typescript/modules/snowflake/SnowflakeModule.d.ts.map +1 -0
  93. package/dist/providers/typescript/modules/snowflake/SnowflakeModule.js +27 -0
  94. package/dist/providers/typescript/modules/snowflake/SnowflakeModule.js.map +1 -0
  95. package/dist/providers/typescript/modules/templateRenderer.d.ts +17 -0
  96. package/dist/providers/typescript/modules/templateRenderer.d.ts.map +1 -0
  97. package/dist/providers/typescript/modules/templateRenderer.js +64 -0
  98. package/dist/providers/typescript/modules/templateRenderer.js.map +1 -0
  99. package/dist/providers/typescript/modules/terse/TerseModule.d.ts +20 -0
  100. package/dist/providers/typescript/modules/terse/TerseModule.d.ts.map +1 -0
  101. package/dist/providers/typescript/modules/terse/TerseModule.js +61 -0
  102. package/dist/providers/typescript/modules/terse/TerseModule.js.map +1 -0
  103. package/dist/providers/typescript/modules/workos/WorkOSModule.d.ts +17 -0
  104. package/dist/providers/typescript/modules/workos/WorkOSModule.d.ts.map +1 -0
  105. package/dist/providers/typescript/modules/workos/WorkOSModule.js +30 -0
  106. package/dist/providers/typescript/modules/workos/WorkOSModule.js.map +1 -0
  107. package/dist/providers/typescript/prepareCodegenData.d.ts +13 -0
  108. package/dist/providers/typescript/prepareCodegenData.d.ts.map +1 -1
  109. package/dist/providers/typescript/prepareCodegenData.js +42 -3
  110. package/dist/providers/typescript/prepareCodegenData.js.map +1 -1
  111. package/dist/providers/typescript/templateEngine.d.ts +8 -2
  112. package/dist/providers/typescript/templateEngine.d.ts.map +1 -1
  113. package/dist/providers/typescript/templateEngine.js +241 -29
  114. package/dist/providers/typescript/templateEngine.js.map +1 -1
  115. package/dist/providers/typescript/triggerTypeDeclarations.d.ts +4 -4
  116. package/dist/providers/typescript/triggerTypeDeclarations.d.ts.map +1 -1
  117. package/dist/providers/typescript/triggerTypeDeclarations.js +26 -83
  118. package/dist/providers/typescript/triggerTypeDeclarations.js.map +1 -1
  119. package/dist/providers/typescript/typePrinter.d.ts +1 -0
  120. package/dist/providers/typescript/typePrinter.d.ts.map +1 -1
  121. package/dist/providers/typescript/typePrinter.js +7 -1
  122. package/dist/providers/typescript/typePrinter.js.map +1 -1
  123. package/package.json +7 -5
  124. package/src/providers/typescript/modules/attio/attio.schemas.hbs +150 -0
  125. package/src/providers/typescript/modules/attio/attio.tools.hbs +192 -0
  126. package/src/providers/typescript/modules/attio/attio.triggers.hbs +130 -0
  127. package/src/providers/typescript/modules/datadog/datadog.tools.hbs +16 -0
  128. package/src/providers/typescript/modules/github/github.tools.hbs +68 -0
  129. package/src/providers/typescript/modules/github/github.triggers.hbs +40 -0
  130. package/src/providers/typescript/modules/gmail/gmail.tools.hbs +17 -0
  131. package/src/providers/typescript/modules/gmail/gmail.triggers.hbs +16 -0
  132. package/src/providers/typescript/modules/hey_reach/hey_reach.tools.hbs +9 -0
  133. package/src/providers/typescript/modules/hey_reach/hey_reach.triggers.hbs +56 -0
  134. package/src/providers/typescript/modules/launchdarkly/launchdarkly.tools.hbs +16 -0
  135. package/src/providers/typescript/modules/linear/linear.tools.hbs +23 -0
  136. package/src/providers/typescript/modules/linear/linear.triggers.hbs +24 -0
  137. package/src/providers/typescript/modules/notion/notion.tools.hbs +20 -0
  138. package/src/providers/typescript/modules/posthog/posthog.tools.hbs +28 -0
  139. package/src/providers/typescript/modules/resend/resend.tools.hbs +46 -0
  140. package/src/providers/typescript/modules/slack/slack.tools.hbs +18 -0
  141. package/src/providers/typescript/modules/slack/slack.triggers.hbs +28 -0
  142. package/src/providers/typescript/modules/snowflake/snowflake.tools.hbs +12 -0
  143. package/src/providers/typescript/modules/terse/terse.tools.hbs +22 -0
  144. package/src/providers/typescript/modules/terse/terse.triggers.hbs +33 -0
  145. package/src/providers/typescript/modules/workos/workos.tools.hbs +12 -0
  146. package/src/providers/typescript/modules/workos/workos.triggers.hbs +64 -0
  147. package/templates/typescript/codegen/.impeccable/hook.cache.json +1 -1
  148. package/templates/typescript/codegen/common.hbs +6 -0
  149. package/templates/typescript/codegen/partials/tools-slice.hbs +18 -0
  150. package/templates/typescript/codegen/root.hbs +72 -0
  151. package/templates/typescript/codegen/sdk-primitives.hbs +42 -0
  152. package/templates/typescript/codegen/generated.hbs +0 -14
  153. package/templates/typescript/codegen/partials/attio-section.hbs +0 -86
  154. package/templates/typescript/codegen/partials/datadog-section.hbs +0 -3
  155. package/templates/typescript/codegen/partials/github-section.hbs +0 -30
  156. package/templates/typescript/codegen/partials/header.hbs +0 -17
  157. package/templates/typescript/codegen/partials/hey-reach-section.hbs +0 -3
  158. package/templates/typescript/codegen/partials/launchdarkly-section.hbs +0 -3
  159. package/templates/typescript/codegen/partials/linear-section.hbs +0 -5
  160. package/templates/typescript/codegen/partials/notion-section.hbs +0 -5
  161. package/templates/typescript/codegen/partials/posthog-section.hbs +0 -15
  162. package/templates/typescript/codegen/partials/skills-section.hbs +0 -99
  163. package/templates/typescript/codegen/partials/slack-section.hbs +0 -5
  164. package/templates/typescript/codegen/partials/tools-section.hbs +0 -94
  165. package/templates/typescript/codegen/partials/triggers-section.hbs +0 -353
@@ -0,0 +1,150 @@
1
+ {{sectionHeader "Attio workspace schemas"}}
2
+
3
+ {{#each section.valueTypeLines}}
4
+ {{{this}}}
5
+ {{/each}}
6
+
7
+ export type AttioAttributeDefinition<TSlug extends string = string, TType extends string = string> = {
8
+ apiSlug: TSlug
9
+ title?: string
10
+ type?: TType
11
+ isRequired?: boolean
12
+ isUnique?: boolean
13
+ }
14
+
15
+ export class AttioObject<
16
+ TSlug extends string = string,
17
+ TRecordValues extends Record<string, unknown> = Record<string, unknown>,
18
+ TInputValues extends Record<string, unknown> = TRecordValues
19
+ > {
20
+ constructor(
21
+ public readonly apiSlug: TSlug,
22
+ public readonly name: string,
23
+ public readonly objectId: string,
24
+ public readonly attributes: readonly AttioAttributeDefinition[] = []
25
+ ) {}
26
+
27
+ declare readonly __recordValues: TRecordValues
28
+ declare readonly __inputValues: TInputValues
29
+ {{#if section.objects.length}}
30
+
31
+ {{#each section.objects}}
32
+ static {{staticName}} = new AttioObject<"{{escape apiSlug}}", {{{recordValuesType}}}, {{{inputValuesType}}}>("{{escape apiSlug}}", "{{escape singularNoun}}", "{{escape objectId}}", {{{attributeSource}}})
33
+ {{/each}}
34
+ {{/if}}
35
+ }
36
+
37
+ {{#if section.objects.length}}
38
+ export type GeneratedAttioObject =
39
+ {{#each section.objects}}
40
+ | typeof AttioObject.{{staticName}}
41
+ {{/each}}
42
+ {{else}}
43
+ export type GeneratedAttioObject = AttioObject
44
+ {{/if}}
45
+
46
+ export class AttioList<
47
+ TSlug extends string = string,
48
+ TEntryValues extends Record<string, unknown> = Record<string, unknown>,
49
+ TEntryRecordValues extends Record<string, unknown> = TEntryValues
50
+ > {
51
+ constructor(
52
+ public readonly apiSlug: TSlug,
53
+ public readonly name: string,
54
+ public readonly listId: string,
55
+ public readonly parentObject: string,
56
+ public readonly attributes: readonly AttioAttributeDefinition[] = []
57
+ ) {}
58
+
59
+ declare readonly __entryValues: TEntryValues
60
+ declare readonly __entryRecordValues: TEntryRecordValues
61
+ {{#if section.lists.length}}
62
+
63
+ {{#each section.lists}}
64
+ static {{staticName}} = new AttioList<"{{escape apiSlug}}", {{{entryValuesType}}}, {{{entryRecordValuesType}}}>("{{escape apiSlug}}", "{{escape name}}", "{{escape listId}}", "{{escape parentObject}}", {{{attributeSource}}})
65
+ {{/each}}
66
+ {{/if}}
67
+ }
68
+
69
+ {{#if section.lists.length}}
70
+ export type GeneratedAttioList =
71
+ {{#each section.lists}}
72
+ | typeof AttioList.{{staticName}}
73
+ {{/each}}
74
+ {{else}}
75
+ export type GeneratedAttioList = AttioList
76
+ {{/if}}
77
+
78
+ {{sectionHeader "Attio type machinery"}}
79
+
80
+ {{#if toolFile}}
81
+ {{#each toolTypeDeclarations}}
82
+ {{{this}}}
83
+ {{/each}}
84
+ export type __AttioPrimitive = string | number | boolean | null
85
+ export type __AttioStructuredValue = Record<string, unknown>
86
+ export type __AttioValue = __AttioPrimitive | __AttioStructuredValue | (__AttioPrimitive | __AttioStructuredValue)[]
87
+ export type __AttioFilterAtom<T> = T extends AttioSelectOption ? string : T extends AttioActorReference ? string : T extends AttioRecordReferenceValue ? string : T extends AttioCurrencyValue ? number : T
88
+ export type __AttioFilterShorthand<T> = T extends (infer U)[] ? __AttioFilterAtom<U> | __AttioFilterAtom<U>[] : __AttioFilterAtom<T>
89
+ export type __AttioFilterValue<T> = __AttioFilterShorthand<T> | { $eq?: __AttioFilterShorthand<T>; $contains?: string; $starts_with?: string; $ends_with?: string } | Record<string, unknown>
90
+ export type __AttioFilterExpression<TValues extends Record<string, unknown>> = Partial<{ [K in keyof TValues]: __AttioFilterValue<TValues[K]> }> & { $and?: Array<__AttioFilterExpression<TValues>>; $or?: Array<__AttioFilterExpression<TValues>> }
91
+ export type __AttioRecordWithValues<TValues extends Record<string, unknown>> = Omit<AttioRecordBase, "values"> & TValues & { values: TValues; attributes: TValues }
92
+
93
+ {{#if section.objects.length}}
94
+ export type AttioInputValuesByObject = {
95
+ {{#each section.objects}}
96
+ "{{escape apiSlug}}": {{inputValuesType}}
97
+ {{/each}}
98
+ }
99
+
100
+ export type AttioRecordValuesByObject = {
101
+ {{#each section.objects}}
102
+ "{{escape apiSlug}}": {{recordValuesType}}
103
+ {{/each}}
104
+ }
105
+
106
+ export type AttioFilterByObject = {
107
+ {{#each section.objects}}
108
+ "{{escape apiSlug}}": __AttioFilterExpression<AttioRecordValuesByObject["{{escape apiSlug}}"]>
109
+ {{/each}}
110
+ }
111
+
112
+ export type AttioRecordByObject = {
113
+ {{#each section.objects}}
114
+ "{{escape apiSlug}}": __AttioRecordWithValues<AttioRecordValuesByObject["{{escape apiSlug}}"]>
115
+ {{/each}}
116
+ }
117
+ {{else}}
118
+ export type AttioInputValuesByObject = Record<string, Record<string, __AttioValue>>
119
+ export type AttioRecordValuesByObject = Record<string, Record<string, __AttioValue>>
120
+ export type AttioFilterByObject = Record<string, __AttioFilterExpression<Record<string, __AttioValue>>>
121
+ export type AttioRecordByObject = Record<string, __AttioRecordWithValues<Record<string, __AttioValue>>>
122
+ {{/if}}
123
+
124
+ export type AttioValuesFor<TObject extends GeneratedAttioObject = GeneratedAttioObject> = TObject extends { __inputValues: infer TInputValues } ? TInputValues : AttioInputValuesByObject[TObject["apiSlug"]]
125
+ export type AttioRecordValuesFor<TObject extends GeneratedAttioObject = GeneratedAttioObject> = TObject extends { __recordValues: infer TRecordValues } ? TRecordValues : AttioRecordValuesByObject[TObject["apiSlug"]]
126
+ export type AttioAttributeSlug<TObject extends GeneratedAttioObject = GeneratedAttioObject> = Extract<keyof AttioValuesFor<TObject>, string>
127
+ export type AttioFilterFor<TObject extends GeneratedAttioObject = GeneratedAttioObject> = __AttioFilterExpression<AttioRecordValuesFor<TObject>>
128
+ export type AttioRecordFor<TObject extends GeneratedAttioObject = GeneratedAttioObject> = __AttioRecordWithValues<AttioRecordValuesFor<TObject>>
129
+ export type AttioQueryRecordsParams<TObject extends GeneratedAttioObject = GeneratedAttioObject> = { object: TObject; filter?: AttioFilterFor<TObject> | null; limit?: number | null; offset?: number | null }
130
+ export type AttioSearchRecordsParams<TObject extends GeneratedAttioObject = GeneratedAttioObject> = { object: TObject; query: string; limit?: number | null }
131
+ export type AttioGetRecordParams<TObject extends GeneratedAttioObject = GeneratedAttioObject> = { object: TObject; recordId: string }
132
+ export type AttioCreateRecordParams<TObject extends GeneratedAttioObject = GeneratedAttioObject> = { object: TObject; values: AttioValuesFor<TObject> }
133
+ export type AttioUpdateRecordParams<TObject extends GeneratedAttioObject = GeneratedAttioObject> = { object: TObject; recordId: string; values: Partial<AttioValuesFor<TObject>>; multiselectMode?: "overwrite" | "append" | null }
134
+ export type AttioUpsertRecordParams<TObject extends GeneratedAttioObject = GeneratedAttioObject> = { object: TObject; matchingAttribute: AttioAttributeSlug<TObject>; records: AttioValuesFor<TObject>[] }
135
+ export type AttioDeleteRecordParams<TObject extends GeneratedAttioObject = GeneratedAttioObject> = { object: TObject; recordId: string }
136
+ export type AttioGetAttributeHistoryParams<TObject extends GeneratedAttioObject = GeneratedAttioObject> = { object: TObject; recordId: string; attribute: AttioAttributeSlug<TObject>; limit?: number | null; offset?: number | null }
137
+ export type AttioQueryRecordsResult<TObject extends GeneratedAttioObject = GeneratedAttioObject> = { records: Array<AttioRecordFor<TObject>>; count: number; offset: number }
138
+ export type AttioSearchRecordsResult = { matches: NonNullable<AttioRecordsResult["matches"]>; count: number }
139
+ export type AttioUpsertRecordResult<TObject extends GeneratedAttioObject = GeneratedAttioObject> = { records: Array<AttioRecordFor<TObject>>; count: number }
140
+ export type AttioSingleRecordResult<TObject extends GeneratedAttioObject = GeneratedAttioObject> = AttioRecordFor<TObject>
141
+ export type AttioEntryValuesFor<TList> = TList extends { __entryValues: infer TValues } ? TValues : Record<string, unknown>
142
+ export type AttioEntryRecordValuesFor<TList> = TList extends { __entryRecordValues: infer TValues extends Record<string, unknown> } ? TValues : Record<string, unknown>
143
+ export type AttioEntryFilterFor<TList> = __AttioFilterExpression<AttioEntryRecordValuesFor<TList>>
144
+ export type AttioListEntryFor<TList> = { id: { workspace_id: string; list_id: string; entry_id: string }; parent_record_id: string; parent_object: string; created_at: string; entry_values: AttioEntryRecordValuesFor<TList> }
145
+ export type AttioListEntriesResult<TList> = { entries: Array<AttioListEntryFor<TList>>; count: number; offset: number }
146
+ export type AttioListEntryResult<TList> = AttioListEntryFor<TList>
147
+ export type __AttioSingleValue<T> = T extends (infer U)[] ? U : T
148
+ export type AttioAttributeHistoryEntryFor<TValue> = { active_from: string; active_until: string | null; value: TValue }
149
+ export type AttioAttributeHistoryResult<TValue = unknown> = { history: Array<AttioAttributeHistoryEntryFor<TValue>>; count: number }
150
+ {{/if}}
@@ -0,0 +1,192 @@
1
+ {{#if toolFile}}
2
+ {{sectionHeader "Attio tools"}}
3
+
4
+ {{> tools-slice toolFile}}
5
+
6
+ {{/if}}
7
+ {{sectionHeader "Attio skill"}}
8
+
9
+ /** Attio — query and upsert records on a CRM object */
10
+ export function attioSkill(opts: { object: AttioObject<any> }): TypedSkill<{{{section.skillToolType}}}> {
11
+ return new AttioOutputConfig("{{escape section.id}}", opts.object.apiSlug)
12
+ }
13
+
14
+ {{sectionHeader "Attio internals (generated plumbing — no need to read)"}}
15
+
16
+ {{#if toolFile}}
17
+ function __normalizeAttioObjectSlug(object: unknown): string {
18
+ if (object && typeof object === "object" && "apiSlug" in (object as Record<string, unknown>)) {
19
+ const apiSlug = (object as { apiSlug?: unknown }).apiSlug
20
+ if (typeof apiSlug === "string" && apiSlug.length > 0) return apiSlug
21
+ }
22
+ return typeof object === "string" ? object : ""
23
+ }
24
+
25
+ function __serializeAttioFilter(filter: unknown): string | null {
26
+ if (filter === undefined || filter === null) return null
27
+ return JSON.stringify(filter)
28
+ }
29
+
30
+ function __serializeAttioValues(values: unknown): string {
31
+ return JSON.stringify(values ?? {})
32
+ }
33
+
34
+ function __serializeAttioRecords(records: unknown): string {
35
+ if (!Array.isArray(records)) return JSON.stringify([])
36
+ return JSON.stringify(records.filter((record): record is Record<string, unknown> => typeof record === "object" && record !== null && !Array.isArray(record)))
37
+ }
38
+
39
+ function __enhanceAttioRecord<TObject extends GeneratedAttioObject>(object: TObject, record: unknown): __AttioRecordWithValues<AttioRecordValuesFor<TObject>> | undefined {
40
+ if (!record || typeof record !== "object") return undefined
41
+ const values = __getAttioRecordValues<AttioRecordValuesFor<TObject>>(__normalizeAttioObjectSlug(object), record)
42
+ return { ...values, ...(record as AttioRecordBase), values, attributes: values } as __AttioRecordWithValues<AttioRecordValuesFor<TObject>>
43
+ }
44
+
45
+ function __requireAttioPayload<T>(value: T | null | undefined, what: string): T {
46
+ if (value === null || value === undefined) throw new Error("Attio returned a response without the expected " + what + " payload.")
47
+ return value
48
+ }
49
+
50
+ function __enhanceAttioQueryResult<TObject extends GeneratedAttioObject>(object: TObject, result: AttioRecordsResult): AttioQueryRecordsResult<TObject> {
51
+ const records = (result.records || []).map(record => __enhanceAttioRecord(object, record)).filter(Boolean) as Array<AttioRecordFor<TObject>>
52
+ return { records, count: records.length, offset: result.offset ?? 0 }
53
+ }
54
+
55
+ function __enhanceAttioSearchResult(result: AttioRecordsResult): AttioSearchRecordsResult {
56
+ const matches = result.matches ?? []
57
+ return { matches, count: matches.length }
58
+ }
59
+
60
+ function __enhanceAttioUpsertResult<TObject extends GeneratedAttioObject>(object: TObject, result: AttioRecordsResult): AttioUpsertRecordResult<TObject> {
61
+ const records = (result.records || []).map(record => __enhanceAttioRecord(object, record)).filter(Boolean) as Array<AttioRecordFor<TObject>>
62
+ return { records, count: records.length }
63
+ }
64
+
65
+ function __enhanceAttioSingleRecordResult<TObject extends GeneratedAttioObject>(object: TObject, result: AttioRecordsResult): AttioSingleRecordResult<TObject> {
66
+ return __requireAttioPayload(__enhanceAttioRecord(object, result.record), "record")
67
+ }
68
+
69
+ {{/if}}
70
+ const __attioMetadataKeys = new Set([
71
+ "active_from",
72
+ "active_until",
73
+ "attribute_type",
74
+ "created_by_actor",
75
+ ])
76
+
77
+ const __attioMultiValueAttributeSlugsByObject: Record<string, readonly string[]> = {
78
+ {{#each section.objects}}
79
+ "{{escape apiSlug}}": [{{{multiValueSlugsText}}}],
80
+ {{/each}}
81
+ }
82
+
83
+ const __attioObjectSlugByObjectId: Record<string, string> = {
84
+ {{#each section.objects}}
85
+ "{{escape objectId}}": "{{escape apiSlug}}",
86
+ {{/each}}
87
+ }
88
+
89
+ function __flattenAttioLeafValue(value: unknown): unknown {
90
+ if (value === null || value === undefined) return value
91
+ if (Array.isArray(value)) return value.map(entry => __flattenAttioLeafValue(entry))
92
+ if (typeof value !== "object") return value
93
+ const rawObject = value as Record<string, unknown>
94
+ if (rawObject.attribute_type === "status") return __toAttioSelectOption(rawObject.status)
95
+ if (rawObject.attribute_type === "select") return __toAttioSelectOption(rawObject.option)
96
+ if (typeof rawObject.full_name === "string") return rawObject.full_name
97
+ if (typeof rawObject.email_address === "string") return rawObject.email_address
98
+ if (typeof rawObject.domain === "string") return rawObject.domain
99
+ if (typeof rawObject.phone_number === "string") return rawObject.phone_number
100
+ if ("value" in rawObject) return __flattenAttioLeafValue(rawObject.value)
101
+ const dataEntries = Object.entries(rawObject).filter(([key]) => !__attioMetadataKeys.has(key))
102
+ if (dataEntries.length === 0) return rawObject
103
+ if (dataEntries.length === 1) return __flattenAttioLeafValue(dataEntries[0][1])
104
+ return Object.fromEntries(dataEntries.map(([key, entryValue]) => [key, __flattenAttioLeafValue(entryValue)]))
105
+ }
106
+
107
+ function __toAttioSelectOption(option: unknown): unknown {
108
+ if (!option || typeof option !== "object") return option
109
+ const rawOption = option as Record<string, unknown>
110
+ const rawId = rawOption.id && typeof rawOption.id === "object" ? (rawOption.id as Record<string, unknown>) : undefined
111
+ const id = rawId?.status_id ?? rawId?.option_id ?? rawOption.id
112
+ return {
113
+ id: typeof id === "string" ? id : "",
114
+ title: typeof rawOption.title === "string" ? rawOption.title : "",
115
+ is_archived: rawOption.is_archived === true,
116
+ } satisfies AttioSelectOption
117
+ }
118
+
119
+ function __flattenAttioAttributeValue(rawValue: unknown, preferArray: boolean): unknown {
120
+ if (!Array.isArray(rawValue)) return __flattenAttioLeafValue(rawValue)
121
+ const flattened = rawValue.map(entry => __flattenAttioLeafValue(entry)).filter(entry => entry !== undefined)
122
+ return preferArray ? flattened : flattened[0]
123
+ }
124
+
125
+ function __isAttioMultiValueAttribute(objectSlug: string, attributeSlug: string): boolean {
126
+ return (__attioMultiValueAttributeSlugsByObject[objectSlug] || []).includes(attributeSlug)
127
+ }
128
+
129
+ function __getAttioRecordValues<TValues extends Record<string, unknown>>(objectSlug: string, record: unknown): TValues {
130
+ const rawValues = record && typeof record === "object" ? (record as { values?: unknown }).values : undefined
131
+ if (!rawValues || typeof rawValues !== "object" || Array.isArray(rawValues)) return {} as TValues
132
+ const flattenedValues: Record<string, unknown> = {}
133
+ for (const [attributeSlug, rawValue] of Object.entries(rawValues)) {
134
+ flattenedValues[attributeSlug] = __flattenAttioAttributeValue(rawValue, __isAttioMultiValueAttribute(objectSlug, attributeSlug))
135
+ }
136
+ return flattenedValues as TValues
137
+ }
138
+
139
+ const __attioMultiValueEntrySlugsByList: Record<string, readonly string[]> = {
140
+ {{#each section.lists}}
141
+ "{{escape apiSlug}}": [{{{multiValueSlugsText}}}],
142
+ "{{escape listId}}": [{{{multiValueSlugsText}}}],
143
+ {{/each}}
144
+ }
145
+
146
+ function __getAttioEntryValues<TValues extends Record<string, unknown>>(listKey: string, rawEntryValues: unknown): TValues {
147
+ if (!rawEntryValues || typeof rawEntryValues !== "object" || Array.isArray(rawEntryValues)) return {} as TValues
148
+ const flattenedValues: Record<string, unknown> = {}
149
+ const multiValueSlugs = __attioMultiValueEntrySlugsByList[listKey] || []
150
+ for (const [attributeSlug, rawValue] of Object.entries(rawEntryValues)) {
151
+ flattenedValues[attributeSlug] = __flattenAttioAttributeValue(rawValue, multiValueSlugs.includes(attributeSlug))
152
+ }
153
+ return flattenedValues as TValues
154
+ }
155
+
156
+ function __requireAttioListParentObject(list: unknown, parentObjectSlug: string | null | undefined): string {
157
+ if (parentObjectSlug) return parentObjectSlug
158
+ if (list && typeof list === "object" && "parentObject" in (list as Record<string, unknown>)) {
159
+ const parentObject = (list as { parentObject?: unknown }).parentObject
160
+ if (typeof parentObject === "string" && parentObject.length > 0) return parentObject
161
+ }
162
+ throw new Error("parentObjectSlug is required when the list is passed as a plain ID/slug rather than a generated AttioList constant.")
163
+ }
164
+
165
+ function __enhanceAttioListEntry<TList>(list: TList, entry: unknown): AttioListEntryFor<TList> {
166
+ const raw = (entry && typeof entry === "object" ? entry : {}) as { entry_values?: unknown }
167
+ return { ...(raw as object), entry_values: __getAttioEntryValues(__normalizeAttioObjectSlug(list), raw.entry_values) } as AttioListEntryFor<TList>
168
+ }
169
+
170
+ function __enhanceAttioListEntriesResult<TList>(list: TList, result: AttioListsResult): AttioListEntriesResult<TList> {
171
+ const entries = (result.entries || []).map(entry => __enhanceAttioListEntry(list, entry))
172
+ return { entries, count: entries.length, offset: result.offset ?? 0 }
173
+ }
174
+
175
+ function __enhanceAttioListEntryResult<TList>(list: TList, result: AttioListsResult): AttioListEntryResult<TList> {
176
+ if (!result.entry) throw new Error("Attio returned a response without the expected list entry payload.")
177
+ return __enhanceAttioListEntry(list, result.entry)
178
+ }
179
+
180
+ function __enhanceAttioHistoryResult<TValue>(result: AttioRecordsResult): AttioAttributeHistoryResult<TValue> {
181
+ const history = (result.history || []).map(entry => ({ active_from: entry.active_from, active_until: entry.active_until, value: __flattenAttioLeafValue(entry) as TValue }))
182
+ return { history, count: history.length }
183
+ }
184
+
185
+ registerEventTransform("attio", (event) => {
186
+ const e = event as { record?: { values?: unknown }; resourceIds?: { object_id?: string } }
187
+ if (!e?.record?.values) return event
188
+ const objectId = e.resourceIds?.object_id
189
+ const slug = objectId ? __attioObjectSlugByObjectId[objectId] : undefined
190
+ if (!slug) return event
191
+ return { ...e, record: { ...e.record, values: __getAttioRecordValues(slug, e.record) } }
192
+ })
@@ -0,0 +1,130 @@
1
+ {{sectionHeader "Attio triggers"}}
2
+
3
+ {{#each triggerDeclarations}}
4
+ {{{this}}}
5
+
6
+ {{/each}}
7
+ {{#each section.recordTriggerAliases}}
8
+ {{{this}}}
9
+ {{/each}}
10
+
11
+ function attioParentObjectFilter(object: GeneratedAttioObject | undefined) {
12
+ if (!object) return null
13
+ return { $and: [{ field: "id.object_id", operator: "equals" as const, value: object.objectId }] }
14
+ }
15
+
16
+ export const attioTriggers = {
17
+ /** Trigger when a call recording is created */
18
+ onCallRecordingCreated(): TypedTrigger<AttioCallRecordingCreatedTrigger> {
19
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.CALL_RECORDING_CREATED }])
20
+ },
21
+ /** Trigger when a comment is created */
22
+ onCommentCreated(): TypedTrigger<AttioCommentCreatedTrigger> {
23
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.COMMENT_CREATED }])
24
+ },
25
+ /** Trigger when a comment is resolved */
26
+ onCommentResolved(): TypedTrigger<AttioCommentResolvedTrigger> {
27
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.COMMENT_RESOLVED }])
28
+ },
29
+ /** Trigger when a comment is unresolved */
30
+ onCommentUnresolved(): TypedTrigger<AttioCommentUnresolvedTrigger> {
31
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.COMMENT_UNRESOLVED }])
32
+ },
33
+ /** Trigger when a comment is deleted */
34
+ onCommentDeleted(): TypedTrigger<AttioCommentDeletedTrigger> {
35
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.COMMENT_DELETED }])
36
+ },
37
+ /** Trigger when a list is created */
38
+ onListCreated(): TypedTrigger<AttioListCreatedTrigger> {
39
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.LIST_CREATED }])
40
+ },
41
+ /** Trigger when a list is updated */
42
+ onListUpdated(): TypedTrigger<AttioListUpdatedTrigger> {
43
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.LIST_UPDATED }])
44
+ },
45
+ /** Trigger when a list is deleted */
46
+ onListDeleted(): TypedTrigger<AttioListDeletedTrigger> {
47
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.LIST_DELETED }])
48
+ },
49
+ /** Trigger when a list attribute is created */
50
+ onListAttributeCreated(): TypedTrigger<AttioListAttributeCreatedTrigger> {
51
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.LIST_ATTRIBUTE_CREATED }])
52
+ },
53
+ /** Trigger when a list attribute is updated */
54
+ onListAttributeUpdated(): TypedTrigger<AttioListAttributeUpdatedTrigger> {
55
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.LIST_ATTRIBUTE_UPDATED }])
56
+ },
57
+ /** Trigger when a list entry is created */
58
+ onListEntryCreated(): TypedTrigger<AttioListEntryCreatedTrigger> {
59
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.LIST_ENTRY_CREATED }])
60
+ },
61
+ /** Trigger when a list entry is updated */
62
+ onListEntryUpdated(): TypedTrigger<AttioListEntryUpdatedTrigger> {
63
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.LIST_ENTRY_UPDATED }])
64
+ },
65
+ /** Trigger when a list entry is deleted */
66
+ onListEntryDeleted(): TypedTrigger<AttioListEntryDeletedTrigger> {
67
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.LIST_ENTRY_DELETED }])
68
+ },
69
+ /** Trigger when an object attribute is created */
70
+ onObjectAttributeCreated(): TypedTrigger<AttioObjectAttributeCreatedTrigger> {
71
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.OBJECT_ATTRIBUTE_CREATED }])
72
+ },
73
+ /** Trigger when an object attribute is updated */
74
+ onObjectAttributeUpdated(): TypedTrigger<AttioObjectAttributeUpdatedTrigger> {
75
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.OBJECT_ATTRIBUTE_UPDATED }])
76
+ },
77
+ /** Trigger when a note is created */
78
+ onNoteCreated(): TypedTrigger<AttioNoteCreatedTrigger> {
79
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.NOTE_CREATED }])
80
+ },
81
+ /** Trigger when a note's content is updated */
82
+ onNoteContentUpdated(): TypedTrigger<AttioNoteContentUpdatedTrigger> {
83
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.NOTE_CONTENT_UPDATED }])
84
+ },
85
+ /** Trigger when a note is updated */
86
+ onNoteUpdated(): TypedTrigger<AttioNoteUpdatedTrigger> {
87
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.NOTE_UPDATED }])
88
+ },
89
+ /** Trigger when a note is deleted */
90
+ onNoteDeleted(): TypedTrigger<AttioNoteDeletedTrigger> {
91
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.NOTE_DELETED }])
92
+ },
93
+ /** Trigger when a record is created. Pass `object` to scope to a specific Attio object. */
94
+ onRecordCreated<T extends GeneratedAttioObject = never>(opts?: { object: T }): TypedTrigger<AttioRecordCreatedTrigger<[T] extends [never] ? GeneratedAttioObject["__recordValues"] : T["__recordValues"]>> {
95
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.RECORD_CREATED, filter: attioParentObjectFilter(opts?.object) }])
96
+ },
97
+ /** Trigger when records are merged. Pass `object` to scope to a specific Attio object. */
98
+ onRecordMerged<T extends GeneratedAttioObject = never>(opts?: { object: T }): TypedTrigger<AttioRecordMergedTrigger<[T] extends [never] ? GeneratedAttioObject["__recordValues"] : T["__recordValues"]>> {
99
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.RECORD_MERGED, filter: attioParentObjectFilter(opts?.object) }])
100
+ },
101
+ /** Trigger when a record is updated. Pass `object` to scope to a specific Attio object. */
102
+ onRecordUpdated<T extends GeneratedAttioObject = never>(opts?: { object: T }): TypedTrigger<AttioRecordUpdatedTrigger<[T] extends [never] ? GeneratedAttioObject["__recordValues"] : T["__recordValues"]>> {
103
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.RECORD_UPDATED, filter: attioParentObjectFilter(opts?.object) }])
104
+ },
105
+ /** Trigger when a record is deleted. Pass `object` to scope to a specific Attio object. */
106
+ onRecordDeleted(opts?: { object?: GeneratedAttioObject }): TypedTrigger<AttioRecordDeletedTrigger> {
107
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.RECORD_DELETED, filter: attioParentObjectFilter(opts?.object) }])
108
+ },
109
+ /** Trigger when a task is created */
110
+ onTaskCreated(): TypedTrigger<AttioTaskCreatedTrigger> {
111
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.TASK_CREATED }])
112
+ },
113
+ /** Trigger when a task is updated */
114
+ onTaskUpdated(): TypedTrigger<AttioTaskUpdatedTrigger> {
115
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.TASK_UPDATED }])
116
+ },
117
+ /** Trigger when a task is deleted */
118
+ onTaskDeleted(): TypedTrigger<AttioTaskDeletedTrigger> {
119
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.TASK_DELETED }])
120
+ },
121
+ /** Trigger when a workspace member is added */
122
+ onWorkspaceMemberCreated(): TypedTrigger<AttioWorkspaceMemberCreatedTrigger> {
123
+ return new AttioInputConfig("{{escape section.id}}", [{ eventType: AttioEventType.WORKSPACE_MEMBER_CREATED }])
124
+ },
125
+ /** Trigger on one or more Attio event types. Pass `object` to scope record events to a specific Attio object. */
126
+ trigger(opts: { eventTypes: AttioEventType[]; object?: GeneratedAttioObject }): TypedTrigger<AttioTrigger> {
127
+ const filter = attioParentObjectFilter(opts.object)
128
+ return new AttioInputConfig("{{escape section.id}}", opts.eventTypes.map(eventType => ({ eventType, filter })))
129
+ },
130
+ }
@@ -0,0 +1,16 @@
1
+ {{sectionHeader "Datadog resources"}}
2
+
3
+ {{> resource-class section.indexClass}}
4
+
5
+ {{#if toolFile}}
6
+ {{sectionHeader "Datadog tools"}}
7
+
8
+ {{> tools-slice toolFile}}
9
+
10
+ {{/if}}
11
+ {{sectionHeader "Datadog skill"}}
12
+
13
+ /** Datadog — search and analyze logs, optionally scoped to specific indexes */
14
+ export function datadogSkill(opts?: { indexes?: DatadogIndex[] }): TypedSkill<{{{section.skillToolType}}}> {
15
+ return new DatadogConfig("{{escape section.id}}", opts?.indexes?.map(i => i.name))
16
+ }
@@ -0,0 +1,68 @@
1
+ {{sectionHeader "GitHub resources"}}
2
+
3
+ export class GithubOwner {
4
+ constructor(public readonly name: string) {}
5
+ {{#if section.owners.length}}
6
+
7
+ {{#each section.owners}}
8
+ static {{staticName}} = new GithubOwner("{{escape name}}")
9
+ {{/each}}
10
+ {{/if}}
11
+ }
12
+
13
+ export class Repos {
14
+ constructor(
15
+ public readonly repositoryId: number,
16
+ public readonly name: string,
17
+ public readonly owner: GithubOwner,
18
+ public readonly fullName: string
19
+ ) {}
20
+ {{#if section.repoGroups.length}}
21
+
22
+ {{#each section.repoGroups}}
23
+ static {{ownerStaticName}} = {
24
+ {{#each repos}}
25
+ {{staticName}}: new Repos({{id}}, "{{escape name}}", GithubOwner.{{../ownerStaticName}}, "{{escape fullName}}"),
26
+ {{/each}}
27
+ } as const
28
+ {{/each}}
29
+ {{/if}}
30
+ }
31
+
32
+ {{#if repoMappings.length}}
33
+ const __githubRepoNameToFullName = new Map<string, string>([
34
+ {{#each repoMappings}}
35
+ ["{{escape name}}", "{{escape fullName}}"],
36
+ {{/each}}
37
+ ])
38
+
39
+ function __normalizeGitHubRepos(repo: unknown): string {
40
+ if (repo && typeof repo === "object" && "fullName" in (repo as Record<string, unknown>)) {
41
+ const fullName = (repo as { fullName?: unknown }).fullName
42
+ if (typeof fullName === "string" && fullName.length > 0) return fullName
43
+ }
44
+ if (typeof repo === "string") {
45
+ if (repo.includes("/")) return repo
46
+ return __githubRepoNameToFullName.get(repo) ?? repo
47
+ }
48
+ return String(repo ?? "")
49
+ }
50
+
51
+ function __normalizeGitHubReposNames(repositories: unknown): string[] {
52
+ if (!Array.isArray(repositories)) return []
53
+ return repositories.map(repo => __normalizeGitHubRepos(repo))
54
+ }
55
+
56
+ {{/if}}
57
+ {{#if toolFile}}
58
+ {{sectionHeader "GitHub tools"}}
59
+
60
+ {{> tools-slice toolFile}}
61
+
62
+ {{/if}}
63
+ {{sectionHeader "GitHub skill"}}
64
+
65
+ /** GitHub — read code and pull requests from the given repositories */
66
+ export function githubSkill(opts: { repos: Repos[] }): TypedSkill<{{{section.skillToolType}}}> {
67
+ return new GitHubConfig("{{escape section.id}}", opts.repos.map(r => r.repositoryId))
68
+ }
@@ -0,0 +1,40 @@
1
+ {{sectionHeader "GitHub triggers"}}
2
+
3
+ {{#each triggerDeclarations}}
4
+ {{{this}}}
5
+
6
+ {{/each}}
7
+ export const githubTriggers = {
8
+ /** Trigger on push to a repository */
9
+ onPush(opts: { repo: Repos }): TypedTrigger<GithubPushTrigger> {
10
+ return new GitHubConfig("{{escape section.id}}", [opts.repo.repositoryId], [GitHubEventType.PUSH])
11
+ },
12
+ /** Trigger when a pull request is opened */
13
+ onPROpened(opts: { repo: Repos }): TypedTrigger<GithubPROpenedTrigger> {
14
+ return new GitHubConfig("{{escape section.id}}", [opts.repo.repositoryId], [GitHubEventType.PR_OPENED])
15
+ },
16
+ /** Trigger when a pull request is merged */
17
+ onPRMerged(opts: { repo: Repos }): TypedTrigger<GithubPRMergedTrigger> {
18
+ return new GitHubConfig("{{escape section.id}}", [opts.repo.repositoryId], [GitHubEventType.PR_MERGED])
19
+ },
20
+ /** Trigger when a pull request is closed */
21
+ onPRClosed(opts: { repo: Repos }): TypedTrigger<GithubPRClosedTrigger> {
22
+ return new GitHubConfig("{{escape section.id}}", [opts.repo.repositoryId], [GitHubEventType.PR_CLOSED])
23
+ },
24
+ /** Trigger when a pull request is synchronized */
25
+ onPRSynchronized(opts: { repo: Repos }): TypedTrigger<GithubPRSynchronizedTrigger> {
26
+ return new GitHubConfig("{{escape section.id}}", [opts.repo.repositoryId], [GitHubEventType.PR_SYNCHRONIZE])
27
+ },
28
+ /** Trigger on any pull request event */
29
+ onPR(opts: { repo: Repos }): TypedTrigger<GithubPRTrigger> {
30
+ return new GitHubConfig("{{escape section.id}}", [opts.repo.repositoryId], [GitHubEventType.PR_OPENED, GitHubEventType.PR_MERGED, GitHubEventType.PR_CLOSED, GitHubEventType.PR_SYNCHRONIZE])
31
+ },
32
+ /** Trigger when a comment is created on an issue or pull request */
33
+ onIssueComment(opts: { repo: Repos }): TypedTrigger<GithubIssueCommentCreatedTrigger> {
34
+ return new GitHubConfig("{{escape section.id}}", [opts.repo.repositoryId], [GitHubEventType.ISSUE_COMMENT_CREATED])
35
+ },
36
+ /** Trigger on specific GitHub events for the given repositories */
37
+ trigger(opts: { repos: Repos[]; eventTypes?: GitHubEventType[] }): TypedTrigger<GithubTrigger> {
38
+ return new GitHubConfig("{{escape section.id}}", opts.repos.map(r => r.repositoryId), opts.eventTypes)
39
+ },
40
+ }
@@ -0,0 +1,17 @@
1
+ {{#if toolFile}}
2
+ {{sectionHeader "Gmail tools"}}
3
+
4
+ {{> tools-slice toolFile}}
5
+
6
+ {{/if}}
7
+ {{sectionHeader "Gmail skills"}}
8
+
9
+ /** Gmail — send emails */
10
+ export function gmailSkill(): TypedSkill<{{{section.skillToolType}}}> {
11
+ return new GmailOutputConfig("{{escape section.id}}")
12
+ }
13
+
14
+ /** Gmail — create draft emails (no auto-send) */
15
+ export function gmailDraftSkill(): TypedSkill<{{{section.skillToolType}}}> {
16
+ return new GmailDraftOutputConfig("{{escape section.id}}")
17
+ }
@@ -0,0 +1,16 @@
1
+ {{sectionHeader "Gmail triggers"}}
2
+
3
+ {{#each triggerDeclarations}}
4
+ {{{this}}}
5
+
6
+ {{/each}}
7
+ export const gmailTriggers = {
8
+ /** Trigger when a new email is received */
9
+ onEmail(): TypedTrigger<GmailTrigger> {
10
+ return new GmailConfig("{{escape section.id}}", [GmailEventType.EMAIL_RECEIVED])
11
+ },
12
+ /** Trigger on all Gmail events */
13
+ trigger(opts?: { eventTypes?: GmailEventType[] }): TypedTrigger<GmailTrigger> {
14
+ return new GmailConfig("{{escape section.id}}", opts?.eventTypes)
15
+ },
16
+ }
@@ -0,0 +1,9 @@
1
+ {{sectionHeader "HeyReach resources"}}
2
+
3
+ {{> resource-class section.campaignClass}}
4
+
5
+ {{#if toolFile}}
6
+ {{sectionHeader "HeyReach tools"}}
7
+
8
+ {{> tools-slice toolFile}}
9
+ {{/if}}