@redmix/api 9.0.0-canary.587 → 9.0.0-canary.589

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.
Files changed (36) hide show
  1. package/dist/auth/index.js +0 -1
  2. package/dist/auth/parseJWT.js +0 -1
  3. package/dist/auth/verifiers/base64Sha1Verifier.js +0 -1
  4. package/dist/auth/verifiers/base64Sha256Verifier.js +0 -1
  5. package/dist/auth/verifiers/common.js +0 -1
  6. package/dist/auth/verifiers/index.js +0 -1
  7. package/dist/auth/verifiers/jwtVerifier.js +0 -1
  8. package/dist/auth/verifiers/secretKeyVerifier.js +0 -1
  9. package/dist/auth/verifiers/sha1Verifier.js +0 -1
  10. package/dist/auth/verifiers/sha256Verifier.js +0 -1
  11. package/dist/auth/verifiers/skipVerifier.js +0 -1
  12. package/dist/auth/verifiers/timestampSchemeVerifier.js +0 -1
  13. package/dist/cache/clients/BaseClient.js +0 -1
  14. package/dist/cache/clients/InMemoryClient.js +0 -1
  15. package/dist/cache/clients/MemcachedClient.js +0 -1
  16. package/dist/cache/clients/RedisClient.js +0 -1
  17. package/dist/cache/errors.js +0 -1
  18. package/dist/cache/index.js +0 -1
  19. package/dist/cjs/index.d.ts +0 -2
  20. package/dist/cjs/index.d.ts.map +1 -1
  21. package/dist/cjs/index.js +11 -23
  22. package/dist/cors.js +0 -1
  23. package/dist/errors.js +0 -1
  24. package/dist/event.js +0 -1
  25. package/dist/functions/fixtures/apiGatewayProxyEvent.fixture.js +0 -1
  26. package/dist/index.d.ts +0 -2
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +11 -12
  29. package/dist/logger/index.js +0 -1
  30. package/dist/package.json +1 -1
  31. package/dist/transforms.js +0 -1
  32. package/dist/types.js +0 -1
  33. package/dist/validations/errors.js +0 -1
  34. package/dist/validations/validations.js +0 -1
  35. package/dist/webhooks/index.js +0 -1
  36. package/package.json +3 -3
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  export * from "./parseJWT.js";
3
2
  import * as cookie from "cookie";
