@coduckai/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/dist/ai/index.cjs +32 -0
- package/dist/ai/index.cjs.map +1 -0
- package/dist/ai/index.d.cts +14 -0
- package/dist/ai/index.d.ts +14 -0
- package/dist/ai/index.js +30 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/auth/index.cjs +139 -0
- package/dist/auth/index.cjs.map +1 -0
- package/dist/auth/index.d.cts +56 -0
- package/dist/auth/index.d.ts +56 -0
- package/dist/auth/index.js +132 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/client/index.cjs +70 -0
- package/dist/client/index.cjs.map +1 -0
- package/dist/client/index.d.cts +20 -0
- package/dist/client/index.d.ts +20 -0
- package/dist/client/index.js +57 -0
- package/dist/client/index.js.map +1 -0
- package/dist/db/index.cjs +126 -0
- package/dist/db/index.cjs.map +1 -0
- package/dist/db/index.d.cts +62 -0
- package/dist/db/index.d.ts +62 -0
- package/dist/db/index.js +120 -0
- package/dist/db/index.js.map +1 -0
- package/dist/email/index.cjs +29 -0
- package/dist/email/index.cjs.map +1 -0
- package/dist/email/index.d.cts +11 -0
- package/dist/email/index.d.ts +11 -0
- package/dist/email/index.js +27 -0
- package/dist/email/index.js.map +1 -0
- package/dist/index.cjs +20 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +32 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/payments/index.cjs +32 -0
- package/dist/payments/index.cjs.map +1 -0
- package/dist/payments/index.d.cts +14 -0
- package/dist/payments/index.d.ts +14 -0
- package/dist/payments/index.js +30 -0
- package/dist/payments/index.js.map +1 -0
- package/dist/storage/index.cjs +31 -0
- package/dist/storage/index.cjs.map +1 -0
- package/dist/storage/index.d.cts +13 -0
- package/dist/storage/index.d.ts +13 -0
- package/dist/storage/index.js +29 -0
- package/dist/storage/index.js.map +1 -0
- package/package.json +93 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global SDK configuration
|
|
3
|
+
*
|
|
4
|
+
* CoDuck apps use env vars automatically — no configure() needed.
|
|
5
|
+
* Standalone usage can call configure() to override.
|
|
6
|
+
*/
|
|
7
|
+
interface SDKConfig {
|
|
8
|
+
auth?: {
|
|
9
|
+
jwtSecret?: string;
|
|
10
|
+
jwtExpiresIn?: string;
|
|
11
|
+
bcryptRounds?: number;
|
|
12
|
+
};
|
|
13
|
+
db?: {
|
|
14
|
+
connectionString?: string;
|
|
15
|
+
};
|
|
16
|
+
client?: {
|
|
17
|
+
baseUrl?: string;
|
|
18
|
+
tokenKey?: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
declare function getConfig(): SDKConfig;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @coduckai/sdk — CoDuck Platform SDK
|
|
25
|
+
*
|
|
26
|
+
* Zero-config in CoDuck apps (env vars auto-detected).
|
|
27
|
+
* For standalone usage, call configure() first.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
declare function configure(config: SDKConfig): void;
|
|
31
|
+
|
|
32
|
+
export { type SDKConfig, configure, getConfig };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/internal/config.ts
|
|
2
|
+
var globalConfig = {};
|
|
3
|
+
function setConfig(config) {
|
|
4
|
+
globalConfig = { ...globalConfig, ...config };
|
|
5
|
+
}
|
|
6
|
+
function getConfig() {
|
|
7
|
+
return globalConfig;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// src/index.ts
|
|
11
|
+
function configure(config) {
|
|
12
|
+
setConfig(config);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { configure, getConfig };
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/internal/config.ts","../src/index.ts"],"names":[],"mappings":";AAsBA,IAAI,eAA0B,EAAC;AAExB,SAAS,UAAU,MAAA,EAAyB;AACjD,EAAA,YAAA,GAAe,EAAE,GAAG,YAAA,EAAc,GAAG,MAAA,EAAO;AAC9C;AAEO,SAAS,SAAA,GAAuB;AACrC,EAAA,OAAO,YAAA;AACT;;;ACnBO,SAAS,UAAU,MAAA,EAAyB;AACjD,EAAA,SAAA,CAAU,MAAM,CAAA;AAClB","file":"index.js","sourcesContent":["/**\n * Global SDK configuration\n *\n * CoDuck apps use env vars automatically — no configure() needed.\n * Standalone usage can call configure() to override.\n */\n\nexport interface SDKConfig {\n auth?: {\n jwtSecret?: string;\n jwtExpiresIn?: string;\n bcryptRounds?: number;\n };\n db?: {\n connectionString?: string;\n };\n client?: {\n baseUrl?: string;\n tokenKey?: string;\n };\n}\n\nlet globalConfig: SDKConfig = {};\n\nexport function setConfig(config: SDKConfig): void {\n globalConfig = { ...globalConfig, ...config };\n}\n\nexport function getConfig(): SDKConfig {\n return globalConfig;\n}\n","/**\n * @coduckai/sdk — CoDuck Platform SDK\n *\n * Zero-config in CoDuck apps (env vars auto-detected).\n * For standalone usage, call configure() first.\n */\n\nimport { setConfig, getConfig, type SDKConfig } from './internal/config';\n\nexport type { SDKConfig };\n\nexport function configure(config: SDKConfig): void {\n setConfig(config);\n}\n\nexport { getConfig };\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/internal/env.ts
|
|
4
|
+
function isServer() {
|
|
5
|
+
return typeof window === "undefined";
|
|
6
|
+
}
|
|
7
|
+
function assertServer(moduleName) {
|
|
8
|
+
if (!isServer()) {
|
|
9
|
+
throw new Error(
|
|
10
|
+
`@coduckai/sdk/${moduleName} is server-only. Use @coduckai/sdk/client for browser code.`
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// src/payments/index.ts
|
|
16
|
+
assertServer("payments");
|
|
17
|
+
var payments = {
|
|
18
|
+
createCheckout: notImplemented("payments.createCheckout"),
|
|
19
|
+
createSubscription: notImplemented("payments.createSubscription"),
|
|
20
|
+
handleWebhook: notImplemented("payments.handleWebhook"),
|
|
21
|
+
webhookMiddleware: notImplemented("payments.webhookMiddleware"),
|
|
22
|
+
getStripe: notImplemented("payments.getStripe")
|
|
23
|
+
};
|
|
24
|
+
function notImplemented(name) {
|
|
25
|
+
return () => {
|
|
26
|
+
throw new Error(`@coduckai/sdk: ${name}() is not yet implemented. Coming in v0.2.0.`);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
exports.payments = payments;
|
|
31
|
+
//# sourceMappingURL=index.cjs.map
|
|
32
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/internal/env.ts","../../src/payments/index.ts"],"names":[],"mappings":";;;AAgBO,SAAS,QAAA,GAAoB;AAClC,EAAA,OAAO,OAAO,MAAA,KAAW,WAAA;AAC3B;AAEO,SAAS,aAAa,UAAA,EAA0B;AACrD,EAAA,IAAI,CAAC,UAAS,EAAG;AACf,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,iBAAiB,UAAU,CAAA,2DAAA;AAAA,KAC7B;AAAA,EACF;AACF;;;ACnBA,YAAA,CAAa,UAAU,CAAA;AAEhB,IAAM,QAAA,GAAW;AAAA,EACtB,cAAA,EAAgB,eAAe,yBAAyB,CAAA;AAAA,EACxD,kBAAA,EAAoB,eAAe,6BAA6B,CAAA;AAAA,EAChE,aAAA,EAAe,eAAe,wBAAwB,CAAA;AAAA,EACtD,iBAAA,EAAmB,eAAe,4BAA4B,CAAA;AAAA,EAC9D,SAAA,EAAW,eAAe,oBAAoB;AAChD;AAEA,SAAS,eAAe,IAAA,EAAc;AACpC,EAAA,OAAO,MAAM;AACX,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,eAAA,EAAkB,IAAI,CAAA,4CAAA,CAA8C,CAAA;AAAA,EACtF,CAAA;AACF","file":"index.cjs","sourcesContent":["/**\n * Environment variable helpers\n */\n\nexport function getEnv(key: string, fallback?: string): string | undefined {\n return process.env[key] || fallback;\n}\n\nexport function requireEnv(key: string): string {\n const val = process.env[key];\n if (!val) {\n throw new Error(`@coduckai/sdk: Missing required environment variable: ${key}`);\n }\n return val;\n}\n\nexport function isServer(): boolean {\n return typeof window === 'undefined';\n}\n\nexport function assertServer(moduleName: string): void {\n if (!isServer()) {\n throw new Error(\n `@coduckai/sdk/${moduleName} is server-only. Use @coduckai/sdk/client for browser code.`\n );\n }\n}\n","/**\n * @coduckai/sdk/payments — Stripe Payments (server-only)\n *\n * Coming in v0.2.0. Wraps Stripe SDK with Connect destination charges.\n */\n\nimport { assertServer } from '../internal/env';\nassertServer('payments');\n\nexport const payments = {\n createCheckout: notImplemented('payments.createCheckout'),\n createSubscription: notImplemented('payments.createSubscription'),\n handleWebhook: notImplemented('payments.handleWebhook'),\n webhookMiddleware: notImplemented('payments.webhookMiddleware'),\n getStripe: notImplemented('payments.getStripe'),\n};\n\nfunction notImplemented(name: string) {\n return () => {\n throw new Error(`@coduckai/sdk: ${name}() is not yet implemented. Coming in v0.2.0.`);\n };\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @coduckai/sdk/payments — Stripe Payments (server-only)
|
|
3
|
+
*
|
|
4
|
+
* Coming in v0.2.0. Wraps Stripe SDK with Connect destination charges.
|
|
5
|
+
*/
|
|
6
|
+
declare const payments: {
|
|
7
|
+
createCheckout: () => never;
|
|
8
|
+
createSubscription: () => never;
|
|
9
|
+
handleWebhook: () => never;
|
|
10
|
+
webhookMiddleware: () => never;
|
|
11
|
+
getStripe: () => never;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { payments };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @coduckai/sdk/payments — Stripe Payments (server-only)
|
|
3
|
+
*
|
|
4
|
+
* Coming in v0.2.0. Wraps Stripe SDK with Connect destination charges.
|
|
5
|
+
*/
|
|
6
|
+
declare const payments: {
|
|
7
|
+
createCheckout: () => never;
|
|
8
|
+
createSubscription: () => never;
|
|
9
|
+
handleWebhook: () => never;
|
|
10
|
+
webhookMiddleware: () => never;
|
|
11
|
+
getStripe: () => never;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { payments };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// src/internal/env.ts
|
|
2
|
+
function isServer() {
|
|
3
|
+
return typeof window === "undefined";
|
|
4
|
+
}
|
|
5
|
+
function assertServer(moduleName) {
|
|
6
|
+
if (!isServer()) {
|
|
7
|
+
throw new Error(
|
|
8
|
+
`@coduckai/sdk/${moduleName} is server-only. Use @coduckai/sdk/client for browser code.`
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// src/payments/index.ts
|
|
14
|
+
assertServer("payments");
|
|
15
|
+
var payments = {
|
|
16
|
+
createCheckout: notImplemented("payments.createCheckout"),
|
|
17
|
+
createSubscription: notImplemented("payments.createSubscription"),
|
|
18
|
+
handleWebhook: notImplemented("payments.handleWebhook"),
|
|
19
|
+
webhookMiddleware: notImplemented("payments.webhookMiddleware"),
|
|
20
|
+
getStripe: notImplemented("payments.getStripe")
|
|
21
|
+
};
|
|
22
|
+
function notImplemented(name) {
|
|
23
|
+
return () => {
|
|
24
|
+
throw new Error(`@coduckai/sdk: ${name}() is not yet implemented. Coming in v0.2.0.`);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { payments };
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/internal/env.ts","../../src/payments/index.ts"],"names":[],"mappings":";AAgBO,SAAS,QAAA,GAAoB;AAClC,EAAA,OAAO,OAAO,MAAA,KAAW,WAAA;AAC3B;AAEO,SAAS,aAAa,UAAA,EAA0B;AACrD,EAAA,IAAI,CAAC,UAAS,EAAG;AACf,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,iBAAiB,UAAU,CAAA,2DAAA;AAAA,KAC7B;AAAA,EACF;AACF;;;ACnBA,YAAA,CAAa,UAAU,CAAA;AAEhB,IAAM,QAAA,GAAW;AAAA,EACtB,cAAA,EAAgB,eAAe,yBAAyB,CAAA;AAAA,EACxD,kBAAA,EAAoB,eAAe,6BAA6B,CAAA;AAAA,EAChE,aAAA,EAAe,eAAe,wBAAwB,CAAA;AAAA,EACtD,iBAAA,EAAmB,eAAe,4BAA4B,CAAA;AAAA,EAC9D,SAAA,EAAW,eAAe,oBAAoB;AAChD;AAEA,SAAS,eAAe,IAAA,EAAc;AACpC,EAAA,OAAO,MAAM;AACX,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,eAAA,EAAkB,IAAI,CAAA,4CAAA,CAA8C,CAAA;AAAA,EACtF,CAAA;AACF","file":"index.js","sourcesContent":["/**\n * Environment variable helpers\n */\n\nexport function getEnv(key: string, fallback?: string): string | undefined {\n return process.env[key] || fallback;\n}\n\nexport function requireEnv(key: string): string {\n const val = process.env[key];\n if (!val) {\n throw new Error(`@coduckai/sdk: Missing required environment variable: ${key}`);\n }\n return val;\n}\n\nexport function isServer(): boolean {\n return typeof window === 'undefined';\n}\n\nexport function assertServer(moduleName: string): void {\n if (!isServer()) {\n throw new Error(\n `@coduckai/sdk/${moduleName} is server-only. Use @coduckai/sdk/client for browser code.`\n );\n }\n}\n","/**\n * @coduckai/sdk/payments — Stripe Payments (server-only)\n *\n * Coming in v0.2.0. Wraps Stripe SDK with Connect destination charges.\n */\n\nimport { assertServer } from '../internal/env';\nassertServer('payments');\n\nexport const payments = {\n createCheckout: notImplemented('payments.createCheckout'),\n createSubscription: notImplemented('payments.createSubscription'),\n handleWebhook: notImplemented('payments.handleWebhook'),\n webhookMiddleware: notImplemented('payments.webhookMiddleware'),\n getStripe: notImplemented('payments.getStripe'),\n};\n\nfunction notImplemented(name: string) {\n return () => {\n throw new Error(`@coduckai/sdk: ${name}() is not yet implemented. Coming in v0.2.0.`);\n };\n}\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/internal/env.ts
|
|
4
|
+
function isServer() {
|
|
5
|
+
return typeof window === "undefined";
|
|
6
|
+
}
|
|
7
|
+
function assertServer(moduleName) {
|
|
8
|
+
if (!isServer()) {
|
|
9
|
+
throw new Error(
|
|
10
|
+
`@coduckai/sdk/${moduleName} is server-only. Use @coduckai/sdk/client for browser code.`
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// src/storage/index.ts
|
|
16
|
+
assertServer("storage");
|
|
17
|
+
var storage = {
|
|
18
|
+
upload: notImplemented("storage.upload"),
|
|
19
|
+
getUrl: notImplemented("storage.getUrl"),
|
|
20
|
+
remove: notImplemented("storage.remove"),
|
|
21
|
+
uploadMiddleware: notImplemented("storage.uploadMiddleware")
|
|
22
|
+
};
|
|
23
|
+
function notImplemented(name) {
|
|
24
|
+
return () => {
|
|
25
|
+
throw new Error(`@coduckai/sdk: ${name}() is not yet implemented. Coming in v0.3.0.`);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
exports.storage = storage;
|
|
30
|
+
//# sourceMappingURL=index.cjs.map
|
|
31
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/internal/env.ts","../../src/storage/index.ts"],"names":[],"mappings":";;;AAgBO,SAAS,QAAA,GAAoB;AAClC,EAAA,OAAO,OAAO,MAAA,KAAW,WAAA;AAC3B;AAEO,SAAS,aAAa,UAAA,EAA0B;AACrD,EAAA,IAAI,CAAC,UAAS,EAAG;AACf,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,iBAAiB,UAAU,CAAA,2DAAA;AAAA,KAC7B;AAAA,EACF;AACF;;;ACnBA,YAAA,CAAa,SAAS,CAAA;AAEf,IAAM,OAAA,GAAU;AAAA,EACrB,MAAA,EAAQ,eAAe,gBAAgB,CAAA;AAAA,EACvC,MAAA,EAAQ,eAAe,gBAAgB,CAAA;AAAA,EACvC,MAAA,EAAQ,eAAe,gBAAgB,CAAA;AAAA,EACvC,gBAAA,EAAkB,eAAe,0BAA0B;AAC7D;AAEA,SAAS,eAAe,IAAA,EAAc;AACpC,EAAA,OAAO,MAAM;AACX,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,eAAA,EAAkB,IAAI,CAAA,4CAAA,CAA8C,CAAA;AAAA,EACtF,CAAA;AACF","file":"index.cjs","sourcesContent":["/**\n * Environment variable helpers\n */\n\nexport function getEnv(key: string, fallback?: string): string | undefined {\n return process.env[key] || fallback;\n}\n\nexport function requireEnv(key: string): string {\n const val = process.env[key];\n if (!val) {\n throw new Error(`@coduckai/sdk: Missing required environment variable: ${key}`);\n }\n return val;\n}\n\nexport function isServer(): boolean {\n return typeof window === 'undefined';\n}\n\nexport function assertServer(moduleName: string): void {\n if (!isServer()) {\n throw new Error(\n `@coduckai/sdk/${moduleName} is server-only. Use @coduckai/sdk/client for browser code.`\n );\n }\n}\n","/**\n * @coduckai/sdk/storage — File Storage (server-only)\n *\n * Coming in v0.3.0.\n */\n\nimport { assertServer } from '../internal/env';\nassertServer('storage');\n\nexport const storage = {\n upload: notImplemented('storage.upload'),\n getUrl: notImplemented('storage.getUrl'),\n remove: notImplemented('storage.remove'),\n uploadMiddleware: notImplemented('storage.uploadMiddleware'),\n};\n\nfunction notImplemented(name: string) {\n return () => {\n throw new Error(`@coduckai/sdk: ${name}() is not yet implemented. Coming in v0.3.0.`);\n };\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// src/internal/env.ts
|
|
2
|
+
function isServer() {
|
|
3
|
+
return typeof window === "undefined";
|
|
4
|
+
}
|
|
5
|
+
function assertServer(moduleName) {
|
|
6
|
+
if (!isServer()) {
|
|
7
|
+
throw new Error(
|
|
8
|
+
`@coduckai/sdk/${moduleName} is server-only. Use @coduckai/sdk/client for browser code.`
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// src/storage/index.ts
|
|
14
|
+
assertServer("storage");
|
|
15
|
+
var storage = {
|
|
16
|
+
upload: notImplemented("storage.upload"),
|
|
17
|
+
getUrl: notImplemented("storage.getUrl"),
|
|
18
|
+
remove: notImplemented("storage.remove"),
|
|
19
|
+
uploadMiddleware: notImplemented("storage.uploadMiddleware")
|
|
20
|
+
};
|
|
21
|
+
function notImplemented(name) {
|
|
22
|
+
return () => {
|
|
23
|
+
throw new Error(`@coduckai/sdk: ${name}() is not yet implemented. Coming in v0.3.0.`);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { storage };
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/internal/env.ts","../../src/storage/index.ts"],"names":[],"mappings":";AAgBO,SAAS,QAAA,GAAoB;AAClC,EAAA,OAAO,OAAO,MAAA,KAAW,WAAA;AAC3B;AAEO,SAAS,aAAa,UAAA,EAA0B;AACrD,EAAA,IAAI,CAAC,UAAS,EAAG;AACf,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,iBAAiB,UAAU,CAAA,2DAAA;AAAA,KAC7B;AAAA,EACF;AACF;;;ACnBA,YAAA,CAAa,SAAS,CAAA;AAEf,IAAM,OAAA,GAAU;AAAA,EACrB,MAAA,EAAQ,eAAe,gBAAgB,CAAA;AAAA,EACvC,MAAA,EAAQ,eAAe,gBAAgB,CAAA;AAAA,EACvC,MAAA,EAAQ,eAAe,gBAAgB,CAAA;AAAA,EACvC,gBAAA,EAAkB,eAAe,0BAA0B;AAC7D;AAEA,SAAS,eAAe,IAAA,EAAc;AACpC,EAAA,OAAO,MAAM;AACX,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,eAAA,EAAkB,IAAI,CAAA,4CAAA,CAA8C,CAAA;AAAA,EACtF,CAAA;AACF","file":"index.js","sourcesContent":["/**\n * Environment variable helpers\n */\n\nexport function getEnv(key: string, fallback?: string): string | undefined {\n return process.env[key] || fallback;\n}\n\nexport function requireEnv(key: string): string {\n const val = process.env[key];\n if (!val) {\n throw new Error(`@coduckai/sdk: Missing required environment variable: ${key}`);\n }\n return val;\n}\n\nexport function isServer(): boolean {\n return typeof window === 'undefined';\n}\n\nexport function assertServer(moduleName: string): void {\n if (!isServer()) {\n throw new Error(\n `@coduckai/sdk/${moduleName} is server-only. Use @coduckai/sdk/client for browser code.`\n );\n }\n}\n","/**\n * @coduckai/sdk/storage — File Storage (server-only)\n *\n * Coming in v0.3.0.\n */\n\nimport { assertServer } from '../internal/env';\nassertServer('storage');\n\nexport const storage = {\n upload: notImplemented('storage.upload'),\n getUrl: notImplemented('storage.getUrl'),\n remove: notImplemented('storage.remove'),\n uploadMiddleware: notImplemented('storage.uploadMiddleware'),\n};\n\nfunction notImplemented(name: string) {\n return () => {\n throw new Error(`@coduckai/sdk: ${name}() is not yet implemented. Coming in v0.3.0.`);\n };\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@coduckai/sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CoDuck platform SDK — auth, database, payments, AI, and more for generated apps",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./auth": {
|
|
16
|
+
"types": "./dist/auth/index.d.ts",
|
|
17
|
+
"import": "./dist/auth/index.js",
|
|
18
|
+
"require": "./dist/auth/index.cjs"
|
|
19
|
+
},
|
|
20
|
+
"./db": {
|
|
21
|
+
"types": "./dist/db/index.d.ts",
|
|
22
|
+
"import": "./dist/db/index.js",
|
|
23
|
+
"require": "./dist/db/index.cjs"
|
|
24
|
+
},
|
|
25
|
+
"./payments": {
|
|
26
|
+
"types": "./dist/payments/index.d.ts",
|
|
27
|
+
"import": "./dist/payments/index.js",
|
|
28
|
+
"require": "./dist/payments/index.cjs"
|
|
29
|
+
},
|
|
30
|
+
"./ai": {
|
|
31
|
+
"types": "./dist/ai/index.d.ts",
|
|
32
|
+
"import": "./dist/ai/index.js",
|
|
33
|
+
"require": "./dist/ai/index.cjs"
|
|
34
|
+
},
|
|
35
|
+
"./email": {
|
|
36
|
+
"types": "./dist/email/index.d.ts",
|
|
37
|
+
"import": "./dist/email/index.js",
|
|
38
|
+
"require": "./dist/email/index.cjs"
|
|
39
|
+
},
|
|
40
|
+
"./storage": {
|
|
41
|
+
"types": "./dist/storage/index.d.ts",
|
|
42
|
+
"import": "./dist/storage/index.js",
|
|
43
|
+
"require": "./dist/storage/index.cjs"
|
|
44
|
+
},
|
|
45
|
+
"./client": {
|
|
46
|
+
"types": "./dist/client/index.d.ts",
|
|
47
|
+
"import": "./dist/client/index.js",
|
|
48
|
+
"require": "./dist/client/index.cjs"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"files": [
|
|
52
|
+
"dist"
|
|
53
|
+
],
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "tsup",
|
|
56
|
+
"dev": "tsup --watch",
|
|
57
|
+
"test": "vitest run",
|
|
58
|
+
"test:watch": "vitest",
|
|
59
|
+
"lint": "tsc --noEmit",
|
|
60
|
+
"prepublishOnly": "npm run build"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"bcrypt": "^5.1.1",
|
|
64
|
+
"jsonwebtoken": "^9.0.2",
|
|
65
|
+
"pg": "^8.11.3",
|
|
66
|
+
"axios": "^1.6.2"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@types/bcrypt": "^5.0.2",
|
|
70
|
+
"@types/jsonwebtoken": "^9.0.7",
|
|
71
|
+
"@types/pg": "^8.11.10",
|
|
72
|
+
"@types/express": "^4.17.21",
|
|
73
|
+
"@types/node": "^20.11.5",
|
|
74
|
+
"express": "^4.18.2",
|
|
75
|
+
"tsup": "^8.0.1",
|
|
76
|
+
"typescript": "^5.3.3",
|
|
77
|
+
"vitest": "^1.2.0"
|
|
78
|
+
},
|
|
79
|
+
"peerDependencies": {
|
|
80
|
+
"express": "^4.18.0"
|
|
81
|
+
},
|
|
82
|
+
"peerDependenciesMeta": {
|
|
83
|
+
"express": {
|
|
84
|
+
"optional": true
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"keywords": ["coduck", "sdk", "auth", "database", "payments", "ai"],
|
|
88
|
+
"license": "MIT",
|
|
89
|
+
"repository": {
|
|
90
|
+
"type": "git",
|
|
91
|
+
"url": "https://github.com/CoDuckAI/CoDuck-APIV4"
|
|
92
|
+
}
|
|
93
|
+
}
|