@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 @@
|
|
|
1
|
+
{"version":3,"file":"decorators.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/decorators.test.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,259 @@
|
|
|
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
|
+
import { describe, it, expect } from "vitest";
|
|
14
|
+
import "reflect-metadata";
|
|
15
|
+
import { z } from "zod";
|
|
16
|
+
import { Extension, EXTENSION_METADATA, Func, FUNCTION_METADATA, FUNCTIONS_METADATA, Ctx, Input, Body, PARAM_METADATA, FunctionParamType, InputSchema, OutputSchema, Description, INPUT_SCHEMA_METADATA, OUTPUT_SCHEMA_METADATA, DESCRIPTION_METADATA, } from "../decorators/index.js";
|
|
17
|
+
describe("Decorators", () => {
|
|
18
|
+
describe("@Extension", () => {
|
|
19
|
+
it("should set metadata with string name", () => {
|
|
20
|
+
let TestExtension = class TestExtension {
|
|
21
|
+
};
|
|
22
|
+
TestExtension = __decorate([
|
|
23
|
+
Extension("test-extension")
|
|
24
|
+
], TestExtension);
|
|
25
|
+
const metadata = Reflect.getMetadata(EXTENSION_METADATA, TestExtension);
|
|
26
|
+
expect(metadata).toEqual({
|
|
27
|
+
name: "test-extension",
|
|
28
|
+
systemVersion: "v1",
|
|
29
|
+
exclusive: false,
|
|
30
|
+
description: undefined,
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
it("should set metadata with options object", () => {
|
|
34
|
+
let AdvancedExtension = class AdvancedExtension {
|
|
35
|
+
};
|
|
36
|
+
AdvancedExtension = __decorate([
|
|
37
|
+
Extension({
|
|
38
|
+
name: "advanced-extension",
|
|
39
|
+
systemVersion: "v2",
|
|
40
|
+
exclusive: true,
|
|
41
|
+
description: "Test description",
|
|
42
|
+
})
|
|
43
|
+
], AdvancedExtension);
|
|
44
|
+
const metadata = Reflect.getMetadata(EXTENSION_METADATA, AdvancedExtension);
|
|
45
|
+
expect(metadata).toEqual({
|
|
46
|
+
name: "advanced-extension",
|
|
47
|
+
systemVersion: "v2",
|
|
48
|
+
exclusive: true,
|
|
49
|
+
description: "Test description",
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
describe("@Func", () => {
|
|
54
|
+
it("should set function metadata with method name as default", () => {
|
|
55
|
+
class TestClass {
|
|
56
|
+
testMethod() { }
|
|
57
|
+
}
|
|
58
|
+
__decorate([
|
|
59
|
+
Func(),
|
|
60
|
+
__metadata("design:type", Function),
|
|
61
|
+
__metadata("design:paramtypes", []),
|
|
62
|
+
__metadata("design:returntype", void 0)
|
|
63
|
+
], TestClass.prototype, "testMethod", null);
|
|
64
|
+
const metadata = Reflect.getMetadata(FUNCTION_METADATA, TestClass, "testMethod");
|
|
65
|
+
expect(metadata).toMatchObject({
|
|
66
|
+
name: "testMethod",
|
|
67
|
+
methodName: "testMethod",
|
|
68
|
+
});
|
|
69
|
+
const functions = Reflect.getMetadata(FUNCTIONS_METADATA, TestClass);
|
|
70
|
+
expect(functions).toContain("testMethod");
|
|
71
|
+
});
|
|
72
|
+
it("should set function metadata with custom name", () => {
|
|
73
|
+
class TestClass {
|
|
74
|
+
myMethod() { }
|
|
75
|
+
}
|
|
76
|
+
__decorate([
|
|
77
|
+
Func("custom.functionName"),
|
|
78
|
+
__metadata("design:type", Function),
|
|
79
|
+
__metadata("design:paramtypes", []),
|
|
80
|
+
__metadata("design:returntype", void 0)
|
|
81
|
+
], TestClass.prototype, "myMethod", null);
|
|
82
|
+
const metadata = Reflect.getMetadata(FUNCTION_METADATA, TestClass, "myMethod");
|
|
83
|
+
expect(metadata).toMatchObject({
|
|
84
|
+
name: "custom.functionName",
|
|
85
|
+
methodName: "myMethod",
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
it("should set function metadata with options", () => {
|
|
89
|
+
class TestClass {
|
|
90
|
+
anotherMethod() { }
|
|
91
|
+
}
|
|
92
|
+
__decorate([
|
|
93
|
+
Func({ name: "options.function", description: "Test function" }),
|
|
94
|
+
__metadata("design:type", Function),
|
|
95
|
+
__metadata("design:paramtypes", []),
|
|
96
|
+
__metadata("design:returntype", void 0)
|
|
97
|
+
], TestClass.prototype, "anotherMethod", null);
|
|
98
|
+
const metadata = Reflect.getMetadata(FUNCTION_METADATA, TestClass, "anotherMethod");
|
|
99
|
+
expect(metadata).toMatchObject({
|
|
100
|
+
name: "options.function",
|
|
101
|
+
methodName: "anotherMethod",
|
|
102
|
+
description: "Test function",
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
describe("Parameter Decorators", () => {
|
|
107
|
+
it("@Ctx should set parameter metadata", () => {
|
|
108
|
+
class TestClass {
|
|
109
|
+
testMethod(_ctx) { }
|
|
110
|
+
}
|
|
111
|
+
__decorate([
|
|
112
|
+
__param(0, Ctx()),
|
|
113
|
+
__metadata("design:type", Function),
|
|
114
|
+
__metadata("design:paramtypes", [Object]),
|
|
115
|
+
__metadata("design:returntype", void 0)
|
|
116
|
+
], TestClass.prototype, "testMethod", null);
|
|
117
|
+
const params = Reflect.getMetadata(PARAM_METADATA, TestClass, "testMethod");
|
|
118
|
+
expect(params).toContainEqual({
|
|
119
|
+
index: 0,
|
|
120
|
+
type: FunctionParamType.CTX,
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
it("@Input should set parameter metadata", () => {
|
|
124
|
+
class TestClass {
|
|
125
|
+
testMethod(_input) { }
|
|
126
|
+
}
|
|
127
|
+
__decorate([
|
|
128
|
+
__param(0, Input()),
|
|
129
|
+
__metadata("design:type", Function),
|
|
130
|
+
__metadata("design:paramtypes", [Object]),
|
|
131
|
+
__metadata("design:returntype", void 0)
|
|
132
|
+
], TestClass.prototype, "testMethod", null);
|
|
133
|
+
const params = Reflect.getMetadata(PARAM_METADATA, TestClass, "testMethod");
|
|
134
|
+
expect(params).toContainEqual({
|
|
135
|
+
index: 0,
|
|
136
|
+
type: FunctionParamType.INPUT,
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
it("@Body should set parameter metadata", () => {
|
|
140
|
+
class TestClass {
|
|
141
|
+
testMethod(_body) { }
|
|
142
|
+
}
|
|
143
|
+
__decorate([
|
|
144
|
+
__param(0, Body()),
|
|
145
|
+
__metadata("design:type", Function),
|
|
146
|
+
__metadata("design:paramtypes", [Object]),
|
|
147
|
+
__metadata("design:returntype", void 0)
|
|
148
|
+
], TestClass.prototype, "testMethod", null);
|
|
149
|
+
const params = Reflect.getMetadata(PARAM_METADATA, TestClass, "testMethod");
|
|
150
|
+
expect(params).toContainEqual({
|
|
151
|
+
index: 0,
|
|
152
|
+
type: FunctionParamType.BODY,
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
it("should handle multiple parameter decorators", () => {
|
|
156
|
+
class TestClass {
|
|
157
|
+
testMethod(_ctx, _input) { }
|
|
158
|
+
}
|
|
159
|
+
__decorate([
|
|
160
|
+
__param(0, Ctx()),
|
|
161
|
+
__param(1, Input()),
|
|
162
|
+
__metadata("design:type", Function),
|
|
163
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
164
|
+
__metadata("design:returntype", void 0)
|
|
165
|
+
], TestClass.prototype, "testMethod", null);
|
|
166
|
+
const params = Reflect.getMetadata(PARAM_METADATA, TestClass, "testMethod");
|
|
167
|
+
expect(params).toHaveLength(2);
|
|
168
|
+
expect(params).toContainEqual({ index: 0, type: FunctionParamType.CTX });
|
|
169
|
+
expect(params).toContainEqual({ index: 1, type: FunctionParamType.INPUT });
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
describe("Schema Decorators", () => {
|
|
173
|
+
const testInputSchema = z.object({
|
|
174
|
+
name: z.string(),
|
|
175
|
+
age: z.number(),
|
|
176
|
+
});
|
|
177
|
+
const testOutputSchema = z.object({
|
|
178
|
+
success: z.boolean(),
|
|
179
|
+
});
|
|
180
|
+
it("@InputSchema should set schema metadata", () => {
|
|
181
|
+
class TestClass {
|
|
182
|
+
testMethod() { }
|
|
183
|
+
}
|
|
184
|
+
__decorate([
|
|
185
|
+
InputSchema(testInputSchema),
|
|
186
|
+
__metadata("design:type", Function),
|
|
187
|
+
__metadata("design:paramtypes", []),
|
|
188
|
+
__metadata("design:returntype", void 0)
|
|
189
|
+
], TestClass.prototype, "testMethod", null);
|
|
190
|
+
const schema = Reflect.getMetadata(INPUT_SCHEMA_METADATA, TestClass, "testMethod");
|
|
191
|
+
expect(schema).toBe(testInputSchema);
|
|
192
|
+
});
|
|
193
|
+
it("@OutputSchema should set schema metadata", () => {
|
|
194
|
+
class TestClass {
|
|
195
|
+
testMethod() { }
|
|
196
|
+
}
|
|
197
|
+
__decorate([
|
|
198
|
+
OutputSchema(testOutputSchema),
|
|
199
|
+
__metadata("design:type", Function),
|
|
200
|
+
__metadata("design:paramtypes", []),
|
|
201
|
+
__metadata("design:returntype", void 0)
|
|
202
|
+
], TestClass.prototype, "testMethod", null);
|
|
203
|
+
const schema = Reflect.getMetadata(OUTPUT_SCHEMA_METADATA, TestClass, "testMethod");
|
|
204
|
+
expect(schema).toBe(testOutputSchema);
|
|
205
|
+
});
|
|
206
|
+
it("@Description should set description metadata", () => {
|
|
207
|
+
class TestClass {
|
|
208
|
+
testMethod() { }
|
|
209
|
+
}
|
|
210
|
+
__decorate([
|
|
211
|
+
Description("This is a test function"),
|
|
212
|
+
__metadata("design:type", Function),
|
|
213
|
+
__metadata("design:paramtypes", []),
|
|
214
|
+
__metadata("design:returntype", void 0)
|
|
215
|
+
], TestClass.prototype, "testMethod", null);
|
|
216
|
+
const description = Reflect.getMetadata(DESCRIPTION_METADATA, TestClass, "testMethod");
|
|
217
|
+
expect(description).toBe("This is a test function");
|
|
218
|
+
});
|
|
219
|
+
it("should combine all decorators", () => {
|
|
220
|
+
let CombinedExtension = class CombinedExtension {
|
|
221
|
+
async testFunction(_ctx, _params) {
|
|
222
|
+
return { success: true };
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
__decorate([
|
|
226
|
+
Func("combined.function"),
|
|
227
|
+
Description("Combined function test"),
|
|
228
|
+
InputSchema(testInputSchema),
|
|
229
|
+
OutputSchema(testOutputSchema),
|
|
230
|
+
__param(0, Ctx()),
|
|
231
|
+
__param(1, Input()),
|
|
232
|
+
__metadata("design:type", Function),
|
|
233
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
234
|
+
__metadata("design:returntype", Promise)
|
|
235
|
+
], CombinedExtension.prototype, "testFunction", null);
|
|
236
|
+
CombinedExtension = __decorate([
|
|
237
|
+
Extension("combined-test")
|
|
238
|
+
], CombinedExtension);
|
|
239
|
+
// Extension metadata
|
|
240
|
+
const extMeta = Reflect.getMetadata(EXTENSION_METADATA, CombinedExtension);
|
|
241
|
+
expect(extMeta.name).toBe("combined-test");
|
|
242
|
+
// Function metadata
|
|
243
|
+
const funcMeta = Reflect.getMetadata(FUNCTION_METADATA, CombinedExtension, "testFunction");
|
|
244
|
+
expect(funcMeta.name).toBe("combined.function");
|
|
245
|
+
// Schema metadata
|
|
246
|
+
const inputSchema = Reflect.getMetadata(INPUT_SCHEMA_METADATA, CombinedExtension, "testFunction");
|
|
247
|
+
const outputSchema = Reflect.getMetadata(OUTPUT_SCHEMA_METADATA, CombinedExtension, "testFunction");
|
|
248
|
+
expect(inputSchema).toBe(testInputSchema);
|
|
249
|
+
expect(outputSchema).toBe(testOutputSchema);
|
|
250
|
+
// Description
|
|
251
|
+
const desc = Reflect.getMetadata(DESCRIPTION_METADATA, CombinedExtension, "testFunction");
|
|
252
|
+
expect(desc).toBe("Combined function test");
|
|
253
|
+
// Parameter metadata
|
|
254
|
+
const params = Reflect.getMetadata(PARAM_METADATA, CombinedExtension, "testFunction");
|
|
255
|
+
expect(params).toHaveLength(2);
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
//# sourceMappingURL=decorators.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorators.test.js","sourceRoot":"","sources":["../../src/__tests__/decorators.test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,IAAI,EACJ,iBAAiB,EACjB,kBAAkB,EAClB,GAAG,EACH,KAAK,EACL,IAAI,EACJ,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAEhC,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC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../../src/__tests__/testing-utils.test.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
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
|
+
import { describe, it, expect } from "vitest";
|
|
14
|
+
import "reflect-metadata";
|
|
15
|
+
import { z } from "zod";
|
|
16
|
+
import { Extension, Func, Ctx, Input, InputSchema, OutputSchema, Description, } from "../decorators/index.js";
|
|
17
|
+
import { createMockContext, createTestExtension } from "../testing/index.js";
|
|
18
|
+
// Test extension for testing utilities
|
|
19
|
+
const TestInputSchema = z.object({
|
|
20
|
+
name: z.string(),
|
|
21
|
+
});
|
|
22
|
+
const TestOutputSchema = z.object({
|
|
23
|
+
greeting: z.string(),
|
|
24
|
+
});
|
|
25
|
+
let TestExtension = class TestExtension {
|
|
26
|
+
async greet(ctx, params) {
|
|
27
|
+
return {
|
|
28
|
+
greeting: `Hello, ${params.name}! Channel: ${ctx.channel.id}`,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
async noSchema(ctx, params) {
|
|
32
|
+
return { result: params.value * 2, channelId: ctx.channel.id };
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
__decorate([
|
|
36
|
+
Func("test.greet"),
|
|
37
|
+
Description("Greet a user"),
|
|
38
|
+
InputSchema(TestInputSchema),
|
|
39
|
+
OutputSchema(TestOutputSchema),
|
|
40
|
+
__param(0, Ctx()),
|
|
41
|
+
__param(1, Input()),
|
|
42
|
+
__metadata("design:type", Function),
|
|
43
|
+
__metadata("design:paramtypes", [Object, void 0]),
|
|
44
|
+
__metadata("design:returntype", Promise)
|
|
45
|
+
], TestExtension.prototype, "greet", null);
|
|
46
|
+
__decorate([
|
|
47
|
+
Func("test.noSchema"),
|
|
48
|
+
__param(0, Ctx()),
|
|
49
|
+
__param(1, Input()),
|
|
50
|
+
__metadata("design:type", Function),
|
|
51
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
52
|
+
__metadata("design:returntype", Promise)
|
|
53
|
+
], TestExtension.prototype, "noSchema", null);
|
|
54
|
+
TestExtension = __decorate([
|
|
55
|
+
Extension({ name: "test", systemVersion: "v1" })
|
|
56
|
+
], TestExtension);
|
|
57
|
+
describe("Testing Utilities", () => {
|
|
58
|
+
describe("createMockContext", () => {
|
|
59
|
+
it("should create context with default values", () => {
|
|
60
|
+
const ctx = createMockContext();
|
|
61
|
+
expect(ctx.channel.id).toBe("test-channel-id");
|
|
62
|
+
expect(ctx.caller.type).toBe("manager");
|
|
63
|
+
expect(ctx.caller.id).toBe("test-caller-id");
|
|
64
|
+
});
|
|
65
|
+
it("should create context with custom values", () => {
|
|
66
|
+
const ctx = createMockContext({
|
|
67
|
+
channelId: "custom-channel",
|
|
68
|
+
callerType: "user",
|
|
69
|
+
callerId: "user-123",
|
|
70
|
+
authToken: "test-token",
|
|
71
|
+
});
|
|
72
|
+
expect(ctx.channel.id).toBe("custom-channel");
|
|
73
|
+
expect(ctx.caller.type).toBe("user");
|
|
74
|
+
expect(ctx.caller.id).toBe("user-123");
|
|
75
|
+
expect(ctx.authToken).toBe("test-token");
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
describe("createTestExtension", () => {
|
|
79
|
+
it("should create test extension with metadata", () => {
|
|
80
|
+
const { instance, extensionName, functionNames } = createTestExtension(TestExtension);
|
|
81
|
+
expect(instance).toBeInstanceOf(TestExtension);
|
|
82
|
+
expect(extensionName).toBe("test");
|
|
83
|
+
expect(functionNames).toContain("test.greet");
|
|
84
|
+
expect(functionNames).toContain("test.noSchema");
|
|
85
|
+
});
|
|
86
|
+
it("should throw error for non-decorated class", () => {
|
|
87
|
+
class NotAnExtension {
|
|
88
|
+
}
|
|
89
|
+
expect(() => createTestExtension(NotAnExtension)).toThrow("not decorated with @Extension");
|
|
90
|
+
});
|
|
91
|
+
it("should call function with schema validation", async () => {
|
|
92
|
+
const { callFunction } = createTestExtension(TestExtension);
|
|
93
|
+
const result = await callFunction("test.greet", { name: "World" });
|
|
94
|
+
expect(result.greeting).toContain("Hello, World!");
|
|
95
|
+
expect(result.greeting).toContain("test-channel-id");
|
|
96
|
+
});
|
|
97
|
+
it("should call function with custom context", async () => {
|
|
98
|
+
const { callFunction } = createTestExtension(TestExtension);
|
|
99
|
+
const result = await callFunction("test.greet", { name: "Test" }, { channelId: "custom-channel" });
|
|
100
|
+
expect(result.greeting).toContain("custom-channel");
|
|
101
|
+
});
|
|
102
|
+
it("should call function without schema", async () => {
|
|
103
|
+
const { callFunction } = createTestExtension(TestExtension);
|
|
104
|
+
const result = await callFunction("test.noSchema", { value: 21 });
|
|
105
|
+
expect(result.result).toBe(42);
|
|
106
|
+
});
|
|
107
|
+
it("should throw error for invalid input", async () => {
|
|
108
|
+
const { callFunction } = createTestExtension(TestExtension);
|
|
109
|
+
await expect(callFunction("test.greet", { name: 123 }) // Invalid: should be string
|
|
110
|
+
).rejects.toThrow();
|
|
111
|
+
});
|
|
112
|
+
it("should throw error for unknown function", async () => {
|
|
113
|
+
const { callFunction } = createTestExtension(TestExtension);
|
|
114
|
+
await expect(callFunction("unknown.function", {})).rejects.toThrow("not found");
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
//# sourceMappingURL=testing-utils.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing-utils.test.js","sourceRoot":"","sources":["../../src/__tests__/testing-utils.test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,SAAS,EACT,IAAI,EACJ,GAAG,EACH,KAAK,EACL,WAAW,EACX,YAAY,EACZ,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG7E,uCAAuC;AACvC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC;AAGH,IAAM,aAAa,GAAnB,MAAM,aAAa;IAKX,AAAN,KAAK,CAAC,KAAK,CACF,GAAoB,EAClB,MAAuC;QAEhD,OAAO;YACL,QAAQ,EAAE,UAAU,MAAM,CAAC,IAAI,cAAc,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE;SAC9D,CAAC;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,QAAQ,CAAQ,GAAoB,EAAW,MAAyB;QAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;IACjE,CAAC;CACF,CAAA;AAbO;I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AAC,YAAY,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAClF,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { AppStoreClientConfig, RegisterExtensionResult, UnregisterExtensionResult } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* AppStore API client for extension registration
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* const client = new AppStoreClient({
|
|
8
|
+
* appId: 'your-app-id',
|
|
9
|
+
* appSecret: 'your-app-secret',
|
|
10
|
+
* });
|
|
11
|
+
*
|
|
12
|
+
* // Register an extension
|
|
13
|
+
* const result = await client.registerExtension({
|
|
14
|
+
* extensionName: 'calendar',
|
|
15
|
+
* systemVersion: 'v1',
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare class AppStoreClient {
|
|
20
|
+
private readonly config;
|
|
21
|
+
private readonly debug;
|
|
22
|
+
constructor(config: AppStoreClientConfig);
|
|
23
|
+
/**
|
|
24
|
+
* Register an extension with the AppStore
|
|
25
|
+
*
|
|
26
|
+
* @param options Extension registration options
|
|
27
|
+
* @returns Registration result with all registered extensions
|
|
28
|
+
*/
|
|
29
|
+
registerExtension(options: {
|
|
30
|
+
extensionName: string;
|
|
31
|
+
systemVersion: string;
|
|
32
|
+
}): Promise<RegisterExtensionResult>;
|
|
33
|
+
/**
|
|
34
|
+
* Unregister an extension from the AppStore
|
|
35
|
+
*
|
|
36
|
+
* @param options Extension unregistration options
|
|
37
|
+
* @returns Unregistration result
|
|
38
|
+
*/
|
|
39
|
+
unregisterExtension(options: {
|
|
40
|
+
extensionName: string;
|
|
41
|
+
systemVersion: string;
|
|
42
|
+
}): Promise<UnregisterExtensionResult>;
|
|
43
|
+
/**
|
|
44
|
+
* Register multiple extensions at once
|
|
45
|
+
*
|
|
46
|
+
* @param extensions Array of extensions to register
|
|
47
|
+
* @returns Array of registration results
|
|
48
|
+
*/
|
|
49
|
+
registerExtensions(extensions: {
|
|
50
|
+
extensionName: string;
|
|
51
|
+
systemVersion: string;
|
|
52
|
+
}[]): Promise<RegisterExtensionResult[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Make a JSON-RPC call to the AppStore
|
|
55
|
+
*/
|
|
56
|
+
private callJsonRpc;
|
|
57
|
+
/**
|
|
58
|
+
* Debug logging
|
|
59
|
+
*/
|
|
60
|
+
private log;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* AppStore API error
|
|
64
|
+
*/
|
|
65
|
+
export declare class AppStoreError extends Error {
|
|
66
|
+
readonly code?: number | undefined;
|
|
67
|
+
readonly responseBody?: string | undefined;
|
|
68
|
+
constructor(message: string, code?: number | undefined, responseBody?: string | undefined);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/appstore/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EAIpB,uBAAuB,EAEvB,yBAAyB,EAC1B,MAAM,YAAY,CAAC;AAOpB;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAGA;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;gBAEpB,MAAM,EAAE,oBAAoB;IAQxC;;;;;OAKG;IACG,iBAAiB,CAAC,OAAO,EAAE;QAC/B,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,MAAM,CAAC;KACvB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAapC;;;;;OAKG;IACG,mBAAmB,CAAC,OAAO,EAAE;QACjC,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,MAAM,CAAC;KACvB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAatC;;;;;OAKG;IACG,kBAAkB,CACtB,UAAU,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,EAAE,GAC7D,OAAO,CAAC,uBAAuB,EAAE,CAAC;IAkBrC;;OAEG;YACW,WAAW;IA8CzB;;OAEG;IACH,OAAO,CAAC,GAAG;CASZ;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,KAAK;aAGpB,IAAI,CAAC,EAAE,MAAM;aACb,YAAY,CAAC,EAAE,MAAM;gBAFrC,OAAO,EAAE,MAAM,EACC,IAAI,CAAC,EAAE,MAAM,YAAA,EACb,YAAY,CAAC,EAAE,MAAM,YAAA;CAKxC"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default AppStore API URL
|
|
3
|
+
*/
|
|
4
|
+
const DEFAULT_APPSTORE_URL = "https://app-store.channel.io";
|
|
5
|
+
/**
|
|
6
|
+
* AppStore API client for extension registration
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const client = new AppStoreClient({
|
|
11
|
+
* appId: 'your-app-id',
|
|
12
|
+
* appSecret: 'your-app-secret',
|
|
13
|
+
* });
|
|
14
|
+
*
|
|
15
|
+
* // Register an extension
|
|
16
|
+
* const result = await client.registerExtension({
|
|
17
|
+
* extensionName: 'calendar',
|
|
18
|
+
* systemVersion: 'v1',
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export class AppStoreClient {
|
|
23
|
+
config;
|
|
24
|
+
debug;
|
|
25
|
+
constructor(config) {
|
|
26
|
+
this.config = {
|
|
27
|
+
...config,
|
|
28
|
+
appStoreUrl: config.appStoreUrl ?? DEFAULT_APPSTORE_URL,
|
|
29
|
+
};
|
|
30
|
+
this.debug = config.debug ?? false;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Register an extension with the AppStore
|
|
34
|
+
*
|
|
35
|
+
* @param options Extension registration options
|
|
36
|
+
* @returns Registration result with all registered extensions
|
|
37
|
+
*/
|
|
38
|
+
async registerExtension(options) {
|
|
39
|
+
const params = {
|
|
40
|
+
app_id: this.config.appId,
|
|
41
|
+
system_version: options.systemVersion,
|
|
42
|
+
extension_name: options.extensionName,
|
|
43
|
+
};
|
|
44
|
+
return this.callJsonRpc("registerExtension", params);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Unregister an extension from the AppStore
|
|
48
|
+
*
|
|
49
|
+
* @param options Extension unregistration options
|
|
50
|
+
* @returns Unregistration result
|
|
51
|
+
*/
|
|
52
|
+
async unregisterExtension(options) {
|
|
53
|
+
const params = {
|
|
54
|
+
app_id: this.config.appId,
|
|
55
|
+
system_version: options.systemVersion,
|
|
56
|
+
extension_name: options.extensionName,
|
|
57
|
+
};
|
|
58
|
+
return this.callJsonRpc("unregisterExtension", params);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Register multiple extensions at once
|
|
62
|
+
*
|
|
63
|
+
* @param extensions Array of extensions to register
|
|
64
|
+
* @returns Array of registration results
|
|
65
|
+
*/
|
|
66
|
+
async registerExtensions(extensions) {
|
|
67
|
+
const results = [];
|
|
68
|
+
for (const ext of extensions) {
|
|
69
|
+
try {
|
|
70
|
+
const result = await this.registerExtension(ext);
|
|
71
|
+
results.push(result);
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
results.push({
|
|
75
|
+
success: false,
|
|
76
|
+
error_message: error instanceof Error ? error.message : String(error),
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return results;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Make a JSON-RPC call to the AppStore
|
|
84
|
+
*/
|
|
85
|
+
async callJsonRpc(method, params) {
|
|
86
|
+
const url = `${this.config.appStoreUrl}/general/v1/native/functions`;
|
|
87
|
+
const request = {
|
|
88
|
+
jsonrpc: "2.0",
|
|
89
|
+
method,
|
|
90
|
+
params,
|
|
91
|
+
id: Date.now(),
|
|
92
|
+
};
|
|
93
|
+
this.log(`Calling ${method}`, params);
|
|
94
|
+
const response = await fetch(url, {
|
|
95
|
+
method: "PUT",
|
|
96
|
+
headers: {
|
|
97
|
+
"Content-Type": "application/json",
|
|
98
|
+
"X-App-Id": this.config.appId,
|
|
99
|
+
"X-App-Secret": this.config.appSecret,
|
|
100
|
+
},
|
|
101
|
+
body: JSON.stringify(request),
|
|
102
|
+
});
|
|
103
|
+
if (!response.ok) {
|
|
104
|
+
const errorBody = await response.text();
|
|
105
|
+
throw new AppStoreError(`AppStore API request failed: ${response.status} ${response.statusText}`, response.status, errorBody);
|
|
106
|
+
}
|
|
107
|
+
const jsonResponse = (await response.json());
|
|
108
|
+
if (jsonResponse.error) {
|
|
109
|
+
throw new AppStoreError(jsonResponse.error.message, jsonResponse.error.code, JSON.stringify(jsonResponse.error.data));
|
|
110
|
+
}
|
|
111
|
+
this.log(`${method} response`, jsonResponse.result);
|
|
112
|
+
return jsonResponse.result;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Debug logging
|
|
116
|
+
*/
|
|
117
|
+
log(message, data) {
|
|
118
|
+
if (this.debug) {
|
|
119
|
+
if (data !== undefined) {
|
|
120
|
+
console.debug(`[AppStoreClient] ${message}`, data);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
console.debug(`[AppStoreClient] ${message}`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* AppStore API error
|
|
130
|
+
*/
|
|
131
|
+
export class AppStoreError extends Error {
|
|
132
|
+
code;
|
|
133
|
+
responseBody;
|
|
134
|
+
constructor(message, code, responseBody) {
|
|
135
|
+
super(message);
|
|
136
|
+
this.code = code;
|
|
137
|
+
this.responseBody = responseBody;
|
|
138
|
+
this.name = "AppStoreError";
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/appstore/client.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,MAAM,oBAAoB,GAAG,8BAA8B,CAAC;AAE5D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,cAAc;IACR,MAAM,CAGA;IACN,KAAK,CAAU;IAEhC,YAAY,MAA4B;QACtC,IAAI,CAAC,MAAM,GAAG;YACZ,GAAG,MAAM;YACT,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,oBAAoB;SACxD,CAAC;QACF,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,KAAK,CAAC;IACrC,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,iBAAiB,CAAC,OAGvB;QACC,MAAM,MAAM,GAA4B;YACtC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK;YACzB,cAAc,EAAE,OAAO,CAAC,aAAa;YACrC,cAAc,EAAE,OAAO,CAAC,aAAa;SACtC,CAAC;QAEF,OAAO,IAAI,CAAC,WAAW,CACrB,mBAAmB,EACnB,MAAM,CACP,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,mBAAmB,CAAC,OAGzB;QACC,MAAM,MAAM,GAA8B;YACxC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK;YACzB,cAAc,EAAE,OAAO,CAAC,aAAa;YACrC,cAAc,EAAE,OAAO,CAAC,aAAa;SACtC,CAAC;QAEF,OAAO,IAAI,CAAC,WAAW,CACrB,qBAAqB,EACrB,MAAM,CACP,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,kBAAkB,CACtB,UAA8D;QAE9D,MAAM,OAAO,GAA8B,EAAE,CAAC;QAE9C,KAAK,MAAM,GAAG,IAAI,UAAU,EA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":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/appstore/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|