4
3
  import { getEventHeader } from "../event.js";
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  function isTokenWithRoles(token) {
3
2
  return !!token.decoded?.roles;
4
3
  }
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  import { createHmac, timingSafeEqual } from "crypto";
3
2
  import {
4
3
  WebhookVerificationError,
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  import { createHmac, timingSafeEqual } from "crypto";
3
2
  import {
4
3
  WebhookVerificationError,
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  import base64Sha1Verifier from "./base64Sha1Verifier.js";
3
2
  import base64Sha256Verifier from "./base64Sha256Verifier.js";
4
3
  import jwtVerifier from "./jwtVerifier.js";
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  import { verifierLookup } from "./common.js";
3
2
  const createVerifier = (type, options) => {
4
3
  if (options) {
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  import jwt from "jsonwebtoken";
3
2
  import {
4
3
  WebhookSignError,
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  import { WebhookVerificationError, DEFAULT_WEBHOOK_SECRET } from "./common.js";
3
2
  const secretKeyVerifier = (_options) => {
4
3
  return {
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  import { createHmac, timingSafeEqual } from "crypto";
3
2
  import {
4
3
  WebhookVerificationError,
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  import { createHmac, timingSafeEqual } from "crypto";
3
2
  import {
4
3
  WebhookVerificationError,
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  const skipVerifier = (_options) => {
3
2
  return {
4
3
  sign: () => {
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  import { createHmac } from "crypto";
3
2
  import {
4
3
  WebhookVerificationError,
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  class BaseClient {
3
2
  constructor() {
4
3
  }
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  import BaseClient from "./BaseClient.js";
3
2
  class InMemoryClient extends BaseClient {
4
3
  storage;
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  import BaseClient from "./BaseClient.js";
3
2
  class MemcachedClient extends BaseClient {
4
3
  client;
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  import BaseClient from "./BaseClient.js";
3
2
  class RedisClient extends BaseClient {
4
3
  client;
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  class CacheTimeoutError extends Error {
3
2
  constructor() {
4
3
  super("Timed out waiting for response from the cache server");
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  import { CacheTimeoutError } from "./errors.js";
3
2
  import { default as default2 } from "./clients/MemcachedClient.js";
4
3
  import { default as default3 } from "./clients/RedisClient.js";
@@ -8,6 +8,4 @@ export * from './cors.js';
8
8
  export * from './event.js';
9
9
  export declare const prismaVersion: any;
10
10
  export declare const redwoodVersion: any;
11
- export declare function getPrismaVersion(): Promise<string>;
12
- export declare function getRedwoodVersion(): Promise<string>;
13
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAM1B,eAAO,MAAM,aAAa,KAAgD,CAAA;AAC1E,eAAO,MAAM,cAAc,KAAuB,CAAA;AAGlD,wBAAsB,gBAAgB,oBAIrC;AAGD,wBAAsB,iBAAiB,oBAItC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAsB1B,eAAO,MAAM,aAAa,KAA8C,CAAA;AACxE,eAAO,MAAM,cAAc,KAAuB,CAAA"}
package/dist/cjs/index.js CHANGED
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -18,23 +16,14 @@ var __copyProps = (to, from, except, desc) => {
18
16
  return to;
19
17
  };
20
18
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
20
  var index_exports = {};
31
21
  __export(index_exports, {
32
- getPrismaVersion: () => getPrismaVersion,
33
- getRedwoodVersion: () => getRedwoodVersion,
34
22
  prismaVersion: () => prismaVersion,
35
23
  redwoodVersion: () => redwoodVersion
36
24
  });
37
25
  module.exports = __toCommonJS(index_exports);
26
+ var import_node_module = require("node:module");
38
27
  __reExport(index_exports, require("./auth/index.js"), module.exports);
39
28
  __reExport(index_exports, require("./errors.js"), module.exports);
40
29
  __reExport(index_exports, require("./validations/validations.js"), module.exports);
@@ -43,21 +32,20 @@ __reExport(index_exports, require("./types.js"), module.exports);
43
32
  __reExport(index_exports, require("./transforms.js"), module.exports);
44
33
  __reExport(index_exports, require("./cors.js"), module.exports);
45
34
  __reExport(index_exports, require("./event.js"), module.exports);
46
- const packageJson = typeof require === "function" ? require("../package.json") : {};
47
- const prismaVersion = packageJson?.dependencies?.["@prisma/client"];
48
- const redwoodVersion = packageJson?.version;
49
- async function getPrismaVersion() {
50
- const { default: apiPackageJson } = await import("@redmix/api/package.json");
51
- return apiPackageJson?.dependencies?.["@prisma/client"];
35
+ const customRequire = typeof require === "function" ? require : (0, import_node_module.createRequire)(process.env.RWJS_CWD || process.cwd());
36
+ const rxApiPath = customRequire.resolve("@redmix/api");
37
+ const rxApiRequire = (0, import_node_module.createRequire)(rxApiPath);
38
+ let packageJson = rxApiRequire("./package.json");
39
+ if (packageJson?.name !== "@redmix/api") {
40
+ packageJson = rxApiRequire("../package.json");
52
41
  }
53
- async function getRedwoodVersion() {
54
- const { default: apiPackageJson } = await import("@redmix/api/package.json");
55
- return apiPackageJson?.version;
42
+ if (packageJson?.name !== "@redmix/api") {
43
+ packageJson = rxApiRequire("../../package.json");
56
44
  }
45
+ const prismaVersion = packageJson?.dependencies["@prisma/client"];
46
+ const redwoodVersion = packageJson?.version;
57
47
  // Annotate the CommonJS export names for ESM import in node:
58
48
  0 && (module.exports = {
59
- getPrismaVersion,
60
- getRedwoodVersion,
61
49
  prismaVersion,
62
50
  redwoodVersion,
63
51
  ...require("./auth/index.js"),
package/dist/cors.js CHANGED
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  import { Headers } from "@whatwg-node/fetch";
3
2
  function createCorsContext(cors) {
4
3
  const corsHeaders = new Headers();
package/dist/errors.js CHANGED
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  class RedwoodError extends Error {
3
2
  extensions;
4
3
  constructor(message, extensions) {
package/dist/event.js CHANGED
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  import { isFetchApiRequest } from "./transforms.js";
3
2
  const getEventHeader = (event, headerName) => {
4
3
  if (isFetchApiRequest(event)) {
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  const mockedAPIGatewayProxyEvent = {
3
2
  body: "MOCKED_BODY",
4
3
  headers: {},
package/dist/index.d.ts CHANGED
@@ -8,6 +8,4 @@ export * from './cors.js';
8
8
  export * from './event.js';
9
9
  export declare const prismaVersion: any;
10
10
  export declare const redwoodVersion: any;
11
- export declare function getPrismaVersion(): Promise<string>;
12
- export declare function getRedwoodVersion(): Promise<string>;
13
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAM1B,eAAO,MAAM,aAAa,KAAgD,CAAA;AAC1E,eAAO,MAAM,cAAc,KAAuB,CAAA;AAGlD,wBAAsB,gBAAgB,oBAIrC;AAGD,wBAAsB,iBAAiB,oBAItC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAsB1B,eAAO,MAAM,aAAa,KAA8C,CAAA;AACxE,eAAO,MAAM,cAAc,KAAuB,CAAA"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
1
+ import { createRequire } from "node:module";
2
2
  export * from "./auth/index.js";
3
3
  export * from "./errors.js";
4
4
  export * from "./validations/validations.js";
@@ -7,20 +7,19 @@ export * from "./types.js";
7
7
  export * from "./transforms.js";
8
8
  export * from "./cors.js";
9
9
  export * from "./event.js";
10
- const packageJson = typeof require === "function" ? require("../package.json") : {};
11
- const prismaVersion = packageJson?.dependencies?.["@prisma/client"];
12
- const redwoodVersion = packageJson?.version;
13
- async function getPrismaVersion() {
14
- const { default: apiPackageJson } = await import("@redmix/api/package.json");
15
- return apiPackageJson?.dependencies?.["@prisma/client"];
10
+ const customRequire = typeof require === "function" ? require : createRequire(process.env.RWJS_CWD || process.cwd());
11
+ const rxApiPath = customRequire.resolve("@redmix/api");
12
+ const rxApiRequire = createRequire(rxApiPath);
13
+ let packageJson = rxApiRequire("./package.json");
14
+ if (packageJson?.name !== "@redmix/api") {
15
+ packageJson = rxApiRequire("../package.json");
16
16
  }
17
- async function getRedwoodVersion() {
18
- const { default: apiPackageJson } = await import("@redmix/api/package.json");
19
- return apiPackageJson?.version;
17
+ if (packageJson?.name !== "@redmix/api") {
18
+ packageJson = rxApiRequire("../../package.json");
20
19
  }
20
+ const prismaVersion = packageJson?.dependencies["@prisma/client"];
21
+ const redwoodVersion = packageJson?.version;
21
22
  export {
22
- getPrismaVersion,
23
- getRedwoodVersion,
24
23
  prismaVersion,
25
24
  redwoodVersion
26
25
  };
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  import pino from "pino";
3
2
  const isDevelopment = process.env.NODE_ENV === "development";
4
3
  const isTest = process.env.NODE_ENV === "test";
package/dist/package.json CHANGED
@@ -1 +1 @@
1
- {"type":"module","version":"9.0.0-canary.587+9d900d54a","dependencies":{"@prisma/client":"5.20.0","@whatwg-node/fetch":"0.9.21","cookie":"1.0.2","humanize-string":"2.1.0","jsonwebtoken":"9.0.2","pascalcase":"1.0.0","pino":"9.4.0","title-case":"3.0.3"}}
1
+ {"type":"module"}
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  import { Headers, Request as PonyfillRequest } from "@whatwg-node/fetch";
3
2
  const parseLambdaEventBody = (event) => {
4
3
  if (!event.body) {
package/dist/types.js CHANGED
@@ -1 +0,0 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  import humanize from "humanize-string";
3
2
  import { titleCase } from "title-case";
4
3
  import { RedwoodError } from "../errors.js";
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  import { PrismaClient } from "@prisma/client";
3
2
  import pascalcase from "pascalcase";
4
3
  import * as ValidationErrors from "./errors.js";
@@ -1,4 +1,3 @@
1
- import bannerPath from "node:path"; import bannerUrl from "node:url"; const __filename = bannerUrl.fileURLToPath(import.meta.url); const __dirname = bannerPath.dirname(__filename);
2
1
  import {
3
2
  createVerifier,
4
3
  WebhookVerificationError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redmix/api",
3
- "version": "9.0.0-canary.587+9d900d54a",
3
+ "version": "9.0.0-canary.589+c8b2c3347",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/redmix-run/redmix.git",
@@ -95,7 +95,7 @@
95
95
  "title-case": "3.0.3"
96
96
  },
97
97
  "devDependencies": {
98
- "@redmix/framework-tools": "9.0.0-canary.587",
98
+ "@redmix/framework-tools": "9.0.0-canary.589",
99
99
  "@types/aws-lambda": "8.10.145",
100
100
  "@types/jsonwebtoken": "9.0.8",
101
101
  "@types/memjs": "1",
@@ -123,5 +123,5 @@
123
123
  "optional": true
124
124
  }
125
125
  },
126
- "gitHead": "9d900d54a5c354f8104e067c769cde8130680991"
126
+ "gitHead": "c8b2c334725899b4823b2871228da0eba605d544"
127
127
  }