@develit-io/backend-sdk 9.0.1 → 9.0.3

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.mts CHANGED
@@ -441,6 +441,19 @@ interface CommandItem<TAuditAction = string> {
441
441
  id: string;
442
442
  }
443
443
 
444
+ interface IdempotencyContextVariables {
445
+ idempotency: {
446
+ key: string;
447
+ };
448
+ }
449
+ interface UserContextVariables {
450
+ user: {
451
+ email: string;
452
+ role: string;
453
+ organizationId: string;
454
+ };
455
+ }
456
+
444
457
  /**
445
458
  * Utility type to infer possible relation includes (`with`) for a given table.
446
459
  * This helps define which relations (one-to-many, many-to-one) can be included in a query.
@@ -831,4 +844,4 @@ type AsyncMethod<TArgs extends unknown[] = unknown[], TResult = unknown> = (...a
831
844
  declare function cloudflareQueue<TArgs extends unknown[] = unknown[], TResult = unknown>(options: WithRetryCounterOptions): (target: unknown, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<AsyncMethod<TArgs, TResult>>) => void;
832
845
 
833
846
  export { DatabaseTransaction, ENVIRONMENT, RPCResponse, USER_ROLES, action, asNonEmpty, bankAccount, bankAccountMetadataSchema, base, bicSchema, buildMultiFilterConditions, buildRangeFilterConditions, buildSearchConditions, calculateExponentialBackoff, cloudflareQueue, composeWranglerBase, createAuditLogWriter, createInternalError, createSignatureKeyPair, defineCommand, derivePortFromId, develitWorker, durableObjectNamespaceIdFromName, first, firstOrError, getD1Credentials, getD1DatabaseIdFromWrangler, getDrizzleD1Config, getSecret, handleAction, ibanSchema, isInternalError, nullToOptional, optionalToNull, paginationQuerySchema, paginationSchema, resolveColumn, service, signPayload, useFetch, useResult, useResultSync, uuidv4, verifyPayloadSignature, workflowInstanceStatusSchema };
834
- export type { ActionExecution, ActionHandlerOptions, AuditLogWriter, BankAccountMetadata, BaseEvent, BuildSearchOptions, Command, CommandLogPayload, DevelitWorkerMethods, Environment, GatewayResponse, IRPCResponse, IncludeRelation, InferResultType, InternalError, InternalErrorResponseStatus, Project, UserRole, ValidatedInput, WorkflowInstanceStatus };
847
+ export type { ActionExecution, ActionHandlerOptions, AuditLogWriter, BankAccountMetadata, BaseEvent, BuildSearchOptions, Command, CommandLogPayload, DevelitWorkerMethods, Environment, GatewayResponse, IRPCResponse, IdempotencyContextVariables, IncludeRelation, InferResultType, InternalError, InternalErrorResponseStatus, Project, UserContextVariables, UserRole, ValidatedInput, WorkflowInstanceStatus };
package/dist/index.d.ts CHANGED
@@ -441,6 +441,19 @@ interface CommandItem<TAuditAction = string> {
441
441
  id: string;
442
442
  }
443
443
 
444
+ interface IdempotencyContextVariables {
445
+ idempotency: {
446
+ key: string;
447
+ };
448
+ }
449
+ interface UserContextVariables {
450
+ user: {
451
+ email: string;
452
+ role: string;
453
+ organizationId: string;
454
+ };
455
+ }
456
+
444
457
  /**
445
458
  * Utility type to infer possible relation includes (`with`) for a given table.
446
459
  * This helps define which relations (one-to-many, many-to-one) can be included in a query.
@@ -831,4 +844,4 @@ type AsyncMethod<TArgs extends unknown[] = unknown[], TResult = unknown> = (...a
831
844
  declare function cloudflareQueue<TArgs extends unknown[] = unknown[], TResult = unknown>(options: WithRetryCounterOptions): (target: unknown, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<AsyncMethod<TArgs, TResult>>) => void;
832
845
 
833
846
  export { DatabaseTransaction, ENVIRONMENT, RPCResponse, USER_ROLES, action, asNonEmpty, bankAccount, bankAccountMetadataSchema, base, bicSchema, buildMultiFilterConditions, buildRangeFilterConditions, buildSearchConditions, calculateExponentialBackoff, cloudflareQueue, composeWranglerBase, createAuditLogWriter, createInternalError, createSignatureKeyPair, defineCommand, derivePortFromId, develitWorker, durableObjectNamespaceIdFromName, first, firstOrError, getD1Credentials, getD1DatabaseIdFromWrangler, getDrizzleD1Config, getSecret, handleAction, ibanSchema, isInternalError, nullToOptional, optionalToNull, paginationQuerySchema, paginationSchema, resolveColumn, service, signPayload, useFetch, useResult, useResultSync, uuidv4, verifyPayloadSignature, workflowInstanceStatusSchema };
834
- export type { ActionExecution, ActionHandlerOptions, AuditLogWriter, BankAccountMetadata, BaseEvent, BuildSearchOptions, Command, CommandLogPayload, DevelitWorkerMethods, Environment, GatewayResponse, IRPCResponse, IncludeRelation, InferResultType, InternalError, InternalErrorResponseStatus, Project, UserRole, ValidatedInput, WorkflowInstanceStatus };
847
+ export type { ActionExecution, ActionHandlerOptions, AuditLogWriter, BankAccountMetadata, BaseEvent, BuildSearchOptions, Command, CommandLogPayload, DevelitWorkerMethods, Environment, GatewayResponse, IRPCResponse, IdempotencyContextVariables, IncludeRelation, InferResultType, InternalError, InternalErrorResponseStatus, Project, UserContextVariables, UserRole, ValidatedInput, WorkflowInstanceStatus };
@@ -1,99 +1,13 @@
1
- import * as hono_types from 'hono/types';
1
+ import { MiddlewareHandler } from 'hono/types';
2
2
 
3
- declare const idempotency: () => hono_types.MiddlewareHandler<{
4
- Variables: {
5
- idempotency: {
6
- key: string;
7
- };
8
- };
9
- Bindings: {
10
- IDEMPOTENCY_KV: KVNamespace;
11
- };
12
- }, string, {}, Response>;
3
+ declare const idempotency: () => MiddlewareHandler;
13
4
 
14
- type AuthService = {
15
- verifyAccessToken: (params: {
16
- accessToken: string;
17
- }) => Promise<{
18
- data?: {
19
- payload: {
20
- user: {
21
- email: string;
22
- role: string;
23
- rawUserMetaData: string | null;
24
- };
25
- };
26
- };
27
- error?: unknown;
28
- }>;
29
- };
30
- declare const jwt: () => hono_types.MiddlewareHandler<{
31
- Variables: {
32
- user: {
33
- email: string;
34
- role: string;
35
- organizationId: string;
36
- };
37
- };
38
- Bindings: {
39
- AUTH_SERVICE: AuthService;
40
- };
41
- }, string, {}, Response>;
5
+ declare const jwt: () => MiddlewareHandler;
42
6
 
43
- type OrganizationService$1 = {
44
- getOrganization: (params: {
45
- organizationId: string;
46
- }) => Promise<{
47
- data: {
48
- id: string;
49
- ipAuthorization: boolean;
50
- authorizedIps: {
51
- ip: string;
52
- }[];
53
- } | null | undefined;
54
- error: boolean;
55
- }>;
56
- };
57
- declare const ip: () => hono_types.MiddlewareHandler<{
58
- Variables: {
59
- user: {
60
- organizationId: string;
61
- };
62
- };
63
- Bindings: {
64
- ENVIRONMENT: string;
65
- ORGANIZATION_SERVICE: OrganizationService$1;
66
- };
67
- }, string, {}, Response>;
7
+ declare const ip: () => MiddlewareHandler;
68
8
 
69
- declare const logger: () => hono_types.MiddlewareHandler<any, string, {}, Response>;
9
+ declare const logger: () => MiddlewareHandler;
70
10
 
71
- type OrganizationService = {
72
- getOrganization: (params: {
73
- organizationId: string;
74
- }) => Promise<{
75
- data: {
76
- id: string;
77
- signatureKeys: {
78
- name: string;
79
- publicKey: string;
80
- }[];
81
- } | null | undefined;
82
- error: boolean;
83
- }>;
84
- };
85
- declare const signature: () => hono_types.MiddlewareHandler<{
86
- Variables: {
87
- user: {
88
- email: string;
89
- role: string;
90
- organizationId: string;
91
- };
92
- };
93
- Bindings: {
94
- ENVIRONMENT: string;
95
- ORGANIZATION_SERVICE: OrganizationService;
96
- };
97
- }, string, {}, Response>;
11
+ declare const signature: () => MiddlewareHandler;
98
12
 
99
13
  export { idempotency, ip, jwt, logger, signature };
@@ -1,99 +1,13 @@
1
- import * as hono_types from 'hono/types';
1
+ import { MiddlewareHandler } from 'hono/types';
2
2
 
3
- declare const idempotency: () => hono_types.MiddlewareHandler<{
4
- Variables: {
5
- idempotency: {
6
- key: string;
7
- };
8
- };
9
- Bindings: {
10
- IDEMPOTENCY_KV: KVNamespace;
11
- };
12
- }, string, {}, Response>;
3
+ declare const idempotency: () => MiddlewareHandler;
13
4
 
14
- type AuthService = {
15
- verifyAccessToken: (params: {
16
- accessToken: string;
17
- }) => Promise<{
18
- data?: {
19
- payload: {
20
- user: {
21
- email: string;
22
- role: string;
23
- rawUserMetaData: string | null;
24
- };
25
- };
26
- };
27
- error?: unknown;
28
- }>;
29
- };
30
- declare const jwt: () => hono_types.MiddlewareHandler<{
31
- Variables: {
32
- user: {
33
- email: string;
34
- role: string;
35
- organizationId: string;
36
- };
37
- };
38
- Bindings: {
39
- AUTH_SERVICE: AuthService;
40
- };
41
- }, string, {}, Response>;
5
+ declare const jwt: () => MiddlewareHandler;
42
6
 
43
- type OrganizationService$1 = {
44
- getOrganization: (params: {
45
- organizationId: string;
46
- }) => Promise<{
47
- data: {
48
- id: string;
49
- ipAuthorization: boolean;
50
- authorizedIps: {
51
- ip: string;
52
- }[];
53
- } | null | undefined;
54
- error: boolean;
55
- }>;
56
- };
57
- declare const ip: () => hono_types.MiddlewareHandler<{
58
- Variables: {
59
- user: {
60
- organizationId: string;
61
- };
62
- };
63
- Bindings: {
64
- ENVIRONMENT: string;
65
- ORGANIZATION_SERVICE: OrganizationService$1;
66
- };
67
- }, string, {}, Response>;
7
+ declare const ip: () => MiddlewareHandler;
68
8
 
69
- declare const logger: () => hono_types.MiddlewareHandler<any, string, {}, Response>;
9
+ declare const logger: () => MiddlewareHandler;
70
10
 
71
- type OrganizationService = {
72
- getOrganization: (params: {
73
- organizationId: string;
74
- }) => Promise<{
75
- data: {
76
- id: string;
77
- signatureKeys: {
78
- name: string;
79
- publicKey: string;
80
- }[];
81
- } | null | undefined;
82
- error: boolean;
83
- }>;
84
- };
85
- declare const signature: () => hono_types.MiddlewareHandler<{
86
- Variables: {
87
- user: {
88
- email: string;
89
- role: string;
90
- organizationId: string;
91
- };
92
- };
93
- Bindings: {
94
- ENVIRONMENT: string;
95
- ORGANIZATION_SERVICE: OrganizationService;
96
- };
97
- }, string, {}, Response>;
11
+ declare const signature: () => MiddlewareHandler;
98
12
 
99
13
  export { idempotency, ip, jwt, logger, signature };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-io/backend-sdk",
3
- "version": "9.0.1",
3
+ "version": "9.0.3",
4
4
  "description": "Develit Backend SDK",
5
5
  "author": "Develit.io",
6
6
  "license": "ISC",