@pikku/addon-strapi 0.0.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 (203) hide show
  1. package/README.md +12 -0
  2. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +67 -0
  3. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts.map +1 -0
  4. package/dist/.pikku/addon/pikku-addon-types.gen.js +78 -0
  5. package/dist/.pikku/addon/pikku-addon-types.gen.js.map +1 -0
  6. package/dist/.pikku/addon/pikku-addon-types.gen.ts +106 -0
  7. package/dist/.pikku/addon/pikku-package.gen.d.ts +2 -0
  8. package/dist/.pikku/addon/pikku-package.gen.d.ts.map +1 -0
  9. package/dist/.pikku/addon/pikku-package.gen.js +10 -0
  10. package/dist/.pikku/addon/pikku-package.gen.js.map +1 -0
  11. package/dist/.pikku/addon/pikku-package.gen.ts +11 -0
  12. package/dist/.pikku/agent/pikku-agent-map.gen.d.ts +4 -0
  13. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +47 -0
  14. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts.map +1 -0
  15. package/dist/.pikku/agent/pikku-agent-types.gen.js +18 -0
  16. package/dist/.pikku/agent/pikku-agent-types.gen.js.map +1 -0
  17. package/dist/.pikku/agent/pikku-agent-types.gen.ts +82 -0
  18. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +112 -0
  19. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts.map +1 -0
  20. package/dist/.pikku/channel/pikku-channel-types.gen.js +60 -0
  21. package/dist/.pikku/channel/pikku-channel-types.gen.js.map +1 -0
  22. package/dist/.pikku/channel/pikku-channel-types.gen.ts +177 -0
  23. package/dist/.pikku/console/pikku-node-types.gen.d.ts +7 -0
  24. package/dist/.pikku/console/pikku-node-types.gen.d.ts.map +1 -0
  25. package/dist/.pikku/console/pikku-node-types.gen.js +2 -0
  26. package/dist/.pikku/console/pikku-node-types.gen.js.map +1 -0
  27. package/dist/.pikku/console/pikku-node-types.gen.ts +8 -0
  28. package/dist/.pikku/credentials/pikku-credentials-meta.gen.json +10 -0
  29. package/dist/.pikku/credentials/pikku-credentials.gen.d.ts +15 -0
  30. package/dist/.pikku/credentials/pikku-credentials.gen.d.ts.map +1 -0
  31. package/dist/.pikku/credentials/pikku-credentials.gen.js +13 -0
  32. package/dist/.pikku/credentials/pikku-credentials.gen.js.map +1 -0
  33. package/dist/.pikku/credentials/pikku-credentials.gen.ts +23 -0
  34. package/dist/.pikku/function/pikku-function-types.gen.d.ts +490 -0
  35. package/dist/.pikku/function/pikku-function-types.gen.d.ts.map +1 -0
  36. package/dist/.pikku/function/pikku-function-types.gen.js +334 -0
  37. package/dist/.pikku/function/pikku-function-types.gen.js.map +1 -0
  38. package/dist/.pikku/function/pikku-function-types.gen.ts +754 -0
  39. package/dist/.pikku/function/pikku-functions-meta-verbose.gen.json +147 -0
  40. package/dist/.pikku/function/pikku-functions-meta.gen.d.ts +2 -0
  41. package/dist/.pikku/function/pikku-functions-meta.gen.d.ts.map +1 -0
  42. package/dist/.pikku/function/pikku-functions-meta.gen.js +7 -0
  43. package/dist/.pikku/function/pikku-functions-meta.gen.js.map +1 -0
  44. package/dist/.pikku/function/pikku-functions-meta.gen.json +97 -0
  45. package/dist/.pikku/function/pikku-functions-meta.gen.ts +7 -0
  46. package/dist/.pikku/function/pikku-functions.gen.d.ts +2 -0
  47. package/dist/.pikku/function/pikku-functions.gen.d.ts.map +1 -0
  48. package/dist/.pikku/function/pikku-functions.gen.js +16 -0
  49. package/dist/.pikku/function/pikku-functions.gen.js.map +1 -0
  50. package/dist/.pikku/function/pikku-functions.gen.ts +16 -0
  51. package/dist/.pikku/http/pikku-http-types.gen.d.ts +120 -0
  52. package/dist/.pikku/http/pikku-http-types.gen.d.ts.map +1 -0
  53. package/dist/.pikku/http/pikku-http-types.gen.js +72 -0
  54. package/dist/.pikku/http/pikku-http-types.gen.js.map +1 -0
  55. package/dist/.pikku/http/pikku-http-types.gen.ts +147 -0
  56. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +131 -0
  57. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts.map +1 -0
  58. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +38 -0
  59. package/dist/.pikku/mcp/pikku-mcp-types.gen.js.map +1 -0
  60. package/dist/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
  61. package/dist/.pikku/pikku-bootstrap.gen.d.ts +9 -0
  62. package/dist/.pikku/pikku-bootstrap.gen.d.ts.map +1 -0
  63. package/dist/.pikku/pikku-bootstrap.gen.js +9 -0
  64. package/dist/.pikku/pikku-bootstrap.gen.js.map +1 -0
  65. package/dist/.pikku/pikku-bootstrap.gen.ts +8 -0
  66. package/dist/.pikku/pikku-meta-service.gen.d.ts +8 -0
  67. package/dist/.pikku/pikku-meta-service.gen.d.ts.map +1 -0
  68. package/dist/.pikku/pikku-meta-service.gen.js +10 -0
  69. package/dist/.pikku/pikku-meta-service.gen.js.map +1 -0
  70. package/dist/.pikku/pikku-meta-service.gen.ts +10 -0
  71. package/dist/.pikku/pikku-services.gen.d.ts +35 -0
  72. package/dist/.pikku/pikku-services.gen.d.ts.map +1 -0
  73. package/dist/.pikku/pikku-services.gen.js +30 -0
  74. package/dist/.pikku/pikku-services.gen.js.map +1 -0
  75. package/dist/.pikku/pikku-services.gen.ts +42 -0
  76. package/dist/.pikku/pikku-types.gen.d.ts +12 -0
  77. package/dist/.pikku/pikku-types.gen.d.ts.map +1 -0
  78. package/dist/.pikku/pikku-types.gen.js +17 -0
  79. package/dist/.pikku/pikku-types.gen.js.map +1 -0
  80. package/dist/.pikku/pikku-types.gen.ts +21 -0
  81. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +24 -0
  82. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts.map +1 -0
  83. package/dist/.pikku/queue/pikku-queue-types.gen.js +17 -0
  84. package/dist/.pikku/queue/pikku-queue-types.gen.js.map +1 -0
  85. package/dist/.pikku/queue/pikku-queue-types.gen.ts +27 -0
  86. package/dist/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +140 -0
  87. package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +145 -0
  88. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts +2 -0
  89. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts.map +1 -0
  90. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +7 -0
  91. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js.map +1 -0
  92. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +7 -0
  93. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
  94. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +22 -0
  95. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts.map +1 -0
  96. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +17 -0
  97. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js.map +1 -0
  98. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -0
  99. package/dist/.pikku/schemas/register.gen.d.ts +2 -0
  100. package/dist/.pikku/schemas/register.gen.d.ts.map +1 -0
  101. package/dist/.pikku/schemas/register.gen.js +29 -0
  102. package/dist/.pikku/schemas/register.gen.js.map +1 -0
  103. package/dist/.pikku/schemas/register.gen.ts +51 -0
  104. package/dist/.pikku/schemas/schemas/CredentialSchema_strapi.schema.json +1 -0
  105. package/dist/.pikku/schemas/schemas/EntryCreateInput.schema.json +1 -0
  106. package/dist/.pikku/schemas/schemas/EntryCreateOutput.schema.json +1 -0
  107. package/dist/.pikku/schemas/schemas/EntryDeleteInput.schema.json +1 -0
  108. package/dist/.pikku/schemas/schemas/EntryDeleteOutput.schema.json +1 -0
  109. package/dist/.pikku/schemas/schemas/EntryGetAllInput.schema.json +1 -0
  110. package/dist/.pikku/schemas/schemas/EntryGetAllOutput.schema.json +1 -0
  111. package/dist/.pikku/schemas/schemas/EntryGetInput.schema.json +1 -0
  112. package/dist/.pikku/schemas/schemas/EntryGetOutput.schema.json +1 -0
  113. package/dist/.pikku/schemas/schemas/EntryUpdateInput.schema.json +1 -0
  114. package/dist/.pikku/schemas/schemas/EntryUpdateOutput.schema.json +1 -0
  115. package/dist/.pikku/schemas/schemas/VariableSchema_STRAPI_BASE_URL.schema.json +1 -0
  116. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +6 -0
  117. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts.map +1 -0
  118. package/dist/.pikku/secrets/pikku-secret-types.gen.js +5 -0
  119. package/dist/.pikku/secrets/pikku-secret-types.gen.js.map +1 -0
  120. package/dist/.pikku/secrets/pikku-secret-types.gen.ts +5 -0
  121. package/dist/.pikku/secrets/pikku-secrets-meta.gen.json +1 -0
  122. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +12 -0
  123. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts.map +1 -0
  124. package/dist/.pikku/secrets/pikku-secrets.gen.js +11 -0
  125. package/dist/.pikku/secrets/pikku-secrets.gen.js.map +1 -0
  126. package/dist/.pikku/secrets/pikku-secrets.gen.ts +21 -0
  127. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +114 -0
  128. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts.map +1 -0
  129. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +34 -0
  130. package/dist/.pikku/trigger/pikku-trigger-types.gen.js.map +1 -0
  131. package/dist/.pikku/trigger/pikku-trigger-types.gen.ts +160 -0
  132. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +6 -0
  133. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts.map +1 -0
  134. package/dist/.pikku/variables/pikku-variable-types.gen.js +5 -0
  135. package/dist/.pikku/variables/pikku-variable-types.gen.js.map +1 -0
  136. package/dist/.pikku/variables/pikku-variable-types.gen.ts +5 -0
  137. package/dist/.pikku/variables/pikku-variables-meta.gen.json +10 -0
  138. package/dist/.pikku/variables/pikku-variables.gen.d.ts +15 -0
  139. package/dist/.pikku/variables/pikku-variables.gen.d.ts.map +1 -0
  140. package/dist/.pikku/variables/pikku-variables.gen.js +13 -0
  141. package/dist/.pikku/variables/pikku-variables.gen.js.map +1 -0
  142. package/dist/.pikku/variables/pikku-variables.gen.ts +23 -0
  143. package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +38 -0
  144. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +90 -0
  145. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts.map +1 -0
  146. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +18 -0
  147. package/dist/.pikku/workflow/pikku-workflow-types.gen.js.map +1 -0
  148. package/dist/.pikku/workflow/pikku-workflow-types.gen.ts +167 -0
  149. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.d.ts +2 -0
  150. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.d.ts.map +1 -0
  151. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +7 -0
  152. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js.map +1 -0
  153. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +9 -0
  154. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +5 -0
  155. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts.map +1 -0
  156. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +5 -0
  157. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js.map +1 -0
  158. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.ts +3 -0
  159. package/dist/src/functions/entryCreate.function.d.ts +17 -0
  160. package/dist/src/functions/entryCreate.function.d.ts.map +1 -0
  161. package/dist/src/functions/entryCreate.function.js +16 -0
  162. package/dist/src/functions/entryCreate.function.js.map +1 -0
  163. package/dist/src/functions/entryDelete.function.d.ts +17 -0
  164. package/dist/src/functions/entryDelete.function.d.ts.map +1 -0
  165. package/dist/src/functions/entryDelete.function.js +16 -0
  166. package/dist/src/functions/entryDelete.function.js.map +1 -0
  167. package/dist/src/functions/entryGet.function.d.ts +17 -0
  168. package/dist/src/functions/entryGet.function.d.ts.map +1 -0
  169. package/dist/src/functions/entryGet.function.js +16 -0
  170. package/dist/src/functions/entryGet.function.js.map +1 -0
  171. package/dist/src/functions/entryGetAll.function.d.ts +21 -0
  172. package/dist/src/functions/entryGetAll.function.d.ts.map +1 -0
  173. package/dist/src/functions/entryGetAll.function.js +17 -0
  174. package/dist/src/functions/entryGetAll.function.js.map +1 -0
  175. package/dist/src/functions/entryUpdate.function.d.ts +21 -0
  176. package/dist/src/functions/entryUpdate.function.d.ts.map +1 -0
  177. package/dist/src/functions/entryUpdate.function.js +17 -0
  178. package/dist/src/functions/entryUpdate.function.js.map +1 -0
  179. package/dist/src/index.d.ts +6 -0
  180. package/dist/src/index.d.ts.map +1 -0
  181. package/dist/src/index.js +6 -0
  182. package/dist/src/index.js.map +1 -0
  183. package/dist/src/services.d.ts +2 -0
  184. package/dist/src/services.d.ts.map +1 -0
  185. package/dist/src/services.js +14 -0
  186. package/dist/src/services.js.map +1 -0
  187. package/dist/src/strapi-api.service.d.ts +10 -0
  188. package/dist/src/strapi-api.service.d.ts.map +1 -0
  189. package/dist/src/strapi-api.service.js +116 -0
  190. package/dist/src/strapi-api.service.js.map +1 -0
  191. package/dist/src/strapi.credential.d.ts +5 -0
  192. package/dist/src/strapi.credential.d.ts.map +1 -0
  193. package/dist/src/strapi.credential.js +13 -0
  194. package/dist/src/strapi.credential.js.map +1 -0
  195. package/dist/src/strapi.types.d.ts +7 -0
  196. package/dist/src/strapi.types.d.ts.map +1 -0
  197. package/dist/src/strapi.types.js +8 -0
  198. package/dist/src/strapi.types.js.map +1 -0
  199. package/dist/src/strapi.variable.d.ts +5 -0
  200. package/dist/src/strapi.variable.d.ts.map +1 -0
  201. package/dist/src/strapi.variable.js +11 -0
  202. package/dist/src/strapi.variable.js.map +1 -0
  203. package/package.json +39 -0
@@ -0,0 +1,167 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.54
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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=pikku-workflow-wirings-meta.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pikku-workflow-wirings-meta.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/workflow/pikku-workflow-wirings-meta.gen.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.54
3
+ */
4
+ import { pikkuState } from '@pikku/core/internal';
5
+ const workflowsMeta = {};
6
+ pikkuState('@pikku/addon-strapi', 'workflows', 'meta', workflowsMeta);
7
+ //# sourceMappingURL=pikku-workflow-wirings-meta.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pikku-workflow-wirings-meta.gen.js","sourceRoot":"","sources":["../../../.pikku/workflow/pikku-workflow-wirings-meta.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAGjD,MAAM,aAAa,GAA6B,EAAE,CAAA;AAElD,UAAU,CAAC,qBAAqB,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,CAAC,CAAA"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.54
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-strapi', 'workflows', 'meta', workflowsMeta)
@@ -0,0 +1,5 @@
1
+ export {};
2
+ /**
3
+ * This file was generated by @pikku/cli@0.12.54
4
+ */
5
+ //# sourceMappingURL=pikku-workflow-wirings.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pikku-workflow-wirings.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/workflow/pikku-workflow-wirings.gen.ts"],"names":[],"mappings":";AAAA;;GAEG"}
@@ -0,0 +1,5 @@
1
+ export {};
2
+ /**
3
+ * This file was generated by @pikku/cli@0.12.54
4
+ */
5
+ //# sourceMappingURL=pikku-workflow-wirings.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pikku-workflow-wirings.gen.js","sourceRoot":"","sources":["../../../.pikku/workflow/pikku-workflow-wirings.gen.ts"],"names":[],"mappings":";AAAA;;GAEG"}
@@ -0,0 +1,3 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.54
3
+ */
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ export declare const EntryCreateInput: z.ZodObject<{
3
+ contentType: z.ZodString;
4
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5
+ }, z.core.$strip>;
6
+ export declare const EntryCreateOutput: z.ZodRecord<z.ZodString, z.ZodUnknown>;
7
+ export declare const entryCreate: import("#pikku").PikkuFunctionConfig<{
8
+ contentType: string;
9
+ data?: Record<string, unknown> | undefined;
10
+ }, Record<string, unknown>, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<{
11
+ contentType: string;
12
+ data?: Record<string, unknown> | undefined;
13
+ }, Record<string, unknown>, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<{
14
+ contentType: string;
15
+ data?: Record<string, unknown> | undefined;
16
+ }, Record<string, unknown>, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
17
+ //# sourceMappingURL=entryCreate.function.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entryCreate.function.d.ts","sourceRoot":"","sources":["../../../src/functions/entryCreate.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,gBAAgB;;;iBAG3B,CAAA;AAEF,eAAO,MAAM,iBAAiB,wCAAoC,CAAA;AAElE,eAAO,MAAM,WAAW;;;;;;;;;gGAOtB,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { pikkuSessionlessFunc } from '#pikku';
3
+ export const EntryCreateInput = z.object({
4
+ contentType: z.string(),
5
+ data: z.record(z.string(), z.unknown()).optional(),
6
+ });
7
+ export const EntryCreateOutput = z.record(z.string(), z.unknown());
8
+ export const entryCreate = pikkuSessionlessFunc({
9
+ description: "Create an entry",
10
+ input: EntryCreateInput,
11
+ output: EntryCreateOutput,
12
+ func: async ({ strapi }, data) => {
13
+ return strapi.call("POST", "/{contentType}", data);
14
+ },
15
+ });
16
+ //# sourceMappingURL=entryCreate.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entryCreate.function.js","sourceRoot":"","sources":["../../../src/functions/entryCreate.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAA;AAE7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAA;AAElE,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB,CAAC;IAC9C,WAAW,EAAE,iBAAiB;IAC9B,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,iBAAiB;IACzB,IAAI,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE;QAC/B,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,CAAQ,CAAA;IAC3D,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ export declare const EntryDeleteInput: z.ZodObject<{
3
+ contentType: z.ZodString;
4
+ entryId: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export declare const EntryDeleteOutput: z.ZodRecord<z.ZodString, z.ZodUnknown>;
7
+ export declare const entryDelete: import("#pikku").PikkuFunctionConfig<{
8
+ contentType: string;
9
+ entryId: string;
10
+ }, Record<string, unknown>, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<{
11
+ contentType: string;
12
+ entryId: string;
13
+ }, Record<string, unknown>, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<{
14
+ contentType: string;
15
+ entryId: string;
16
+ }, Record<string, unknown>, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
17
+ //# sourceMappingURL=entryDelete.function.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entryDelete.function.d.ts","sourceRoot":"","sources":["../../../src/functions/entryDelete.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,gBAAgB;;;iBAG3B,CAAA;AAEF,eAAO,MAAM,iBAAiB,wCAAoC,CAAA;AAElE,eAAO,MAAM,WAAW;;;;;;;;;gGAOtB,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { pikkuSessionlessFunc } from '#pikku';
3
+ export const EntryDeleteInput = z.object({
4
+ contentType: z.string(),
5
+ entryId: z.string(),
6
+ });
7
+ export const EntryDeleteOutput = z.record(z.string(), z.unknown());
8
+ export const entryDelete = pikkuSessionlessFunc({
9
+ description: "Delete an entry",
10
+ input: EntryDeleteInput,
11
+ output: EntryDeleteOutput,
12
+ func: async ({ strapi }, data) => {
13
+ return strapi.call("DELETE", "/{contentType}/{entryId}", data);
14
+ },
15
+ });
16
+ //# sourceMappingURL=entryDelete.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entryDelete.function.js","sourceRoot":"","sources":["../../../src/functions/entryDelete.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAA;AAE7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAA;AAElE,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB,CAAC;IAC9C,WAAW,EAAE,iBAAiB;IAC9B,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,iBAAiB;IACzB,IAAI,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE;QAC/B,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,0BAA0B,EAAE,IAAI,CAAQ,CAAA;IACvE,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ export declare const EntryGetInput: z.ZodObject<{
3
+ contentType: z.ZodString;
4
+ entryId: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export declare const EntryGetOutput: z.ZodRecord<z.ZodString, z.ZodUnknown>;
7
+ export declare const entryGet: import("#pikku").PikkuFunctionConfig<{
8
+ contentType: string;
9
+ entryId: string;
10
+ }, Record<string, unknown>, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<{
11
+ contentType: string;
12
+ entryId: string;
13
+ }, Record<string, unknown>, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<{
14
+ contentType: string;
15
+ entryId: string;
16
+ }, Record<string, unknown>, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
17
+ //# sourceMappingURL=entryGet.function.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entryGet.function.d.ts","sourceRoot":"","sources":["../../../src/functions/entryGet.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,aAAa;;;iBAGxB,CAAA;AAEF,eAAO,MAAM,cAAc,wCAAoC,CAAA;AAE/D,eAAO,MAAM,QAAQ;;;;;;;;;gGAOnB,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { pikkuSessionlessFunc } from '#pikku';
3
+ export const EntryGetInput = z.object({
4
+ contentType: z.string(),
5
+ entryId: z.string(),
6
+ });
7
+ export const EntryGetOutput = z.record(z.string(), z.unknown());
8
+ export const entryGet = pikkuSessionlessFunc({
9
+ description: "Get an entry",
10
+ input: EntryGetInput,
11
+ output: EntryGetOutput,
12
+ func: async ({ strapi }, data) => {
13
+ return strapi.call("GET", "/{contentType}/{entryId}", data);
14
+ },
15
+ });
16
+ //# sourceMappingURL=entryGet.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entryGet.function.js","sourceRoot":"","sources":["../../../src/functions/entryGet.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAA;AAE7C,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAA;AAE/D,MAAM,CAAC,MAAM,QAAQ,GAAG,oBAAoB,CAAC;IAC3C,WAAW,EAAE,cAAc;IAC3B,KAAK,EAAE,aAAa;IACpB,MAAM,EAAE,cAAc;IACtB,IAAI,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE;QAC/B,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,0BAA0B,EAAE,IAAI,CAAQ,CAAA;IACpE,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ export declare const EntryGetAllInput: z.ZodObject<{
3
+ contentType: z.ZodString;
4
+ sort: z.ZodOptional<z.ZodString>;
5
+ limit: z.ZodOptional<z.ZodNumber>;
6
+ }, z.core.$strip>;
7
+ export declare const EntryGetAllOutput: z.ZodRecord<z.ZodString, z.ZodUnknown>;
8
+ export declare const entryGetAll: import("#pikku").PikkuFunctionConfig<{
9
+ contentType: string;
10
+ sort?: string | undefined;
11
+ limit?: number | undefined;
12
+ }, Record<string, unknown>, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<{
13
+ contentType: string;
14
+ sort?: string | undefined;
15
+ limit?: number | undefined;
16
+ }, Record<string, unknown>, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<{
17
+ contentType: string;
18
+ sort?: string | undefined;
19
+ limit?: number | undefined;
20
+ }, Record<string, unknown>, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
21
+ //# sourceMappingURL=entryGetAll.function.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entryGetAll.function.d.ts","sourceRoot":"","sources":["../../../src/functions/entryGetAll.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,gBAAgB;;;;iBAI3B,CAAA;AAEF,eAAO,MAAM,iBAAiB,wCAAoC,CAAA;AAElE,eAAO,MAAM,WAAW;;;;;;;;;;;;gGAOtB,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ import { pikkuSessionlessFunc } from '#pikku';
3
+ export const EntryGetAllInput = z.object({
4
+ contentType: z.string(),
5
+ sort: z.string().optional(),
6
+ limit: z.number().optional(),
7
+ });
8
+ export const EntryGetAllOutput = z.record(z.string(), z.unknown());
9
+ export const entryGetAll = pikkuSessionlessFunc({
10
+ description: "Get many entries",
11
+ input: EntryGetAllInput,
12
+ output: EntryGetAllOutput,
13
+ func: async ({ strapi }, data) => {
14
+ return strapi.call("GET", "/{contentType}", data);
15
+ },
16
+ });
17
+ //# sourceMappingURL=entryGetAll.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entryGetAll.function.js","sourceRoot":"","sources":["../../../src/functions/entryGetAll.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAA;AAE7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAA;AAElE,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB,CAAC;IAC9C,WAAW,EAAE,kBAAkB;IAC/B,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,iBAAiB;IACzB,IAAI,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE;QAC/B,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,gBAAgB,EAAE,IAAI,CAAQ,CAAA;IAC1D,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ export declare const EntryUpdateInput: z.ZodObject<{
3
+ contentType: z.ZodString;
4
+ entryId: z.ZodString;
5
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
6
+ }, z.core.$strip>;
7
+ export declare const EntryUpdateOutput: z.ZodRecord<z.ZodString, z.ZodUnknown>;
8
+ export declare const entryUpdate: import("#pikku").PikkuFunctionConfig<{
9
+ contentType: string;
10
+ entryId: string;
11
+ data?: Record<string, unknown> | undefined;
12
+ }, Record<string, unknown>, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<{
13
+ contentType: string;
14
+ entryId: string;
15
+ data?: Record<string, unknown> | undefined;
16
+ }, Record<string, unknown>, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<{
17
+ contentType: string;
18
+ entryId: string;
19
+ data?: Record<string, unknown> | undefined;
20
+ }, Record<string, unknown>, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
21
+ //# sourceMappingURL=entryUpdate.function.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entryUpdate.function.d.ts","sourceRoot":"","sources":["../../../src/functions/entryUpdate.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,gBAAgB;;;;iBAI3B,CAAA;AAEF,eAAO,MAAM,iBAAiB,wCAAoC,CAAA;AAElE,eAAO,MAAM,WAAW;;;;;;;;;;;;gGAOtB,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ import { pikkuSessionlessFunc } from '#pikku';
3
+ export const EntryUpdateInput = z.object({
4
+ contentType: z.string(),
5
+ entryId: z.string(),
6
+ data: z.record(z.string(), z.unknown()).optional(),
7
+ });
8
+ export const EntryUpdateOutput = z.record(z.string(), z.unknown());
9
+ export const entryUpdate = pikkuSessionlessFunc({
10
+ description: "Update an entry",
11
+ input: EntryUpdateInput,
12
+ output: EntryUpdateOutput,
13
+ func: async ({ strapi }, data) => {
14
+ return strapi.call("PUT", "/{contentType}/{entryId}", data);
15
+ },
16
+ });
17
+ //# sourceMappingURL=entryUpdate.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entryUpdate.function.js","sourceRoot":"","sources":["../../../src/functions/entryUpdate.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAA;AAE7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAA;AAElE,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB,CAAC;IAC9C,WAAW,EAAE,iBAAiB;IAC9B,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,iBAAiB;IACzB,IAAI,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE;QAC/B,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,0BAA0B,EAAE,IAAI,CAAQ,CAAA;IACpE,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ export { entryGetAll } from './functions/entryGetAll.function.js';
2
+ export { entryCreate } from './functions/entryCreate.function.js';
3
+ export { entryGet } from './functions/entryGet.function.js';
4
+ export { entryUpdate } from './functions/entryUpdate.function.js';
5
+ export { entryDelete } from './functions/entryDelete.function.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA"}
@@ -0,0 +1,6 @@
1
+ export { entryGetAll } from './functions/entryGetAll.function.js';
2
+ export { entryCreate } from './functions/entryCreate.function.js';
3
+ export { entryGet } from './functions/entryGet.function.js';
4
+ export { entryUpdate } from './functions/entryUpdate.function.js';
5
+ export { entryDelete } from './functions/entryDelete.function.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const createWireServices: any;
2
+ //# sourceMappingURL=services.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/services.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,KAa9B,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { StrapiService } from './strapi-api.service.js';
2
+ import { pikkuAddonWireServices } from '#pikku';
3
+ export const createWireServices = pikkuAddonWireServices(async ({ variables }, wire) => {
4
+ if (!wire.getCredential) {
5
+ throw new Error('Credential resolution is not available in this runtime');
6
+ }
7
+ const cred = await wire.getCredential('strapi');
8
+ if (!cred?.token) {
9
+ throw new Error('Missing strapi credential');
10
+ }
11
+ const strapi = new StrapiService(cred, variables);
12
+ return { strapi };
13
+ });
14
+ //# sourceMappingURL=services.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services.js","sourceRoot":"","sources":["../../src/services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAA;AAE/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,sBAAsB,CACtD,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,EAAE;IAC5B,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;IAC3E,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,aAAa,CAAoB,QAAQ,CAAC,CAAA;IAClE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;IAC9C,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;IAEjD,OAAO,EAAE,MAAM,EAAE,CAAA;AACnB,CAAC,CACF,CAAA"}
@@ -0,0 +1,10 @@
1
+ import type { TypedVariablesService } from '#pikku/variables/pikku-variables.gen.js';
2
+ export declare class StrapiService {
3
+ private creds;
4
+ private baseUrl;
5
+ constructor(creds: {
6
+ token: string;
7
+ }, variables: TypedVariablesService);
8
+ call<T>(method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH', path: string, data?: Record<string, unknown>): Promise<T>;
9
+ }
10
+ //# sourceMappingURL=strapi-api.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strapi-api.service.d.ts","sourceRoot":"","sources":["../../src/strapi-api.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAA;AA8CpF,qBAAa,aAAa;IAGZ,OAAO,CAAC,KAAK;IAFzB,OAAO,CAAC,OAAO,CAAQ;gBAEH,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,SAAS,EAAE,qBAAqB;IAIxE,IAAI,CAAC,CAAC,EACV,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,EACnD,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC,CAAC,CAAC;CAwEd"}
@@ -0,0 +1,116 @@
1
+ import { BadRequestError, ConflictError, ForbiddenError, InternalServerError, MethodNotAllowedError, NotFoundError, TooManyRequestsError, UnauthorizedError, UnprocessableContentError } from '@pikku/core/errors';
2
+ const ROUTES = {
3
+ "GET /{contentType}": {
4
+ "path": [
5
+ "contentType"
6
+ ],
7
+ "query": [
8
+ "sort",
9
+ "limit"
10
+ ],
11
+ "headers": []
12
+ },
13
+ "POST /{contentType}": {
14
+ "path": [
15
+ "contentType"
16
+ ],
17
+ "query": [],
18
+ "headers": []
19
+ },
20
+ "GET /{contentType}/{entryId}": {
21
+ "path": [
22
+ "contentType",
23
+ "entryId"
24
+ ],
25
+ "query": [],
26
+ "headers": []
27
+ },
28
+ "PUT /{contentType}/{entryId}": {
29
+ "path": [
30
+ "contentType",
31
+ "entryId"
32
+ ],
33
+ "query": [],
34
+ "headers": []
35
+ },
36
+ "DELETE /{contentType}/{entryId}": {
37
+ "path": [
38
+ "contentType",
39
+ "entryId"
40
+ ],
41
+ "query": [],
42
+ "headers": []
43
+ }
44
+ };
45
+ export class StrapiService {
46
+ constructor(creds, variables) {
47
+ this.creds = creds;
48
+ this.baseUrl = variables.get('STRAPI_BASE_URL');
49
+ }
50
+ async call(method, path, data) {
51
+ const route = ROUTES[`${method} ${path}`];
52
+ let endpoint = path;
53
+ let body;
54
+ const query = {};
55
+ const headers = {
56
+ 'Content-Type': 'application/json',
57
+ };
58
+ if (data && route) {
59
+ // Interpolate path params
60
+ for (const param of route.path) {
61
+ if (data[param] !== undefined) {
62
+ endpoint = endpoint.replace(`{${param}}`, String(data[param]));
63
+ }
64
+ }
65
+ // Extract query params
66
+ for (const param of route.query) {
67
+ if (data[param] !== undefined) {
68
+ query[param] = String(data[param]);
69
+ }
70
+ }
71
+ // Extract header params
72
+ for (const param of route.headers) {
73
+ if (data[param] !== undefined) {
74
+ headers[param] = String(data[param]);
75
+ }
76
+ }
77
+ // Everything else goes into body
78
+ const pathQueryHeaders = new Set([...route.path, ...route.query, ...route.headers]);
79
+ const remaining = Object.fromEntries(Object.entries(data).filter(([k]) => !pathQueryHeaders.has(k)));
80
+ if (Object.keys(remaining).length > 0) {
81
+ body = remaining;
82
+ }
83
+ }
84
+ const url = new URL(`${this.baseUrl}${endpoint}`);
85
+ for (const [key, value] of Object.entries(query)) {
86
+ url.searchParams.set(key, value);
87
+ }
88
+ headers.Authorization = `Bearer ${this.creds.token}`;
89
+ const response = await fetch(url.toString(), {
90
+ method,
91
+ headers,
92
+ body: body ? JSON.stringify(body) : undefined,
93
+ });
94
+ if (!response.ok) {
95
+ const errorText = await response.text();
96
+ const errorMessage = route?.errors?.[response.status] ?? errorText;
97
+ switch (response.status) {
98
+ case 400: throw new BadRequestError(errorMessage);
99
+ case 401: throw new UnauthorizedError(errorMessage);
100
+ case 403: throw new ForbiddenError(errorMessage);
101
+ case 404: throw new NotFoundError(errorMessage);
102
+ case 405: throw new MethodNotAllowedError(errorMessage);
103
+ case 409: throw new ConflictError(errorMessage);
104
+ case 422: throw new UnprocessableContentError(errorMessage);
105
+ case 429: throw new TooManyRequestsError(errorMessage);
106
+ case 500: throw new InternalServerError(errorMessage);
107
+ default: throw new Error(`Strapi API error (${response.status}): ${errorText}`);
108
+ }
109
+ }
110
+ const text = await response.text();
111
+ if (!text)
112
+ return {};
113
+ return JSON.parse(text);
114
+ }
115
+ }
116
+ //# sourceMappingURL=strapi-api.service.js.map