moss-partner-sdk 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 +120 -0
- package/README.md +347 -0
- package/dist/__tests__/setup.d.ts +33 -0
- package/dist/__tests__/setup.d.ts.map +1 -0
- package/dist/__tests__/setup.js +52 -0
- package/dist/__tests__/setup.js.map +1 -0
- package/dist/analytics.d.ts +23 -0
- package/dist/analytics.d.ts.map +1 -0
- package/dist/analytics.js +55 -0
- package/dist/analytics.js.map +1 -0
- package/dist/client.d.ts +15 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +47 -0
- package/dist/client.js.map +1 -0
- package/dist/customers.d.ts +20 -0
- package/dist/customers.d.ts.map +1 -0
- package/dist/customers.js +171 -0
- package/dist/customers.js.map +1 -0
- package/dist/http.d.ts +31 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +200 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +225 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +36 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/case.d.ts +5 -0
- package/dist/utils/case.d.ts.map +1 -0
- package/dist/utils/case.js +47 -0
- package/dist/utils/case.js.map +1 -0
- package/dist/webhooks.d.ts +16 -0
- package/dist/webhooks.d.ts.map +1 -0
- package/dist/webhooks.js +83 -0
- package/dist/webhooks.js.map +1 -0
- package/package.json +53 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
export interface MossPartnerConfig {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
baseUrl?: string;
|
|
4
|
+
timeout?: number;
|
|
5
|
+
retries?: number;
|
|
6
|
+
logger?: Logger;
|
|
7
|
+
metrics?: MetricsExporter;
|
|
8
|
+
testMode?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface Logger {
|
|
11
|
+
debug(message: string, meta?: any): void;
|
|
12
|
+
info(message: string, meta?: any): void;
|
|
13
|
+
warn(message: string, meta?: any): void;
|
|
14
|
+
error(message: string, meta?: any): void;
|
|
15
|
+
}
|
|
16
|
+
export interface MetricsExporter {
|
|
17
|
+
recordLatency(operation: string, durationMs: number): void;
|
|
18
|
+
recordError(operation: string, error: Error): void;
|
|
19
|
+
recordSuccess(operation: string): void;
|
|
20
|
+
}
|
|
21
|
+
export interface Customer {
|
|
22
|
+
id: string;
|
|
23
|
+
externalId: string;
|
|
24
|
+
name: string;
|
|
25
|
+
email: string;
|
|
26
|
+
status: CustomerStatus;
|
|
27
|
+
sandboxToken?: string;
|
|
28
|
+
productionToken?: string;
|
|
29
|
+
governance: Governance;
|
|
30
|
+
limits: ResourceLimits;
|
|
31
|
+
compliance: ComplianceInfo;
|
|
32
|
+
billing?: BillingInfo;
|
|
33
|
+
createdAt: string;
|
|
34
|
+
updatedAt: string;
|
|
35
|
+
promotedAt?: string;
|
|
36
|
+
suspendedAt?: string;
|
|
37
|
+
}
|
|
38
|
+
export type CustomerStatus = 'sandbox_active' | 'production_active' | 'suspended' | 'deactivated';
|
|
39
|
+
export interface Governance {
|
|
40
|
+
jurisdictions: string[];
|
|
41
|
+
frameworks: string[];
|
|
42
|
+
settings?: Record<string, any>;
|
|
43
|
+
}
|
|
44
|
+
export interface ResourceLimits {
|
|
45
|
+
agents: number;
|
|
46
|
+
envelopesPerMonth?: number;
|
|
47
|
+
policies?: number;
|
|
48
|
+
}
|
|
49
|
+
export interface ComplianceInfo {
|
|
50
|
+
score: number;
|
|
51
|
+
status: 'compliant' | 'at_risk' | 'non_compliant';
|
|
52
|
+
issues: ComplianceIssue[];
|
|
53
|
+
lastAssessment: string;
|
|
54
|
+
}
|
|
55
|
+
export interface ComplianceIssue {
|
|
56
|
+
id: string;
|
|
57
|
+
severity: 'critical' | 'high' | 'medium' | 'low';
|
|
58
|
+
description: string;
|
|
59
|
+
framework: string;
|
|
60
|
+
remediationUrl?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface BillingInfo {
|
|
63
|
+
tier: string;
|
|
64
|
+
billingEmail: string;
|
|
65
|
+
stripeCustomerId?: string;
|
|
66
|
+
currentMrr?: number;
|
|
67
|
+
}
|
|
68
|
+
export interface CreateCustomerRequest {
|
|
69
|
+
externalId: string;
|
|
70
|
+
name: string;
|
|
71
|
+
email: string;
|
|
72
|
+
governance?: Partial<Governance>;
|
|
73
|
+
limits?: Partial<ResourceLimits>;
|
|
74
|
+
}
|
|
75
|
+
export interface UpdateCustomerRequest {
|
|
76
|
+
name?: string;
|
|
77
|
+
email?: string;
|
|
78
|
+
governance?: Partial<Governance>;
|
|
79
|
+
limits?: Partial<ResourceLimits>;
|
|
80
|
+
}
|
|
81
|
+
export interface ListCustomersParams {
|
|
82
|
+
status?: CustomerStatus;
|
|
83
|
+
limit?: number;
|
|
84
|
+
cursor?: string;
|
|
85
|
+
[key: string]: string | number | boolean | undefined;
|
|
86
|
+
}
|
|
87
|
+
export interface ListCustomersResponse {
|
|
88
|
+
data: Customer[];
|
|
89
|
+
pagination: {
|
|
90
|
+
hasMore: boolean;
|
|
91
|
+
nextCursor?: string;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export interface PromoteCustomerRequest {
|
|
95
|
+
attestation: {
|
|
96
|
+
kycCompleted: boolean;
|
|
97
|
+
termsAccepted: boolean;
|
|
98
|
+
complianceReviewed: boolean;
|
|
99
|
+
attestedBy: string;
|
|
100
|
+
};
|
|
101
|
+
billing: {
|
|
102
|
+
tier: string;
|
|
103
|
+
billingEmail: string;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
export interface SuspendCustomerRequest {
|
|
107
|
+
reason: string;
|
|
108
|
+
gracePeriodHours?: number;
|
|
109
|
+
}
|
|
110
|
+
export interface ReactivateCustomerRequest {
|
|
111
|
+
resolution: {
|
|
112
|
+
issueResolved: boolean;
|
|
113
|
+
resolutionType: string;
|
|
114
|
+
notes?: string;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
export interface Webhook {
|
|
118
|
+
id: string;
|
|
119
|
+
url: string;
|
|
120
|
+
events: string[];
|
|
121
|
+
secret: string;
|
|
122
|
+
enabled: boolean;
|
|
123
|
+
createdAt: string;
|
|
124
|
+
updatedAt: string;
|
|
125
|
+
}
|
|
126
|
+
export interface CreateWebhookRequest {
|
|
127
|
+
url: string;
|
|
128
|
+
events: string[];
|
|
129
|
+
secret?: string;
|
|
130
|
+
}
|
|
131
|
+
export interface WebhookEvent<T = any> {
|
|
132
|
+
id: string;
|
|
133
|
+
type: string;
|
|
134
|
+
customerId: string;
|
|
135
|
+
data: T;
|
|
136
|
+
timestamp: string;
|
|
137
|
+
}
|
|
138
|
+
export interface AnalyticsResponse {
|
|
139
|
+
period: string;
|
|
140
|
+
customers: {
|
|
141
|
+
total: number;
|
|
142
|
+
active: number;
|
|
143
|
+
sandboxOnly: number;
|
|
144
|
+
production: number;
|
|
145
|
+
churnedThisPeriod: number;
|
|
146
|
+
};
|
|
147
|
+
compliance: {
|
|
148
|
+
averageScore: number;
|
|
149
|
+
atRiskCount: number;
|
|
150
|
+
nonCompliantCount: number;
|
|
151
|
+
};
|
|
152
|
+
usage: {
|
|
153
|
+
totalEnvelopes: number;
|
|
154
|
+
totalPolicyEvaluations: number;
|
|
155
|
+
totalBlocked: number;
|
|
156
|
+
totalEscalations: number;
|
|
157
|
+
};
|
|
158
|
+
billing: {
|
|
159
|
+
currentMrr: number;
|
|
160
|
+
newMrr: number;
|
|
161
|
+
churnedMrr: number;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
export interface AnalyticsStreamEvent {
|
|
165
|
+
type: 'signature' | 'violation' | 'escalation' | 'anomaly';
|
|
166
|
+
customerId: string;
|
|
167
|
+
agentId?: string;
|
|
168
|
+
data: any;
|
|
169
|
+
timestamp: string;
|
|
170
|
+
}
|
|
171
|
+
export interface CreateSessionRequest {
|
|
172
|
+
customerId: string;
|
|
173
|
+
purpose: string;
|
|
174
|
+
ttlSeconds?: number;
|
|
175
|
+
}
|
|
176
|
+
export interface SessionResponse {
|
|
177
|
+
sessionToken: string;
|
|
178
|
+
expiresAt: string;
|
|
179
|
+
metadata: {
|
|
180
|
+
customerId: string;
|
|
181
|
+
purpose: string;
|
|
182
|
+
issuedAt: string;
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
export interface TokenIntrospectionRequest {
|
|
186
|
+
token: string;
|
|
187
|
+
}
|
|
188
|
+
export interface TokenIntrospectionResponse {
|
|
189
|
+
active: boolean;
|
|
190
|
+
tokenType?: string;
|
|
191
|
+
scope?: string;
|
|
192
|
+
exp?: number;
|
|
193
|
+
iat?: number;
|
|
194
|
+
sub?: string;
|
|
195
|
+
}
|
|
196
|
+
export interface ComplianceReportRequest {
|
|
197
|
+
customerId: string;
|
|
198
|
+
format?: 'pdf' | 'json';
|
|
199
|
+
frameworks?: string[];
|
|
200
|
+
}
|
|
201
|
+
export interface ComplianceReportResponse {
|
|
202
|
+
reportId: string;
|
|
203
|
+
downloadUrl?: string;
|
|
204
|
+
data?: any;
|
|
205
|
+
signature: string;
|
|
206
|
+
keyId: string;
|
|
207
|
+
generatedAt: string;
|
|
208
|
+
}
|
|
209
|
+
export declare class MossError extends Error {
|
|
210
|
+
statusCode?: number | undefined;
|
|
211
|
+
code?: string | undefined;
|
|
212
|
+
details?: any | undefined;
|
|
213
|
+
constructor(message: string, statusCode?: number | undefined, code?: string | undefined, details?: any | undefined);
|
|
214
|
+
}
|
|
215
|
+
export declare class MossAPIError extends MossError {
|
|
216
|
+
constructor(message: string, statusCode: number, code: string, details?: any);
|
|
217
|
+
}
|
|
218
|
+
export declare class MossNetworkError extends MossError {
|
|
219
|
+
originalError: Error;
|
|
220
|
+
constructor(message: string, originalError: Error);
|
|
221
|
+
}
|
|
222
|
+
export declare class MossValidationError extends MossError {
|
|
223
|
+
constructor(message: string, details?: any);
|
|
224
|
+
}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ED,MAAM,WAAW,wBAAwB;IAEvC,QAAQ,EAAE,MAAM,CAAC;IAGjB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,IAAI,CAAC,EAAE,GAAG,CAAC;IAGX,SAAS,EAAE,MAAM,CAAC;IAGlB,KAAK,EAAE,MAAM,CAAC;IAGd,WAAW,EAAE,MAAM,CAAC;CACrB;AAMD,qBAAa,SAAU,SAAQ,KAAK;IAGzB,UAAU,CAAC,EAAE,MAAM;IACnB,IAAI,CAAC,EAAE,MAAM;IACb,OAAO,CAAC,EAAE,GAAG;gBAHpB,OAAO,EAAE,MAAM,EACR,UAAU,CAAC,EAAE,MAAM,YAAA,EACnB,IAAI,CAAC,EAAE,MAAM,YAAA,EACb,OAAO,CAAC,EAAE,GAAG,YAAA;CAKvB;AAED,qBAAa,YAAa,SAAQ,SAAS;gBAEvC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,GAAG;CAKhB;AAED,qBAAa,gBAAiB,SAAQ,SAAS;IACT,aAAa,EAAE,KAAK;gBAA5C,OAAO,EAAE,MAAM,EAAS,aAAa,EAAE,KAAK;CAIzD;AAED,qBAAa,mBAAoB,SAAQ,SAAS;gBACpC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;CAI3C"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MossValidationError = exports.MossNetworkError = exports.MossAPIError = exports.MossError = void 0;
|
|
4
|
+
class MossError extends Error {
|
|
5
|
+
constructor(message, statusCode, code, details) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.statusCode = statusCode;
|
|
8
|
+
this.code = code;
|
|
9
|
+
this.details = details;
|
|
10
|
+
this.name = 'MossError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.MossError = MossError;
|
|
14
|
+
class MossAPIError extends MossError {
|
|
15
|
+
constructor(message, statusCode, code, details) {
|
|
16
|
+
super(message, statusCode, code, details);
|
|
17
|
+
this.name = 'MossAPIError';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.MossAPIError = MossAPIError;
|
|
21
|
+
class MossNetworkError extends MossError {
|
|
22
|
+
constructor(message, originalError) {
|
|
23
|
+
super(message);
|
|
24
|
+
this.originalError = originalError;
|
|
25
|
+
this.name = 'MossNetworkError';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.MossNetworkError = MossNetworkError;
|
|
29
|
+
class MossValidationError extends MossError {
|
|
30
|
+
constructor(message, details) {
|
|
31
|
+
super(message, 400, 'validation_error', details);
|
|
32
|
+
this.name = 'MossValidationError';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.MossValidationError = MossValidationError;
|
|
36
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAycA,MAAa,SAAU,SAAQ,KAAK;IAClC,YACE,OAAe,EACR,UAAmB,EACnB,IAAa,EACb,OAAa;QAEpB,KAAK,CAAC,OAAO,CAAC,CAAC;QAJR,eAAU,GAAV,UAAU,CAAS;QACnB,SAAI,GAAJ,IAAI,CAAS;QACb,YAAO,GAAP,OAAO,CAAM;QAGpB,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;IAC1B,CAAC;CACF;AAVD,8BAUC;AAED,MAAa,YAAa,SAAQ,SAAS;IACzC,YACE,OAAe,EACf,UAAkB,EAClB,IAAY,EACZ,OAAa;QAEb,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AAVD,oCAUC;AAED,MAAa,gBAAiB,SAAQ,SAAS;IAC7C,YAAY,OAAe,EAAS,aAAoB;QACtD,KAAK,CAAC,OAAO,CAAC,CAAC;QADmB,kBAAa,GAAb,aAAa,CAAO;QAEtD,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AALD,4CAKC;AAED,MAAa,mBAAoB,SAAQ,SAAS;IAChD,YAAY,OAAe,EAAE,OAAa;QACxC,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AALD,kDAKC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function toSnakeCase(str: string): string;
|
|
2
|
+
export declare function toCamelCase(str: string): string;
|
|
3
|
+
export declare function keysToSnakeCase<T = any>(obj: any): T;
|
|
4
|
+
export declare function keysToCamelCase<T = any>(obj: any): T;
|
|
5
|
+
//# sourceMappingURL=case.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"case.d.ts","sourceRoot":"","sources":["../../src/utils/case.ts"],"names":[],"mappings":"AAQA,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C;AAKD,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C;AAKD,wBAAgB,eAAe,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAmBpD;AAKD,wBAAgB,eAAe,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAmBpD"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toSnakeCase = toSnakeCase;
|
|
4
|
+
exports.toCamelCase = toCamelCase;
|
|
5
|
+
exports.keysToSnakeCase = keysToSnakeCase;
|
|
6
|
+
exports.keysToCamelCase = keysToCamelCase;
|
|
7
|
+
function toSnakeCase(str) {
|
|
8
|
+
return str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
|
|
9
|
+
}
|
|
10
|
+
function toCamelCase(str) {
|
|
11
|
+
return str.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
12
|
+
}
|
|
13
|
+
function keysToSnakeCase(obj) {
|
|
14
|
+
if (obj === null || obj === undefined) {
|
|
15
|
+
return obj;
|
|
16
|
+
}
|
|
17
|
+
if (Array.isArray(obj)) {
|
|
18
|
+
return obj.map((item) => keysToSnakeCase(item));
|
|
19
|
+
}
|
|
20
|
+
if (typeof obj === 'object' && obj.constructor === Object) {
|
|
21
|
+
const result = {};
|
|
22
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
23
|
+
const newKey = toSnakeCase(key);
|
|
24
|
+
result[newKey] = keysToSnakeCase(value);
|
|
25
|
+
}
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
return obj;
|
|
29
|
+
}
|
|
30
|
+
function keysToCamelCase(obj) {
|
|
31
|
+
if (obj === null || obj === undefined) {
|
|
32
|
+
return obj;
|
|
33
|
+
}
|
|
34
|
+
if (Array.isArray(obj)) {
|
|
35
|
+
return obj.map((item) => keysToCamelCase(item));
|
|
36
|
+
}
|
|
37
|
+
if (typeof obj === 'object' && obj.constructor === Object) {
|
|
38
|
+
const result = {};
|
|
39
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
40
|
+
const newKey = toCamelCase(key);
|
|
41
|
+
result[newKey] = keysToCamelCase(value);
|
|
42
|
+
}
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
return obj;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=case.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"case.js","sourceRoot":"","sources":["../../src/utils/case.ts"],"names":[],"mappings":";;AAQA,kCAEC;AAKD,kCAEC;AAKD,0CAmBC;AAKD,0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AAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAM,CAAC;IACvD,CAAC;IAED,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,WAAW,KAAK,MAAM,EAAE,CAAC;QAC1D,MAAM,MAAM,GAAQ,EAAE,CAAC;QACvB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YAC/C,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;YAChC,MAAM,CAAC,MAAM,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,MAAW,CAAC;IACrB,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HTTPClient } from './http';
|
|
2
|
+
import { Webhook, CreateWebhookRequest, WebhookEvent } from './types';
|
|
3
|
+
export declare class WebhooksResource {
|
|
4
|
+
private http;
|
|
5
|
+
constructor(http: HTTPClient);
|
|
6
|
+
create(request: CreateWebhookRequest): Promise<Webhook>;
|
|
7
|
+
list(): Promise<Webhook[]>;
|
|
8
|
+
get(webhookId: string): Promise<Webhook>;
|
|
9
|
+
update(webhookId: string, request: Partial<CreateWebhookRequest>): Promise<Webhook>;
|
|
10
|
+
delete(webhookId: string): Promise<void>;
|
|
11
|
+
verify(payload: string | Buffer, signature: string, timestamp: string, secret: string, toleranceSeconds?: number): boolean;
|
|
12
|
+
private computeSignature;
|
|
13
|
+
private secureCompare;
|
|
14
|
+
on<T = any>(_eventType: string, _handler: (event: WebhookEvent<T>) => void | Promise<void>): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../src/webhooks.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EACL,OAAO,EACP,oBAAoB,EACpB,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB,qBAAa,gBAAgB;IACf,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAiB9B,MAAM,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;IAuBvD,IAAI,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAe1B,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAwBxC,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAenF,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAsC9C,MAAM,CACJ,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,gBAAgB,GAAE,MAAY,GAC7B,OAAO;IAiCV,OAAO,CAAC,gBAAgB;IAaxB,OAAO,CAAC,aAAa;IA4BrB,EAAE,CAAC,CAAC,GAAG,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;CASlG"}
|
package/dist/webhooks.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebhooksResource = void 0;
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
5
|
+
class WebhooksResource {
|
|
6
|
+
constructor(http) {
|
|
7
|
+
this.http = http;
|
|
8
|
+
}
|
|
9
|
+
async create(request) {
|
|
10
|
+
const response = await this.http.request({
|
|
11
|
+
method: 'POST',
|
|
12
|
+
path: '/v1/partner/webhooks',
|
|
13
|
+
body: request,
|
|
14
|
+
});
|
|
15
|
+
return response.data;
|
|
16
|
+
}
|
|
17
|
+
async list() {
|
|
18
|
+
const response = await this.http.request({
|
|
19
|
+
method: 'GET',
|
|
20
|
+
path: '/v1/partner/webhooks',
|
|
21
|
+
});
|
|
22
|
+
return response.data.data;
|
|
23
|
+
}
|
|
24
|
+
async get(webhookId) {
|
|
25
|
+
const response = await this.http.request({
|
|
26
|
+
method: 'GET',
|
|
27
|
+
path: `/v1/partner/webhooks/${webhookId}`,
|
|
28
|
+
});
|
|
29
|
+
return response.data;
|
|
30
|
+
}
|
|
31
|
+
async update(webhookId, request) {
|
|
32
|
+
const response = await this.http.request({
|
|
33
|
+
method: 'PATCH',
|
|
34
|
+
path: `/v1/partner/webhooks/${webhookId}`,
|
|
35
|
+
body: request,
|
|
36
|
+
});
|
|
37
|
+
return response.data;
|
|
38
|
+
}
|
|
39
|
+
async delete(webhookId) {
|
|
40
|
+
await this.http.request({
|
|
41
|
+
method: 'DELETE',
|
|
42
|
+
path: `/v1/partner/webhooks/${webhookId}`,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
verify(payload, signature, timestamp, secret, toleranceSeconds = 300) {
|
|
46
|
+
try {
|
|
47
|
+
const now = Math.floor(Date.now() / 1000);
|
|
48
|
+
const webhookTime = parseInt(timestamp, 10);
|
|
49
|
+
if (isNaN(webhookTime)) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
const age = now - webhookTime;
|
|
53
|
+
if (age > toleranceSeconds) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
const signedPayload = `${timestamp}.${payload}`;
|
|
57
|
+
const expectedSignature = this.computeSignature(signedPayload, secret);
|
|
58
|
+
return this.secureCompare(signature, expectedSignature);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
computeSignature(payload, secret) {
|
|
65
|
+
const hmac = (0, crypto_1.createHmac)('sha256', secret);
|
|
66
|
+
hmac.update(payload);
|
|
67
|
+
return hmac.digest('hex');
|
|
68
|
+
}
|
|
69
|
+
secureCompare(a, b) {
|
|
70
|
+
if (a.length !== b.length) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
const bufferA = Buffer.from(a);
|
|
74
|
+
const bufferB = Buffer.from(b);
|
|
75
|
+
return (0, crypto_1.timingSafeEqual)(bufferA, bufferB);
|
|
76
|
+
}
|
|
77
|
+
on(_eventType, _handler) {
|
|
78
|
+
throw new Error('Event handler registration is not yet implemented. ' +
|
|
79
|
+
'Use the verify() method to validate webhooks in your HTTP handler.');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.WebhooksResource = WebhooksResource;
|
|
83
|
+
//# sourceMappingURL=webhooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../src/webhooks.ts"],"names":[],"mappings":";;;AAMA,mCAAqD;AAQrD,MAAa,gBAAgB;IAC3B,YAAoB,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAiBxC,KAAK,CAAC,MAAM,CAAC,OAA6B;QACxC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAU;YAChD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,sBAAsB;YAC5B,IAAI,EAAE,OAAO;SACd,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAeD,KAAK,CAAC,IAAI;QACR,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAsB;YAC5D,MAAM,EAAE,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,EAAE,CAAC;gBAC3B,OAAO,KAAK,CAAC;YACf,CAAC;YAGD,MAAM,aAAa,GAAG,GAAG,SAAS,IAAI,OAAO,EAAE,CAAC;YAChD,MAAM,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;YAGvE,OAAO,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;QAC1D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IASO,gBAAgB,CAAC,OAAe,EAAE,MAAc;QACtD,MAAM,IAAI,GAAG,IAAA,mBAAU,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IASO,aAAa,CAAC,CAAS,EAAE,CAAS;QACxC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;YAC1B,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAE/B,OAAO,IAAA,wBAAe,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;IAmBD,EAAE,CAAU,UAAkB,EAAE,QAA0D;QAIxF,MAAM,IAAI,KAAK,CACb,qDAAqD;YACrD,oEAAoE,CACrE,CAAC;IACJ,CAAC;CACF;AA9ND,4CA8NC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "moss-partner-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "TypeScript SDK for MOSS Partner API - Manage customers, configure governance, and monitor compliance",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md",
|
|
10
|
+
"LICENSE"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"test": "vitest",
|
|
15
|
+
"test:coverage": "vitest --coverage",
|
|
16
|
+
"lint": "eslint src --ext .ts",
|
|
17
|
+
"typecheck": "tsc --noEmit",
|
|
18
|
+
"prepublishOnly": "npm run build"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"moss",
|
|
22
|
+
"ai-governance",
|
|
23
|
+
"partner-api",
|
|
24
|
+
"typescript",
|
|
25
|
+
"sdk"
|
|
26
|
+
],
|
|
27
|
+
"author": "MOSS Computing <hello@mosscomputing.com>",
|
|
28
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/mosscomputing/moss-partner-sdk-ts.git",
|
|
32
|
+
"private": true
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/mosscomputing/moss-partner-sdk-ts/issues"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/mosscomputing/moss-partner-sdk-ts#readme",
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/node": "^20.0.0",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^8.65.0",
|
|
44
|
+
"@typescript-eslint/parser": "^8.65.0",
|
|
45
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
46
|
+
"eslint": "^10.8.0",
|
|
47
|
+
"typescript": "^5.0.0",
|
|
48
|
+
"vitest": "^4.1.10"
|
|
49
|
+
},
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": ">=20.0.0"
|
|
52
|
+
}
|
|
53
|
+
}
|