@shipfox/api-integration-core-dto 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/.turbo/turbo-build.log +2 -0
  2. package/.turbo/turbo-type$colon$emit.log +1 -0
  3. package/.turbo/turbo-type.log +1 -0
  4. package/CHANGELOG.md +70 -0
  5. package/LICENSE +21 -0
  6. package/dist/contracts/index.d.ts +3 -0
  7. package/dist/contracts/index.d.ts.map +1 -0
  8. package/dist/contracts/index.js +3 -0
  9. package/dist/contracts/index.js.map +1 -0
  10. package/dist/contracts/integrations.d.ts +191 -0
  11. package/dist/contracts/integrations.d.ts.map +1 -0
  12. package/dist/contracts/integrations.js +44 -0
  13. package/dist/contracts/integrations.js.map +1 -0
  14. package/dist/errors.d.ts +4 -0
  15. package/dist/errors.d.ts.map +1 -0
  16. package/dist/errors.js +10 -0
  17. package/dist/errors.js.map +1 -0
  18. package/dist/events.d.ts +87 -0
  19. package/dist/events.d.ts.map +1 -0
  20. package/dist/events.js +56 -0
  21. package/dist/events.js.map +1 -0
  22. package/dist/index.d.ts +7 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +8 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/ports.d.ts +59 -0
  27. package/dist/ports.d.ts.map +1 -0
  28. package/dist/ports.js +3 -0
  29. package/dist/ports.js.map +1 -0
  30. package/dist/schemas/index.d.ts +2 -0
  31. package/dist/schemas/index.d.ts.map +1 -0
  32. package/dist/schemas/index.js +3 -0
  33. package/dist/schemas/index.js.map +1 -0
  34. package/dist/schemas/integrations.d.ts +162 -0
  35. package/dist/schemas/integrations.d.ts.map +1 -0
  36. package/dist/schemas/integrations.js +82 -0
  37. package/dist/schemas/integrations.js.map +1 -0
  38. package/dist/slug.d.ts +7 -0
  39. package/dist/slug.d.ts.map +1 -0
  40. package/dist/slug.js +14 -0
  41. package/dist/slug.js.map +1 -0
  42. package/dist/tsconfig.test.tsbuildinfo +1 -0
  43. package/package.json +55 -0
  44. package/src/contracts/index.ts +43 -0
  45. package/src/contracts/integrations.test.ts +64 -0
  46. package/src/contracts/integrations.ts +312 -0
  47. package/src/errors.ts +6 -0
  48. package/src/events.test.ts +109 -0
  49. package/src/events.ts +91 -0
  50. package/src/index.ts +6 -0
  51. package/src/ports.ts +73 -0
  52. package/src/schemas/index.ts +35 -0
  53. package/src/schemas/integrations.ts +109 -0
  54. package/src/slug.test.ts +32 -0
  55. package/src/slug.ts +26 -0
  56. package/tsconfig.build.json +9 -0
  57. package/tsconfig.build.tsbuildinfo +1 -0
  58. package/tsconfig.json +3 -0
  59. package/tsconfig.test.json +8 -0
  60. package/vitest.config.ts +3 -0
