@omnibase/core-js 0.1.3 → 0.1.5

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.
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/auth/index.ts
17
+ var auth_exports = {};
18
+ module.exports = __toCommonJS(auth_exports);
@@ -0,0 +1,107 @@
1
+ import { LoginFlow as LoginFlow$1, RecoveryFlow as RecoveryFlow$1, VerificationFlow as VerificationFlow$1, RegistrationFlow as RegistrationFlow$1, SettingsFlow as SettingsFlow$1, LogoutFlow as LogoutFlow$1, SessionAuthenticationMethod, AuthenticatorAssuranceLevel, SessionDevice, Identity } from '@ory/client-fetch';
2
+
3
+ type FlowType = LoginFlow | RecoveryFlow | VerificationFlow | RegistrationFlow | SettingsFlow;
4
+ /**
5
+ * Logout Flow - Flow Type that Ensures that the session is terminated in the Auth server
6
+ */
7
+ type LogoutFlow = LogoutFlow$1;
8
+ /**
9
+ * This object represents a login flow. A login flow is initiated at the "Initiate Login API / Browser Flow" endpoint by a client.
10
+ *
11
+ * Once a login flow is completed successfully, a session cookie or session token will be issued.
12
+ */
13
+ type LoginFlow = LoginFlow$1;
14
+ /**
15
+ * This flow is used when an identity wants to recover their account.
16
+ */
17
+ type RecoveryFlow = RecoveryFlow$1;
18
+ /**
19
+ * Used to verify an out-of-band communication channel such as an email address or a phone number.
20
+ */
21
+ type VerificationFlow = VerificationFlow$1;
22
+ /**
23
+ * Used when a user is registering an account
24
+ */
25
+ type RegistrationFlow = RegistrationFlow$1;
26
+ /**
27
+ * This flow is used when an identity wants to update settings (e.g. profile data, passwords, ...) in a selfservice manner.
28
+ */
29
+ type SettingsFlow = SettingsFlow$1;
30
+ /**
31
+ * A Session
32
+ * @export
33
+ * @interface Session
34
+ */
35
+ type Session = {
36
+ /**
37
+ * Active state. If false the session is no longer active.
38
+ * @type {boolean}
39
+ * @memberof Session
40
+ */
41
+ active?: boolean;
42
+ /**
43
+ * The Session Authentication Timestamp
44
+ *
45
+ * When this session was authenticated at. If multi-factor authentication was used this
46
+ * is the time when the last factor was authenticated (e.g. the TOTP code challenge was completed).
47
+ * @type {Date}
48
+ * @memberof Session
49
+ */
50
+ authenticated_at?: Date;
51
+ /**
52
+ * A list of authenticators which were used to authenticate the session.
53
+ * @type {Array<SessionAuthenticationMethod>}
54
+ * @memberof Session
55
+ */
56
+ authentication_methods?: Array<SessionAuthenticationMethod>;
57
+ /**
58
+ *
59
+ * @type {AuthenticatorAssuranceLevel}
60
+ * @memberof Session
61
+ */
62
+ authenticator_assurance_level?: AuthenticatorAssuranceLevel;
63
+ /**
64
+ * Devices has history of all endpoints where the session was used
65
+ * @type {Array<SessionDevice>}
66
+ * @memberof Session
67
+ */
68
+ devices?: Array<SessionDevice>;
69
+ /**
70
+ * The Session Expiry
71
+ *
72
+ * When this session expires at.
73
+ * @type {Date}
74
+ * @memberof Session
75
+ */
76
+ expires_at?: Date;
77
+ /**
78
+ * Session ID
79
+ * @type {string}
80
+ * @memberof Session
81
+ */
82
+ id: string;
83
+ /**
84
+ *
85
+ * @type {Identity}
86
+ * @memberof Session
87
+ */
88
+ identity?: Identity;
89
+ /**
90
+ * The Session Issuance Timestamp
91
+ *
92
+ * When this session was issued at. Usually equal or close to `authenticated_at`.
93
+ * @type {Date}
94
+ * @memberof Session
95
+ */
96
+ issued_at?: Date;
97
+ /**
98
+ * Tokenized is the tokenized (e.g. JWT) version of the session.
99
+ *
100
+ * It is only set when the `tokenize_as` query parameter was set to a valid tokenize template during calls to `/session/whoami`.
101
+ * @type {string}
102
+ * @memberof Session
103
+ */
104
+ tokenized?: string;
105
+ };
106
+
107
+ export type { FlowType, LoginFlow, LogoutFlow, RecoveryFlow, RegistrationFlow, Session, SettingsFlow, VerificationFlow };
@@ -0,0 +1,107 @@
1
+ import { LoginFlow as LoginFlow$1, RecoveryFlow as RecoveryFlow$1, VerificationFlow as VerificationFlow$1, RegistrationFlow as RegistrationFlow$1, SettingsFlow as SettingsFlow$1, LogoutFlow as LogoutFlow$1, SessionAuthenticationMethod, AuthenticatorAssuranceLevel, SessionDevice, Identity } from '@ory/client-fetch';
2
+
3
+ type FlowType = LoginFlow | RecoveryFlow | VerificationFlow | RegistrationFlow | SettingsFlow;
4
+ /**
5
+ * Logout Flow - Flow Type that Ensures that the session is terminated in the Auth server
6
+ */
7
+ type LogoutFlow = LogoutFlow$1;
8
+ /**
9
+ * This object represents a login flow. A login flow is initiated at the "Initiate Login API / Browser Flow" endpoint by a client.
10
+ *
11
+ * Once a login flow is completed successfully, a session cookie or session token will be issued.
12
+ */
13
+ type LoginFlow = LoginFlow$1;
14
+ /**
15
+ * This flow is used when an identity wants to recover their account.
16
+ */
17
+ type RecoveryFlow = RecoveryFlow$1;
18
+ /**
19
+ * Used to verify an out-of-band communication channel such as an email address or a phone number.
20
+ */
21
+ type VerificationFlow = VerificationFlow$1;
22
+ /**
23
+ * Used when a user is registering an account
24
+ */
25
+ type RegistrationFlow = RegistrationFlow$1;
26
+ /**
27
+ * This flow is used when an identity wants to update settings (e.g. profile data, passwords, ...) in a selfservice manner.
28
+ */
29
+ type SettingsFlow = SettingsFlow$1;
30
+ /**
31
+ * A Session
32
+ * @export
33
+ * @interface Session
34
+ */
35
+ type Session = {
36
+ /**
37
+ * Active state. If false the session is no longer active.
38
+ * @type {boolean}
39
+ * @memberof Session
40
+ */
41
+ active?: boolean;
42
+ /**
43
+ * The Session Authentication Timestamp
44
+ *
45
+ * When this session was authenticated at. If multi-factor authentication was used this
46
+ * is the time when the last factor was authenticated (e.g. the TOTP code challenge was completed).
47
+ * @type {Date}
48
+ * @memberof Session
49
+ */
50
+ authenticated_at?: Date;
51
+ /**
52
+ * A list of authenticators which were used to authenticate the session.
53
+ * @type {Array<SessionAuthenticationMethod>}
54
+ * @memberof Session
55
+ */
56
+ authentication_methods?: Array<SessionAuthenticationMethod>;
57
+ /**
58
+ *
59
+ * @type {AuthenticatorAssuranceLevel}
60
+ * @memberof Session
61
+ */
62
+ authenticator_assurance_level?: AuthenticatorAssuranceLevel;
63
+ /**
64
+ * Devices has history of all endpoints where the session was used
65
+ * @type {Array<SessionDevice>}
66
+ * @memberof Session
67
+ */
68
+ devices?: Array<SessionDevice>;
69
+ /**
70
+ * The Session Expiry
71
+ *
72
+ * When this session expires at.
73
+ * @type {Date}
74
+ * @memberof Session
75
+ */
76
+ expires_at?: Date;
77
+ /**
78
+ * Session ID
79
+ * @type {string}
80
+ * @memberof Session
81
+ */
82
+ id: string;
83
+ /**
84
+ *
85
+ * @type {Identity}
86
+ * @memberof Session
87
+ */
88
+ identity?: Identity;
89
+ /**
90
+ * The Session Issuance Timestamp
91
+ *
92
+ * When this session was issued at. Usually equal or close to `authenticated_at`.
93
+ * @type {Date}
94
+ * @memberof Session
95
+ */
96
+ issued_at?: Date;
97
+ /**
98
+ * Tokenized is the tokenized (e.g. JWT) version of the session.
99
+ *
100
+ * It is only set when the `tokenize_as` query parameter was set to a valid tokenize template during calls to `/session/whoami`.
101
+ * @type {string}
102
+ * @memberof Session
103
+ */
104
+ tokenized?: string;
105
+ };
106
+
107
+ export type { FlowType, LoginFlow, LogoutFlow, RecoveryFlow, RegistrationFlow, Session, SettingsFlow, VerificationFlow };
File without changes
@@ -1,5 +1,3 @@
1
- import { ApiResponse } from '../index.cjs';
2
-
3
1
  /**
4
2
  * Return type of the `acceptTenantInvite` function
5
3
  */
