@xube/kit-aws-schema 0.0.59 → 0.0.61

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/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
- export * from "./schema/fields";
2
- export * from "./schema/item";
3
- export * from "./schema/keys";
1
+ export * from "./schema/table/fields";
2
+ export * from "./schema/table/item";
3
+ export * from "./schema/table/keys";
4
+ export * from "./schema/auth/authentication";
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./schema/fields"), exports);
18
- __exportStar(require("./schema/item"), exports);
19
- __exportStar(require("./schema/keys"), exports);
17
+ __exportStar(require("./schema/table/fields"), exports);
18
+ __exportStar(require("./schema/table/item"), exports);
19
+ __exportStar(require("./schema/table/keys"), exports);
20
+ __exportStar(require("./schema/auth/authentication"), exports);
@@ -0,0 +1,43 @@
1
+ import { z } from "zod";
2
+ export declare const AuthenticationRequestSchema: z.ZodObject<{
3
+ email: z.ZodString;
4
+ password: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ email: string;
7
+ password: string;
8
+ }, {
9
+ email: string;
10
+ password: string;
11
+ }>;
12
+ export type AuthenticationRequest = z.infer<typeof AuthenticationRequestSchema>;
13
+ export declare const isAuthenticationRequest: (object: unknown) => object is {
14
+ email: string;
15
+ password: string;
16
+ };
17
+ export declare const AuthenticationResponseSchema: z.ZodObject<{
18
+ token: z.ZodString;
19
+ accessToken: z.ZodString;
20
+ refreshToken: z.ZodString;
21
+ expiry: z.ZodNumber;
22
+ deviceKey: z.ZodOptional<z.ZodString>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ token: string;
25
+ accessToken: string;
26
+ refreshToken: string;
27
+ expiry: number;
28
+ deviceKey?: string | undefined;
29
+ }, {
30
+ token: string;
31
+ accessToken: string;
32
+ refreshToken: string;
33
+ expiry: number;
34
+ deviceKey?: string | undefined;
35
+ }>;
36
+ export type AuthenticationResponse = z.infer<typeof AuthenticationResponseSchema>;
37
+ export declare const isAuthenticationResponse: (object: unknown) => object is {
38
+ token: string;
39
+ accessToken: string;
40
+ refreshToken: string;
41
+ expiry: number;
42
+ deviceKey?: string | undefined;
43
+ };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isAuthenticationResponse = exports.AuthenticationResponseSchema = exports.isAuthenticationRequest = exports.AuthenticationRequestSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.AuthenticationRequestSchema = zod_1.z.object({
6
+ email: zod_1.z.string(),
7
+ password: zod_1.z.string(),
8
+ });
9
+ const isAuthenticationRequest = (object) => exports.AuthenticationRequestSchema.passthrough().safeParse(object).success;
10
+ exports.isAuthenticationRequest = isAuthenticationRequest;
11
+ exports.AuthenticationResponseSchema = zod_1.z.object({
12
+ token: zod_1.z.string(),
13
+ accessToken: zod_1.z.string(),
14
+ refreshToken: zod_1.z.string(),
15
+ expiry: zod_1.z.number(),
16
+ deviceKey: zod_1.z.string().optional(),
17
+ });
18
+ const isAuthenticationResponse = (object) => exports.AuthenticationResponseSchema.passthrough().safeParse(object).success;
19
+ exports.isAuthenticationResponse = isAuthenticationResponse;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xube/kit-aws-schema",
3
- "version": "0.0.59",
3
+ "version": "0.0.61",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -18,10 +18,10 @@
18
18
  "homepage": "https://github.com/XubeLtd/dev-kit#readme",
19
19
  "devDependencies": {
20
20
  "@types/aws-lambda": "^8.10.119",
21
- "@xube/kit-build": "^0.0.59"
21
+ "@xube/kit-build": "^0.0.61"
22
22
  },
23
23
  "dependencies": {
24
- "@xube/kit-schema": "^0.0.59",
24
+ "@xube/kit-schema": "^0.0.61",
25
25
  "zod": "^3.22.4"
26
26
  }
27
27
  }
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
- export * from "./schema/fields";
2
- export * from "./schema/item";
3
- export * from "./schema/keys";
1
+ export * from "./schema/table/fields";
2
+ export * from "./schema/table/item";
3
+ export * from "./schema/table/keys";
4
+ export * from "./schema/auth/authentication";
@@ -0,0 +1,24 @@
1
+ import { z } from "zod";
2
+
3
+ export const AuthenticationRequestSchema = z.object({
4
+ email: z.string(),
5
+ password: z.string(),
6
+ });
7
+ export type AuthenticationRequest = z.infer<typeof AuthenticationRequestSchema>;
8
+ export const isAuthenticationRequest = (
9
+ object: unknown
10
+ ): object is AuthenticationRequest =>
11
+ AuthenticationRequestSchema.passthrough().safeParse(object).success;
12
+
13
+ export const AuthenticationResponseSchema = z.object({
14
+ token: z.string(),
15
+ accessToken: z.string(),
16
+ refreshToken: z.string(),
17
+ expiry: z.number(),
18
+ deviceKey: z.string().optional(),
19
+ });
20
+ export type AuthenticationResponse = z.infer<typeof AuthenticationResponseSchema>;
21
+ export const isAuthenticationResponse = (
22
+ object: unknown
23
+ ): object is AuthenticationResponse =>
24
+ AuthenticationResponseSchema.passthrough().safeParse(object).success;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes