@convert-buddy/cloud-client 0.1.0-beta.1
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 +64 -0
- package/NOTICE +33 -0
- package/README.md +13 -0
- package/dist/chunk-DIBGYTC7.js +372 -0
- package/dist/index.d.ts +1471 -0
- package/dist/index.js +158 -0
- package/dist/processing-DFE8ktWi.d.ts +3204 -0
- package/dist/server.d.ts +10 -0
- package/dist/server.js +21 -0
- package/package.json +53 -0
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { P as ProcessingClient } from './processing-DFE8ktWi.js';
|
|
2
|
+
|
|
3
|
+
/** Server-only export. Mint browser sessions through the API; never give the server key to a browser. */
|
|
4
|
+
declare function createServerProcessingClient(options: {
|
|
5
|
+
apiUrl: string;
|
|
6
|
+
serverKey: string;
|
|
7
|
+
fetch?: typeof fetch;
|
|
8
|
+
}): ProcessingClient;
|
|
9
|
+
|
|
10
|
+
export { createServerProcessingClient };
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ProcessingClient
|
|
3
|
+
} from "./chunk-DIBGYTC7.js";
|
|
4
|
+
|
|
5
|
+
// src/server.ts
|
|
6
|
+
function createServerProcessingClient(options) {
|
|
7
|
+
if (typeof window !== "undefined" || !/^cb_sk_[a-f0-9]{64}\.[A-Za-z0-9_-]{43}$/.test(options.serverKey))
|
|
8
|
+
throw new TypeError(
|
|
9
|
+
"A server processing key in a server runtime is required"
|
|
10
|
+
);
|
|
11
|
+
return new ProcessingClient({
|
|
12
|
+
...options,
|
|
13
|
+
authorization: () => ({
|
|
14
|
+
authorization: `Bearer ${options.serverKey}`,
|
|
15
|
+
"X-Processing-Identity": "server"
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
createServerProcessingClient
|
|
21
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@convert-buddy/cloud-client",
|
|
3
|
+
"version": "0.1.0-beta.1",
|
|
4
|
+
"description": "Short-lived session browser client for Convert Buddy Cloud API v2",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
"./server": { "types": "./dist/server.d.ts", "default": "./dist/server.js" },
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist/**",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE",
|
|
20
|
+
"NOTICE",
|
|
21
|
+
"!**/*.map"
|
|
22
|
+
],
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsup",
|
|
26
|
+
"check": "tsc --noEmit",
|
|
27
|
+
"test": "npm run build && tsc -p tsconfig.test.json && node --test .test-dist/tests/widget.test.js .test-dist/tests/processing.test.js",
|
|
28
|
+
"prepack": "npm run check && npm test && node ../../scripts/distribution-policy.mjs package",
|
|
29
|
+
"prepublishOnly": "node ../../scripts/distribution-policy.mjs package"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@convert-buddy/importer-contracts": "0.1.0-beta.1"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/node": "^25.0.3",
|
|
36
|
+
"tsup": "^8.5.1",
|
|
37
|
+
"typescript": "^5.5.0"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=20.17"
|
|
41
|
+
},
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/brunohanss/convert-buddy.git",
|
|
45
|
+
"directory": "packages/cloud-client"
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public",
|
|
49
|
+
"registry": "https://registry.npmjs.org/",
|
|
50
|
+
"provenance": false
|
|
51
|
+
},
|
|
52
|
+
"homepage": "https://convert-buddy.app/docs"
|
|
53
|
+
}
|