@channel.io/app-sdk-server 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/dist/__tests__/decorators.test.d.ts +2 -0
- package/dist/__tests__/decorators.test.d.ts.map +1 -0
- package/dist/__tests__/decorators.test.js +259 -0
- package/dist/__tests__/decorators.test.js.map +1 -0
- package/dist/__tests__/testing-utils.test.d.ts +2 -0
- package/dist/__tests__/testing-utils.test.d.ts.map +1 -0
- package/dist/__tests__/testing-utils.test.js +118 -0
- package/dist/__tests__/testing-utils.test.js.map +1 -0
- package/dist/appstore/client.d.ts +70 -0
- package/dist/appstore/client.d.ts.map +1 -0
- package/dist/appstore/client.js +141 -0
- package/dist/appstore/client.js.map +1 -0
- package/dist/appstore/index.d.ts +3 -0
- package/dist/appstore/index.d.ts.map +1 -0
- package/dist/appstore/index.js +3 -0
- package/dist/appstore/index.js.map +1 -0
- package/dist/appstore/types.d.ts +87 -0
- package/dist/appstore/types.d.ts.map +1 -0
- package/dist/appstore/types.js +5 -0
- package/dist/appstore/types.js.map +1 -0
- package/dist/decorators/extension.decorator.d.ts +33 -0
- package/dist/decorators/extension.decorator.d.ts.map +1 -0
- package/dist/decorators/extension.decorator.js +36 -0
- package/dist/decorators/extension.decorator.js.map +1 -0
- package/dist/decorators/function.decorator.d.ts +34 -0
- package/dist/decorators/function.decorator.d.ts.map +1 -0
- package/dist/decorators/function.decorator.js +45 -0
- package/dist/decorators/function.decorator.js.map +1 -0
- package/dist/decorators/index.d.ts +5 -0
- package/dist/decorators/index.d.ts.map +1 -0
- package/dist/decorators/index.js +9 -0
- package/dist/decorators/index.js.map +1 -0
- package/dist/decorators/param.decorator.d.ts +49 -0
- package/dist/decorators/param.decorator.d.ts.map +1 -0
- package/dist/decorators/param.decorator.js +62 -0
- package/dist/decorators/param.decorator.js.map +1 -0
- package/dist/decorators/schema.decorator.d.ts +48 -0
- package/dist/decorators/schema.decorator.d.ts.map +1 -0
- package/dist/decorators/schema.decorator.js +59 -0
- package/dist/decorators/schema.decorator.js.map +1 -0
- package/dist/discovery/extension-discovery.service.d.ts +45 -0
- package/dist/discovery/extension-discovery.service.d.ts.map +1 -0
- package/dist/discovery/extension-discovery.service.js +192 -0
- package/dist/discovery/extension-discovery.service.js.map +1 -0
- package/dist/discovery/index.d.ts +3 -0
- package/dist/discovery/index.d.ts.map +1 -0
- package/dist/discovery/index.js +2 -0
- package/dist/discovery/index.js.map +1 -0
- package/dist/discovery/metadata.interface.d.ts +42 -0
- package/dist/discovery/metadata.interface.d.ts.map +1 -0
- package/dist/discovery/metadata.interface.js +2 -0
- package/dist/discovery/metadata.interface.js.map +1 -0
- package/dist/guards/index.d.ts +3 -0
- package/dist/guards/index.d.ts.map +1 -0
- package/dist/guards/index.js +3 -0
- package/dist/guards/index.js.map +1 -0
- package/dist/guards/signature.guard.d.ts +65 -0
- package/dist/guards/signature.guard.d.ts.map +1 -0
- package/dist/guards/signature.guard.js +156 -0
- package/dist/guards/signature.guard.js.map +1 -0
- package/dist/guards/signature.middleware.d.ts +76 -0
- package/dist/guards/signature.middleware.d.ts.map +1 -0
- package/dist/guards/signature.middleware.js +110 -0
- package/dist/guards/signature.middleware.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/native/client.d.ts +105 -0
- package/dist/native/client.d.ts.map +1 -0
- package/dist/native/client.js +210 -0
- package/dist/native/client.js.map +1 -0
- package/dist/native/index.d.ts +3 -0
- package/dist/native/index.d.ts.map +1 -0
- package/dist/native/index.js +3 -0
- package/dist/native/index.js.map +1 -0
- package/dist/native/types.d.ts +198 -0
- package/dist/native/types.d.ts.map +1 -0
- package/dist/native/types.js +8 -0
- package/dist/native/types.js.map +1 -0
- package/dist/nestjs/channel-app.controller.d.ts +22 -0
- package/dist/nestjs/channel-app.controller.d.ts.map +1 -0
- package/dist/nestjs/channel-app.controller.js +87 -0
- package/dist/nestjs/channel-app.controller.js.map +1 -0
- package/dist/nestjs/channel-app.module.d.ts +47 -0
- package/dist/nestjs/channel-app.module.d.ts.map +1 -0
- package/dist/nestjs/channel-app.module.js +93 -0
- package/dist/nestjs/channel-app.module.js.map +1 -0
- package/dist/nestjs/channel-app.service.d.ts +44 -0
- package/dist/nestjs/channel-app.service.d.ts.map +1 -0
- package/dist/nestjs/channel-app.service.js +190 -0
- package/dist/nestjs/channel-app.service.js.map +1 -0
- package/dist/nestjs/index.d.ts +5 -0
- package/dist/nestjs/index.d.ts.map +1 -0
- package/dist/nestjs/index.js +5 -0
- package/dist/nestjs/index.js.map +1 -0
- package/dist/nestjs/types.d.ts +70 -0
- package/dist/nestjs/types.d.ts.map +1 -0
- package/dist/nestjs/types.js +5 -0
- package/dist/nestjs/types.js.map +1 -0
- package/dist/simple/channel-app.d.ts +80 -0
- package/dist/simple/channel-app.d.ts.map +1 -0
- package/dist/simple/channel-app.js +253 -0
- package/dist/simple/channel-app.js.map +1 -0
- package/dist/simple/index.d.ts +2 -0
- package/dist/simple/index.d.ts.map +1 -0
- package/dist/simple/index.js +2 -0
- package/dist/simple/index.js.map +1 -0
- package/dist/testing/index.d.ts +9 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +9 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/mock-context.d.ts +32 -0
- package/dist/testing/mock-context.d.ts.map +1 -0
- package/dist/testing/mock-context.js +33 -0
- package/dist/testing/mock-context.js.map +1 -0
- package/dist/testing/test-extension.d.ts +60 -0
- package/dist/testing/test-extension.d.ts.map +1 -0
- package/dist/testing/test-extension.js +113 -0
- package/dist/testing/test-extension.js.map +1 -0
- package/dist/token/cache.d.ts +31 -0
- package/dist/token/cache.d.ts.map +1 -0
- package/dist/token/cache.js +69 -0
- package/dist/token/cache.js.map +1 -0
- package/dist/token/index.d.ts +4 -0
- package/dist/token/index.d.ts.map +1 -0
- package/dist/token/index.js +4 -0
- package/dist/token/index.js.map +1 -0
- package/dist/token/manager.d.ts +111 -0
- package/dist/token/manager.d.ts.map +1 -0
- package/dist/token/manager.js +246 -0
- package/dist/token/manager.js.map +1 -0
- package/dist/token/types.d.ts +85 -0
- package/dist/token/types.d.ts.map +1 -0
- package/dist/token/types.js +5 -0
- package/dist/token/types.js.map +1 -0
- package/package.json +69 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native Function types for ch-app-store
|
|
3
|
+
*
|
|
4
|
+
* This module contains types for PUBLIC native functions only.
|
|
5
|
+
* Public functions don't require special RBAC claims.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Native function client configuration
|
|
9
|
+
*/
|
|
10
|
+
export interface NativeFunctionClientConfig {
|
|
11
|
+
/** App ID */
|
|
12
|
+
appId: string;
|
|
13
|
+
/** App secret */
|
|
14
|
+
appSecret: string;
|
|
15
|
+
/** AppStore API base URL (default: https://app-store.channel.io) */
|
|
16
|
+
appStoreUrl?: string | undefined;
|
|
17
|
+
/** Enable debug logging */
|
|
18
|
+
debug?: boolean | undefined;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Function call context
|
|
22
|
+
*/
|
|
23
|
+
export interface FunctionContext {
|
|
24
|
+
/** Channel information */
|
|
25
|
+
channel: {
|
|
26
|
+
id: string;
|
|
27
|
+
};
|
|
28
|
+
/** Caller information */
|
|
29
|
+
caller: {
|
|
30
|
+
type: "user" | "manager" | "system";
|
|
31
|
+
id: string;
|
|
32
|
+
};
|
|
33
|
+
/** OAuth token (optional) */
|
|
34
|
+
authToken?: string;
|
|
35
|
+
/** API credentials (optional) */
|
|
36
|
+
apiCredentials?: Record<string, string>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Native function request
|
|
40
|
+
*/
|
|
41
|
+
export interface NativeFunctionRequest<TParams = unknown> {
|
|
42
|
+
method: string;
|
|
43
|
+
params?: TParams;
|
|
44
|
+
context?: FunctionContext;
|
|
45
|
+
systemVersion?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Native function response
|
|
49
|
+
*/
|
|
50
|
+
export interface NativeFunctionResponse<TResult = unknown> {
|
|
51
|
+
result?: TResult;
|
|
52
|
+
error?: NativeFunctionErrorResponse;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Native function error response structure
|
|
56
|
+
*/
|
|
57
|
+
export interface NativeFunctionErrorResponse {
|
|
58
|
+
code: number;
|
|
59
|
+
message: string;
|
|
60
|
+
data?: unknown;
|
|
61
|
+
type?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Issue token params
|
|
65
|
+
*/
|
|
66
|
+
export interface IssueTokenParams {
|
|
67
|
+
secret: string;
|
|
68
|
+
channelId?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Issue token result
|
|
72
|
+
*/
|
|
73
|
+
export interface IssueTokenResult {
|
|
74
|
+
accessToken: string;
|
|
75
|
+
refreshToken: string;
|
|
76
|
+
expiresIn: number;
|
|
77
|
+
expiresAt?: number;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Refresh token params
|
|
81
|
+
*/
|
|
82
|
+
export interface RefreshTokenParams {
|
|
83
|
+
refreshToken: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Command scope
|
|
87
|
+
*/
|
|
88
|
+
export type CommandScope = "front" | "desk";
|
|
89
|
+
/**
|
|
90
|
+
* ALF mode for commands
|
|
91
|
+
*/
|
|
92
|
+
export type AlfMode = "disable" | "recommend";
|
|
93
|
+
/**
|
|
94
|
+
* Parameter type for commands
|
|
95
|
+
*/
|
|
96
|
+
export type ParamType = "string" | "float" | "int" | "bool";
|
|
97
|
+
/**
|
|
98
|
+
* Internationalization for command name
|
|
99
|
+
*/
|
|
100
|
+
export interface CommandNameI18n {
|
|
101
|
+
name: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Internationalization for command name and description
|
|
105
|
+
*/
|
|
106
|
+
export interface CommandNameDescI18n {
|
|
107
|
+
/** Name (max 30 chars, no spaces) */
|
|
108
|
+
name: string;
|
|
109
|
+
/** Description (max 100 chars) */
|
|
110
|
+
description: string;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Parameter definition internationalization
|
|
114
|
+
*/
|
|
115
|
+
export interface CommandParamDefI18n {
|
|
116
|
+
/** Name (max 20 chars, no spaces) */
|
|
117
|
+
name: string;
|
|
118
|
+
/** Description (max 50 chars) */
|
|
119
|
+
description: string;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Choice option for command parameters
|
|
123
|
+
*/
|
|
124
|
+
export interface CommandChoice {
|
|
125
|
+
/** Display name */
|
|
126
|
+
name: string;
|
|
127
|
+
/** Value */
|
|
128
|
+
value: string | number | boolean;
|
|
129
|
+
/** Internationalization map */
|
|
130
|
+
nameDescI18nMap?: Record<string, CommandNameDescI18n>;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Command parameter definition
|
|
134
|
+
*/
|
|
135
|
+
export interface CommandParamDefinition {
|
|
136
|
+
/** Parameter name (alphanumeric, underscore, hyphen only, max 20 chars) */
|
|
137
|
+
name: string;
|
|
138
|
+
/** Parameter type */
|
|
139
|
+
type: ParamType;
|
|
140
|
+
/** Whether required */
|
|
141
|
+
required: boolean;
|
|
142
|
+
/** Description (max 50 chars) */
|
|
143
|
+
description?: string;
|
|
144
|
+
/** Predefined choices (max 10) */
|
|
145
|
+
choices?: CommandChoice[];
|
|
146
|
+
/** Internationalization map */
|
|
147
|
+
nameDescI18nMap?: Record<string, CommandParamDefI18n>;
|
|
148
|
+
/** Enable auto-complete */
|
|
149
|
+
autoComplete?: boolean;
|
|
150
|
+
/** ALF description (max 1500 chars) */
|
|
151
|
+
alfDescription?: string;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Command definition
|
|
155
|
+
*/
|
|
156
|
+
export interface CommandDTO {
|
|
157
|
+
/** Command name (alphanumeric, underscore, hyphen only, 1-30 chars) */
|
|
158
|
+
name: string;
|
|
159
|
+
/** Command scope */
|
|
160
|
+
scope: CommandScope;
|
|
161
|
+
/** Button display name */
|
|
162
|
+
buttonName?: string;
|
|
163
|
+
/** Button name internationalization */
|
|
164
|
+
buttonNameI18nMap?: Record<string, CommandNameI18n>;
|
|
165
|
+
/** Description (max 100 chars) */
|
|
166
|
+
description?: string;
|
|
167
|
+
/** Name and description internationalization */
|
|
168
|
+
nameDescI18nMap?: Record<string, CommandNameDescI18n>;
|
|
169
|
+
/** Function to call when command is executed */
|
|
170
|
+
actionFunctionName: string;
|
|
171
|
+
/** Function for auto-complete suggestions */
|
|
172
|
+
autoCompleteFunctionName?: string;
|
|
173
|
+
/** ALF mode */
|
|
174
|
+
alfMode: AlfMode;
|
|
175
|
+
/** ALF description (max 1500 chars) */
|
|
176
|
+
alfDescription?: string;
|
|
177
|
+
/** Parameter definitions (max 10) */
|
|
178
|
+
paramDefinitions?: CommandParamDefinition[];
|
|
179
|
+
/** Whether enabled by default */
|
|
180
|
+
enabledByDefault?: boolean;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Register commands params
|
|
184
|
+
*/
|
|
185
|
+
export interface RegisterCommandsParams {
|
|
186
|
+
/** App ID */
|
|
187
|
+
appId: string;
|
|
188
|
+
/** Commands to register (max 30) */
|
|
189
|
+
commands: CommandDTO[];
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Register commands result
|
|
193
|
+
*/
|
|
194
|
+
export interface RegisterCommandsResult {
|
|
195
|
+
/** Whether registration succeeded */
|
|
196
|
+
success: boolean;
|
|
197
|
+
}
|
|
198
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/native/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW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+1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/native/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type FunctionCallRequest } from "@channel.io/app-sdk-core";
|
|
2
|
+
import { ChannelAppService } from "./channel-app.service.js";
|
|
3
|
+
export declare class ChannelAppController {
|
|
4
|
+
private readonly channelAppService;
|
|
5
|
+
private readonly logger;
|
|
6
|
+
constructor(channelAppService: ChannelAppService);
|
|
7
|
+
/**
|
|
8
|
+
* Versioned endpoint: PUT /functions/:version
|
|
9
|
+
* ch-app-store calls this endpoint with systemVersion (e.g., /functions/v1)
|
|
10
|
+
*/
|
|
11
|
+
handleVersionedFunctions(version: string, body: FunctionCallRequest): Promise<import("@channel.io/app-sdk-core").FunctionCallResponse<unknown>>;
|
|
12
|
+
/**
|
|
13
|
+
* Legacy endpoint: POST /functions
|
|
14
|
+
* For backward compatibility
|
|
15
|
+
*/
|
|
16
|
+
handleFunctions(body: FunctionCallRequest): Promise<import("@channel.io/app-sdk-core").FunctionCallResponse<unknown>>;
|
|
17
|
+
/**
|
|
18
|
+
* Common request handler
|
|
19
|
+
*/
|
|
20
|
+
private handleRequest;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=channel-app.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-app.controller.d.ts","sourceRoot":"","sources":["../../src/nestjs/channel-app.controller.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,mBAAmB,EAGzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,qBACa,oBAAoB;IAGnB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAF9C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyC;gBAEnC,iBAAiB,EAAE,iBAAiB;IAEjE;;;OAGG;IAEG,wBAAwB,CACV,OAAO,EAAE,MAAM,EACzB,IAAI,EAAE,mBAAmB;IAKnC;;;OAGG;IAEG,eAAe,CAAS,IAAI,EAAE,mBAAmB;IAIvD;;OAEG;YACW,aAAa;CAqC5B"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
var ChannelAppController_1;
|
|
14
|
+
import { Controller, Post, Put, Body, Param, HttpException, HttpStatus, Logger, } from "@nestjs/common";
|
|
15
|
+
import { FunctionNotFoundError, ValidationError, } from "@channel.io/app-sdk-core";
|
|
16
|
+
import { ChannelAppService } from "./channel-app.service.js";
|
|
17
|
+
let ChannelAppController = ChannelAppController_1 = class ChannelAppController {
|
|
18
|
+
channelAppService;
|
|
19
|
+
logger = new Logger(ChannelAppController_1.name);
|
|
20
|
+
constructor(channelAppService) {
|
|
21
|
+
this.channelAppService = channelAppService;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Versioned endpoint: PUT /functions/:version
|
|
25
|
+
* ch-app-store calls this endpoint with systemVersion (e.g., /functions/v1)
|
|
26
|
+
*/
|
|
27
|
+
async handleVersionedFunctions(version, body) {
|
|
28
|
+
return this.handleRequest(body, version);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Legacy endpoint: POST /functions
|
|
32
|
+
* For backward compatibility
|
|
33
|
+
*/
|
|
34
|
+
async handleFunctions(body) {
|
|
35
|
+
return this.handleRequest(body);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Common request handler
|
|
39
|
+
*/
|
|
40
|
+
async handleRequest(body, version) {
|
|
41
|
+
try {
|
|
42
|
+
return await this.channelAppService.handleFunctionCall(body, version);
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
this.logger.error(`Error handling function call: ${body.method}`, error);
|
|
46
|
+
if (error instanceof FunctionNotFoundError) {
|
|
47
|
+
throw new HttpException({
|
|
48
|
+
error: "FUNCTION_NOT_FOUND",
|
|
49
|
+
message: error.message,
|
|
50
|
+
}, HttpStatus.NOT_FOUND);
|
|
51
|
+
}
|
|
52
|
+
if (error instanceof ValidationError) {
|
|
53
|
+
throw new HttpException({
|
|
54
|
+
error: "VALIDATION_ERROR",
|
|
55
|
+
message: error.message,
|
|
56
|
+
details: error.details,
|
|
57
|
+
}, HttpStatus.BAD_REQUEST);
|
|
58
|
+
}
|
|
59
|
+
// Re-throw unexpected errors
|
|
60
|
+
throw new HttpException({
|
|
61
|
+
error: "INTERNAL_ERROR",
|
|
62
|
+
message: error instanceof Error ? error.message : "Unknown error",
|
|
63
|
+
}, HttpStatus.INTERNAL_SERVER_ERROR);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
__decorate([
|
|
68
|
+
Put(":version"),
|
|
69
|
+
__param(0, Param("version")),
|
|
70
|
+
__param(1, Body()),
|
|
71
|
+
__metadata("design:type", Function),
|
|
72
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
73
|
+
__metadata("design:returntype", Promise)
|
|
74
|
+
], ChannelAppController.prototype, "handleVersionedFunctions", null);
|
|
75
|
+
__decorate([
|
|
76
|
+
Post(),
|
|
77
|
+
__param(0, Body()),
|
|
78
|
+
__metadata("design:type", Function),
|
|
79
|
+
__metadata("design:paramtypes", [Object]),
|
|
80
|
+
__metadata("design:returntype", Promise)
|
|
81
|
+
], ChannelAppController.prototype, "handleFunctions", null);
|
|
82
|
+
ChannelAppController = ChannelAppController_1 = __decorate([
|
|
83
|
+
Controller("functions"),
|
|
84
|
+
__metadata("design:paramtypes", [ChannelAppService])
|
|
85
|
+
], ChannelAppController);
|
|
86
|
+
export { ChannelAppController };
|
|
87
|
+
//# sourceMappingURL=channel-app.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-app.controller.js","sourceRoot":"","sources":["../../src/nestjs/channel-app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EACL,UAAU,EACV,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,KAAK,EACL,aAAa,EACb,UAAU,EACV,MAAM,GACP,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,qBAAqB,EACrB,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGtD,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAGF;IAFZ,MAAM,GAAG,IAAI,MAAM,CAAC,sBAAoB,CAAC,IAAI,CAAC,CAAC;IAEhE,YAA6B,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAAG,CAAC;IAErE;;;OAGG;IAEG,AAAN,KAAK,CAAC,wBAAwB,CACV,OAAe,EACzB,IAAyB;QAEjC,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED;;;OAGG;IAEG,AAAN,KAAK,CAAC,eAAe,CAAS,IAAyB;QACrD,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;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BAAoB,CAkEhC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type DynamicModule } from "@nestjs/common";
|
|
2
|
+
import { type ChannelAppModuleOptions, type ChannelAppModuleAsyncOptions } from "./types.js";
|
|
3
|
+
export declare class ChannelAppModule {
|
|
4
|
+
/**
|
|
5
|
+
* Register the module with static options
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Using decorator-based extensions (recommended)
|
|
10
|
+
* @Module({
|
|
11
|
+
* imports: [
|
|
12
|
+
* ChannelAppModule.forRoot({
|
|
13
|
+
* appId: process.env.APP_ID,
|
|
14
|
+
* appSecret: process.env.APP_SECRET,
|
|
15
|
+
* }),
|
|
16
|
+
* ],
|
|
17
|
+
* providers: [CalendarExtension], // Your @Extension decorated classes
|
|
18
|
+
* })
|
|
19
|
+
* export class AppModule {}
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
static forRoot(options: ChannelAppModuleOptions): DynamicModule;
|
|
23
|
+
/**
|
|
24
|
+
* Register the module with async options (for dependency injection)
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* @Module({
|
|
29
|
+
* imports: [
|
|
30
|
+
* ConfigModule,
|
|
31
|
+
* ChannelAppModule.forRootAsync({
|
|
32
|
+
* imports: [ConfigModule],
|
|
33
|
+
* inject: [ConfigService],
|
|
34
|
+
* useFactory: (config: ConfigService) => ({
|
|
35
|
+
* appId: config.get('APP_ID'),
|
|
36
|
+
* appSecret: config.get('APP_SECRET'),
|
|
37
|
+
* }),
|
|
38
|
+
* }),
|
|
39
|
+
* ],
|
|
40
|
+
* providers: [CalendarExtension], // Your @Extension decorated classes
|
|
41
|
+
* })
|
|
42
|
+
* export class AppModule {}
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
static forRootAsync(options: ChannelAppModuleAsyncOptions): DynamicModule;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=channel-app.module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-app.module.d.ts","sourceRoot":"","sources":["../../src/nestjs/channel-app.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAyB,MAAM,gBAAgB,CAAC;AAK3E,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EAElC,MAAM,YAAY,CAAC;AAEpB,qBACa,gBAAgB;IAC3B;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,uBAAuB,GAAG,aAAa;IAkB/D;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,4BAA4B,GAAG,aAAa;CAkB1E"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var ChannelAppModule_1;
|
|
8
|
+
import { Module } from "@nestjs/common";
|
|
9
|
+
import { DiscoveryModule } from "@nestjs/core";
|
|
10
|
+
import { ChannelAppController } from "./channel-app.controller.js";
|
|
11
|
+
import { ChannelAppService } from "./channel-app.service.js";
|
|
12
|
+
import { ExtensionDiscoveryService } from "../discovery/extension-discovery.service.js";
|
|
13
|
+
import { CHANNEL_APP_OPTIONS, } from "./types.js";
|
|
14
|
+
let ChannelAppModule = ChannelAppModule_1 = class ChannelAppModule {
|
|
15
|
+
/**
|
|
16
|
+
* Register the module with static options
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* // Using decorator-based extensions (recommended)
|
|
21
|
+
* @Module({
|
|
22
|
+
* imports: [
|
|
23
|
+
* ChannelAppModule.forRoot({
|
|
24
|
+
* appId: process.env.APP_ID,
|
|
25
|
+
* appSecret: process.env.APP_SECRET,
|
|
26
|
+
* }),
|
|
27
|
+
* ],
|
|
28
|
+
* providers: [CalendarExtension], // Your @Extension decorated classes
|
|
29
|
+
* })
|
|
30
|
+
* export class AppModule {}
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
static forRoot(options) {
|
|
34
|
+
return {
|
|
35
|
+
module: ChannelAppModule_1,
|
|
36
|
+
imports: [DiscoveryModule],
|
|
37
|
+
controllers: [ChannelAppController],
|
|
38
|
+
providers: [
|
|
39
|
+
{
|
|
40
|
+
provide: CHANNEL_APP_OPTIONS,
|
|
41
|
+
useValue: options,
|
|
42
|
+
},
|
|
43
|
+
ExtensionDiscoveryService,
|
|
44
|
+
ChannelAppService,
|
|
45
|
+
],
|
|
46
|
+
exports: [ChannelAppService, ExtensionDiscoveryService],
|
|
47
|
+
global: true,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Register the module with async options (for dependency injection)
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* @Module({
|
|
56
|
+
* imports: [
|
|
57
|
+
* ConfigModule,
|
|
58
|
+
* ChannelAppModule.forRootAsync({
|
|
59
|
+
* imports: [ConfigModule],
|
|
60
|
+
* inject: [ConfigService],
|
|
61
|
+
* useFactory: (config: ConfigService) => ({
|
|
62
|
+
* appId: config.get('APP_ID'),
|
|
63
|
+
* appSecret: config.get('APP_SECRET'),
|
|
64
|
+
* }),
|
|
65
|
+
* }),
|
|
66
|
+
* ],
|
|
67
|
+
* providers: [CalendarExtension], // Your @Extension decorated classes
|
|
68
|
+
* })
|
|
69
|
+
* export class AppModule {}
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
static forRootAsync(options) {
|
|
73
|
+
const asyncProvider = {
|
|
74
|
+
provide: CHANNEL_APP_OPTIONS,
|
|
75
|
+
useFactory: options.useFactory,
|
|
76
|
+
inject: options.inject ?? [],
|
|
77
|
+
};
|
|
78
|
+
const result = {
|
|
79
|
+
module: ChannelAppModule_1,
|
|
80
|
+
imports: [DiscoveryModule, ...(options.imports ?? [])],
|
|
81
|
+
controllers: [ChannelAppController],
|
|
82
|
+
providers: [asyncProvider, ExtensionDiscoveryService, ChannelAppService],
|
|
83
|
+
exports: [ChannelAppService, ExtensionDiscoveryService],
|
|
84
|
+
global: true,
|
|
85
|
+
};
|
|
86
|
+
return result;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
ChannelAppModule = ChannelAppModule_1 = __decorate([
|
|
90
|
+
Module({})
|
|
91
|
+
], ChannelAppModule);
|
|
92
|
+
export { ChannelAppModule };
|
|
93
|
+
//# sourceMappingURL=channel-app.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-app.module.js","sourceRoot":"","sources":["../../src/nestjs/channel-app.module.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAsB,MAAM,EAAiB,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EAGL,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAGb,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAC3B;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,OAAO,CAAC,OAAgC;QAC7C,OAAO;YACL,MAAM,EAAE,kBAAgB;YACxB,OAAO,EAAE,CAAC,eAAe,CAAC;YAC1B,WAAW,EAAE,CAAC,oBAAoB,CAAC;YACnC,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,mBAAmB;oBAC5B,QAAQ,EAAE,OAAO;iBAClB;gBACD,yBAAyB;gBACzB,iBAAiB;aAClB;YACD,OAAO,EAAE,CAAC,iBAAiB,EAAE,yBAAyB,CAAC;YACvD,MAAM,EAAE,IAAI;SACb,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,YAAY,CAAC,OAAqC;QACvD,MAAM,aAAa,GAAa;YAC9B,OAAO,EAAE,mBAAmB;YAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;SAC7B,CAAC;QAEF,MAAM,MAAM,GAAkB;YAC5B,MAAM,EAAE,kBAAgB;YACxB,OAAO,EAAE,CAAC,eAAe,EAAE,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;YACtD,WAAW,EAAE,CAAC,oBAAoB,CAAC;YACnC,SAAS,EAAE,CAAC,aAAa,EAAE,yBAAyB,EAAE,iBAAiB,CAAC;YACxE,OAAO,EAAE,CAAC,iBAAiB,EAAE,yBAAyB,CAAC;YACvD,MAAM,EAAE,IAAI;SACb,CAAC;QAEF,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAA;AA7EY,gBAAgB;IAD5B,MAAM,CAAC,EAAE,CAAC;GACE,gBAAgB,CA6E5B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type OnModuleInit } from "@nestjs/common";
|
|
2
|
+
import { type FunctionCallRequest, type FunctionCallResponse, type GetFunctionsResponse } from "@channel.io/app-sdk-core";
|
|
3
|
+
import { type ChannelAppModuleOptions } from "./types.js";
|
|
4
|
+
import { ExtensionDiscoveryService } from "../discovery/extension-discovery.service.js";
|
|
5
|
+
/**
|
|
6
|
+
* Version mismatch error for when a function call targets the wrong version
|
|
7
|
+
*/
|
|
8
|
+
export declare class VersionMismatchError extends Error {
|
|
9
|
+
readonly requestedVersion: string;
|
|
10
|
+
readonly availableVersions: string[];
|
|
11
|
+
constructor(requestedVersion: string, availableVersions: string[]);
|
|
12
|
+
}
|
|
13
|
+
export declare class ChannelAppService implements OnModuleInit {
|
|
14
|
+
private readonly options;
|
|
15
|
+
private readonly discoveryService?;
|
|
16
|
+
private readonly logger;
|
|
17
|
+
constructor(options: ChannelAppModuleOptions, discoveryService?: ExtensionDiscoveryService | undefined);
|
|
18
|
+
onModuleInit(): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Auto-register all extensions with the AppStore
|
|
21
|
+
*/
|
|
22
|
+
private autoRegisterExtensions;
|
|
23
|
+
/**
|
|
24
|
+
* Get all registered versions
|
|
25
|
+
*/
|
|
26
|
+
getRegisteredVersions(): string[];
|
|
27
|
+
/**
|
|
28
|
+
* Handle incoming function call
|
|
29
|
+
* @param request The function call request
|
|
30
|
+
* @param _version Optional version from URL path (e.g., "v1")
|
|
31
|
+
*/
|
|
32
|
+
handleFunctionCall(request: FunctionCallRequest, _version?: string): Promise<FunctionCallResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Get list of all registered functions
|
|
35
|
+
*/
|
|
36
|
+
getFunctions(): GetFunctionsResponse;
|
|
37
|
+
/**
|
|
38
|
+
* Get app configuration
|
|
39
|
+
*/
|
|
40
|
+
getAppConfig(): {
|
|
41
|
+
appId: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=channel-app.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-app.service.d.ts","sourceRoot":"","sources":["../../src/nestjs/channel-app.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAoB,MAAM,gBAAgB,CAAC;AACzF,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAEzB,KAAK,oBAAoB,EAE1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEL,KAAK,uBAAuB,EAE7B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAExF;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;aAE3B,gBAAgB,EAAE,MAAM;aACxB,iBAAiB,EAAE,MAAM,EAAE;gBAD3B,gBAAgB,EAAE,MAAM,EACxB,iBAAiB,EAAE,MAAM,EAAE;CAO9C;AAED,qBACa,iBAAkB,YAAW,YAAY;IAKlD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAExB,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IANpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsC;gBAI1C,OAAO,EAAE,uBAAuB,EAEhC,gBAAgB,CAAC,EAAE,yBAAyB,YAAA;IAGzD,YAAY;IAwBlB;;OAEG;YACW,sBAAsB;IAwDpC;;OAEG;IACH,qBAAqB,IAAI,MAAM,EAAE;IAWjC;;;;OAIG;IACG,kBAAkB,CACtB,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,oBAAoB,CAAC;IAyBhC;;OAEG;IACH,YAAY,IAAI,oBAAoB;IA6BpC;;OAEG;IACH,YAAY;;;CAKb"}
|