@corsair-dev/onedrive 0.1.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/LICENSE +191 -0
- package/dist/api.test.d.ts +2 -0
- package/dist/api.test.d.ts.map +1 -0
- package/dist/client.d.ts +21 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/endpoints/drive.d.ts +13 -0
- package/dist/endpoints/drive.d.ts.map +1 -0
- package/dist/endpoints/files.d.ts +8 -0
- package/dist/endpoints/files.d.ts.map +1 -0
- package/dist/endpoints/index.d.ts +903 -0
- package/dist/endpoints/index.d.ts.map +1 -0
- package/dist/endpoints/items.d.ts +27 -0
- package/dist/endpoints/items.d.ts.map +1 -0
- package/dist/endpoints/permissions.d.ts +12 -0
- package/dist/endpoints/permissions.d.ts.map +1 -0
- package/dist/endpoints/sharepoint.d.ts +10 -0
- package/dist/endpoints/sharepoint.d.ts.map +1 -0
- package/dist/endpoints/subscriptions.d.ts +3 -0
- package/dist/endpoints/subscriptions.d.ts.map +1 -0
- package/dist/endpoints/types.d.ts +5779 -0
- package/dist/endpoints/types.d.ts.map +1 -0
- package/dist/error-handlers.d.ts +40 -0
- package/dist/error-handlers.d.ts.map +1 -0
- package/dist/index.d.ts +3079 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/schema/database.d.ts +217 -0
- package/dist/schema/database.d.ts.map +1 -0
- package/dist/schema/index.d.ts +219 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/tsup.config.d.ts +3 -0
- package/dist/tsup.config.d.ts.map +1 -0
- package/dist/webhooks/drive.d.ts +3 -0
- package/dist/webhooks/drive.d.ts.map +1 -0
- package/dist/webhooks/index.d.ts +36 -0
- package/dist/webhooks/index.d.ts.map +1 -0
- package/dist/webhooks/types.d.ts +101 -0
- package/dist/webhooks/types.d.ts.map +1 -0
- package/dist/webhooks/validation.d.ts +3 -0
- package/dist/webhooks/validation.d.ts.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: import("tsup").Options | import("tsup").Options[] | ((overrideOptions: import("tsup").Options) => import("tsup").Options | import("tsup").Options[] | Promise<import("tsup").Options | import("tsup").Options[]>);
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=tsup.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsup.config.d.ts","sourceRoot":"","sources":["../tsup.config.ts"],"names":[],"mappings":";AAEA,wBAYG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drive.d.ts","sourceRoot":"","sources":["../../webhooks/drive.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA0B,gBAAgB,EAAE,MAAM,IAAI,CAAC;AAGnE,eAAO,MAAM,iBAAiB,EAAE,gBAAgB,CAAC,mBAAmB,CAwEnE,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const DriveWebhooks: {
|
|
2
|
+
validation: {
|
|
3
|
+
match: import("corsair/core").CorsairWebhookMatcher;
|
|
4
|
+
handler: import("corsair/core").CorsairWebhookHandler<import("..").OnedriveContext, {
|
|
5
|
+
validationToken: string;
|
|
6
|
+
}, {
|
|
7
|
+
validationToken: string;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
driveNotification: {
|
|
11
|
+
match: import("corsair/core").CorsairWebhookMatcher;
|
|
12
|
+
handler: import("corsair/core").CorsairWebhookHandler<import("..").OnedriveContext, {
|
|
13
|
+
value: {
|
|
14
|
+
subscriptionId: string;
|
|
15
|
+
changeType: string;
|
|
16
|
+
tenantId?: string | undefined;
|
|
17
|
+
clientState?: string | undefined;
|
|
18
|
+
resource?: string | undefined;
|
|
19
|
+
resourceData?: Record<string, unknown> | undefined;
|
|
20
|
+
subscriptionExpirationDateTime?: string | undefined;
|
|
21
|
+
}[];
|
|
22
|
+
}, {
|
|
23
|
+
value: {
|
|
24
|
+
subscriptionId: string;
|
|
25
|
+
changeType: string;
|
|
26
|
+
tenantId?: string | undefined;
|
|
27
|
+
clientState?: string | undefined;
|
|
28
|
+
resource?: string | undefined;
|
|
29
|
+
resourceData?: Record<string, unknown> | undefined;
|
|
30
|
+
subscriptionExpirationDateTime?: string | undefined;
|
|
31
|
+
}[];
|
|
32
|
+
}>;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export * from './types';
|
|
36
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../webhooks/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGzB,CAAC;AAEF,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { CorsairWebhookMatcher, RawWebhookRequest } from 'corsair/core';
|
|
3
|
+
export declare const OnedriveNotificationSchema: z.ZodObject<{
|
|
4
|
+
subscriptionId: z.ZodString;
|
|
5
|
+
changeType: z.ZodString;
|
|
6
|
+
clientState: z.ZodOptional<z.ZodString>;
|
|
7
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
8
|
+
resourceData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
9
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
10
|
+
subscriptionExpirationDateTime: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
subscriptionId: string;
|
|
13
|
+
changeType: string;
|
|
14
|
+
tenantId?: string | undefined;
|
|
15
|
+
clientState?: string | undefined;
|
|
16
|
+
resource?: string | undefined;
|
|
17
|
+
resourceData?: Record<string, unknown> | undefined;
|
|
18
|
+
subscriptionExpirationDateTime?: string | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
subscriptionId: string;
|
|
21
|
+
changeType: string;
|
|
22
|
+
tenantId?: string | undefined;
|
|
23
|
+
clientState?: string | undefined;
|
|
24
|
+
resource?: string | undefined;
|
|
25
|
+
resourceData?: Record<string, unknown> | undefined;
|
|
26
|
+
subscriptionExpirationDateTime?: string | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const OnedriveWebhookPayloadSchema: z.ZodObject<{
|
|
29
|
+
value: z.ZodArray<z.ZodObject<{
|
|
30
|
+
subscriptionId: z.ZodString;
|
|
31
|
+
changeType: z.ZodString;
|
|
32
|
+
clientState: z.ZodOptional<z.ZodString>;
|
|
33
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
34
|
+
resourceData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
35
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
36
|
+
subscriptionExpirationDateTime: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
subscriptionId: string;
|
|
39
|
+
changeType: string;
|
|
40
|
+
tenantId?: string | undefined;
|
|
41
|
+
clientState?: string | undefined;
|
|
42
|
+
resource?: string | undefined;
|
|
43
|
+
resourceData?: Record<string, unknown> | undefined;
|
|
44
|
+
subscriptionExpirationDateTime?: string | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
subscriptionId: string;
|
|
47
|
+
changeType: string;
|
|
48
|
+
tenantId?: string | undefined;
|
|
49
|
+
clientState?: string | undefined;
|
|
50
|
+
resource?: string | undefined;
|
|
51
|
+
resourceData?: Record<string, unknown> | undefined;
|
|
52
|
+
subscriptionExpirationDateTime?: string | undefined;
|
|
53
|
+
}>, "many">;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
value: {
|
|
56
|
+
subscriptionId: string;
|
|
57
|
+
changeType: string;
|
|
58
|
+
tenantId?: string | undefined;
|
|
59
|
+
clientState?: string | undefined;
|
|
60
|
+
resource?: string | undefined;
|
|
61
|
+
resourceData?: Record<string, unknown> | undefined;
|
|
62
|
+
subscriptionExpirationDateTime?: string | undefined;
|
|
63
|
+
}[];
|
|
64
|
+
}, {
|
|
65
|
+
value: {
|
|
66
|
+
subscriptionId: string;
|
|
67
|
+
changeType: string;
|
|
68
|
+
tenantId?: string | undefined;
|
|
69
|
+
clientState?: string | undefined;
|
|
70
|
+
resource?: string | undefined;
|
|
71
|
+
resourceData?: Record<string, unknown> | undefined;
|
|
72
|
+
subscriptionExpirationDateTime?: string | undefined;
|
|
73
|
+
}[];
|
|
74
|
+
}>;
|
|
75
|
+
export type OnedriveWebhookPayload = z.infer<typeof OnedriveWebhookPayloadSchema>;
|
|
76
|
+
export type OnedriveNotification = z.infer<typeof OnedriveNotificationSchema>;
|
|
77
|
+
export declare const OnedriveValidationPayloadSchema: z.ZodObject<{
|
|
78
|
+
validationToken: z.ZodString;
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
validationToken: string;
|
|
81
|
+
}, {
|
|
82
|
+
validationToken: string;
|
|
83
|
+
}>;
|
|
84
|
+
export type OnedriveValidationPayload = z.infer<typeof OnedriveValidationPayloadSchema>;
|
|
85
|
+
export declare function createOnedriveMatch(changeType?: string): CorsairWebhookMatcher;
|
|
86
|
+
export declare function createOnedriveValidationMatch(): CorsairWebhookMatcher;
|
|
87
|
+
export declare function extractOnedriveValidationToken(request: RawWebhookRequest | {
|
|
88
|
+
payload?: unknown;
|
|
89
|
+
headers?: Record<string, string | string[] | undefined>;
|
|
90
|
+
}): string | null;
|
|
91
|
+
export declare function verifyOnedriveClientState(notification: {
|
|
92
|
+
clientState?: string | null;
|
|
93
|
+
}, expectedClientState: string): {
|
|
94
|
+
valid: boolean;
|
|
95
|
+
error?: string;
|
|
96
|
+
};
|
|
97
|
+
export type OnedriveWebhookOutputs = {
|
|
98
|
+
validation: OnedriveValidationPayload;
|
|
99
|
+
driveNotification: OnedriveWebhookPayload;
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -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AM,sBAAsB,GAAG;IACpC,UAAU,EAAE,yBAAyB,CAAC;IACtC,iBAAiB,EAAE,sBAAsB,CAAC;CAC1C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../webhooks/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;AAG3C,eAAO,MAAM,UAAU,EAAE,gBAAgB,CAAC,YAAY,CAwBrD,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@corsair-dev/onedrive",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "onedrive plugin for Corsair",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"dev-source": "./index.ts",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"corsair": ">=0.1.0",
|
|
18
|
+
"zod": "^3.0.0"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@types/jest": "^29.5.14",
|
|
22
|
+
"ts-jest": "^29.4.6",
|
|
23
|
+
"tsup": "^8.0.1",
|
|
24
|
+
"typescript": "^5.9.3",
|
|
25
|
+
"zod": "^3.25.76",
|
|
26
|
+
"corsair": "0.1.52"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"corsair",
|
|
30
|
+
"onedrive",
|
|
31
|
+
"plugin"
|
|
32
|
+
],
|
|
33
|
+
"author": "",
|
|
34
|
+
"license": "Apache-2.0",
|
|
35
|
+
"files": [
|
|
36
|
+
"dist"
|
|
37
|
+
],
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"jest": "^29.7.0"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "rm -rf dist && tsc --build --force && tsup",
|
|
43
|
+
"typecheck": "tsc --noEmit",
|
|
44
|
+
"test": "jest"
|
|
45
|
+
}
|
|
46
|
+
}
|