@pikku/addon-meta-conversions 0.1.1 → 0.1.2

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 (160) hide show
  1. package/.pikku/addon/pikku-addon-types.gen.ts +105 -0
  2. package/.pikku/addon/pikku-package.gen.ts +11 -0
  3. package/.pikku/agent/pikku-agent-map.gen.d.ts +4 -0
  4. package/.pikku/agent/pikku-agent-types.gen.ts +82 -0
  5. package/.pikku/channel/pikku-channel-types.gen.ts +177 -0
  6. package/.pikku/console/pikku-addon-meta.gen.json +33 -0
  7. package/.pikku/console/pikku-node-types.gen.ts +8 -0
  8. package/.pikku/function/pikku-function-types.gen.ts +754 -0
  9. package/.pikku/function/pikku-functions-meta-verbose.gen.json +31 -0
  10. package/.pikku/function/pikku-functions-meta.gen.json +21 -0
  11. package/.pikku/function/pikku-functions-meta.gen.ts +7 -0
  12. package/.pikku/function/pikku-functions.gen.ts +8 -0
  13. package/.pikku/http/pikku-http-types.gen.ts +147 -0
  14. package/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
  15. package/.pikku/pikku-bootstrap.gen.ts +8 -0
  16. package/.pikku/pikku-meta-service.gen.ts +10 -0
  17. package/.pikku/pikku-services.gen.ts +45 -0
  18. package/.pikku/pikku-types.gen.ts +21 -0
  19. package/.pikku/queue/pikku-queue-types.gen.ts +27 -0
  20. package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +134 -0
  21. package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +135 -0
  22. package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +3 -0
  23. package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
  24. package/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -0
  25. package/.pikku/schemas/register.gen.ts +15 -0
  26. package/.pikku/schemas/schemas/EventSendInput.schema.json +1 -0
  27. package/.pikku/schemas/schemas/EventSendOutput.schema.json +1 -0
  28. package/.pikku/schemas/schemas/SecretSchema_metaConversions.schema.json +1 -0
  29. package/.pikku/secrets/pikku-secret-types.gen.ts +5 -0
  30. package/.pikku/secrets/pikku-secrets-meta.gen.json +10 -0
  31. package/.pikku/secrets/pikku-secrets.gen.ts +23 -0
  32. package/.pikku/trigger/pikku-trigger-types.gen.ts +160 -0
  33. package/.pikku/variables/pikku-variable-types.gen.ts +5 -0
  34. package/.pikku/variables/pikku-variables-meta.gen.json +1 -0
  35. package/.pikku/variables/pikku-variables.gen.ts +21 -0
  36. package/.pikku/workflow/pikku-workflow-map.gen.d.ts +38 -0
  37. package/.pikku/workflow/pikku-workflow-types.gen.ts +167 -0
  38. package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +9 -0
  39. package/.pikku/workflow/pikku-workflow-wirings.gen.ts +3 -0
  40. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +4 -4
  41. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts.map +1 -1
  42. package/dist/.pikku/addon/pikku-addon-types.gen.js +7 -3
  43. package/dist/.pikku/addon/pikku-addon-types.gen.js.map +1 -1
  44. package/dist/.pikku/addon/pikku-addon-types.gen.ts +11 -6
  45. package/dist/.pikku/addon/pikku-package.gen.js +2 -1
  46. package/dist/.pikku/addon/pikku-package.gen.js.map +1 -1
  47. package/dist/.pikku/addon/pikku-package.gen.ts +3 -1
  48. package/dist/.pikku/agent/pikku-agent-map.gen.d.ts +2 -14
  49. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +6 -6
  50. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts.map +1 -1
  51. package/dist/.pikku/agent/pikku-agent-types.gen.js.map +1 -1
  52. package/dist/.pikku/agent/pikku-agent-types.gen.ts +13 -7
  53. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +112 -0
  54. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts.map +1 -0
  55. package/dist/.pikku/channel/pikku-channel-types.gen.js +60 -0
  56. package/dist/.pikku/channel/pikku-channel-types.gen.js.map +1 -0
  57. package/dist/.pikku/channel/pikku-channel-types.gen.ts +177 -0
  58. package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
  59. package/dist/.pikku/console/pikku-node-types.gen.ts +1 -1
  60. package/dist/.pikku/function/pikku-function-types.gen.d.ts +71 -87
  61. package/dist/.pikku/function/pikku-function-types.gen.d.ts.map +1 -1
  62. package/dist/.pikku/function/pikku-function-types.gen.js +80 -60
  63. package/dist/.pikku/function/pikku-function-types.gen.js.map +1 -1
  64. package/dist/.pikku/function/pikku-function-types.gen.ts +170 -102
  65. package/dist/.pikku/function/pikku-functions-meta-verbose.gen.json +3 -0
  66. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  67. package/dist/.pikku/function/pikku-functions-meta.gen.json +1 -0
  68. package/dist/.pikku/function/pikku-functions-meta.gen.ts +1 -1
  69. package/dist/.pikku/function/pikku-functions.gen.js +2 -2
  70. package/dist/.pikku/function/pikku-functions.gen.js.map +1 -1
  71. package/dist/.pikku/function/pikku-functions.gen.ts +2 -2
  72. package/dist/.pikku/http/pikku-http-types.gen.d.ts +120 -0
  73. package/dist/.pikku/http/pikku-http-types.gen.d.ts.map +1 -0
  74. package/dist/.pikku/http/pikku-http-types.gen.js +72 -0
  75. package/dist/.pikku/http/pikku-http-types.gen.js.map +1 -0
  76. package/dist/.pikku/http/pikku-http-types.gen.ts +147 -0
  77. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +131 -0
  78. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts.map +1 -0
  79. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +38 -0
  80. package/dist/.pikku/mcp/pikku-mcp-types.gen.js.map +1 -0
  81. package/dist/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
  82. package/dist/.pikku/pikku-bootstrap.gen.d.ts +4 -2
  83. package/dist/.pikku/pikku-bootstrap.gen.d.ts.map +1 -1
  84. package/dist/.pikku/pikku-bootstrap.gen.js +2 -10
  85. package/dist/.pikku/pikku-bootstrap.gen.js.map +1 -1
  86. package/dist/.pikku/pikku-bootstrap.gen.ts +2 -9
  87. package/dist/.pikku/pikku-meta-service.gen.d.ts +8 -0
  88. package/dist/.pikku/pikku-meta-service.gen.d.ts.map +1 -0
  89. package/dist/.pikku/pikku-meta-service.gen.js +10 -0
  90. package/dist/.pikku/pikku-meta-service.gen.js.map +1 -0
  91. package/dist/.pikku/pikku-meta-service.gen.ts +10 -0
  92. package/dist/.pikku/pikku-services.gen.d.ts +10 -2
  93. package/dist/.pikku/pikku-services.gen.d.ts.map +1 -1
  94. package/dist/.pikku/pikku-services.gen.js +9 -0
  95. package/dist/.pikku/pikku-services.gen.js.map +1 -1
  96. package/dist/.pikku/pikku-services.gen.ts +12 -2
  97. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  98. package/dist/.pikku/pikku-types.gen.js +1 -1
  99. package/dist/.pikku/pikku-types.gen.ts +1 -1
  100. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +24 -0
  101. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts.map +1 -0
  102. package/dist/.pikku/queue/pikku-queue-types.gen.js +17 -0
  103. package/dist/.pikku/queue/pikku-queue-types.gen.js.map +1 -0
  104. package/dist/.pikku/queue/pikku-queue-types.gen.ts +27 -0
  105. package/dist/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +27 -8
  106. package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +27 -8
  107. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts +2 -0
  108. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts.map +1 -0
  109. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +7 -0
  110. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js.map +1 -0
  111. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +3 -0
  112. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
  113. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +22 -0
  114. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts.map +1 -0
  115. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +17 -0
  116. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js.map +1 -0
  117. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -0
  118. package/dist/.pikku/schemas/register.gen.js +1 -1
  119. package/dist/.pikku/schemas/register.gen.ts +1 -1
  120. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  121. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  122. package/dist/.pikku/secrets/pikku-secret-types.gen.ts +1 -1
  123. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  124. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  125. package/dist/.pikku/secrets/pikku-secrets.gen.ts +1 -1
  126. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  127. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  128. package/dist/.pikku/trigger/pikku-trigger-types.gen.ts +1 -1
  129. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  130. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  131. package/dist/.pikku/variables/pikku-variable-types.gen.ts +1 -1
  132. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  133. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  134. package/dist/.pikku/variables/pikku-variables.gen.ts +1 -1
  135. package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +9 -5
  136. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +36 -27
  137. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts.map +1 -1
  138. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +5 -18
  139. package/dist/.pikku/workflow/pikku-workflow-types.gen.js.map +1 -1
  140. package/dist/.pikku/workflow/pikku-workflow-types.gen.ts +66 -57
  141. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  142. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +1 -1
  143. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
  144. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  145. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.ts +1 -1
  146. package/dist/src/services.d.ts.map +1 -1
  147. package/dist/src/services.js +1 -1
  148. package/dist/src/services.js.map +1 -1
  149. package/package.json +7 -6
  150. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts +0 -2
  151. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts.map +0 -1
  152. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js +0 -7
  153. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js.map +0 -1
  154. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.json +0 -3
  155. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.ts +0 -7
  156. package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts +0 -5
  157. package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts.map +0 -1
  158. package/dist/.pikku/agent/pikku-agent-wirings.gen.js +0 -5
  159. package/dist/.pikku/agent/pikku-agent-wirings.gen.js.map +0 -1
  160. package/dist/.pikku/agent/pikku-agent-wirings.gen.ts +0 -3
