@degallery/node 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/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # node
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build node` to build the library.
8
+
9
+ ## Running unit tests
10
+
11
+ Run `nx test node` to execute the unit tests via [Vitest](https://vitest.dev/).
@@ -0,0 +1,2 @@
1
+ export * from './lib/node.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./lib/node.js"), exports);
@@ -0,0 +1,8 @@
1
+ export { GalleryClient } from '@thegallery/sdk';
2
+ export declare function createDeliveryToken(input: {
3
+ resourceId: string;
4
+ environmentId: string;
5
+ preset: string;
6
+ expiresAt: number;
7
+ }, secret: string): string;
8
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/lib/node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,wBAAgB,mBAAmB,CACjC,KAAK,EAAE;IACL,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,EACD,MAAM,EAAE,MAAM,UAIf"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GalleryClient = void 0;
4
+ exports.createDeliveryToken = createDeliveryToken;
5
+ const node_crypto_1 = require("node:crypto");
6
+ var sdk_1 = require("@thegallery/sdk");
7
+ Object.defineProperty(exports, "GalleryClient", { enumerable: true, get: function () { return sdk_1.GalleryClient; } });
8
+ function createDeliveryToken(input, secret) {
9
+ const payload = Buffer.from(JSON.stringify(input)).toString('base64url');
10
+ return `${payload}.${(0, node_crypto_1.createHmac)('sha256', secret).update(payload).digest('base64url')}`;
11
+ }
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@degallery/node",
3
+ "version": "0.1.0",
4
+ "main": "./dist/index.js",
5
+ "module": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ "./package.json": "./package.json",
9
+ ".": {
10
+ "@degallery/source": "./src/index.ts",
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "default": "./dist/index.js"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "!**/*.tsbuildinfo"
19
+ ],
20
+ "dependencies": {
21
+ "tslib": "^2.3.0",
22
+ "@degallery/sdk": "0.1.0"
23
+ }
24
+ }