@@ -100,6 +98,15 @@ type DeleteTenantResponse = ApiResponse<{
100
98
  */
101
99
  declare function deleteTenant(tenantId: string): Promise<DeleteTenantResponse>;
102
100
 
101
+ /**
102
+ * Base API Response structure for API
103
+ */
104
+ type ApiResponse<T> = {
105
+ data?: T;
106
+ status: number;
107
+ error?: string;
108
+ };
109
+
103
110
  /**
104
111
  * Return type of the `switchActiveTenant` function
105
112
  */
@@ -114,4 +121,4 @@ type SwitchActiveTenantResponse = ApiResponse<{
114
121
  */
115
122
  declare function switchActiveTenant(tenantId: string): Promise<SwitchActiveTenantResponse>;
116
123
 
117
- export { type AcceptTenantInviteResponse, ApiResponse, type CreateTenantRequest, type CreateTenantResponse, type CreateTenantUserInviteRequest, type CreateTenantUserInviteResponse, type DeleteTenantResponse, type SwitchActiveTenantResponse, type Tenant, type TenantInvite, acceptTenantInvite, createTenant, createTenantUserInvite, deleteTenant, switchActiveTenant };
124
+ export { type AcceptTenantInviteResponse, type ApiResponse, type CreateTenantRequest, type CreateTenantResponse, type CreateTenantUserInviteRequest, type CreateTenantUserInviteResponse, type DeleteTenantResponse, type SwitchActiveTenantResponse, type Tenant, type TenantInvite, acceptTenantInvite, createTenant, createTenantUserInvite, deleteTenant, switchActiveTenant };
@@ -1,5 +1,3 @@
1
- import { ApiResponse } from '../index.js';
2
-
3
1
  /**
4
2
  * Return type of the `acceptTenantInvite` function
5
3
  */
@@ -100,6 +98,15 @@ type DeleteTenantResponse = ApiResponse<{
100
98
  */
101
99
  declare function deleteTenant(tenantId: string): Promise<DeleteTenantResponse>;
102
100
 
101
+ /**
102
+ * Base API Response structure for API
103
+ */
104
+ type ApiResponse<T> = {
105
+ data?: T;
106
+ status: number;
107
+ error?: string;
108
+ };
109
+
103
110
  /**
104
111
  * Return type of the `switchActiveTenant` function
105
112
  */
@@ -114,4 +121,4 @@ type SwitchActiveTenantResponse = ApiResponse<{
114
121
  */
115
122
  declare function switchActiveTenant(tenantId: string): Promise<SwitchActiveTenantResponse>;
116
123
 
117
- export { type AcceptTenantInviteResponse, ApiResponse, type CreateTenantRequest, type CreateTenantResponse, type CreateTenantUserInviteRequest, type CreateTenantUserInviteResponse, type DeleteTenantResponse, type SwitchActiveTenantResponse, type Tenant, type TenantInvite, acceptTenantInvite, createTenant, createTenantUserInvite, deleteTenant, switchActiveTenant };
124
+ export { type AcceptTenantInviteResponse, type ApiResponse, type CreateTenantRequest, type CreateTenantResponse, type CreateTenantUserInviteRequest, type CreateTenantUserInviteResponse, type DeleteTenantResponse, type SwitchActiveTenantResponse, type Tenant, type TenantInvite, acceptTenantInvite, createTenant, createTenantUserInvite, deleteTenant, switchActiveTenant };
package/package.json CHANGED
@@ -1,19 +1,16 @@
1
1
  {
2
2
  "name": "@omnibase/core-js",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "OmniBase core Javascript SDK - framework agnostic",
5
5
  "files": [
6
6
  "dist/**/*"
7
7
  ],
8
8
  "type": "module",
9
9
  "scripts": {
10
- "build": "tsup src/index.ts src/database/index.ts src/tenants/index.ts src/auth/types.ts --format cjs,esm --dts",
10
+ "build": "tsup src/database/index.ts src/tenants/index.ts src/auth/index.ts --format cjs,esm --dts",
11
11
  "prepublishOnly": "npm run build"
12
12
  },
13
13
  "exports": {
14
- ".": {
15
- "types": "./dist/index.d.ts"
16
- },
17
14
  "./auth": {
18
15
  "types": "./dist/auth/index.d.ts"
19
16
  },