@@ -0,0 +1,59 @@
1
+ import type { IntegrationConnection, IntegrationConnectionLifecycleStatus } from '#contracts/index.js';
2
+ import type { IntegrationEventReceivedEvent, SourcePushPayload } from '#events.js';
3
+ /**
4
+ * Database/transaction handle threaded from core into a provider and back into
5
+ * core-owned persistence. Typed loosely so providers don't take a Drizzle
6
+ * dependency just to pass a transaction through; core supplies the concrete
7
+ * executor and conformance is checked where it wires the providers.
8
+ */
9
+ export type IntegrationTx = any;
10
+ export type PublishIntegrationEventReceivedFn = (params: {
11
+ tx: IntegrationTx;
12
+ event: IntegrationEventReceivedEvent;
13
+ }) => Promise<{
14
+ published: boolean;
15
+ }>;
16
+ export type CreateIntegrationConnectionFn = (params: {
17
+ workspaceId: string;
18
+ provider: string;
19
+ externalAccountId: string;
20
+ slug: string;
21
+ displayName: string;
22
+ lifecycleStatus?: IntegrationConnectionLifecycleStatus | undefined;
23
+ }, options?: {
24
+ tx?: IntegrationTx;
25
+ }) => Promise<IntegrationConnection>;
26
+ export type PublishSourcePushFn = (params: {
27
+ tx: IntegrationTx;
28
+ provider: string;
29
+ source: string;
30
+ workspaceId: string;
31
+ connectionId: string;
32
+ connectionName: string;
33
+ deliveryId: string;
34
+ receivedAt: string;
35
+ rawPayload: unknown;
36
+ push: SourcePushPayload;
37
+ }) => Promise<{
38
+ published: boolean;
39
+ }>;
40
+ export type RecordDeliveryOnlyFn = (params: {
41
+ tx: IntegrationTx;
42
+ provider: string;
43
+ deliveryId: string;
44
+ }) => Promise<void>;
45
+ export type GetIntegrationConnectionByIdFn = (id: string, options?: {
46
+ tx?: IntegrationTx;
47
+ }) => Promise<IntegrationConnection | undefined>;
48
+ export type UpdateIntegrationConnectionLifecycleStatusFn = (params: {
49
+ id: string;
50
+ lifecycleStatus: IntegrationConnectionLifecycleStatus;
51
+ }, options?: {
52
+ tx?: IntegrationTx;
53
+ }) => Promise<IntegrationConnection | undefined>;
54
+ export type DeleteIntegrationConnectionFn = (params: {
55
+ id: string;
56
+ }, options?: {
57
+ tx?: IntegrationTx;
58
+ }) => Promise<boolean>;
59
+ //# sourceMappingURL=ports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ports.d.ts","sourceRoot":"","sources":["../src/ports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,oCAAoC,EACrC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAC,6BAA6B,EAAE,iBAAiB,EAAC,MAAM,YAAY,CAAC;AAQjF;;;;;GAKG;AAEH,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC;AAEhC,MAAM,MAAM,iCAAiC,GAAG,CAAC,MAAM,EAAE;IACvD,EAAE,EAAE,aAAa,CAAC;IAClB,KAAK,EAAE,6BAA6B,CAAC;CACtC,KAAK,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAC,CAAC,CAAC;AAEpC,MAAM,MAAM,6BAA6B,GAAG,CAC1C,MAAM,EAAE;IACN,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,oCAAoC,G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,CAAA;CAAC,EACpB,OAAO,CAAC,EAAE;IAAC,EAAE,CAAC,EAAE,aAAa,CAAA;CAAC,KAC3B,OAAO,CAAC,OAAO,CAAC,CAAC"}
package/dist/ports.js ADDED
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=ports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ports.ts"],"sourcesContent":["import type {\n IntegrationConnection,\n IntegrationConnectionLifecycleStatus,\n} from '#contracts/index.js';\nimport type {IntegrationEventReceivedEvent, SourcePushPayload} from '#events.js';\n\n// The persistence seam between the integrations core and a provider package.\n// `@shipfox/api-integration-core` implements these against its own tables and\n// injects them into each provider at composition time, so providers depend only\n// on this contract — never on core itself, which would create a dependency cycle\n// (core composes the providers).\n\n/**\n * Database/transaction handle threaded from core into a provider and back into\n * core-owned persistence. Typed loosely so providers don't take a Drizzle\n * dependency just to pass a transaction through; core supplies the concrete\n * executor and conformance is checked where it wires the providers.\n */\n// biome-ignore lint/suspicious/noExplicitAny: cross-package tx handle, kept opaque to avoid a cyclic dep on core\nexport type IntegrationTx = any;\n\nexport type PublishIntegrationEventReceivedFn = (params: {\n tx: IntegrationTx;\n event: IntegrationEventReceivedEvent;\n}) => Promise<{published: boolean}>;\n\nexport type CreateIntegrationConnectionFn = (\n params: {\n workspaceId: string;\n provider: string;\n externalAccountId: string;\n slug: string;\n displayName: string;\n lifecycleStatus?: IntegrationConnectionLifecycleStatus | undefined;\n },\n options?: {tx?: IntegrationTx},\n) => Promise<IntegrationConnection>;\n\n// Emitted by source-control providers for a single push. The delivery dedup and the outbox\n// rows it writes must commit together, so it requires a transaction, never a bare connection.\nexport type PublishSourcePushFn = (params: {\n tx: IntegrationTx;\n provider: string;\n source: string;\n workspaceId: string;\n connectionId: string;\n connectionName: string;\n deliveryId: string;\n receivedAt: string;\n rawPayload: unknown;\n push: SourcePushPayload;\n}) => Promise<{published: boolean}>;\n\nexport type RecordDeliveryOnlyFn = (params: {\n tx: IntegrationTx;\n provider: string;\n deliveryId: string;\n}) => Promise<void>;\n\nexport type GetIntegrationConnectionByIdFn = (\n id: string,\n options?: {tx?: IntegrationTx},\n) => Promise<IntegrationConnection | undefined>;\n\nexport type UpdateIntegrationConnectionLifecycleStatusFn = (\n params: {id: string; lifecycleStatus: IntegrationConnectionLifecycleStatus},\n options?: {tx?: IntegrationTx},\n) => Promise<IntegrationConnection | undefined>;\n\nexport type DeleteIntegrationConnectionFn = (\n params: {id: string},\n options?: {tx?: IntegrationTx},\n) => Promise<boolean>;\n"],"names":[],"mappings":"AAqEA,WAGsB"}
@@ -0,0 +1,2 @@
1
+ export { connectionSlugSchema, type IntegrationCapabilityDto, type IntegrationConnectionDto, type IntegrationConnectionLifecycleStatusDto, type IntegrationProviderDto, type IntegrationProviderKindDto, integrationCapabilitySchema, integrationConnectionDtoSchema, integrationConnectionLifecycleStatusSchema, integrationProviderDtoSchema, integrationProviderKindSchema, type ListIntegrationConnectionsQueryDto, type ListIntegrationConnectionsResponseDto, type ListIntegrationProvidersQueryDto, type ListIntegrationProvidersResponseDto, type ListRepositoriesParamsDto, type ListRepositoriesQueryDto, type ListRepositoriesResponseDto, listIntegrationConnectionsQuerySchema, listIntegrationConnectionsResponseSchema, listIntegrationProvidersQuerySchema, listIntegrationProvidersResponseSchema, listRepositoriesParamsSchema, listRepositoriesQuerySchema, listRepositoriesResponseSchema, type RepositoryDto, type RepositoryVisibilityDto, repositoryDtoSchema, repositoryVisibilitySchema, type UpdateIntegrationConnectionBodyDto, type UpdateIntegrationConnectionLifecycleStatusDto, updateIntegrationConnectionBodySchema, updateIntegrationConnectionLifecycleStatusSchema, } from './integrations.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,uCAAuC,EAC5C,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,2BAA2B,EAC3B,8BAA8B,EAC9B,0CAA0C,EAC1C,4BAA4B,EAC5B,6BAA6B,EAC7B,KAAK,kCAAkC,EACvC,KAAK,qCAAqC,EAC1C,KAAK,gCAAgC,EACrC,KAAK,mCAAmC,EACxC,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,qCAAqC,EACrC,wCAAwC,EACxC,mCAAmC,EACnC,sCAAsC,EACtC,4BAA4B,EAC5B,2BAA2B,EAC3B,8BAA8B,EAC9B,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,mBAAmB,EACnB,0BAA0B,EAC1B,KAAK,kCAAkC,EACvC,KAAK,6CAA6C,EAClD,qCAAqC,EACrC,gDAAgD,GACjD,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { connectionSlugSchema, integrationCapabilitySchema, integrationConnectionDtoSchema, integrationConnectionLifecycleStatusSchema, integrationProviderDtoSchema, integrationProviderKindSchema, listIntegrationConnectionsQuerySchema, listIntegrationConnectionsResponseSchema, listIntegrationProvidersQuerySchema, listIntegrationProvidersResponseSchema, listRepositoriesParamsSchema, listRepositoriesQuerySchema, listRepositoriesResponseSchema, repositoryDtoSchema, repositoryVisibilitySchema, updateIntegrationConnectionBodySchema, updateIntegrationConnectionLifecycleStatusSchema } from './integrations.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schemas/index.ts"],"sourcesContent":["export {\n connectionSlugSchema,\n type IntegrationCapabilityDto,\n type IntegrationConnectionDto,\n type IntegrationConnectionLifecycleStatusDto,\n type IntegrationProviderDto,\n type IntegrationProviderKindDto,\n integrationCapabilitySchema,\n integrationConnectionDtoSchema,\n integrationConnectionLifecycleStatusSchema,\n integrationProviderDtoSchema,\n integrationProviderKindSchema,\n type ListIntegrationConnectionsQueryDto,\n type ListIntegrationConnectionsResponseDto,\n type ListIntegrationProvidersQueryDto,\n type ListIntegrationProvidersResponseDto,\n type ListRepositoriesParamsDto,\n type ListRepositoriesQueryDto,\n type ListRepositoriesResponseDto,\n listIntegrationConnectionsQuerySchema,\n listIntegrationConnectionsResponseSchema,\n listIntegrationProvidersQuerySchema,\n listIntegrationProvidersResponseSchema,\n listRepositoriesParamsSchema,\n listRepositoriesQuerySchema,\n listRepositoriesResponseSchema,\n type RepositoryDto,\n type RepositoryVisibilityDto,\n repositoryDtoSchema,\n repositoryVisibilitySchema,\n type UpdateIntegrationConnectionBodyDto,\n type UpdateIntegrationConnectionLifecycleStatusDto,\n updateIntegrationConnectionBodySchema,\n updateIntegrationConnectionLifecycleStatusSchema,\n} from './integrations.js';\n"],"names":["connectionSlugSchema","integrationCapabilitySchema","integrationConnectionDtoSchema","integrationConnectionLifecycleStatusSchema","integrationProviderDtoSchema","integrationProviderKindSchema","listIntegrationConnectionsQuerySchema","listIntegrationConnectionsResponseSchema","listIntegrationProvidersQuerySchema","listIntegrationProvidersResponseSchema","listRepositoriesParamsSchema","listRepositoriesQuerySchema","listRepositoriesResponseSchema","repositoryDtoSchema","repositoryVisibilitySchema","updateIntegrationConnectionBodySchema","updateIntegrationConnectionLifecycleStatusSchema"],"mappings":"AAAA,SACEA,oBAAoB,EAMpBC,2BAA2B,EAC3BC,8BAA8B,EAC9BC,0CAA0C,EAC1CC,4BAA4B,EAC5BC,6BAA6B,EAQ7BC,qCAAqC,EACrCC,wCAAwC,EACxCC,mCAAmC,EACnCC,sCAAsC,EACtCC,4BAA4B,EAC5BC,2BAA2B,EAC3BC,8BAA8B,EAG9BC,mBAAmB,EACnBC,0BAA0B,EAG1BC,qCAAqC,EACrCC,gDAAgD,QAC3C,oBAAoB"}
@@ -0,0 +1,162 @@
1
+ import { z } from 'zod';
2
+ import { connectionSlugSchema } from '#slug.js';
3
+ export { connectionSlugSchema };
4
+ export declare const integrationProviderKindSchema: z.ZodString;
5
+ export type IntegrationProviderKindDto = z.infer<typeof integrationProviderKindSchema>;
6
+ export declare const integrationCapabilitySchema: z.ZodEnum<{
7
+ source_control: "source_control";
8
+ agent_tools: "agent_tools";
9
+ }>;
10
+ export type IntegrationCapabilityDto = z.infer<typeof integrationCapabilitySchema>;
11
+ export declare const integrationConnectionLifecycleStatusSchema: z.ZodEnum<{
12
+ error: "error";
13
+ active: "active";
14
+ disabled: "disabled";
15
+ }>;
16
+ export type IntegrationConnectionLifecycleStatusDto = z.infer<typeof integrationConnectionLifecycleStatusSchema>;
17
+ export declare const updateIntegrationConnectionLifecycleStatusSchema: z.ZodEnum<{
18
+ active: "active";
19
+ disabled: "disabled";
20
+ }>;
21
+ export type UpdateIntegrationConnectionLifecycleStatusDto = z.infer<typeof updateIntegrationConnectionLifecycleStatusSchema>;
22
+ export declare const repositoryVisibilitySchema: z.ZodEnum<{
23
+ unknown: "unknown";
24
+ public: "public";
25
+ private: "private";
26
+ internal: "internal";
27
+ }>;
28
+ export type RepositoryVisibilityDto = z.infer<typeof repositoryVisibilitySchema>;
29
+ export declare const integrationProviderDtoSchema: z.ZodObject<{
30
+ provider: z.ZodString;
31
+ display_name: z.ZodString;
32
+ capabilities: z.ZodArray<z.ZodEnum<{
33
+ source_control: "source_control";
34
+ agent_tools: "agent_tools";
35
+ }>>;
36
+ }, z.core.$strip>;
37
+ export type IntegrationProviderDto = z.infer<typeof integrationProviderDtoSchema>;
38
+ export declare const listIntegrationProvidersQuerySchema: z.ZodObject<{
39
+ capability: z.ZodOptional<z.ZodEnum<{
40
+ source_control: "source_control";
41
+ agent_tools: "agent_tools";
42
+ }>>;
43
+ }, z.core.$strip>;
44
+ export type ListIntegrationProvidersQueryDto = z.infer<typeof listIntegrationProvidersQuerySchema>;
45
+ export declare const listIntegrationProvidersResponseSchema: z.ZodObject<{
46
+ providers: z.ZodArray<z.ZodObject<{
47
+ provider: z.ZodString;
48
+ display_name: z.ZodString;
49
+ capabilities: z.ZodArray<z.ZodEnum<{
50
+ source_control: "source_control";
51
+ agent_tools: "agent_tools";
52
+ }>>;
53
+ }, z.core.$strip>>;
54
+ }, z.core.$strip>;
55
+ export type ListIntegrationProvidersResponseDto = z.infer<typeof listIntegrationProvidersResponseSchema>;
56
+ export declare const integrationConnectionDtoSchema: z.ZodObject<{
57
+ id: z.ZodString;
58
+ workspace_id: z.ZodString;
59
+ provider: z.ZodString;
60
+ external_account_id: z.ZodString;
61
+ slug: z.ZodString;
62
+ display_name: z.ZodString;
63
+ lifecycle_status: z.ZodEnum<{
64
+ error: "error";
65
+ active: "active";
66
+ disabled: "disabled";
67
+ }>;
68
+ capabilities: z.ZodArray<z.ZodEnum<{
69
+ source_control: "source_control";
70
+ agent_tools: "agent_tools";
71
+ }>>;
72
+ external_url: z.ZodOptional<z.ZodString>;
73
+ created_at: z.ZodString;
74
+ updated_at: z.ZodString;
75
+ }, z.core.$strip>;
76
+ export type IntegrationConnectionDto = z.infer<typeof integrationConnectionDtoSchema>;
77
+ export declare const listIntegrationConnectionsQuerySchema: z.ZodObject<{
78
+ workspace_id: z.ZodString;
79
+ capability: z.ZodOptional<z.ZodEnum<{
80
+ source_control: "source_control";
81
+ agent_tools: "agent_tools";
82
+ }>>;
83
+ }, z.core.$strip>;
84
+ export type ListIntegrationConnectionsQueryDto = z.infer<typeof listIntegrationConnectionsQuerySchema>;
85
+ export declare const listIntegrationConnectionsResponseSchema: z.ZodObject<{
86
+ connections: z.ZodArray<z.ZodObject<{
87
+ id: z.ZodString;
88
+ workspace_id: z.ZodString;
89
+ provider: z.ZodString;
90
+ external_account_id: z.ZodString;
91
+ slug: z.ZodString;
92
+ display_name: z.ZodString;
93
+ lifecycle_status: z.ZodEnum<{
94
+ error: "error";
95
+ active: "active";
96
+ disabled: "disabled";
97
+ }>;
98
+ capabilities: z.ZodArray<z.ZodEnum<{
99
+ source_control: "source_control";
100
+ agent_tools: "agent_tools";
101
+ }>>;
102
+ external_url: z.ZodOptional<z.ZodString>;
103
+ created_at: z.ZodString;
104
+ updated_at: z.ZodString;
105
+ }, z.core.$strip>>;
106
+ }, z.core.$strip>;
107
+ export type ListIntegrationConnectionsResponseDto = z.infer<typeof listIntegrationConnectionsResponseSchema>;
108
+ export declare const updateIntegrationConnectionBodySchema: z.ZodObject<{
109
+ lifecycle_status: z.ZodEnum<{
110
+ active: "active";
111
+ disabled: "disabled";
112
+ }>;
113
+ }, z.core.$strip>;
114
+ export type UpdateIntegrationConnectionBodyDto = z.infer<typeof updateIntegrationConnectionBodySchema>;
115
+ export declare const listRepositoriesParamsSchema: z.ZodObject<{
116
+ connectionId: z.ZodString;
117
+ }, z.core.$strip>;
118
+ export type ListRepositoriesParamsDto = z.infer<typeof listRepositoriesParamsSchema>;
119
+ export declare const listRepositoriesQuerySchema: z.ZodObject<{
120
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
121
+ cursor: z.ZodOptional<z.ZodString>;
122
+ search: z.ZodOptional<z.ZodString>;
123
+ }, z.core.$strip>;
124
+ export type ListRepositoriesQueryDto = z.infer<typeof listRepositoriesQuerySchema>;
125
+ export declare const repositoryDtoSchema: z.ZodObject<{
126
+ connection_id: z.ZodString;
127
+ external_repository_id: z.ZodString;
128
+ owner: z.ZodString;
129
+ name: z.ZodString;
130
+ full_name: z.ZodString;
131
+ default_branch: z.ZodString;
132
+ visibility: z.ZodEnum<{
133
+ unknown: "unknown";
134
+ public: "public";
135
+ private: "private";
136
+ internal: "internal";
137
+ }>;
138
+ clone_url: z.ZodString;
139
+ html_url: z.ZodString;
140
+ }, z.core.$strip>;
141
+ export type RepositoryDto = z.infer<typeof repositoryDtoSchema>;
142
+ export declare const listRepositoriesResponseSchema: z.ZodObject<{
143
+ repositories: z.ZodArray<z.ZodObject<{
144
+ connection_id: z.ZodString;
145
+ external_repository_id: z.ZodString;
146
+ owner: z.ZodString;
147
+ name: z.ZodString;
148
+ full_name: z.ZodString;
149
+ default_branch: z.ZodString;
150
+ visibility: z.ZodEnum<{
151
+ unknown: "unknown";
152
+ public: "public";
153
+ private: "private";
154
+ internal: "internal";
155
+ }>;
156
+ clone_url: z.ZodString;
157
+ html_url: z.ZodString;
158
+ }, z.core.$strip>>;
159
+ next_cursor: z.ZodNullable<z.ZodString>;
160
+ }, z.core.$strip>;
161
+ export type ListRepositoriesResponseDto = z.infer<typeof listRepositoriesResponseSchema>;
162
+ //# sourceMappingURL=integrations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../src/schemas/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,EAAC,oBAAoB,EAAC,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAC,oBAAoB,EAAC,CAAC;AAE9B,eAAO,MAAM,6BAA6B,aAAoB,CAAC;AAC/D,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEvF,eAAO,MAAM,2BAA2B;;;EAA4C,CAAC;AACrF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEnF,eAAO,MAAM,0CAA0C;;;;EAA0C,CAAC;AAClG,MAAM,MAAM,uCAAuC,GAAG,CAAC,CAAC,KAAK,CAC3D,OAAO,0CAA0C,CAClD,CAAC;AACF,eAAO,MAAM,gDAAgD;;;EAAiC,CAAC;AAC/F,MAAM,MAAM,6CAA6C,GAAG,CAAC,CAAC,KAAK,CACjE,OAAO,gDAAgD,CACxD,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;EAAuD,CAAC;AAC/F,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEjF,eAAO,MAAM,4BAA4B;;;;;;;iBAIvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC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;;;;;;;;;;;;;;;iBAGzC,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
@@ -0,0 +1,82 @@
1
+ import { z } from 'zod';
2
+ import { connectionSlugSchema } from '#slug.js';
3
+ export { connectionSlugSchema };
4
+ export const integrationProviderKindSchema = z.string().min(1);
5
+ export const integrationCapabilitySchema = z.enum([
6
+ 'source_control',
7
+ 'agent_tools'
8
+ ]);
9
+ export const integrationConnectionLifecycleStatusSchema = z.enum([
10
+ 'active',
11
+ 'disabled',
12
+ 'error'
13
+ ]);
14
+ export const updateIntegrationConnectionLifecycleStatusSchema = z.enum([
15
+ 'active',
16
+ 'disabled'
17
+ ]);
18
+ export const repositoryVisibilitySchema = z.enum([
19
+ 'public',
20
+ 'private',
21
+ 'internal',
22
+ 'unknown'
23
+ ]);
24
+ export const integrationProviderDtoSchema = z.object({
25
+ provider: integrationProviderKindSchema,
26
+ display_name: z.string(),
27
+ capabilities: z.array(integrationCapabilitySchema)
28
+ });
29
+ export const listIntegrationProvidersQuerySchema = z.object({
30
+ capability: integrationCapabilitySchema.optional()
31
+ });
32
+ export const listIntegrationProvidersResponseSchema = z.object({
33
+ providers: z.array(integrationProviderDtoSchema)
34
+ });
35
+ export const integrationConnectionDtoSchema = z.object({
36
+ id: z.string().uuid(),
37
+ workspace_id: z.string().uuid(),
38
+ provider: integrationProviderKindSchema,
39
+ external_account_id: z.string(),
40
+ slug: connectionSlugSchema,
41
+ display_name: z.string(),
42
+ lifecycle_status: integrationConnectionLifecycleStatusSchema,
43
+ capabilities: z.array(integrationCapabilitySchema),
44
+ external_url: z.string().url().optional(),
45
+ created_at: z.string(),
46
+ updated_at: z.string()
47
+ });
48
+ export const listIntegrationConnectionsQuerySchema = z.object({
49
+ workspace_id: z.string().uuid(),
50
+ capability: integrationCapabilitySchema.optional()
51
+ });
52
+ export const listIntegrationConnectionsResponseSchema = z.object({
53
+ connections: z.array(integrationConnectionDtoSchema)
54
+ });
55
+ export const updateIntegrationConnectionBodySchema = z.object({
56
+ lifecycle_status: updateIntegrationConnectionLifecycleStatusSchema
57
+ });
58
+ export const listRepositoriesParamsSchema = z.object({
59
+ connectionId: z.string().uuid()
60
+ });
61
+ export const listRepositoriesQuerySchema = z.object({
62
+ limit: z.coerce.number().int().min(1).max(100).default(50),
63
+ cursor: z.string().optional(),
64
+ search: z.string().min(1).max(100).optional()
65
+ });
66
+ export const repositoryDtoSchema = z.object({
67
+ connection_id: z.string().uuid(),
68
+ external_repository_id: z.string(),
69
+ owner: z.string(),
70
+ name: z.string(),
71
+ full_name: z.string(),
72
+ default_branch: z.string(),
73
+ visibility: repositoryVisibilitySchema,
74
+ clone_url: z.string(),
75
+ html_url: z.string()
76
+ });
77
+ export const listRepositoriesResponseSchema = z.object({
78
+ repositories: z.array(repositoryDtoSchema),
79
+ next_cursor: z.string().nullable()
80
+ });
81
+
82
+ //# sourceMappingURL=integrations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schemas/integrations.ts"],"sourcesContent":["import {z} from 'zod';\nimport {connectionSlugSchema} from '#slug.js';\n\nexport {connectionSlugSchema};\n\nexport const integrationProviderKindSchema = z.string().min(1);\nexport type IntegrationProviderKindDto = z.infer<typeof integrationProviderKindSchema>;\n\nexport const integrationCapabilitySchema = z.enum(['source_control', 'agent_tools']);\nexport type IntegrationCapabilityDto = z.infer<typeof integrationCapabilitySchema>;\n\nexport const integrationConnectionLifecycleStatusSchema = z.enum(['active', 'disabled', 'error']);\nexport type IntegrationConnectionLifecycleStatusDto = z.infer<\n typeof integrationConnectionLifecycleStatusSchema\n>;\nexport const updateIntegrationConnectionLifecycleStatusSchema = z.enum(['active', 'disabled']);\nexport type UpdateIntegrationConnectionLifecycleStatusDto = z.infer<\n typeof updateIntegrationConnectionLifecycleStatusSchema\n>;\n\nexport const repositoryVisibilitySchema = z.enum(['public', 'private', 'internal', 'unknown']);\nexport type RepositoryVisibilityDto = z.infer<typeof repositoryVisibilitySchema>;\n\nexport const integrationProviderDtoSchema = z.object({\n provider: integrationProviderKindSchema,\n display_name: z.string(),\n capabilities: z.array(integrationCapabilitySchema),\n});\nexport type IntegrationProviderDto = z.infer<typeof integrationProviderDtoSchema>;\n\nexport const listIntegrationProvidersQuerySchema = z.object({\n capability: integrationCapabilitySchema.optional(),\n});\nexport type ListIntegrationProvidersQueryDto = z.infer<typeof listIntegrationProvidersQuerySchema>;\n\nexport const listIntegrationProvidersResponseSchema = z.object({\n providers: z.array(integrationProviderDtoSchema),\n});\nexport type ListIntegrationProvidersResponseDto = z.infer<\n typeof listIntegrationProvidersResponseSchema\n>;\n\nexport const integrationConnectionDtoSchema = z.object({\n id: z.string().uuid(),\n workspace_id: z.string().uuid(),\n provider: integrationProviderKindSchema,\n external_account_id: z.string(),\n slug: connectionSlugSchema,\n display_name: z.string(),\n lifecycle_status: integrationConnectionLifecycleStatusSchema,\n capabilities: z.array(integrationCapabilitySchema),\n external_url: z.string().url().optional(),\n created_at: z.string(),\n updated_at: z.string(),\n});\nexport type IntegrationConnectionDto = z.infer<typeof integrationConnectionDtoSchema>;\n\nexport const listIntegrationConnectionsQuerySchema = z.object({\n workspace_id: z.string().uuid(),\n capability: integrationCapabilitySchema.optional(),\n});\nexport type ListIntegrationConnectionsQueryDto = z.infer<\n typeof listIntegrationConnectionsQuerySchema\n>;\n\nexport const listIntegrationConnectionsResponseSchema = z.object({\n connections: z.array(integrationConnectionDtoSchema),\n});\nexport type ListIntegrationConnectionsResponseDto = z.infer<\n typeof listIntegrationConnectionsResponseSchema\n>;\n\nexport const updateIntegrationConnectionBodySchema = z.object({\n lifecycle_status: updateIntegrationConnectionLifecycleStatusSchema,\n});\nexport type UpdateIntegrationConnectionBodyDto = z.infer<\n typeof updateIntegrationConnectionBodySchema\n>;\n\nexport const listRepositoriesParamsSchema = z.object({\n connectionId: z.string().uuid(),\n});\nexport type ListRepositoriesParamsDto = z.infer<typeof listRepositoriesParamsSchema>;\n\nexport const listRepositoriesQuerySchema = z.object({\n limit: z.coerce.number().int().min(1).max(100).default(50),\n cursor: z.string().optional(),\n search: z.string().min(1).max(100).optional(),\n});\nexport type ListRepositoriesQueryDto = z.infer<typeof listRepositoriesQuerySchema>;\n\nexport const repositoryDtoSchema = z.object({\n connection_id: z.string().uuid(),\n external_repository_id: z.string(),\n owner: z.string(),\n name: z.string(),\n full_name: z.string(),\n default_branch: z.string(),\n visibility: repositoryVisibilitySchema,\n clone_url: z.string(),\n html_url: z.string(),\n});\nexport type RepositoryDto = z.infer<typeof repositoryDtoSchema>;\n\nexport const listRepositoriesResponseSchema = z.object({\n repositories: z.array(repositoryDtoSchema),\n next_cursor: z.string().nullable(),\n});\nexport type ListRepositoriesResponseDto = z.infer<typeof listRepositoriesResponseSchema>;\n"],"names":["z","connectionSlugSchema","integrationProviderKindSchema","string","min","integrationCapabilitySchema","enum","integrationConnectionLifecycleStatusSchema","updateIntegrationConnectionLifecycleStatusSchema","repositoryVisibilitySchema","integrationProviderDtoSchema","object","provider","display_name","capabilities","array","listIntegrationProvidersQuerySchema","capability","optional","listIntegrationProvidersResponseSchema","providers","integrationConnectionDtoSchema","id","uuid","workspace_id","external_account_id","slug","lifecycle_status","external_url","url","created_at","updated_at","listIntegrationConnectionsQuerySchema","listIntegrationConnectionsResponseSchema","connections","updateIntegrationConnectionBodySchema","listRepositoriesParamsSchema","connectionId","listRepositoriesQuerySchema","limit","coerce","number","int","max","default","cursor","search","repositoryDtoSchema","connection_id","external_repository_id","owner","name","full_name","default_branch","visibility","clone_url","html_url","listRepositoriesResponseSchema","repositories","next_cursor","nullable"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AACtB,SAAQC,oBAAoB,QAAO,WAAW;AAE9C,SAAQA,oBAAoB,GAAE;AAE9B,OAAO,MAAMC,gCAAgCF,EAAEG,MAAM,GAAGC,GAAG,CAAC,GAAG;AAG/D,OAAO,MAAMC,8BAA8BL,EAAEM,IAAI,CAAC;IAAC;I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AAKH,OAAO,MAAMc,wCAAwCnC,EAAEW,MAAM,CAAC;IAC5DgB,kBAAkBnB;AACpB,GAAG;AAKH,OAAO,MAAM4B,+BAA+BpC,EAAEW,MAAM,CAAC;IACnD0B,cAAcrC,EAAEG,MAAM,GAAGoB,IAAI;AAC/B,GAAG;AAGH,OAAO,MAAMe,8BAA8BtC,EAAEW,MAAM,CAAC;IAClD4B,OAAOvC,EAAEwC,MAAM,CAACC,MAAM,GAAGC,GAAG,GAAGtC,GAAG,CAAC,GAAGuC,GAAG,CAAC,KAAKC,OAAO,CAAC;IACvDC,QAAQ7C,EAAEG,MAAM,GAAGe,QAAQ;IAC3B4B,QAAQ9C,EAAEG,MAAM,GAAGC,GAAG,CAAC,GAAGuC,GAAG,CAAC,KAAKzB,QAAQ;AAC7C,GAAG;AAGH,OAAO,MAAM6B,sBAAsB/C,EAAEW,MAAM,CAAC;IAC1CqC,eAAehD,EAAEG,MAAM,GAAGoB,IAAI;IAC9B0B,wBAAwBjD,EAAEG,MAAM;IAChC+C,OAAOlD,EAAEG,MAAM;IACfgD,MAAMnD,EAAEG,MAAM;IACdiD,WAAWpD,EAAEG,MAAM;IACnBkD,gBAAgBrD,EAAEG,MAAM;IACxBmD,YAAY7C;IACZ8C,WAAWvD,EAAEG,MAAM;IACnBqD,UAAUxD,EAAEG,MAAM;AACpB,GAAG;AAGH,OAAO,MAAMsD,iCAAiCzD,EAAEW,MAAM,CAAC;IACrD+C,cAAc1D,EAAEe,KAAK,CAACgC;IACtBY,aAAa3D,EAAEG,MAAM,GAAGyD,QAAQ;AAClC,GAAG"}
package/dist/slug.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ export declare const CONNECTION_SLUG_MAX_LENGTH = 100;
3
+ export declare const connectionSlugSchema: z.ZodString;
4
+ export declare function slugifyConnectionSlug(input: string, options: {
5
+ fallback: string;
6
+ }): string;
7
+ //# sourceMappingURL=slug.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slug.d.ts","sourceRoot":"","sources":["../src/slug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAE9C,eAAO,MAAM,oBAAoB,aAIQ,CAAC;AAE1C,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAC,GAAG,MAAM,CAMxF"}
package/dist/slug.js ADDED
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ export const CONNECTION_SLUG_MAX_LENGTH = 100;
3
+ export const connectionSlugSchema = z.string().min(1).max(CONNECTION_SLUG_MAX_LENGTH).regex(/^[a-z0-9]+(?:[_-][a-z0-9]+)*$/);
4
+ export function slugifyConnectionSlug(input, options) {
5
+ const slug = normalizeSlug(input);
6
+ if (slug) return slug;
7
+ const fallback = normalizeSlug(options.fallback);
8
+ return fallback || 'connection';
9
+ }
10
+ function normalizeSlug(input) {
11
+ return input.toLowerCase().replaceAll(/[^a-z0-9]+/g, '_').replaceAll(/^_+|_+$/g, '').slice(0, CONNECTION_SLUG_MAX_LENGTH).replaceAll(/_+$/g, '');
12
+ }
13
+
14
+ //# sourceMappingURL=slug.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/slug.ts"],"sourcesContent":["import {z} from 'zod';\n\nexport const CONNECTION_SLUG_MAX_LENGTH = 100;\n\nexport const connectionSlugSchema = z\n .string()\n .min(1)\n .max(CONNECTION_SLUG_MAX_LENGTH)\n .regex(/^[a-z0-9]+(?:[_-][a-z0-9]+)*$/);\n\nexport function slugifyConnectionSlug(input: string, options: {fallback: string}): string {\n const slug = normalizeSlug(input);\n if (slug) return slug;\n\n const fallback = normalizeSlug(options.fallback);\n return fallback || 'connection';\n}\n\nfunction normalizeSlug(input: string): string {\n return input\n .toLowerCase()\n .replaceAll(/[^a-z0-9]+/g, '_')\n .replaceAll(/^_+|_+$/g, '')\n .slice(0, CONNECTION_SLUG_MAX_LENGTH)\n .replaceAll(/_+$/g, '');\n}\n"],"names":["z","CONNECTION_SLUG_MAX_LENGTH","connectionSlugSchema","string","min","max","regex","slugifyConnectionSlug","input","options","slug","normalizeSlug","fallback","toLowerCase","replaceAll","slice"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB,OAAO,MAAMC,6BAA6B,IAAI;AAE9C,OAAO,MAAMC,uBAAuBF,EACjCG,MAAM,GACNC,GAAG,CAAC,GACJC,GAAG,CAACJ,4BACJK,KAAK,CAAC,iCAAiC;AAE1C,OAAO,SAASC,sBAAsBC,KAAa,EAAEC,OAA2B;IAC9E,MAAMC,OAAOC,cAAcH;IAC3B,IAAIE,MAAM,OAAOA;IAEjB,MAAME,WAAWD,cAAcF,QAAQG,QAAQ;IAC/C,OAAOA,YAAY;AACrB;AAEA,SAASD,cAAcH,KAAa;IAClC,OAAOA,MACJK,WAAW,GACXC,UAAU,CAAC,eAAe,KAC1BA,UAAU,CAAC,YAAY,IACvBC,KAAK,CAAC,GAAGd,4BACTa,UAAU,CAAC,QAAQ;AACxB"}