@@ -0,0 +1,135 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
3
+ */
4
+ /**
5
+ * This provides the structure needed for typescript to be aware of RPCs and their return types
6
+ */
7
+
8
+
9
+
10
+
11
+
12
+ export type EventSendInput = {
13
+ /** Array of server events to send (max 1000 per request) */
14
+ data: {
15
+ /** Standard or custom event name (e.g., Purchase, Lead, AddToCart, PageView, ViewContent) */
16
+ event_name: string;
17
+ /** Unix timestamp in seconds when the event occurred */
18
+ event_time: number;
19
+ /** Unique event ID for deduplication with browser pixel events */
20
+ event_id?: string | undefined;
21
+ /** URL where the event occurred */
22
+ event_source_url?: string | undefined;
23
+ /** Where the conversion occurred */
24
+ action_source: "website" | "email" | "app" | "phone_call" | "chat" | "physical_store" | "system_generated" | "other";
25
+ /** Hashed user data for matching (em, ph, fn, ln, ct, st, zp, country, external_id, client_ip_address, client_user_agent, fbc, fbp) */
26
+ user_data: {
27
+ [key: string]: string | string[];
28
+ };
29
+ custom_data?: {
30
+ [key: string]: unknown;
31
+ } | undefined;
32
+ /** If true, event is used for attribution but not ad delivery optimization */
33
+ opt_out?: boolean | undefined;
34
+ }[];
35
+ /** Test event code from Events Manager for testing without affecting production data */
36
+ test_event_code?: string | undefined;
37
+ }
38
+ export type EventSendOutput = {
39
+ /** Number of events received by Meta */
40
+ events_received: number;
41
+ /** Diagnostic messages from the API */
42
+ messages: string[];
43
+ /** Trace ID for debugging with Meta support */
44
+ fbtrace_id: string;
45
+ }
46
+ export type SecretSchema_metaConversions = {
47
+ /** Meta Pixel ID */
48
+ pixelId: string;
49
+ /** Conversions API access token (generated in Events Manager) */
50
+ accessToken: string;
51
+ }
52
+
53
+ interface RPCHandler<I, O> {
54
+ input: I;
55
+ output: O;
56
+ }
57
+
58
+ export type RPCMap = {
59
+ readonly 'eventSend': RPCHandler<EventSendInput, EventSendOutput>,
60
+ };
61
+
62
+
63
+
64
+ // No addon packages, use RPCMap directly
65
+ export type FlattenedRPCMap = RPCMap
66
+
67
+ type IsAny<T> = 0 extends (1 & T) ? true : false
68
+ type IsVoidishInput<T> = IsAny<T> extends true
69
+ ? false
70
+ : [T] extends [void | null | undefined]
71
+ ? true
72
+ : false
73
+
74
+
75
+ export type RPCInvoke = <Name extends keyof FlattenedRPCMap>(
76
+ ...args: IsVoidishInput<FlattenedRPCMap[Name]['input']> extends true
77
+ ? [name: Name]
78
+ : [name: Name, data: FlattenedRPCMap[Name]['input']]
79
+ ) => Promise<FlattenedRPCMap[Name]['output']>
80
+
81
+ export type RPCRemote = <Name extends keyof FlattenedRPCMap>(
82
+ ...args: IsVoidishInput<FlattenedRPCMap[Name]['input']> extends true
83
+ ? [name: Name]
84
+ : [name: Name, data: FlattenedRPCMap[Name]['input']]
85
+ ) => Promise<FlattenedRPCMap[Name]['output']>
86
+
87
+ import type { FlattenedWorkflowMap } from '../workflow/pikku-workflow-map.gen.d.js'
88
+
89
+ import type { AgentMap } from '../agent/pikku-agent-map.gen.d.js'
90
+
91
+
92
+ type FlattenedAgentMap = AgentMap
93
+
94
+
95
+ import type { PikkuRPC } from '@pikku/core/rpc'
96
+
97
+ interface AIAgentInput {
98
+ message: string
99
+ threadId: string
100
+ resourceId: string
101
+ }
102
+
103
+ export type TypedStartWorkflow = <Name extends keyof FlattenedWorkflowMap>(
104
+ name: Name,
105
+ input: FlattenedWorkflowMap[Name]['input'],
106
+ options?: { startNode?: string }
107
+ ) => Promise<{ runId: string }>
108
+
109
+ export type TypedRunWorkflow = <Name extends keyof FlattenedWorkflowMap>(
110
+ name: Name,
111
+ input: FlattenedWorkflowMap[Name]['input']
112
+ ) => Promise<FlattenedWorkflowMap[Name]['output']>
113
+
114
+ export type TypedWorkflowStatus = (
115
+ workflowName: string,
116
+ runId: string
117
+ ) => Promise<{ id: string; status: 'running' | 'suspended' | 'completed' | 'failed' | 'cancelled'; output?: unknown; error?: { message?: string } }>
118
+
119
+ type TypedAgentRun = [keyof FlattenedAgentMap] extends [never]
120
+ ? (name: string, input: AIAgentInput) => Promise<any>
121
+ : <Name extends keyof FlattenedAgentMap>(
122
+ name: Name,
123
+ input: AIAgentInput
124
+ ) => Promise<{ runId: string; result: FlattenedAgentMap[Name]['output']; usage: { inputTokens: number; outputTokens: number } }>
125
+
126
+ type TypedAgentStream = [keyof FlattenedAgentMap] extends [never]
127
+ ? (name: string, input: AIAgentInput, options?: { requiresToolApproval?: 'all' | 'explicit' | false }) => Promise<void>
128
+ : <Name extends keyof FlattenedAgentMap>(
129
+ name: Name,
130
+ input: AIAgentInput,
131
+ options?: { requiresToolApproval?: 'all' | 'explicit' | false }
132
+ ) => Promise<void>
133
+
134
+ export type TypedPikkuRPC = PikkuRPC<RPCInvoke, RPCRemote, TypedStartWorkflow, TypedAgentRun, TypedAgentStream>
135
+
@@ -0,0 +1,3 @@
1
+ {
2
+ "eventSend": "eventSend"
3
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
3
+ */
4
+ import { pikkuState } from '@pikku/core/internal'
5
+ import metaData from './pikku-rpc-wirings-meta.internal.gen.json' with { type: 'json' }
6
+ pikkuState('@pikku/addon-meta-conversions', 'rpc', 'meta', metaData as Record<string, string>)
@@ -0,0 +1,25 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
3
+ */
4
+ /**
5
+ * Scheduler-specific type definitions for tree-shaking optimization
6
+ */
7
+
8
+ import { CoreScheduledTask, wireScheduler as wireSchedulerCore } from '@pikku/core/scheduler'
9
+ import type { PikkuFunctionConfig, PikkuMiddleware } from '../function/pikku-function-types.gen.js'
10
+
11
+ /**
12
+ * Type definition for scheduled tasks that run at specified intervals.
13
+ * These are sessionless functions that execute based on cron expressions.
14
+ */
15
+ type SchedulerWiring = CoreScheduledTask<PikkuFunctionConfig<void, void, 'session' | 'rpc'>, PikkuMiddleware>
16
+
17
+ /**
18
+ * Registers a scheduled task with the Pikku framework.
19
+ * Tasks run based on cron expressions and are sessionless.
20
+ *
21
+ * @param task - Scheduled task definition with cron expression and handler
22
+ */
23
+ export const wireScheduler = (task: SchedulerWiring) => {
24
+ wireSchedulerCore(task as any)
25
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
3
+ */
4
+ import { addSchema } from '@pikku/core/schema'
5
+
6
+ import * as EventSendInput from './schemas/EventSendInput.schema.json' with { type: 'json' }
7
+ addSchema('EventSendInput', EventSendInput, '@pikku/addon-meta-conversions')
8
+
9
+
10
+ import * as EventSendOutput from './schemas/EventSendOutput.schema.json' with { type: 'json' }
11
+ addSchema('EventSendOutput', EventSendOutput, '@pikku/addon-meta-conversions')
12
+
13
+
14
+ import * as SecretSchema_metaConversions from './schemas/SecretSchema_metaConversions.schema.json' with { type: 'json' }
15
+ addSchema('SecretSchema_metaConversions', SecretSchema_metaConversions, '@pikku/addon-meta-conversions')
@@ -0,0 +1 @@
1
+ {"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"minItems":1,"type":"array","items":{"type":"object","properties":{"event_name":{"type":"string","description":"Standard or custom event name (e.g., Purchase, Lead, AddToCart, PageView, ViewContent)"},"event_time":{"type":"number","description":"Unix timestamp in seconds when the event occurred"},"event_id":{"description":"Unique event ID for deduplication with browser pixel events","type":"string"},"event_source_url":{"description":"URL where the event occurred","type":"string"},"action_source":{"type":"string","enum":["website","email","app","phone_call","chat","physical_store","system_generated","other"],"description":"Where the conversion occurred"},"user_data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"description":"Hashed user data for matching (em, ph, fn, ln, ct, st, zp, country, external_id, client_ip_address, client_user_agent, fbc, fbp)"},"custom_data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Custom event data (value, currency, content_name, content_ids, contents, num_items, etc.)"},"opt_out":{"description":"If true, event is used for attribution but not ad delivery optimization","type":"boolean"}},"required":["event_name","event_time","action_source","user_data"],"additionalProperties":false},"description":"Array of server events to send (max 1000 per request)"},"test_event_code":{"description":"Test event code from Events Manager for testing without affecting production data","type":"string"}},"required":["data"],"additionalProperties":false}
@@ -0,0 +1 @@
1
+ {"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"events_received":{"type":"number","description":"Number of events received by Meta"},"messages":{"type":"array","items":{"type":"string"},"description":"Diagnostic messages from the API"},"fbtrace_id":{"type":"string","description":"Trace ID for debugging with Meta support"}},"required":["events_received","messages","fbtrace_id"],"additionalProperties":false}
@@ -0,0 +1 @@
1
+ {"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pixelId":{"type":"string","description":"Meta Pixel ID"},"accessToken":{"type":"string","description":"Conversions API access token (generated in Events Manager)"}},"required":["pixelId","accessToken"],"additionalProperties":false}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
3
+ */
4
+ export { wireSecret } from '@pikku/core/secret'
5
+ export type { CoreSecret, SecretDefinitionMeta, SecretDefinitionsMeta } from '@pikku/core/secret'
@@ -0,0 +1,10 @@
1
+ {
2
+ "metaConversions": {
3
+ "name": "metaConversions",
4
+ "displayName": "Meta Conversions API",
5
+ "description": "Meta (Facebook) Conversions API for server-side event tracking",
6
+ "secretId": "META_CONVERSIONS_CREDENTIALS",
7
+ "schema": "SecretSchema_metaConversions",
8
+ "sourceFile": "/home/runner/work/addons/addons/packages/analytics/meta-conversions/src/meta-conversions.secret.ts"
9
+ }
10
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
3
+ */
4
+ import { TypedSecretService as CoreTypedSecretService, type CredentialMeta } from '@pikku/core/services'
5
+ import type { SecretService } from '@pikku/core/services'
6
+ import type { z } from 'zod'
7
+ import { metaConversionsSecretsSchema } from '../../src/meta-conversions.secret.js'
8
+
9
+ export interface CredentialsMap {
10
+ 'META_CONVERSIONS_CREDENTIALS': z.infer<typeof metaConversionsSecretsSchema>
11
+ }
12
+
13
+ export type SecretId = keyof CredentialsMap
14
+
15
+ const CREDENTIALS_META: Record<string, CredentialMeta> = {
16
+ 'META_CONVERSIONS_CREDENTIALS': { name: 'metaConversions', displayName: 'Meta Conversions API' }
17
+ }
18
+
19
+ export class TypedSecretService extends CoreTypedSecretService<CredentialsMap> {
20
+ constructor(secrets: SecretService) {
21
+ super(secrets, CREDENTIALS_META)
22
+ }
23
+ }
@@ -0,0 +1,160 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
3
+ */
4
+ /**
5
+ * Trigger-specific type definitions for tree-shaking optimization
6
+ */
7
+
8
+ import { CorePikkuTriggerFunction, CorePikkuTriggerFunctionConfig, CoreTrigger, wireTrigger as wireTriggerCore, wireTriggerSource as wireTriggerSourceCore } from '@pikku/core/trigger'
9
+ import type { CoreNodeConfig } from '@pikku/core/node'
10
+ import type { SingletonServices } from '../../types/application-types.d.js'
11
+ import type { StandardSchemaV1 } from '@standard-schema/spec'
12
+
13
+
14
+
15
+ /**
16
+ * A trigger function that sets up a subscription and returns a teardown function.
17
+ * The trigger is fired via wire.trigger.invoke(data).
18
+ *
19
+ * @template TInput - Input type (configuration passed when wired)
20
+ * @template TOutput - Output type produced when trigger fires
21
+ */
22
+ export type PikkuTriggerFunction<
23
+ TInput = unknown,
24
+ TOutput = unknown
25
+ > = CorePikkuTriggerFunction<TInput, TOutput, SingletonServices>
26
+
27
+ /**
28
+ * Configuration object for creating a trigger function with metadata
29
+ */
30
+ export type PikkuTriggerFunctionConfig<
31
+ TInput = unknown,
32
+ TOutput = unknown,
33
+ InputSchema extends StandardSchemaV1 | undefined = undefined,
34
+ OutputSchema extends StandardSchemaV1 | undefined = undefined
35
+ > = CorePikkuTriggerFunctionConfig<TInput, TOutput, SingletonServices, InputSchema, OutputSchema>
36
+
37
+ /**
38
+ * Helper type to infer the output type from a Standard Schema
39
+ */
40
+ type InferSchemaOutput<T> = T extends StandardSchemaV1<any, infer Output> ? Output : never
41
+
42
+ /**
43
+ * Configuration object for trigger functions with Zod schema validation.
44
+ * Use this when you want to define input/output schemas using Zod.
45
+ * Types are automatically inferred from the schemas.
46
+ */
47
+ export type PikkuTriggerFunctionConfigWithSchema<
48
+ InputSchema extends StandardSchemaV1,
49
+ OutputSchema extends StandardSchemaV1 | undefined = undefined
50
+ > = {
51
+ title?: string
52
+ description?: string
53
+ tags?: string[]
54
+ func: PikkuTriggerFunction<
55
+ InferSchemaOutput<InputSchema>,
56
+ OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown
57
+ >
58
+ input: InputSchema
59
+ output?: OutputSchema
60
+ node?: CoreNodeConfig
61
+ }
62
+
63
+ /**
64
+ * Type definition for trigger wirings.
65
+ * Declares a trigger name and its target pikku function.
66
+ */
67
+ export type TriggerWiring = CoreTrigger
68
+
69
+ /**
70
+ * A trigger source with the subscription function, using project-specific services.
71
+ *
72
+ * @template TInput - Input type passed to the trigger function
73
+ * @template TOutput - Output type produced when trigger fires
74
+ */
75
+ export type TriggerSource<
76
+ TInput = unknown,
77
+ TOutput = unknown
78
+ > = {
79
+ name: string
80
+ func: PikkuTriggerFunctionConfig<TInput, TOutput>
81
+ } & (unknown extends TInput ? { input?: TInput } : { input: TInput })
82
+
83
+ /**
84
+ * Creates a trigger function configuration.
85
+ * Use this to define trigger functions that set up subscriptions.
86
+ *
87
+ * @param triggerOrConfig - Function definition or configuration object
88
+ * @returns The normalized configuration object
89
+ *
90
+ * @example
91
+ * ```typescript
92
+ * export const redisSubscribeTrigger = pikkuTriggerFunc<
93
+ * { channel: string },
94
+ * { message: string }
95
+ * >(async ({ redis }, { channel }, { trigger }) => {
96
+ * const subscriber = redis.duplicate()
97
+ * await subscriber.subscribe(channel, (msg) => {
98
+ * trigger.invoke({ message: msg })
99
+ * })
100
+ * return () => subscriber.unsubscribe()
101
+ * })
102
+ *
103
+ * export const redisSubscribeTrigger = pikkuTriggerFunc({
104
+ * title: 'Redis Subscribe Trigger',
105
+ * description: 'Listens to Redis pub/sub channel',
106
+ * input: z.object({ channel: z.string() }),
107
+ * output: z.object({ message: z.string() }),
108
+ * func: async ({ redis }, { channel }, { trigger }) => {
109
+ * const subscriber = redis.duplicate()
110
+ * await subscriber.subscribe(channel, (msg) => {
111
+ * trigger.invoke({ message: msg })
112
+ * })
113
+ * return () => subscriber.unsubscribe()
114
+ * }
115
+ * })
116
+ * ```
117
+ */
118
+ export function pikkuTriggerFunc<
119
+ InputSchema extends StandardSchemaV1,
120
+ OutputSchema extends StandardSchemaV1 | undefined = undefined
121
+ >(
122
+ config: PikkuTriggerFunctionConfigWithSchema<InputSchema, OutputSchema>
123
+ ): PikkuTriggerFunctionConfig<InferSchemaOutput<InputSchema>, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, InputSchema, OutputSchema>
124
+ export function pikkuTriggerFunc<TInput, TOutput = unknown>(
125
+ triggerOrConfig:
126
+ | PikkuTriggerFunction<TInput, TOutput>
127
+ | PikkuTriggerFunctionConfig<TInput, TOutput>
128
+ ): PikkuTriggerFunctionConfig<TInput, TOutput>
129
+ export function pikkuTriggerFunc(triggerOrConfig: any) {
130
+ if (typeof triggerOrConfig === 'function') {
131
+ return { func: triggerOrConfig }
132
+ }
133
+ return triggerOrConfig
134
+ }
135
+
136
+ /**
137
+ * Registers a trigger with the Pikku framework.
138
+ * Declares a trigger name and its target pikku function.
139
+ * Runs everywhere — inspector extracts at build time.
140
+ *
141
+ * @param trigger - Trigger definition with name and function config
142
+ */
143
+ export const wireTrigger = (
144
+ trigger: TriggerWiring
145
+ ) => {
146
+ wireTriggerCore(trigger as any)
147
+ }
148
+
149
+ /**
150
+ * Registers a trigger source with the Pikku framework.
151
+ * Provides the subscription function and input data.
152
+ * Only imported in the trigger worker process.
153
+ *
154
+ * @param source - Trigger source with name, func, and input
155
+ */
156
+ export const wireTriggerSource = <TInput = unknown, TOutput = unknown>(
157
+ source: TriggerSource<TInput, TOutput>
158
+ ) => {
159
+ wireTriggerSourceCore(source as any)
160
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
3
+ */
4
+ export { wireVariable } from '@pikku/core/variable'
5
+ export type { CoreVariable, VariableDefinitionMeta, VariableDefinitionsMeta } from '@pikku/core/variable'
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
3
+ */
4
+ import { TypedVariablesService as CoreTypedVariablesService, type VariableMeta } from '@pikku/core/services'
5
+ import type { VariablesService } from '@pikku/core/services'
6
+
7
+ export interface VariablesMap {
8
+
9
+ }
10
+
11
+ export type VariableId = keyof VariablesMap
12
+
13
+ const VARIABLES_META: Record<string, VariableMeta> = {
14
+
15
+ }
16
+
17
+ export class TypedVariablesService extends CoreTypedVariablesService<VariablesMap> {
18
+ constructor(variables: VariablesService) {
19
+ super(variables, VARIABLES_META)
20
+ }
21
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
3
+ */
4
+ /**
5
+ * Workflow type map with input/output types for each workflow
6
+ */
7
+
8
+
9
+
10
+
11
+
12
+ interface WorkflowHandler<I, O> {
13
+ input: I;
14
+ output: O;
15
+ }
16
+
17
+ interface GraphNodeHandler<I> {
18
+ input: I;
19
+ }
20
+
21
+ export type WorkflowMap = {
22
+ };
23
+
24
+ export type GraphsMap = {
25
+ };
26
+
27
+ export type FlattenedWorkflowMap = WorkflowMap
28
+
29
+
30
+ export type WorkflowClient<Name extends keyof FlattenedWorkflowMap> = {
31
+ start: (input: FlattenedWorkflowMap[Name]['input']) => Promise<{ runId: string }>;
32
+ getRun: <output extends keyof FlattenedWorkflowMap[Name]>(runId: string) => Promise<FlattenedWorkflowMap[Name][output]>;
33
+ cancelRun: (runId: string) => Promise<boolean>;
34
+ }
35
+
36
+ export type TypedWorkflowClients = {
37
+ [Name in keyof FlattenedWorkflowMap]: WorkflowClient<Name>;
38
+ }
@@ -0,0 +1,167 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
3
+ */
4
+ import { WorkflowCancelledException } from '@pikku/core/workflow'
5
+ import { template } from '@pikku/core/workflow'
6
+ import {
7
+ pikkuWorkflowGraph as corePikkuWorkflowGraph,
8
+ type PikkuWorkflowGraphConfig,
9
+ type PikkuWorkflowGraphResult,
10
+ } from '@pikku/core/workflow'
11
+ import type { PikkuWorkflowWire, WorkflowStepOptions } from '@pikku/core/workflow'
12
+
13
+ export { WorkflowCancelledException }
14
+ import type { PikkuFunctionSessionless, PikkuFunctionConfig } from '../function/pikku-function-types.gen.js'
15
+ import type { FlattenedRPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.d.js'
16
+ import type { FlattenedWorkflowMap } from './pikku-workflow-map.gen.d.js'
17
+
18
+ export { template }
19
+
20
+ export interface TypedWorkflow extends PikkuWorkflowWire {
21
+ do<K extends keyof FlattenedRPCMap>(
22
+ stepName: string,
23
+ rpcName: K,
24
+ data: FlattenedRPCMap[K]['input'],
25
+ options?: WorkflowStepOptions
26
+ ): Promise<FlattenedRPCMap[K]['output']>
27
+
28
+ do<K extends keyof FlattenedWorkflowMap>(
29
+ stepName: string,
30
+ workflowName: K,
31
+ data: FlattenedWorkflowMap[K]['input'],
32
+ options?: WorkflowStepOptions
33
+ ): Promise<FlattenedWorkflowMap[K]['output']>
34
+
35
+ do<T>(
36
+ stepName: string,
37
+ fn: () => T | Promise<T>,
38
+ options?: WorkflowStepOptions
39
+ ): Promise<T>
40
+ }
41
+
42
+ import type { StandardSchemaV1 } from '@standard-schema/spec'
43
+ import type { InferSchemaOutput, PikkuPermission, PikkuMiddleware, NodeConfig, PikkuApprovalDescription } from '../function/pikku-function-types.gen.js'
44
+ import { PikkuError } from '@pikku/core/errors'
45
+ import type { CorePermissionGroup } from '@pikku/core'
46
+
47
+ export type PikkuFunctionWorkflow<
48
+ In = unknown,
49
+ Out = never
50
+ > = PikkuFunctionSessionless<In, Out, 'workflow'>
51
+
52
+ export type PikkuWorkflowConfigWithSchema<
53
+ InputSchema extends StandardSchemaV1 | undefined = undefined,
54
+ OutputSchema extends StandardSchemaV1 | undefined = undefined
55
+ > = {
56
+ title?: string
57
+ description?: string
58
+ tags?: string[]
59
+ expose?: boolean
60
+ internal?: boolean
61
+ override?: string
62
+ version?: number
63
+ remote?: boolean
64
+ mcp?: boolean
65
+ readonly?: boolean
66
+ approvalRequired?: boolean
67
+ approvalDescription?: InputSchema extends StandardSchemaV1 ? PikkuApprovalDescription<InferSchemaOutput<InputSchema>> : never
68
+ func: PikkuFunctionWorkflow<
69
+ InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown,
70
+ OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown
71
+ >
72
+ auth?: boolean
73
+ permissions?: InputSchema extends StandardSchemaV1 ? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>> : undefined
74
+ middleware?: PikkuMiddleware[]
75
+ input?: InputSchema
76
+ output?: OutputSchema
77
+ node?: NodeConfig
78
+ errors?: Array<typeof PikkuError>
79
+ inline?: boolean
80
+ }
81
+
82
+ export function pikkuWorkflowFunc<
83
+ InputSchema extends StandardSchemaV1 | undefined = undefined,
84
+ OutputSchema extends StandardSchemaV1 | undefined = undefined
85
+ >(
86
+ config: PikkuWorkflowConfigWithSchema<InputSchema, OutputSchema>
87
+ ): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'workflow', PikkuFunctionWorkflow<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown>, InputSchema, OutputSchema>
88
+ export function pikkuWorkflowFunc<In, Out = unknown>(
89
+ func:
90
+ | PikkuFunctionWorkflow<In, Out>
91
+ | PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
92
+ ): PikkuFunctionConfig<In, Out, 'workflow'>
93
+ export function pikkuWorkflowFunc(func: any) {
94
+ return typeof func === 'function' ? { func } : func
95
+ }
96
+
97
+ export function pikkuWorkflowComplexFunc<
98
+ InputSchema extends StandardSchemaV1 | undefined = undefined,
99
+ OutputSchema extends StandardSchemaV1 | undefined = undefined
100
+ >(
101
+ config: PikkuWorkflowConfigWithSchema<InputSchema, OutputSchema>
102
+ ): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'workflow', PikkuFunctionWorkflow<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown>, InputSchema, OutputSchema>
103
+ export function pikkuWorkflowComplexFunc<In, Out = unknown>(
104
+ func:
105
+ | PikkuFunctionWorkflow<In, Out>
106
+ | PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
107
+ ): PikkuFunctionConfig<In, Out, 'workflow'>
108
+ export function pikkuWorkflowComplexFunc(func: any) {
109
+ return typeof func === 'function' ? { func } : func
110
+ }
111
+
112
+ type TypedRef<T> = { $ref: string; path?: string } & { __phantomType?: T }
113
+
114
+ type TemplateString = {
115
+ $template: {
116
+ parts: string[]
117
+ expressions: Array<{ $ref: string; path?: string }>
118
+ }
119
+ } & { __brand: 'TemplateString' }
120
+
121
+ type InputWithRefs<T> = {
122
+ [K in keyof T]?: T[K] | TypedRef<T[K]> | TypedRef<unknown> | TemplateString
123
+ }
124
+
125
+ type NodeInputType<FuncMap extends Record<string, string>, K extends keyof FuncMap> =
126
+ FuncMap[K] extends keyof FlattenedRPCMap
127
+ ? InputWithRefs<FlattenedRPCMap[FuncMap[K]]['input']>
128
+ : Record<string, unknown>
129
+
130
+ type NodeOutputKeys<FuncMap extends Record<string, string>, N extends string> =
131
+ N extends keyof FuncMap
132
+ ? FuncMap[N] extends keyof FlattenedRPCMap
133
+ ? keyof FlattenedRPCMap[FuncMap[N]]['output'] & string
134
+ : string
135
+ : string
136
+
137
+ type RefFunction<FuncMap extends Record<string, string>> = {
138
+ <N extends Extract<keyof FuncMap, string>>(
139
+ nodeId: N,
140
+ path: NodeOutputKeys<FuncMap, N>
141
+ ): TypedRef<unknown>
142
+ (nodeId: 'trigger' | '$item', path?: string): TypedRef<unknown>
143
+ }
144
+
145
+ type TemplateFunction = (templateStr: string, refs: TypedRef<unknown>[]) => TemplateString
146
+
147
+ type GraphNodeConfigMap<FuncMap extends Record<string, string>> = {
148
+ [K in Extract<keyof FuncMap, string>]?: {
149
+ next?: NextConfig<Extract<keyof FuncMap, string>>
150
+ input?:
151
+ | NodeInputType<FuncMap, K>
152
+ | (() => NodeInputType<FuncMap, K>)
153
+ | ((ref: RefFunction<FuncMap>, template: TemplateFunction) => NodeInputType<FuncMap, K>)
154
+ onError?: Extract<keyof FuncMap, string> | Extract<keyof FuncMap, string>[]
155
+ }
156
+ }
157
+
158
+ type NextConfig<NodeIds extends string> = NodeIds | NodeIds[] | { if: string; then: NodeIds; else?: NodeIds }
159
+
160
+ export function pikkuWorkflowGraph<
161
+ const FuncMap extends Record<string, keyof FlattenedRPCMap & string>
162
+ >(
163
+ config: PikkuWorkflowGraphConfig<FuncMap, GraphNodeConfigMap<FuncMap>>
164
+ ): PikkuWorkflowGraphResult {
165
+ return corePikkuWorkflowGraph(config as any)
166
+ }
167
+
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
3
+ */
4
+ import { pikkuState } from '@pikku/core/internal'
5
+ import type { SerializedWorkflowGraphs } from '@pikku/inspector/workflow-graph'
6
+
7
+ const workflowsMeta: SerializedWorkflowGraphs = {}
8
+
9
+ pikkuState('@pikku/addon-meta-conversions', 'workflows', 'meta', workflowsMeta)
@@ -0,0 +1,3 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
3
+ */