services-as-software 0.1.0 → 2.0.1
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/.turbo/turbo-build.log +5 -0
- package/CHANGELOG.md +10 -0
- package/README.md +235 -225
- package/dist/client.d.ts +25 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +103 -0
- package/dist/client.js.map +1 -0
- package/dist/endpoint.d.ts +102 -0
- package/dist/endpoint.d.ts.map +1 -0
- package/dist/endpoint.js +96 -0
- package/dist/endpoint.js.map +1 -0
- package/dist/entities/billing.d.ts +60 -0
- package/dist/entities/billing.d.ts.map +1 -0
- package/dist/entities/billing.js +954 -0
- package/dist/entities/billing.js.map +1 -0
- package/dist/entities/customers.d.ts +45 -0
- package/dist/entities/customers.d.ts.map +1 -0
- package/dist/entities/customers.js +679 -0
- package/dist/entities/customers.js.map +1 -0
- package/dist/entities/delivery.d.ts +59 -0
- package/dist/entities/delivery.d.ts.map +1 -0
- package/dist/entities/delivery.js +890 -0
- package/dist/entities/delivery.js.map +1 -0
- package/dist/entities/index.d.ts +114 -0
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/index.js +89 -0
- package/dist/entities/index.js.map +1 -0
- package/dist/entities/operations.d.ts +59 -0
- package/dist/entities/operations.d.ts.map +1 -0
- package/dist/entities/operations.js +1010 -0
- package/dist/entities/operations.js.map +1 -0
- package/dist/entities/orchestration.d.ts +52 -0
- package/dist/entities/orchestration.d.ts.map +1 -0
- package/dist/entities/orchestration.js +883 -0
- package/dist/entities/orchestration.js.map +1 -0
- package/dist/entities/services.d.ts +50 -0
- package/dist/entities/services.d.ts.map +1 -0
- package/dist/entities/services.js +805 -0
- package/dist/entities/services.js.map +1 -0
- package/dist/helpers.d.ts +362 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.js +400 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +17 -215
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -172
- package/dist/index.js.map +1 -0
- package/dist/provider.d.ts +85 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +158 -0
- package/dist/provider.js.map +1 -0
- package/dist/service.d.ts +43 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +206 -0
- package/dist/service.js.map +1 -0
- package/dist/types.d.ts +469 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/examples/client-usage.ts +82 -0
- package/examples/translation-service.ts +227 -0
- package/package.json +24 -38
- package/src/client.ts +132 -0
- package/src/endpoint.ts +144 -0
- package/src/entities/billing.ts +1037 -0
- package/src/entities/customers.ts +740 -0
- package/src/entities/delivery.ts +974 -0
- package/src/entities/index.ts +157 -0
- package/src/entities/operations.ts +1099 -0
- package/src/entities/orchestration.ts +956 -0
- package/src/entities/services.ts +872 -0
- package/src/helpers.ts +474 -0
- package/src/index.ts +97 -0
- package/src/provider.ts +183 -0
- package/src/service.test.ts +195 -0
- package/src/service.ts +266 -0
- package/src/types.ts +543 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,MAAM,CAAC,MAAoB;IACzC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,IAAI,EAAE,CAAA;IAChC,MAAM,OAAO,GAA2B;QACtC,cAAc,EAAE,kBAAkB;QAClC,GAAG,MAAM,CAAC,OAAO;KAClB,CAAA;IAED,mBAAmB;IACnB,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,QAAQ,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACzB,KAAK,SAAS;gBACZ,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,IAAI,MA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AS,CAAC,MAAc;YAC5B,OAAO,OAAO,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;QACzC,CAAC;QAED,KAAK,CAAC,YAAY;YAChB,MAAM,MAAM,GAAG,MAAM,OAAO,CAA6B,cAAc,EAAE,EAAE,CAAC,CAAA;YAC5E,OAAO,MAAM,CAAC,YAAY,CAAA;QAC5B,CAAC;QAED,KAAK,CAAC,IAAI;YACR,OAAO,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;QAC5B,CAAC;QAED,KAAK,CAAC,IAAI;YACR,OAAO,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;QAC5B,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Endpoint helper for defining service endpoints
|
|
3
|
+
*/
|
|
4
|
+
import type { EndpointDefinition, PricingConfig, JSONSchema } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Endpoint configuration (input to Endpoint function)
|
|
7
|
+
*/
|
|
8
|
+
export interface EndpointConfig<TInput = unknown, TOutput = unknown> {
|
|
9
|
+
/** Endpoint name */
|
|
10
|
+
name: string;
|
|
11
|
+
/** Description of what this endpoint does */
|
|
12
|
+
description?: string;
|
|
13
|
+
/** HTTP method (for REST endpoints) */
|
|
14
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
15
|
+
/** Path pattern (e.g., '/users/:id') */
|
|
16
|
+
path?: string;
|
|
17
|
+
/** Input schema */
|
|
18
|
+
input?: JSONSchema;
|
|
19
|
+
/** Output schema */
|
|
20
|
+
output?: JSONSchema;
|
|
21
|
+
/** Handler function */
|
|
22
|
+
handler: EndpointDefinition<TInput, TOutput>['handler'];
|
|
23
|
+
/** Pricing specific to this endpoint */
|
|
24
|
+
pricing?: PricingConfig;
|
|
25
|
+
/** Rate limiting */
|
|
26
|
+
rateLimit?: {
|
|
27
|
+
requests: number;
|
|
28
|
+
window: number;
|
|
29
|
+
};
|
|
30
|
+
/** Whether authentication is required */
|
|
31
|
+
requiresAuth?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Create an endpoint definition
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const translateEndpoint = Endpoint({
|
|
39
|
+
* name: 'translate',
|
|
40
|
+
* description: 'Translate text between languages',
|
|
41
|
+
* method: 'POST',
|
|
42
|
+
* path: '/translate',
|
|
43
|
+
* input: {
|
|
44
|
+
* type: 'object',
|
|
45
|
+
* properties: {
|
|
46
|
+
* text: { type: 'string', description: 'Text to translate' },
|
|
47
|
+
* from: { type: 'string', description: 'Source language code' },
|
|
48
|
+
* to: { type: 'string', description: 'Target language code' },
|
|
49
|
+
* },
|
|
50
|
+
* required: ['text', 'to'],
|
|
51
|
+
* additionalProperties: false,
|
|
52
|
+
* },
|
|
53
|
+
* output: {
|
|
54
|
+
* type: 'object',
|
|
55
|
+
* properties: {
|
|
56
|
+
* translatedText: { type: 'string' },
|
|
57
|
+
* confidence: { type: 'number' },
|
|
58
|
+
* },
|
|
59
|
+
* required: ['translatedText'],
|
|
60
|
+
* additionalProperties: false,
|
|
61
|
+
* },
|
|
62
|
+
* handler: async (input, context) => {
|
|
63
|
+
* // Translation logic here
|
|
64
|
+
* return {
|
|
65
|
+
* translatedText: `Translated: ${input.text}`,
|
|
66
|
+
* confidence: 0.95,
|
|
67
|
+
* }
|
|
68
|
+
* },
|
|
69
|
+
* pricing: {
|
|
70
|
+
* model: 'per-use',
|
|
71
|
+
* pricePerUnit: 0.01,
|
|
72
|
+
* currency: 'USD',
|
|
73
|
+
* },
|
|
74
|
+
* rateLimit: {
|
|
75
|
+
* requests: 100,
|
|
76
|
+
* window: 60000, // 1 minute
|
|
77
|
+
* },
|
|
78
|
+
* })
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
export declare function Endpoint<TInput = unknown, TOutput = unknown>(config: EndpointConfig<TInput, TOutput>): EndpointDefinition<TInput, TOutput>;
|
|
82
|
+
/**
|
|
83
|
+
* Create a GET endpoint
|
|
84
|
+
*/
|
|
85
|
+
export declare function GET<TInput = unknown, TOutput = unknown>(config: Omit<EndpointConfig<TInput, TOutput>, 'method'>): EndpointDefinition<TInput, TOutput>;
|
|
86
|
+
/**
|
|
87
|
+
* Create a POST endpoint
|
|
88
|
+
*/
|
|
89
|
+
export declare function POST<TInput = unknown, TOutput = unknown>(config: Omit<EndpointConfig<TInput, TOutput>, 'method'>): EndpointDefinition<TInput, TOutput>;
|
|
90
|
+
/**
|
|
91
|
+
* Create a PUT endpoint
|
|
92
|
+
*/
|
|
93
|
+
export declare function PUT<TInput = unknown, TOutput = unknown>(config: Omit<EndpointConfig<TInput, TOutput>, 'method'>): EndpointDefinition<TInput, TOutput>;
|
|
94
|
+
/**
|
|
95
|
+
* Create a DELETE endpoint
|
|
96
|
+
*/
|
|
97
|
+
export declare function DELETE<TInput = unknown, TOutput = unknown>(config: Omit<EndpointConfig<TInput, TOutput>, 'method'>): EndpointDefinition<TInput, TOutput>;
|
|
98
|
+
/**
|
|
99
|
+
* Create a PATCH endpoint
|
|
100
|
+
*/
|
|
101
|
+
export declare function PATCH<TInput = unknown, TOutput = unknown>(config: Omit<EndpointConfig<TInput, TOutput>, 'method'>): EndpointDefinition<TInput, TOutput>;
|
|
102
|
+
//# sourceMappingURL=endpoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../src/endpoint.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE/E;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,MAAM,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO;IACjE,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,6CAA6C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kB,CAAC,MAAM,EAAE,OAAO,CAAC,CAErC;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,MAAM,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,EACrD,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,GACtD,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAErC;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,MAAM,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,EACxD,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,GACtD,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAErC;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,MAAM,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,EACvD,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,GACtD,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAErC"}
|
package/dist/endpoint.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Endpoint helper for defining service endpoints
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Create an endpoint definition
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* const translateEndpoint = Endpoint({
|
|
10
|
+
* name: 'translate',
|
|
11
|
+
* description: 'Translate text between languages',
|
|
12
|
+
* method: 'POST',
|
|
13
|
+
* path: '/translate',
|
|
14
|
+
* input: {
|
|
15
|
+
* type: 'object',
|
|
16
|
+
* properties: {
|
|
17
|
+
* text: { type: 'string', description: 'Text to translate' },
|
|
18
|
+
* from: { type: 'string', description: 'Source language code' },
|
|
19
|
+
* to: { type: 'string', description: 'Target language code' },
|
|
20
|
+
* },
|
|
21
|
+
* required: ['text', 'to'],
|
|
22
|
+
* additionalProperties: false,
|
|
23
|
+
* },
|
|
24
|
+
* output: {
|
|
25
|
+
* type: 'object',
|
|
26
|
+
* properties: {
|
|
27
|
+
* translatedText: { type: 'string' },
|
|
28
|
+
* confidence: { type: 'number' },
|
|
29
|
+
* },
|
|
30
|
+
* required: ['translatedText'],
|
|
31
|
+
* additionalProperties: false,
|
|
32
|
+
* },
|
|
33
|
+
* handler: async (input, context) => {
|
|
34
|
+
* // Translation logic here
|
|
35
|
+
* return {
|
|
36
|
+
* translatedText: `Translated: ${input.text}`,
|
|
37
|
+
* confidence: 0.95,
|
|
38
|
+
* }
|
|
39
|
+
* },
|
|
40
|
+
* pricing: {
|
|
41
|
+
* model: 'per-use',
|
|
42
|
+
* pricePerUnit: 0.01,
|
|
43
|
+
* currency: 'USD',
|
|
44
|
+
* },
|
|
45
|
+
* rateLimit: {
|
|
46
|
+
* requests: 100,
|
|
47
|
+
* window: 60000, // 1 minute
|
|
48
|
+
* },
|
|
49
|
+
* })
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export function Endpoint(config) {
|
|
53
|
+
return {
|
|
54
|
+
name: config.name,
|
|
55
|
+
description: config.description,
|
|
56
|
+
method: config.method || 'POST',
|
|
57
|
+
path: config.path || `/${config.name}`,
|
|
58
|
+
input: config.input,
|
|
59
|
+
output: config.output,
|
|
60
|
+
handler: config.handler,
|
|
61
|
+
pricing: config.pricing,
|
|
62
|
+
rateLimit: config.rateLimit,
|
|
63
|
+
requiresAuth: config.requiresAuth !== false, // Default to true
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Create a GET endpoint
|
|
68
|
+
*/
|
|
69
|
+
export function GET(config) {
|
|
70
|
+
return Endpoint({ ...config, method: 'GET' });
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Create a POST endpoint
|
|
74
|
+
*/
|
|
75
|
+
export function POST(config) {
|
|
76
|
+
return Endpoint({ ...config, method: 'POST' });
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Create a PUT endpoint
|
|
80
|
+
*/
|
|
81
|
+
export function PUT(config) {
|
|
82
|
+
return Endpoint({ ...config, method: 'PUT' });
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Create a DELETE endpoint
|
|
86
|
+
*/
|
|
87
|
+
export function DELETE(config) {
|
|
88
|
+
return Endpoint({ ...config, method: 'DELETE' });
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Create a PATCH endpoint
|
|
92
|
+
*/
|
|
93
|
+
export function PATCH(config) {
|
|
94
|
+
return Endpoint({ ...config, method: 'PATCH' });
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=endpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../src/endpoint.ts"],"names":[],"mappings":"AAAA;;GAEG;AAiCH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,UAAU,QAAQ,CACtB,MAAuC;IAEvC,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,MAAM;QAC/B,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE;QACtC,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,YAAY,EAAE,MAAM,CAAC,YAAY,KAAK,KAAK,EAAE,kBAAkB;KAChE,CAAA;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,GAAG,CACjB,MAAuD;IAEvD,OAAO,QAAQ,CAAC,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAA;AAC/C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,IAAI,CAClB,MAAuD;IAEvD,OAAO,QAAQ,CAAC,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;AAChD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,GAAG,CACjB,MAAuD;IAEvD,OAAO,QAAQ,CAAC,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAA;AAC/C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM,CACpB,MAAuD;IAEvD,OAAO,QAAQ,CAAC,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;AAClD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,KAAK,CACnB,MAAuD;IAEvD,OAAO,QAAQ,CAAC,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;AACjD,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Billing Entity Types (Nouns)
|
|
3
|
+
*
|
|
4
|
+
* Billing & commerce: ServiceQuote, ServiceOrder, ServiceSubscription, Usage, Invoice, Payment
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
import type { Noun } from 'ai-database';
|
|
9
|
+
/**
|
|
10
|
+
* ServiceQuote entity
|
|
11
|
+
*
|
|
12
|
+
* Price quote for a service.
|
|
13
|
+
*/
|
|
14
|
+
export declare const ServiceQuote: Noun;
|
|
15
|
+
/**
|
|
16
|
+
* ServiceOrder entity
|
|
17
|
+
*
|
|
18
|
+
* Customer order for a service.
|
|
19
|
+
*/
|
|
20
|
+
export declare const ServiceOrder: Noun;
|
|
21
|
+
/**
|
|
22
|
+
* ServiceSubscription entity
|
|
23
|
+
*
|
|
24
|
+
* Recurring service subscription.
|
|
25
|
+
*/
|
|
26
|
+
export declare const ServiceSubscription: Noun;
|
|
27
|
+
/**
|
|
28
|
+
* Usage entity
|
|
29
|
+
*
|
|
30
|
+
* Service usage tracking record.
|
|
31
|
+
*/
|
|
32
|
+
export declare const Usage: Noun;
|
|
33
|
+
/**
|
|
34
|
+
* Invoice entity
|
|
35
|
+
*
|
|
36
|
+
* Billing invoice.
|
|
37
|
+
*/
|
|
38
|
+
export declare const Invoice: Noun;
|
|
39
|
+
/**
|
|
40
|
+
* Payment entity
|
|
41
|
+
*
|
|
42
|
+
* Payment record.
|
|
43
|
+
*/
|
|
44
|
+
export declare const Payment: Noun;
|
|
45
|
+
export declare const BillingEntities: {
|
|
46
|
+
ServiceQuote: Noun;
|
|
47
|
+
ServiceOrder: Noun;
|
|
48
|
+
ServiceSubscription: Noun;
|
|
49
|
+
Usage: Noun;
|
|
50
|
+
Invoice: Noun;
|
|
51
|
+
Payment: Noun;
|
|
52
|
+
};
|
|
53
|
+
export declare const BillingCategories: {
|
|
54
|
+
readonly quotes: readonly ["ServiceQuote"];
|
|
55
|
+
readonly orders: readonly ["ServiceOrder"];
|
|
56
|
+
readonly subscriptions: readonly ["ServiceSubscription"];
|
|
57
|
+
readonly usage: readonly ["Usage"];
|
|
58
|
+
readonly invoicing: readonly ["Invoice", "Payment"];
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=billing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing.d.ts","sourceRoot":"","sources":["../../src/entities/billing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAMvC;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,IA+J1B,CAAA;AAMD;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,IAmL1B,CAAA;AAMD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,IAoKjC,CAAA;AAMD;;;;GAIG;AACH,eAAO,MAAM,KAAK,EAAE,IAqInB,CAAA;AAMD;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,IAiKrB,CAAA;AAMD;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,IAiJrB,CAAA;AAMD,eAAO,MAAM,eAAe;;;;;;;CAO3B,CAAA;AAED,eAAO,MAAM,iBAAiB;;;;;;CAMpB,CAAA"}
|