@shipfox/api-integration-webhook-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.
- package/.turbo/turbo-build.log +2 -0
- package/.turbo/turbo-type$colon$emit.log +1 -0
- package/.turbo/turbo-type.log +1 -0
- package/CHANGELOG.md +27 -0
- package/LICENSE +21 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -0
- package/dist/tsconfig.test.tsbuildinfo +1 -0
- package/package.json +56 -0
- package/src/index.test.ts +51 -0
- package/src/index.ts +51 -0
- package/tsconfig.build.json +9 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +3 -0
- package/tsconfig.test.json +8 -0
- package/vitest.config.ts +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
$ shipfox-tsc-emit
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
$ shipfox-tsc-check
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# @shipfox/api-integration-webhook-dto
|
|
2
|
+
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1b0d344: Publishes the complete API runtime closure with packed-consumer-safe internal imports and records its exact package set in application releases.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [1b0d344]
|
|
12
|
+
- @shipfox/api-integration-core-dto@2.0.0
|
|
13
|
+
|
|
14
|
+
## 0.0.1
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 861091c: Adds reserved webhook slug validation while keeping legacy webhook response DTOs readable.
|
|
19
|
+
- Updated dependencies [115655e]
|
|
20
|
+
- Updated dependencies [ce062a9]
|
|
21
|
+
- Updated dependencies [f3614ae]
|
|
22
|
+
- Updated dependencies [f8f339a]
|
|
23
|
+
- Updated dependencies [b8e49ff]
|
|
24
|
+
- Updated dependencies [d6d4862]
|
|
25
|
+
- Updated dependencies [01be723]
|
|
26
|
+
- Updated dependencies [2933c33]
|
|
27
|
+
- @shipfox/api-integration-core-dto@0.1.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shipfox
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const WEBHOOK_PROVIDER: "webhook";
|
|
3
|
+
export declare const WEBHOOK_RECEIVED_EVENT: "received";
|
|
4
|
+
export declare const WEBHOOK_RESERVED_SLUGS: readonly ["github", "gitea", "sentry", "manual", "cron"];
|
|
5
|
+
export declare const webhookSlugSchema: z.ZodPipe<z.ZodString, z.ZodString>;
|
|
6
|
+
export declare const createWebhookConnectionBodySchema: z.ZodObject<{
|
|
7
|
+
workspace_id: z.ZodString;
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
slug: z.ZodPipe<z.ZodString, z.ZodString>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type CreateWebhookConnectionBodyDto = z.infer<typeof createWebhookConnectionBodySchema>;
|
|
12
|
+
export declare const updateWebhookConnectionBodySchema: z.ZodObject<{
|
|
13
|
+
lifecycle_status: z.ZodEnum<{
|
|
14
|
+
active: "active";
|
|
15
|
+
disabled: "disabled";
|
|
16
|
+
}>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type UpdateWebhookConnectionBodyDto = z.infer<typeof updateWebhookConnectionBodySchema>;
|
|
19
|
+
export declare const webhookConnectionDtoSchema: z.ZodObject<{
|
|
20
|
+
id: z.ZodString;
|
|
21
|
+
workspace_id: z.ZodString;
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
slug: z.ZodString;
|
|
24
|
+
lifecycle_status: z.ZodEnum<{
|
|
25
|
+
error: "error";
|
|
26
|
+
active: "active";
|
|
27
|
+
disabled: "disabled";
|
|
28
|
+
}>;
|
|
29
|
+
inbound_url: z.ZodString;
|
|
30
|
+
created_at: z.ZodString;
|
|
31
|
+
updated_at: z.ZodString;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export type WebhookConnectionDto = z.infer<typeof webhookConnectionDtoSchema>;
|
|
34
|
+
export declare const listWebhookConnectionsQuerySchema: z.ZodObject<{
|
|
35
|
+
workspace_id: z.ZodString;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export type ListWebhookConnectionsQueryDto = z.infer<typeof listWebhookConnectionsQuerySchema>;
|
|
38
|
+
export declare const listWebhookConnectionsResponseSchema: z.ZodObject<{
|
|
39
|
+
connections: z.ZodArray<z.ZodObject<{
|
|
40
|
+
id: z.ZodString;
|
|
41
|
+
workspace_id: z.ZodString;
|
|
42
|
+
name: z.ZodString;
|
|
43
|
+
slug: z.ZodString;
|
|
44
|
+
lifecycle_status: z.ZodEnum<{
|
|
45
|
+
error: "error";
|
|
46
|
+
active: "active";
|
|
47
|
+
disabled: "disabled";
|
|
48
|
+
}>;
|
|
49
|
+
inbound_url: z.ZodString;
|
|
50
|
+
created_at: z.ZodString;
|
|
51
|
+
updated_at: z.ZodString;
|
|
52
|
+
}, z.core.$strip>>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
export type ListWebhookConnectionsResponseDto = z.infer<typeof listWebhookConnectionsResponseSchema>;
|
|
55
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,gBAAgB,EAAG,SAAkB,CAAC;AACnD,eAAO,MAAM,sBAAsB,EAAG,UAAmB,CAAC;AAC1D,eAAO,MAAM,sBAAsB,0DAA2D,CAAC;AAI/F,eAAO,MAAM,iBAAiB,qCAK1B,CAAC;AAEL,eAAO,MAAM,iCAAiC;;;;iBAI5C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE/F,eAAO,MAAM,iCAAiC;;;;;iBAE5C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE/F,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;iBASrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,iCAAiC;;iBAE5C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE/F,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;iBAE/C,CAAC;AACH,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CACrD,OAAO,oCAAoC,CAC5C,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { connectionSlugSchema } from '@shipfox/api-integration-core-dto';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export const WEBHOOK_PROVIDER = 'webhook';
|
|
4
|
+
export const WEBHOOK_RECEIVED_EVENT = 'received';
|
|
5
|
+
export const WEBHOOK_RESERVED_SLUGS = [
|
|
6
|
+
'github',
|
|
7
|
+
'gitea',
|
|
8
|
+
'sentry',
|
|
9
|
+
'manual',
|
|
10
|
+
'cron'
|
|
11
|
+
];
|
|
12
|
+
const webhookReservedSlugSet = new Set(WEBHOOK_RESERVED_SLUGS);
|
|
13
|
+
export const webhookSlugSchema = z.string().pipe(connectionSlugSchema).refine((slug)=>!webhookReservedSlugSet.has(slug), {
|
|
14
|
+
message: 'Slug is reserved'
|
|
15
|
+
});
|
|
16
|
+
export const createWebhookConnectionBodySchema = z.object({
|
|
17
|
+
workspace_id: z.string().uuid(),
|
|
18
|
+
name: z.string().min(1).max(100),
|
|
19
|
+
slug: webhookSlugSchema
|
|
20
|
+
});
|
|
21
|
+
export const updateWebhookConnectionBodySchema = z.object({
|
|
22
|
+
lifecycle_status: z.enum([
|
|
23
|
+
'active',
|
|
24
|
+
'disabled'
|
|
25
|
+
])
|
|
26
|
+
});
|
|
27
|
+
export const webhookConnectionDtoSchema = z.object({
|
|
28
|
+
id: z.string().uuid(),
|
|
29
|
+
workspace_id: z.string().uuid(),
|
|
30
|
+
name: z.string(),
|
|
31
|
+
slug: connectionSlugSchema,
|
|
32
|
+
lifecycle_status: z.enum([
|
|
33
|
+
'active',
|
|
34
|
+
'disabled',
|
|
35
|
+
'error'
|
|
36
|
+
]),
|
|
37
|
+
inbound_url: z.string().url(),
|
|
38
|
+
created_at: z.string(),
|
|
39
|
+
updated_at: z.string()
|
|
40
|
+
});
|
|
41
|
+
export const listWebhookConnectionsQuerySchema = z.object({
|
|
42
|
+
workspace_id: z.string().uuid()
|
|
43
|
+
});
|
|
44
|
+
export const listWebhookConnectionsResponseSchema = z.object({
|
|
45
|
+
connections: z.array(webhookConnectionDtoSchema)
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {connectionSlugSchema} from '@shipfox/api-integration-core-dto';\nimport {z} from 'zod';\n\nexport const WEBHOOK_PROVIDER = 'webhook' as const;\nexport const WEBHOOK_RECEIVED_EVENT = 'received' as const;\nexport const WEBHOOK_RESERVED_SLUGS = ['github', 'gitea', 'sentry', 'manual', 'cron'] as const;\n\nconst webhookReservedSlugSet = new Set<string>(WEBHOOK_RESERVED_SLUGS);\n\nexport const webhookSlugSchema = z\n .string()\n .pipe(connectionSlugSchema)\n .refine((slug) => !webhookReservedSlugSet.has(slug), {\n message: 'Slug is reserved',\n });\n\nexport const createWebhookConnectionBodySchema = z.object({\n workspace_id: z.string().uuid(),\n name: z.string().min(1).max(100),\n slug: webhookSlugSchema,\n});\nexport type CreateWebhookConnectionBodyDto = z.infer<typeof createWebhookConnectionBodySchema>;\n\nexport const updateWebhookConnectionBodySchema = z.object({\n lifecycle_status: z.enum(['active', 'disabled']),\n});\nexport type UpdateWebhookConnectionBodyDto = z.infer<typeof updateWebhookConnectionBodySchema>;\n\nexport const webhookConnectionDtoSchema = z.object({\n id: z.string().uuid(),\n workspace_id: z.string().uuid(),\n name: z.string(),\n slug: connectionSlugSchema,\n lifecycle_status: z.enum(['active', 'disabled', 'error']),\n inbound_url: z.string().url(),\n created_at: z.string(),\n updated_at: z.string(),\n});\nexport type WebhookConnectionDto = z.infer<typeof webhookConnectionDtoSchema>;\n\nexport const listWebhookConnectionsQuerySchema = z.object({\n workspace_id: z.string().uuid(),\n});\nexport type ListWebhookConnectionsQueryDto = z.infer<typeof listWebhookConnectionsQuerySchema>;\n\nexport const listWebhookConnectionsResponseSchema = z.object({\n connections: z.array(webhookConnectionDtoSchema),\n});\nexport type ListWebhookConnectionsResponseDto = z.infer<\n typeof listWebhookConnectionsResponseSchema\n>;\n"],"names":["connectionSlugSchema","z","WEBHOOK_PROVIDER","WEBHOOK_RECEIVED_EVENT","WEBHOOK_RESERVED_SLUGS","webhookReservedSlugSet","Set","webhookSlugSchema","string","pipe","refine","slug","has","message","createWebhookConnectionBodySchema","object","workspace_id","uuid","name","min","max","updateWebhookConnectionBodySchema","lifecycle_status","enum","webhookConnectionDtoSchema","id","inbound_url","url","created_at","updated_at","listWebhookConnectionsQuerySchema","listWebhookConnectionsResponseSchema","connections","array"],"mappings":"AAAA,SAAQA,oBAAoB,QAAO,oCAAoC;AACvE,SAAQC,CAAC,QAAO,MAAM;AAEtB,OAAO,MAAMC,mBAAmB,UAAmB;AACnD,OAAO,MAAMC,yBAAyB,WAAoB;AAC1D,OAAO,MAAMC,yBAAyB;IAAC;IAAU;IAAS;IAAU;IAAU;CAAO,CAAU;AAE/F,MAAMC,yBAAyB,IAAIC,IAAYF;AAE/C,OAAO,MAAMG,oBAAoBN,EAC9BO,MAAM,GACNC,IAAI,CAACT,sBACLU,MAAM,CAAC,CAACC,OAAS,CAACN,uBAAuBO,GAAG,CAACD,OAAO;IACnDE,SAAS;AACX,GAAG;AAEL,OAAO,MAAMC,oCAAoCb,EAAEc,MAAM,CAAC;IACxDC,cAAcf,EAAEO,MAAM,GAAGS,IAAI;IAC7BC,MAAMjB,EAAEO,MAAM,GAAGW,GAAG,CAAC,GAAGC,GAAG,CAAC;IAC5BT,MAAMJ;AACR,GAAG;AAGH,OAAO,MAAMc,oCAAoCpB,EAAEc,MAAM,CAAC;IACxDO,kBAAkBrB,EAAEsB,IAAI,CAAC;QAAC;QAAU;KAAW;AACjD,GAAG;AAGH,OAAO,MAAMC,6BAA6BvB,EAAEc,MAAM,CAAC;IACjDU,IAAIxB,EAAEO,MAAM,GAAGS,IAAI;IACnBD,cAAcf,EAAEO,MAAM,GAAGS,IAAI;IAC7BC,MAAMjB,EAAEO,MAAM;IACdG,MAAMX;IACNsB,kBAAkBrB,EAAEsB,IAAI,CAAC;QAAC;QAAU;QAAY;KAAQ;IACxDG,aAAazB,EAAEO,MAAM,GAAGmB,GAAG;IAC3BC,YAAY3B,EAAEO,MAAM;IACpBqB,YAAY5B,EAAEO,MAAM;AACtB,GAAG;AAGH,OAAO,MAAMsB,oCAAoC7B,EAAEc,MAAM,CAAC;IACxDC,cAAcf,EAAEO,MAAM,GAAGS,IAAI;AAC/B,GAAG;AAGH,OAAO,MAAMc,uCAAuC9B,EAAEc,MAAM,CAAC;IAC3DiB,aAAa/B,EAAEgC,KAAK,CAACT;AACvB,GAAG"}
|