@deployed.md/dpd-implementation-partner-sdk 0.0.0-stage → 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 +21 -0
- package/README.md +120 -2
- package/dist/client.d.ts +40 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +114 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +31 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +30 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +60 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +51 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Deployed Core
|
|
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/README.md
CHANGED
|
@@ -1,3 +1,121 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @deployed.md/dpd-implementation-partner-sdk
|
|
2
|
+
|
|
3
|
+
Report user sign-ups from your app to **Deployed**. Every email is captured; enterprise emails (not Gmail, Outlook, …) receive a one-time introduction from Deployed, as an official implementation partner of your company.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
Your user signs up ──► your server ──(DeployedImplementationSDK + API key/secret)──► Deployed
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
> **Never ship your API secret to a browser.** The SDK refuses to run in one. Call it from your backend after your own sign-up succeeds.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @deployed.md/dpd-implementation-partner-sdk
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Requires Node.js 18+.
|
|
18
|
+
|
|
19
|
+
## Configure
|
|
20
|
+
|
|
21
|
+
Get an API key and secret from the Deployed Implementation SDK admin dashboard (**API Keys → Generate key**).
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# .env (server)
|
|
25
|
+
DEPLOYED_API_URL=https://api.deployed.md
|
|
26
|
+
DEPLOYED_API_KEY=ak_live_...
|
|
27
|
+
DEPLOYED_API_SECRET=sk_live_...
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { DeployedImplementationSDK } from "@deployed.md/dpd-implementation-partner-sdk";
|
|
32
|
+
|
|
33
|
+
export const deployed = new DeployedImplementationSDK({
|
|
34
|
+
apiKey: process.env.DEPLOYED_API_KEY!,
|
|
35
|
+
apiSecret: process.env.DEPLOYED_API_SECRET!,
|
|
36
|
+
baseUrl: process.env.DEPLOYED_API_URL, // default http://localhost:4000
|
|
37
|
+
timeoutMs: 10_000, // optional
|
|
38
|
+
});
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Report a sign-up
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import { getRequestContext } from "@deployed.md/dpd-implementation-partner-sdk";
|
|
45
|
+
|
|
46
|
+
const result = await deployed.signUp(
|
|
47
|
+
{
|
|
48
|
+
email: "nirav@deployed.md", // required
|
|
49
|
+
name: "Nirav Boghra", // optional
|
|
50
|
+
metadata: { company: "Deployed", role: "Developer", plan: "pro" }, // optional, any JSON (max 16 KB)
|
|
51
|
+
},
|
|
52
|
+
getRequestContext(req), // optional: the user's IP and user agent
|
|
53
|
+
);
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`signUp` resolves to:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
{
|
|
60
|
+
signup: {
|
|
61
|
+
id: string;
|
|
62
|
+
email: string;
|
|
63
|
+
name: string | null;
|
|
64
|
+
emailType: "ENTERPRISE" | "PERSONAL";
|
|
65
|
+
submissions: number; // how many times this email signed up through your key
|
|
66
|
+
firstSeenAt: string;
|
|
67
|
+
lastSeenAt: string;
|
|
68
|
+
}
|
|
69
|
+
isNew: boolean; // first time this email signed up through your key
|
|
70
|
+
outreach: "queued" | "already_sent" | "not_applicable" | "disabled";
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
| `outreach` | Meaning |
|
|
75
|
+
| ---------------- | ------------------------------------------------------------------------------------ |
|
|
76
|
+
| `queued` | Enterprise email seen for the first time; Deployed is sending its introduction email |
|
|
77
|
+
| `already_sent` | Enterprise email that Deployed already contacted (once per address) |
|
|
78
|
+
| `not_applicable` | Personal email; stored, no outreach |
|
|
79
|
+
| `disabled` | Enterprise email, but outreach is turned off on the Deployed server |
|
|
80
|
+
|
|
81
|
+
Calling `signUp` again for the same email updates the stored record (latest name and metadata, repeat count) and never sends a second email.
|
|
82
|
+
|
|
83
|
+
`getRequestContext(req)` works with Node/Express requests and Fetch API `Request` objects (Next.js route handlers, etc.).
|
|
84
|
+
|
|
85
|
+
### Example: Express
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
app.post("/signup", async (req, res, next) => {
|
|
89
|
+
try {
|
|
90
|
+
const user = await createUserInYourDatabase(req.body); // your own sign-up
|
|
91
|
+
await deployed.signUp(
|
|
92
|
+
{ email: user.email, name: user.name, metadata: { plan: user.plan } },
|
|
93
|
+
getRequestContext(req),
|
|
94
|
+
);
|
|
95
|
+
res.status(201).json(user);
|
|
96
|
+
} catch (err) {
|
|
97
|
+
next(err);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Reporting to Deployed shouldn't block your sign-up: if you prefer, call `signUp` without `await` and log failures with `.catch(...)`.
|
|
103
|
+
|
|
104
|
+
## Errors
|
|
105
|
+
|
|
106
|
+
Every failed call rejects with a `DeployedImplementationSDKError`:
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
import { isDeployedImplementationSDKError } from "@deployed.md/dpd-implementation-partner-sdk";
|
|
110
|
+
|
|
111
|
+
try {
|
|
112
|
+
await deployed.signUp({ email });
|
|
113
|
+
} catch (err) {
|
|
114
|
+
if (isDeployedImplementationSDKError(err)) {
|
|
115
|
+
err.code; // 'VALIDATION_ERROR' | 'INVALID_API_CREDENTIALS' | 'API_KEY_REVOKED' | 'RATE_LIMITED' | 'NETWORK_ERROR' | 'TIMEOUT' | ...
|
|
116
|
+
err.status; // HTTP status (0 for NETWORK_ERROR / TIMEOUT)
|
|
117
|
+
err.details; // field errors for VALIDATION_ERROR
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
2
121
|
|
|
3
|
-
This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { DeployedImplementationSDKOptions, RequestContext, SignUpInput, SignUpResult } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Server-side client for the Deployed Implementation SDK.
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* const deployed = new DeployedImplementationSDK({ apiKey: process.env.DEPLOYED_API_KEY!, apiSecret: process.env.DEPLOYED_API_SECRET! });
|
|
7
|
+
* await deployed.signUp({ email, name, metadata: { company, role } });
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
export declare class DeployedImplementationSDK {
|
|
11
|
+
private readonly apiKey;
|
|
12
|
+
private readonly apiSecret;
|
|
13
|
+
private readonly baseUrl;
|
|
14
|
+
private readonly timeoutMs;
|
|
15
|
+
private readonly fetchImpl;
|
|
16
|
+
constructor(options: DeployedImplementationSDKOptions);
|
|
17
|
+
/**
|
|
18
|
+
* Records a user sign-up from your app. Call it after your own sign-up succeeds.
|
|
19
|
+
* Every email is stored; enterprise emails (not Gmail, Outlook, ...) receive the Deployed
|
|
20
|
+
* outreach email once. Calling it again for the same email updates the record.
|
|
21
|
+
*/
|
|
22
|
+
signUp(input: SignUpInput, context?: RequestContext): Promise<SignUpResult>;
|
|
23
|
+
private request;
|
|
24
|
+
}
|
|
25
|
+
type HeaderBag = Record<string, string | string[] | undefined> | {
|
|
26
|
+
get(name: string): string | null;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Builds a RequestContext from an incoming request (Node/Express `req` or a Fetch API `Request`),
|
|
30
|
+
* so the sign-up records the end user's IP and user agent.
|
|
31
|
+
*/
|
|
32
|
+
export declare const getRequestContext: (req: {
|
|
33
|
+
headers: HeaderBag;
|
|
34
|
+
ip?: string;
|
|
35
|
+
socket?: {
|
|
36
|
+
remoteAddress?: string;
|
|
37
|
+
};
|
|
38
|
+
}) => RequestContext;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gCAAgC,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAK3G;;;;;;;GAOG;AACH,qBAAa,yBAAyB;IACpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;gBAE7B,OAAO,EAAE,gCAAgC;IAoBrD;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;YAI7D,OAAO;CAkDtB;AAED,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GAAG;IAAE,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAEtG;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK;IAAE,OAAO,EAAE,SAAS,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,KAAG,cAcjH,CAAC"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRequestContext = exports.DeployedImplementationSDK = void 0;
|
|
4
|
+
const errors_1 = require("./errors");
|
|
5
|
+
const DEFAULT_BASE_URL = 'http://localhost:4000';
|
|
6
|
+
const VERSION = '0.3.0';
|
|
7
|
+
/**
|
|
8
|
+
* Server-side client for the Deployed Implementation SDK.
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* const deployed = new DeployedImplementationSDK({ apiKey: process.env.DEPLOYED_API_KEY!, apiSecret: process.env.DEPLOYED_API_SECRET! });
|
|
12
|
+
* await deployed.signUp({ email, name, metadata: { company, role } });
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
class DeployedImplementationSDK {
|
|
16
|
+
apiKey;
|
|
17
|
+
apiSecret;
|
|
18
|
+
baseUrl;
|
|
19
|
+
timeoutMs;
|
|
20
|
+
fetchImpl;
|
|
21
|
+
constructor(options) {
|
|
22
|
+
if (!options?.apiKey || !options?.apiSecret) {
|
|
23
|
+
throw new Error('DeployedImplementationSDK: `apiKey` and `apiSecret` are required');
|
|
24
|
+
}
|
|
25
|
+
if (typeof window !== 'undefined' && typeof document !== 'undefined' && !options.dangerouslyAllowBrowser) {
|
|
26
|
+
throw new Error('DeployedImplementationSDK must not run in a browser because it would expose your API secret. ' +
|
|
27
|
+
'Call it from your backend when a user signs up.');
|
|
28
|
+
}
|
|
29
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
30
|
+
if (!fetchImpl)
|
|
31
|
+
throw new Error('DeployedImplementationSDK: global fetch is not available. Use Node 18+ or pass `fetch`.');
|
|
32
|
+
this.apiKey = options.apiKey;
|
|
33
|
+
this.apiSecret = options.apiSecret;
|
|
34
|
+
this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, '');
|
|
35
|
+
this.timeoutMs = options.timeoutMs ?? 10_000;
|
|
36
|
+
this.fetchImpl = fetchImpl.bind(globalThis);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Records a user sign-up from your app. Call it after your own sign-up succeeds.
|
|
40
|
+
* Every email is stored; enterprise emails (not Gmail, Outlook, ...) receive the Deployed
|
|
41
|
+
* outreach email once. Calling it again for the same email updates the record.
|
|
42
|
+
*/
|
|
43
|
+
signUp(input, context) {
|
|
44
|
+
return this.request('POST', '/v1/signups', { body: input, context });
|
|
45
|
+
}
|
|
46
|
+
async request(method, path, opts = {}) {
|
|
47
|
+
const headers = {
|
|
48
|
+
accept: 'application/json',
|
|
49
|
+
'x-api-key': this.apiKey,
|
|
50
|
+
'x-api-secret': this.apiSecret,
|
|
51
|
+
'x-dpd-sdk': `node/${VERSION}`,
|
|
52
|
+
};
|
|
53
|
+
if (opts.body !== undefined)
|
|
54
|
+
headers['content-type'] = 'application/json';
|
|
55
|
+
if (opts.context?.ip)
|
|
56
|
+
headers['x-dpd-client-ip'] = opts.context.ip;
|
|
57
|
+
if (opts.context?.userAgent)
|
|
58
|
+
headers['x-dpd-client-ua'] = opts.context.userAgent;
|
|
59
|
+
const controller = new AbortController();
|
|
60
|
+
const timer = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
61
|
+
let res;
|
|
62
|
+
try {
|
|
63
|
+
res = await this.fetchImpl(this.baseUrl + path, {
|
|
64
|
+
method,
|
|
65
|
+
headers,
|
|
66
|
+
body: opts.body === undefined ? undefined : JSON.stringify(opts.body),
|
|
67
|
+
signal: controller.signal,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
if (controller.signal.aborted) {
|
|
72
|
+
throw new errors_1.DeployedImplementationSDKError('TIMEOUT', `Request timed out after ${this.timeoutMs}ms`, 0);
|
|
73
|
+
}
|
|
74
|
+
throw new errors_1.DeployedImplementationSDKError('NETWORK_ERROR', `Could not reach ${this.baseUrl}: ${err.message}`, 0);
|
|
75
|
+
}
|
|
76
|
+
finally {
|
|
77
|
+
clearTimeout(timer);
|
|
78
|
+
}
|
|
79
|
+
const text = await res.text();
|
|
80
|
+
let data;
|
|
81
|
+
try {
|
|
82
|
+
data = text ? JSON.parse(text) : undefined;
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
data = undefined;
|
|
86
|
+
}
|
|
87
|
+
if (!res.ok) {
|
|
88
|
+
const error = data?.error;
|
|
89
|
+
throw new errors_1.DeployedImplementationSDKError(error?.code ?? 'INTERNAL_ERROR', error?.message ?? `Request failed (${res.status})`, res.status, error?.details);
|
|
90
|
+
}
|
|
91
|
+
return data;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.DeployedImplementationSDK = DeployedImplementationSDK;
|
|
95
|
+
/**
|
|
96
|
+
* Builds a RequestContext from an incoming request (Node/Express `req` or a Fetch API `Request`),
|
|
97
|
+
* so the sign-up records the end user's IP and user agent.
|
|
98
|
+
*/
|
|
99
|
+
const getRequestContext = (req) => {
|
|
100
|
+
const header = (name) => {
|
|
101
|
+
const h = req.headers;
|
|
102
|
+
const value = typeof h.get === 'function'
|
|
103
|
+
? h.get(name)
|
|
104
|
+
: h[name];
|
|
105
|
+
return (Array.isArray(value) ? value[0] : value) ?? undefined;
|
|
106
|
+
};
|
|
107
|
+
const forwarded = header('x-forwarded-for')?.split(',')[0]?.trim();
|
|
108
|
+
return {
|
|
109
|
+
ip: forwarded || header('x-real-ip') || req.ip || req.socket?.remoteAddress,
|
|
110
|
+
userAgent: header('user-agent'),
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
exports.getRequestContext = getRequestContext;
|
|
114
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,qCAA0D;AAG1D,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AACjD,MAAM,OAAO,GAAG,OAAO,CAAC;AAExB;;;;;;;GAOG;AACH,MAAa,yBAAyB;IACnB,MAAM,CAAS;IACf,SAAS,CAAS;IAClB,OAAO,CAAS;IAChB,SAAS,CAAS;IAClB,SAAS,CAAe;IAEzC,YAAY,OAAyC;QACnD,IAAI,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC;YAC5C,MAAM,IAAI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AAE,EAAE,SAAS,IAAI,MAAM,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,MAAM,EAAE,aAAa;QAC3E,SAAS,EAAE,MAAM,CAAC,YAAY,CAAC;KAChC,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,iBAAiB,qBAc5B"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type DeployedImplementationSDKErrorCode = 'VALIDATION_ERROR' | 'INVALID_API_CREDENTIALS' | 'API_KEY_REVOKED' | 'NOT_FOUND' | 'RATE_LIMITED' | 'INTERNAL_ERROR' | 'NETWORK_ERROR' | 'TIMEOUT';
|
|
2
|
+
export interface DeployedImplementationSDKErrorDetail {
|
|
3
|
+
path: string;
|
|
4
|
+
message: string;
|
|
5
|
+
}
|
|
6
|
+
/** Every failed SDK call rejects with a DeployedImplementationSDKError. */
|
|
7
|
+
export declare class DeployedImplementationSDKError extends Error {
|
|
8
|
+
/** Machine-readable code, stable across versions. */
|
|
9
|
+
readonly code: DeployedImplementationSDKErrorCode | (string & {});
|
|
10
|
+
/** HTTP status from the API (0 for network errors and timeouts). */
|
|
11
|
+
readonly status: number;
|
|
12
|
+
/** Field-level validation errors, when `code` is VALIDATION_ERROR. */
|
|
13
|
+
readonly details?: DeployedImplementationSDKErrorDetail[] | undefined;
|
|
14
|
+
readonly name = "DeployedImplementationSDKError";
|
|
15
|
+
constructor(
|
|
16
|
+
/** Machine-readable code, stable across versions. */
|
|
17
|
+
code: DeployedImplementationSDKErrorCode | (string & {}), message: string,
|
|
18
|
+
/** HTTP status from the API (0 for network errors and timeouts). */
|
|
19
|
+
status: number,
|
|
20
|
+
/** Field-level validation errors, when `code` is VALIDATION_ERROR. */
|
|
21
|
+
details?: DeployedImplementationSDKErrorDetail[] | undefined);
|
|
22
|
+
toJSON(): {
|
|
23
|
+
name: string;
|
|
24
|
+
code: DeployedImplementationSDKErrorCode | (string & {});
|
|
25
|
+
message: string;
|
|
26
|
+
status: number;
|
|
27
|
+
details: DeployedImplementationSDKErrorDetail[] | undefined;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export declare const isDeployedImplementationSDKError: (err: unknown) => err is DeployedImplementationSDKError;
|
|
31
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kCAAkC,GAC1C,kBAAkB,GAClB,yBAAyB,GACzB,iBAAiB,GACjB,WAAW,GACX,cAAc,GACd,gBAAgB,GAChB,eAAe,GACf,SAAS,CAAC;AAEd,MAAM,WAAW,oCAAoC;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,2EAA2E;AAC3E,qBAAa,8BAA+B,SAAQ,KAAK;IAIrD,qDAAqD;IACrD,QAAQ,CAAC,IAAI,EAAE,kCAAkC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;IAEjE,oEAAoE;IACpE,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,sEAAsE;IACtE,QAAQ,CAAC,OAAO,CAAC,EAAE,oCAAoC,EAAE;IAT3D,QAAQ,CAAC,IAAI,oCAAoC;;IAG/C,qDAAqD;IAC5C,IAAI,EAAE,kCAAkC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,EACjE,OAAO,EAAE,MAAM;IACf,oEAAoE;IAC3D,MAAM,EAAE,MAAM;IACvB,sEAAsE;IAC7D,OAAO,CAAC,EAAE,oCAAoC,EAAE,YAAA;IAK3D,MAAM;;;;;;;CAGP;AAED,eAAO,MAAM,gCAAgC,GAAI,KAAK,OAAO,KAAG,GAAG,IAAI,8BAE4C,CAAC"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isDeployedImplementationSDKError = exports.DeployedImplementationSDKError = void 0;
|
|
4
|
+
/** Every failed SDK call rejects with a DeployedImplementationSDKError. */
|
|
5
|
+
class DeployedImplementationSDKError extends Error {
|
|
6
|
+
code;
|
|
7
|
+
status;
|
|
8
|
+
details;
|
|
9
|
+
name = 'DeployedImplementationSDKError';
|
|
10
|
+
constructor(
|
|
11
|
+
/** Machine-readable code, stable across versions. */
|
|
12
|
+
code, message,
|
|
13
|
+
/** HTTP status from the API (0 for network errors and timeouts). */
|
|
14
|
+
status,
|
|
15
|
+
/** Field-level validation errors, when `code` is VALIDATION_ERROR. */
|
|
16
|
+
details) {
|
|
17
|
+
super(message);
|
|
18
|
+
this.code = code;
|
|
19
|
+
this.status = status;
|
|
20
|
+
this.details = details;
|
|
21
|
+
}
|
|
22
|
+
toJSON() {
|
|
23
|
+
return { name: this.name, code: this.code, message: this.message, status: this.status, details: this.details };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.DeployedImplementationSDKError = DeployedImplementationSDKError;
|
|
27
|
+
const isDeployedImplementationSDKError = (err) => err instanceof DeployedImplementationSDKError ||
|
|
28
|
+
(typeof err === 'object' && err !== null && err.name === 'DeployedImplementationSDKError');
|
|
29
|
+
exports.isDeployedImplementationSDKError = isDeployedImplementationSDKError;
|
|
30
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAeA,2EAA2E;AAC3E,MAAa,8BAA+B,SAAQ,KAAK;IAK5C;IAGA;IAEA;IATF,IAAI,GAAG,gCAAgC,CAAC;IAEjD;IACE,qDAAqD;IAC5C,IAAwD,EACjE,OAAe;IACf,oEAAoE;IAC3D,MAAc;IACvB,sEAAsE;IAC7D,OAAgD;QAEzD,KAAK,CAAC,OAAO,CAAC,CAAC;QAPN,SAAI,GAAJ,IAAI,CAAoD;QAGxD,WAAM,GAAN,MAAM,CAAQ;QAEd,YAAO,GAAP,OAAO,CAAyC;IAG3D,CAAC;IAED,MAAM;QACJ,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;IACjH,CAAC;CACF;AAlBD,wEAkBC;AAEM,MAAM,gCAAgC,GAAG,CAAC,GAAY,EAAyC,EAAE,CACtG,GAAG,YAAY,8BAA8B;IAC7C,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAK,GAAyB,CAAC,IAAI,KAAK,gCAAgC,CAAC,CAAC;AAFvG,QAAA,gCAAgC,oCAEuE"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { DeployedImplementationSDK, getRequestContext } from './client';
|
|
2
|
+
export { DeployedImplementationSDKError, isDeployedImplementationSDKError } from './errors';
|
|
3
|
+
export type { DeployedImplementationSDKErrorCode, DeployedImplementationSDKErrorDetail } from './errors';
|
|
4
|
+
export type * from './types';
|
|
5
|
+
//# 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,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,8BAA8B,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AAC5F,YAAY,EAAE,kCAAkC,EAAE,oCAAoC,EAAE,MAAM,UAAU,CAAC;AACzG,mBAAmB,SAAS,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isDeployedImplementationSDKError = exports.DeployedImplementationSDKError = exports.getRequestContext = exports.DeployedImplementationSDK = void 0;
|
|
4
|
+
var client_1 = require("./client");
|
|
5
|
+
Object.defineProperty(exports, "DeployedImplementationSDK", { enumerable: true, get: function () { return client_1.DeployedImplementationSDK; } });
|
|
6
|
+
Object.defineProperty(exports, "getRequestContext", { enumerable: true, get: function () { return client_1.getRequestContext; } });
|
|
7
|
+
var errors_1 = require("./errors");
|
|
8
|
+
Object.defineProperty(exports, "DeployedImplementationSDKError", { enumerable: true, get: function () { return errors_1.DeployedImplementationSDKError; } });
|
|
9
|
+
Object.defineProperty(exports, "isDeployedImplementationSDKError", { enumerable: true, get: function () { return errors_1.isDeployedImplementationSDKError; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAAwE;AAA/D,mHAAA,yBAAyB,OAAA;AAAE,2GAAA,iBAAiB,OAAA;AACrD,mCAA4F;AAAnF,wHAAA,8BAA8B,OAAA;AAAE,0HAAA,gCAAgC,OAAA"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export interface DeployedImplementationSDKOptions {
|
|
2
|
+
/** Public API key (`ak_live_...`) from the Deployed Implementation SDK admin dashboard. */
|
|
3
|
+
apiKey: string;
|
|
4
|
+
/** API secret (`sk_live_...`). Server-side only - never ship it to a browser. */
|
|
5
|
+
apiSecret: string;
|
|
6
|
+
/** API base URL, e.g. `https://api.deployed.md`. Defaults to `http://localhost:4000`. */
|
|
7
|
+
baseUrl?: string;
|
|
8
|
+
/** Request timeout in milliseconds. Default 10 000. */
|
|
9
|
+
timeoutMs?: number;
|
|
10
|
+
/** Custom fetch implementation (defaults to the global `fetch`, Node 18+). */
|
|
11
|
+
fetch?: typeof fetch;
|
|
12
|
+
/**
|
|
13
|
+
* The SDK refuses to run in a browser because the API secret would be exposed.
|
|
14
|
+
* Only set this for local experiments.
|
|
15
|
+
*/
|
|
16
|
+
dangerouslyAllowBrowser?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** Information about the end user's request, recorded with the sign-up. */
|
|
19
|
+
export interface RequestContext {
|
|
20
|
+
ip?: string;
|
|
21
|
+
userAgent?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Any JSON-serialisable value. */
|
|
24
|
+
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
25
|
+
[key: string]: JsonValue;
|
|
26
|
+
};
|
|
27
|
+
export interface SignUpInput {
|
|
28
|
+
/** The user's email address (required). */
|
|
29
|
+
email: string;
|
|
30
|
+
/** The user's name (optional). The first word is used to greet them in the outreach email. */
|
|
31
|
+
name?: string;
|
|
32
|
+
/** Any extra information about the user, e.g. `{ company, role, plan, signupMethod }`. Max 16 KB. */
|
|
33
|
+
metadata?: {
|
|
34
|
+
[key: string]: JsonValue;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export type EmailType = 'PERSONAL' | 'ENTERPRISE';
|
|
38
|
+
/**
|
|
39
|
+
* - `queued`: enterprise email seen for the first time; the outreach email is being sent.
|
|
40
|
+
* - `already_sent`: enterprise email that already received outreach (sent once per address).
|
|
41
|
+
* - `not_applicable`: personal email (Gmail, Outlook, ...); no outreach.
|
|
42
|
+
* - `disabled`: outreach is turned off on the server.
|
|
43
|
+
*/
|
|
44
|
+
export type OutreachStatus = 'queued' | 'already_sent' | 'not_applicable' | 'disabled';
|
|
45
|
+
export interface SignUpResult {
|
|
46
|
+
signup: {
|
|
47
|
+
id: string;
|
|
48
|
+
email: string;
|
|
49
|
+
name: string | null;
|
|
50
|
+
emailType: EmailType;
|
|
51
|
+
/** How many times this email has signed up through your integration. */
|
|
52
|
+
submissions: number;
|
|
53
|
+
firstSeenAt: string;
|
|
54
|
+
lastSeenAt: string;
|
|
55
|
+
};
|
|
56
|
+
/** True the first time this email signs up through your integration. */
|
|
57
|
+
isNew: boolean;
|
|
58
|
+
outreach: OutreachStatus;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gCAAgC;IAC/C,2FAA2F;IAC3F,MAAM,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,SAAS,EAAE,MAAM,CAAC;IAClB,yFAAyF;IACzF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,2EAA2E;AAC3E,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,mCAAmC;AACnC,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEtG,MAAM,WAAW,WAAW;IAC1B,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,8FAA8F;IAC9F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qGAAqG;IACrG,QAAQ,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;CACzC;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,YAAY,CAAC;AAElD;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,cAAc,GAAG,gBAAgB,GAAG,UAAU,CAAC;AAEvF,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE;QACN,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QACpB,SAAS,EAAE,SAAS,CAAC;QACrB,wEAAwE;QACxE,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,wEAAwE;IACxE,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,cAAc,CAAC;CAC1B"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deployed.md/dpd-implementation-partner-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Record user sign-ups from your app with Deployed: every email is captured and enterprise emails get a Deployed introduction.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"deployed",
|
|
7
|
+
"signup",
|
|
8
|
+
"leads",
|
|
9
|
+
"enterprise",
|
|
10
|
+
"outreach",
|
|
11
|
+
"sdk"
|
|
12
|
+
],
|
|
13
|
+
"author": "Deployed (https://deployed.md)",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+ssh://git@github.com/Deployed-Core/dpd-implementation-partner-sdk.git"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://github.com/Deployed-Core/dpd-implementation-partner-sdk#readme",
|
|
20
|
+
"bugs": "https://github.com/Deployed-Core/dpd-implementation-partner-sdk/issues",
|
|
21
|
+
"main": "dist/index.js",
|
|
22
|
+
"types": "dist/index.d.ts",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"default": "./dist/index.js"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"README.md"
|
|
32
|
+
],
|
|
33
|
+
"sideEffects": false,
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "tsc -p tsconfig.json",
|
|
36
|
+
"dev": "tsc -p tsconfig.json --watch --preserveWatchOutput",
|
|
37
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
38
|
+
"clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
39
|
+
"prepack": "npm run clean && npm run build",
|
|
40
|
+
"prepare": "npm run build",
|
|
41
|
+
"prepublishOnly": "npm run typecheck"
|
|
42
|
+
},
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public",
|
|
45
|
+
"registry": "https://registry.npmjs.org/"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"typescript": "^5.6.3"
|
|
49
|
+
},
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": ">=18"
|
|
52
|
+
}
|
|
53
|
+
}
|