@daffodil/driver 0.41.0 → 0.42.2
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/errors/codes.d.ts +3 -0
- package/errors/public_api.d.ts +1 -0
- package/esm2020/errors/bad-input.mjs +3 -2
- package/esm2020/errors/codes.mjs +5 -0
- package/esm2020/errors/public_api.mjs +2 -1
- package/esm2020/magento/errors/error.class.mjs +1 -1
- package/esm2020/magento/graphql/cacheable-operations/apollo-cacheable-operations-link-generator.mjs +1 -1
- package/esm2020/magento/testing/factories/discount.factory.mjs +1 -1
- package/esm2020/magento/testing/factories/money.factory.mjs +1 -1
- package/fesm2015/daffodil-driver-magento-testing.mjs.map +1 -1
- package/fesm2015/daffodil-driver-magento.mjs.map +1 -1
- package/fesm2015/daffodil-driver.mjs +7 -2
- package/fesm2015/daffodil-driver.mjs.map +1 -1
- package/fesm2020/daffodil-driver-magento-testing.mjs.map +1 -1
- package/fesm2020/daffodil-driver-magento.mjs.map +1 -1
- package/fesm2020/daffodil-driver.mjs +7 -2
- package/fesm2020/daffodil-driver.mjs.map +1 -1
- package/package.json +1 -1
package/errors/public_api.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { DaffInheritableError, } from '@daffodil/core';
|
|
2
|
+
import { DaffDriverErrorCodes } from './codes';
|
|
2
3
|
export class DaffBadInputError extends DaffInheritableError {
|
|
3
4
|
constructor(message) {
|
|
4
5
|
super(message);
|
|
5
6
|
this.message = message;
|
|
6
|
-
this.code =
|
|
7
|
+
this.code = DaffDriverErrorCodes.BAD_INPUT;
|
|
7
8
|
}
|
|
8
9
|
}
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFkLWlucHV0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vbGlicy9kcml2ZXIvc3JjL2Vycm9ycy9iYWQtaW5wdXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUVMLG9CQUFvQixHQUNyQixNQUFNLGdCQUFnQixDQUFDO0FBRXhCLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLFNBQVMsQ0FBQztBQUUvQyxNQUFNLE9BQU8saUJBQWtCLFNBQVEsb0JBQW9CO0lBR3pELFlBQW1CLE9BQWU7UUFDaEMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBREUsWUFBTyxHQUFQLE9BQU8sQ0FBUTtRQUZsQixTQUFJLEdBQVcsb0JBQW9CLENBQUMsU0FBUyxDQUFDO0lBSTlELENBQUM7Q0FDRiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7XG4gIERhZmZFcnJvcixcbiAgRGFmZkluaGVyaXRhYmxlRXJyb3IsXG59IGZyb20gJ0BkYWZmb2RpbC9jb3JlJztcblxuaW1wb3J0IHsgRGFmZkRyaXZlckVycm9yQ29kZXMgfSBmcm9tICcuL2NvZGVzJztcblxuZXhwb3J0IGNsYXNzIERhZmZCYWRJbnB1dEVycm9yIGV4dGVuZHMgRGFmZkluaGVyaXRhYmxlRXJyb3IgaW1wbGVtZW50cyBEYWZmRXJyb3Ige1xuICBwdWJsaWMgcmVhZG9ubHkgY29kZTogc3RyaW5nID0gRGFmZkRyaXZlckVycm9yQ29kZXMuQkFEX0lOUFVUO1xuXG4gIGNvbnN0cnVjdG9yKHB1YmxpYyBtZXNzYWdlOiBzdHJpbmcpIHtcbiAgICBzdXBlcihtZXNzYWdlKTtcbiAgfVxufVxuIl19
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export var DaffDriverErrorCodes;
|
|
2
|
+
(function (DaffDriverErrorCodes) {
|
|
3
|
+
DaffDriverErrorCodes["BAD_INPUT"] = "DAFF_BAD_INPUT";
|
|
4
|
+
})(DaffDriverErrorCodes || (DaffDriverErrorCodes = {}));
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29kZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9saWJzL2RyaXZlci9zcmMvZXJyb3JzL2NvZGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sQ0FBTixJQUFZLG9CQUVYO0FBRkQsV0FBWSxvQkFBb0I7SUFDOUIsb0RBQTRCLENBQUE7QUFDOUIsQ0FBQyxFQUZXLG9CQUFvQixLQUFwQixvQkFBb0IsUUFFL0IiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZW51bSBEYWZmRHJpdmVyRXJyb3JDb2RlcyB7XG4gIEJBRF9JTlBVVCA9ICdEQUZGX0JBRF9JTlBVVCdcbn1cbiJdfQ==
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { DaffBadInputError } from './bad-input';
|
|
2
|
-
|
|
2
|
+
export { DaffDriverErrorCodes } from './codes';
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvZHJpdmVyL3NyYy9lcnJvcnMvcHVibGljX2FwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFDaEQsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgRGFmZkJhZElucHV0RXJyb3IgfSBmcm9tICcuL2JhZC1pbnB1dCc7XG5leHBvcnQgeyBEYWZmRHJpdmVyRXJyb3JDb2RlcyB9IGZyb20gJy4vY29kZXMnO1xuIl19
|
|
@@ -9,4 +9,4 @@ export class DaffDriverMagentoError extends DaffInheritableError {
|
|
|
9
9
|
this.code = DAFF_DRIVER_MAGENTO_ERROR_CODE;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3IuY2xhc3MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2RyaXZlci9tYWdlbnRvL3NyYy9lcnJvcnMvZXJyb3IuY2xhc3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUVMLG9CQUFvQixHQUNyQixNQUFNLGdCQUFnQixDQUFDO0FBRXhCLE1BQU0sQ0FBQyxNQUFNLDhCQUE4QixHQUFHLDJCQUEyQixDQUFDO0FBRTFFOztHQUVHO0FBQ0gsTUFBTSxPQUFPLHNCQUF1QixTQUFRLG9CQUFvQjtJQUc5RCxZQUFZLE9BQWdCO1FBQzNCLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUhBLFNBQUksR0FBVyw4QkFBOEIsQ0FBQztJQUk5RCxDQUFDO0NBQ0YiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge1xuICBEYWZmRXJyb3IsXG4gIERhZmZJbmhlcml0YWJsZUVycm9yLFxufSBmcm9tICdAZGFmZm9kaWwvY29yZSc7XG5cbmV4cG9ydCBjb25zdCBEQUZGX0RSSVZFUl9NQUdFTlRPX0VSUk9SX0NPREUgPSAnREFGRl9EUklWRVJfTUFHRU5UT19FUlJPUic7XG5cbi8qKlxuICogQSB2ZXJ5IGdlbmVyYWwgZXJyb3IgdGhyb3duIHdoZW4gYSBtb3JlIHNwZWNpZmljIGVycm9yIHR5cGUgY2Fubm90IGJlIGRldGVybWluZWQuXG4gKi9cbmV4cG9ydCBjbGFzcyBEYWZmRHJpdmVyTWFnZW50b0Vycm9yIGV4dGVuZHMgRGFmZkluaGVyaXRhYmxlRXJyb3IgaW1wbGVtZW50cyBEYWZmRXJyb3Ige1xuICBwdWJsaWMgcmVhZG9ubHkgY29kZTogc3RyaW5nID0gREFGRl9EUklWRVJfTUFHRU5UT19FUlJPUl9DT0RFO1xuXG4gIGNvbnN0cnVjdG9yKG1lc3NhZ2U/OiBzdHJpbmcpIHtcblx0ICBzdXBlcihtZXNzYWdlKTtcbiAgfVxufVxuIl19
|
package/esm2020/magento/graphql/cacheable-operations/apollo-cacheable-operations-link-generator.mjs
CHANGED
|
@@ -31,4 +31,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
31
31
|
type: Inject,
|
|
32
32
|
args: [DAFF_MAGENTO_CACHEABLE_OPERATIONS]
|
|
33
33
|
}] }]; } });
|
|
34
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
34
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBvbGxvLWNhY2hlYWJsZS1vcGVyYXRpb25zLWxpbmstZ2VuZXJhdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9kcml2ZXIvbWFnZW50by9zcmMvZ3JhcGhxbC9jYWNoZWFibGUtb3BlcmF0aW9ucy9hcG9sbG8tY2FjaGVhYmxlLW9wZXJhdGlvbnMtbGluay1nZW5lcmF0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNMLE1BQU0sRUFDTixVQUFVLEdBQ1gsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBSWpELE9BQU8sRUFBRSxpQ0FBaUMsRUFBRSxNQUFNLDhCQUE4QixDQUFDOztBQUVqRjs7OztHQUlHO0FBS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lvbnMtdG9rZW4nO1xuXG4vKipcbiAqIEEgc2VydmljZSB0aGF0IHdpbGwgY29udmVydCBjYWNoZWFibGUgYXBvbGxvIG9wZXJhdGlvbnMgaW50byBhIGZvcm1hdCB0aGF0IE1hZ2VudG8gd2lsbCB1bmRlcnN0YW5kIGFzIGNhY2hlYWJsZS5cbiAqXG4gKiBAaW5oZXJpdGRvY1xuICovXG5ASW5qZWN0YWJsZSh7XG4gIHByb3ZpZGVkSW46ICdyb290Jyxcbn0pXG5leHBvcnQgY2xhc3MgRGFmZk1hZ2VudG9BcG9sbG9DYWNoZWFibGVPcGVyYXRpb25zTGlua0dlbmVyYXRvciBpbXBsZW1lbnRzIERhZmZBcG9sbG9DYWNoZWFibGVPcGVyYXRpb25MaW5rR2VuZXJhdG9yIHtcbiAgY29uc3RydWN0b3IoXG4gICAgQEluamVjdChEQUZGX01BR0VOVE9fQ0FDSEVBQkxFX09QRVJBVElPTlMpIHByaXZhdGUgYXBvbGxvR2V0UmVxdWVzdHM6IHN0cmluZ1tdLFxuICApIHt9XG5cbiAgZ2V0TGluaygpOiBBcG9sbG9MaW5rIHtcbiAgICByZXR1cm4gbmV3IEFwb2xsb0xpbmsoKG9wZXJhdGlvbiwgZm9yd2FyZCkgPT4ge1xuICAgICAgaWYodGhpcy5hcG9sbG9HZXRSZXF1ZXN0cy5pbmRleE9mKG9wZXJhdGlvbi5vcGVyYXRpb25OYW1lKSA+IC0xKSB7XG4gICAgICAgIG9wZXJhdGlvbi5zZXRDb250ZXh0KHsgbWV0aG9kOiAnR0VUJyB9KTtcbiAgICAgIH1cbiAgICAgIHJldHVybiBmb3J3YXJkKG9wZXJhdGlvbik7XG4gICAgfSk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -27,4 +27,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
27
27
|
providedIn: 'root',
|
|
28
28
|
}]
|
|
29
29
|
}], ctorParameters: function () { return []; } });
|
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+23,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
23
23
|
providedIn: 'root',
|
|
24
24
|
}]
|
|
25
25
|
}], ctorParameters: function () { return []; } });
|
|
26
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
26
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9uZXkuZmFjdG9yeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvZHJpdmVyL21hZ2VudG8vdGVzdGluZy9zcmMvZmFjdG9yaWVzL21vbmV5LmZhY3RvcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMzQyxPQUFPLEtBQUssS0FBSyxNQUFNLDhCQUE4QixDQUFDO0FBRXRELE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHdCQUF3QixDQUFDOztBQUcxRCxNQUFNLE9BQU8sZ0JBQWdCO0lBQTdCO1FBQ0UsZUFBVSxHQUFHLE9BQU8sQ0FBQztRQUNyQixVQUFLLEdBQUcsS0FBSyxDQUFDLFFBQVEsQ0FBQyxNQUFNLENBQUMsRUFBRSxHQUFHLEVBQUUsQ0FBQyxFQUFFLEdBQUcsRUFBRSxLQUFLLEVBQUUsQ0FBQyxDQUFDO1FBQ3RELGFBQVEsR0FBRyxLQUFLLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRSxDQUFDO0lBQ2pDLENBQUM7Q0FBQTtBQUFBLENBQUM7QUFLRixNQUFNLE9BQU8sbUJBQW9CLFNBQVEsZ0JBQThCO0lBQ3JFO1FBQ0UsS0FBSyxDQUFDLGdCQUFnQixDQUFDLENBQUM7SUFDMUIsQ0FBQzs7Z0hBSFUsbUJBQW1CO29IQUFuQixtQkFBbUIsY0FGbEIsTUFBTTsyRkFFUCxtQkFBbUI7a0JBSC9CLFVBQVU7bUJBQUM7b0JBQ1YsVUFBVSxFQUFFLE1BQU07aUJBQ25CIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSW5qZWN0YWJsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0ICogYXMgZmFrZXIgZnJvbSAnQGZha2VyLWpzL2Zha2VyL2xvY2FsZS9lbl9VUyc7XG5cbmltcG9ydCB7IERhZmZNb2RlbEZhY3RvcnkgfSBmcm9tICdAZGFmZm9kaWwvY29yZS90ZXN0aW5nJztcbmltcG9ydCB7IE1hZ2VudG9Nb25leSB9IGZyb20gJ0BkYWZmb2RpbC9kcml2ZXIvbWFnZW50byc7XG5cbmV4cG9ydCBjbGFzcyBNb2NrTWFnZW50b01vbmV5IGltcGxlbWVudHMgTWFnZW50b01vbmV5IHtcbiAgX190eXBlbmFtZSA9ICdNb25leSc7XG4gIHZhbHVlID0gZmFrZXIuZGF0YXR5cGUubnVtYmVyKHsgbWluOiAxLCBtYXg6IDEwMDAwIH0pO1xuICBjdXJyZW5jeSA9IGZha2VyLnJhbmRvbS53b3JkKCk7XG59O1xuXG5ASW5qZWN0YWJsZSh7XG4gIHByb3ZpZGVkSW46ICdyb290Jyxcbn0pXG5leHBvcnQgY2xhc3MgTWFnZW50b01vbmV5RmFjdG9yeSBleHRlbmRzIERhZmZNb2RlbEZhY3Rvcnk8TWFnZW50b01vbmV5PiB7XG4gIGNvbnN0cnVjdG9yKCkge1xuICAgIHN1cGVyKE1vY2tNYWdlbnRvTW9uZXkpO1xuICB9XG59XG4iXX0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-driver-magento-testing.mjs","sources":["../../../libs/driver/magento/testing/src/factories/money.factory.ts","../../../libs/driver/magento/testing/src/factories/discount.factory.ts","../../../libs/driver/magento/testing/src/daffodil-driver-magento-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { MagentoMoney } from '@daffodil/driver/magento';\n\nexport class MockMagentoMoney implements MagentoMoney {\n
|
|
1
|
+
{"version":3,"file":"daffodil-driver-magento-testing.mjs","sources":["../../../libs/driver/magento/testing/src/factories/money.factory.ts","../../../libs/driver/magento/testing/src/factories/discount.factory.ts","../../../libs/driver/magento/testing/src/daffodil-driver-magento-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { MagentoMoney } from '@daffodil/driver/magento';\n\nexport class MockMagentoMoney implements MagentoMoney {\n __typename = 'Money';\n value = faker.datatype.number({ min: 1, max: 10000 });\n currency = faker.random.word();\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoMoneyFactory extends DaffModelFactory<MagentoMoney> {\n constructor() {\n super(MockMagentoMoney);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n MagentoDiscount,\n MagentoMoney,\n} from '@daffodil/driver/magento';\n\nimport { MagentoMoneyFactory } from './money.factory';\n\nexport class MockMagentoDiscount implements MagentoDiscount {\n __typename = 'Discount';\n amount = this.money();\n label = faker.random.word();\n\n private money(): MagentoMoney {\n return (new MagentoMoneyFactory()).create();\n }\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoDiscountFactory extends DaffModelFactory<MagentoDiscount> {\n constructor() {\n super(MockMagentoDiscount);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAMa,gBAAgB,CAAA;AAA7B,IAAA,WAAA,GAAA;AACE,QAAA,IAAU,CAAA,UAAA,GAAG,OAAO,CAAC;AACrB,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,QAAQ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AAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAtB,sBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,cAFrB,MAAM,EAAA,CAAA,CAAA;2FAEP,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAHlC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;iBACnB,CAAA;;;ACvBD;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-driver-magento.mjs","sources":["../../../libs/driver/magento/src/schema/schema.ts","../../../libs/driver/magento/src/errors/error.class.ts","../../../libs/driver/magento/src/errors/transform-graphql.ts","../../../libs/driver/magento/src/errors/transform.ts","../../../libs/driver/magento/src/graphql/cacheable-operations/cacheable-operations-token.ts","../../../libs/driver/magento/src/graphql/cacheable-operations/apollo-cacheable-operations-link-generator.ts","../../../libs/driver/magento/src/daffodil-driver-magento.ts"],"sourcesContent":["import introspectionQueryResultData from './introspection.json';\n\nexport const schema = introspectionQueryResultData;\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_DRIVER_MAGENTO_ERROR_CODE = 'DAFF_DRIVER_MAGENTO_ERROR';\n\n/**\n * A very general error thrown when a more specific error type cannot be determined.\n */\nexport class DaffDriverMagentoError extends DaffInheritableError implements DaffError {\n
|
|
1
|
+
{"version":3,"file":"daffodil-driver-magento.mjs","sources":["../../../libs/driver/magento/src/schema/schema.ts","../../../libs/driver/magento/src/errors/error.class.ts","../../../libs/driver/magento/src/errors/transform-graphql.ts","../../../libs/driver/magento/src/errors/transform.ts","../../../libs/driver/magento/src/graphql/cacheable-operations/cacheable-operations-token.ts","../../../libs/driver/magento/src/graphql/cacheable-operations/apollo-cacheable-operations-link-generator.ts","../../../libs/driver/magento/src/daffodil-driver-magento.ts"],"sourcesContent":["import introspectionQueryResultData from './introspection.json';\n\nexport const schema = introspectionQueryResultData;\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_DRIVER_MAGENTO_ERROR_CODE = 'DAFF_DRIVER_MAGENTO_ERROR';\n\n/**\n * A very general error thrown when a more specific error type cannot be determined.\n */\nexport class DaffDriverMagentoError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_DRIVER_MAGENTO_ERROR_CODE;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import { GraphQLError } from 'graphql';\n\nimport {\n DaffError,\n DaffErrorCodeMap,\n} from '@daffodil/core';\n\nimport { DaffDriverMagentoError } from './error.class';\n\nexport function daffMagentoTransformGraphQlError<T extends DaffErrorCodeMap>(\n error: GraphQLError,\n map: T,\n): DaffError {\n const ErrorClass = map[error.extensions.category] || DaffDriverMagentoError;\n\n return new ErrorClass(error.message) ;\n};\n","import {\n DaffError,\n DaffErrorCodeMap,\n daffIsError,\n} from '@daffodil/core';\n\nimport { DaffDriverMagentoError } from './error.class';\nimport { daffMagentoTransformGraphQlError } from './transform-graphql';\n\n/**\n * Transforms the passed error according to the lookup in the passed map.\n */\n// TODO: return array of errors\nexport function daffTransformMagentoError<T extends DaffErrorCodeMap>(error: any, map: T): DaffError {\n // TODO: handle network errors\n if (error.graphQLErrors) {\n return error.graphQLErrors.map(err => daffMagentoTransformGraphQlError<T>(err, map))[0];\n } else if (daffIsError(error)) {\n return error;\n } else {\n return new DaffDriverMagentoError(error.message);\n }\n};\n","import { InjectionToken } from '@angular/core';\n\n/**\n * A multi-provider injection token of the operation names of magento queries that should\n * be cached. This is needed because queries need to be converted into GET queries in order for Magento\n * to cache them. This token should be used by daffodil driver platform modules to register operation names that are cacheable, and is\n * intended for internal daffodil use only.\n */\nexport const DAFF_MAGENTO_CACHEABLE_OPERATIONS = new InjectionToken<string[]>('DAFF_MAGENTO_CACHEABLE_OPERATIONS', { factory: () => []});\n\n/**\n * Adds an operation name to the list of cacheable Magento operations. Use only with Angular 9+.\n */\nexport function provideDaffMagentoCacheableOperation(operationName: string) {\n return {\n provide: DAFF_MAGENTO_CACHEABLE_OPERATIONS,\n useValue: operationName,\n multi: true,\n };\n}\n\n/**\n * Adds many operation names to the list of cacheable Magento operations. Use only with Angular 9+.\n */\nexport function provideManyDaffMagentoCacheableOperations(...operationNames: string[]) {\n return operationNames.map(name => ({\n provide: DAFF_MAGENTO_CACHEABLE_OPERATIONS,\n useValue: name,\n multi: true,\n }));\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { ApolloLink } from '@apollo/client/core';\n\nimport { DaffApolloCacheableOperationLinkGenerator } from '@daffodil/core/graphql';\n\nimport { DAFF_MAGENTO_CACHEABLE_OPERATIONS } from './cacheable-operations-token';\n\n/**\n * A service that will convert cacheable apollo operations into a format that Magento will understand as cacheable.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoApolloCacheableOperationsLinkGenerator implements DaffApolloCacheableOperationLinkGenerator {\n constructor(\n @Inject(DAFF_MAGENTO_CACHEABLE_OPERATIONS) private apolloGetRequests: string[],\n ) {}\n\n getLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if(this.apolloGetRequests.indexOf(operation.operationName) > -1) {\n operation.setContext({ method: 'GET' });\n }\n return forward(operation);\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAM,MAAM,GAAG;;ACGf,MAAM,8BAA8B,GAAG,4BAA4B;AAE1E;;AAEG;AACG,MAAO,sBAAuB,SAAQ,oBAAoB,CAAA;AAG9D,IAAA,WAAA,CAAY,OAAgB,EAAA;QAC3B,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|
1
1
|
import { DaffInheritableError } from '@daffodil/core';
|
|
2
2
|
|
|
3
|
+
var DaffDriverErrorCodes;
|
|
4
|
+
(function (DaffDriverErrorCodes) {
|
|
5
|
+
DaffDriverErrorCodes["BAD_INPUT"] = "DAFF_BAD_INPUT";
|
|
6
|
+
})(DaffDriverErrorCodes || (DaffDriverErrorCodes = {}));
|
|
7
|
+
|
|
3
8
|
class DaffBadInputError extends DaffInheritableError {
|
|
4
9
|
constructor(message) {
|
|
5
10
|
super(message);
|
|
6
11
|
this.message = message;
|
|
7
|
-
this.code =
|
|
12
|
+
this.code = DaffDriverErrorCodes.BAD_INPUT;
|
|
8
13
|
}
|
|
9
14
|
}
|
|
10
15
|
|
|
@@ -12,5 +17,5 @@ class DaffBadInputError extends DaffInheritableError {
|
|
|
12
17
|
* Generated bundle index. Do not edit.
|
|
13
18
|
*/
|
|
14
19
|
|
|
15
|
-
export { DaffBadInputError };
|
|
20
|
+
export { DaffBadInputError, DaffDriverErrorCodes };
|
|
16
21
|
//# sourceMappingURL=daffodil-driver.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-driver.mjs","sources":["../../../libs/driver/src/errors/bad-input.ts","../../../libs/driver/src/daffodil-driver.ts"],"sourcesContent":["import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport class DaffBadInputError extends DaffInheritableError implements DaffError {\n public readonly code: string =
|
|
1
|
+
{"version":3,"file":"daffodil-driver.mjs","sources":["../../../libs/driver/src/errors/codes.ts","../../../libs/driver/src/errors/bad-input.ts","../../../libs/driver/src/daffodil-driver.ts"],"sourcesContent":["export enum DaffDriverErrorCodes {\n BAD_INPUT = 'DAFF_BAD_INPUT'\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffDriverErrorCodes } from './codes';\n\nexport class DaffBadInputError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffDriverErrorCodes.BAD_INPUT;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAY,IAAA,qBAEX;AAFD,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,WAAA,CAAA,GAAA,gBAA4B,CAAA;AAC9B,CAAC,EAFW,oBAAoB,KAApB,oBAAoB,GAE/B,EAAA,CAAA,CAAA;;ACKK,MAAO,iBAAkB,SAAQ,oBAAoB,CAAA;AAGzD,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;AADE,QAAA,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;AAFlB,QAAA,IAAA,CAAA,IAAI,GAAW,oBAAoB,CAAC,SAAS,CAAC;KAI7D;AACF;;ACbD;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-driver-magento-testing.mjs","sources":["../../../libs/driver/magento/testing/src/factories/money.factory.ts","../../../libs/driver/magento/testing/src/factories/discount.factory.ts","../../../libs/driver/magento/testing/src/daffodil-driver-magento-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { MagentoMoney } from '@daffodil/driver/magento';\n\nexport class MockMagentoMoney implements MagentoMoney {\n
|
|
1
|
+
{"version":3,"file":"daffodil-driver-magento-testing.mjs","sources":["../../../libs/driver/magento/testing/src/factories/money.factory.ts","../../../libs/driver/magento/testing/src/factories/discount.factory.ts","../../../libs/driver/magento/testing/src/daffodil-driver-magento-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { MagentoMoney } from '@daffodil/driver/magento';\n\nexport class MockMagentoMoney implements MagentoMoney {\n __typename = 'Money';\n value = faker.datatype.number({ min: 1, max: 10000 });\n currency = faker.random.word();\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoMoneyFactory extends DaffModelFactory<MagentoMoney> {\n constructor() {\n super(MockMagentoMoney);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n MagentoDiscount,\n MagentoMoney,\n} from '@daffodil/driver/magento';\n\nimport { MagentoMoneyFactory } from './money.factory';\n\nexport class MockMagentoDiscount implements MagentoDiscount {\n __typename = 'Discount';\n amount = this.money();\n label = faker.random.word();\n\n private money(): MagentoMoney {\n return (new MagentoMoneyFactory()).create();\n }\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoDiscountFactory extends DaffModelFactory<MagentoDiscount> {\n constructor() {\n super(MockMagentoDiscount);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAMa,gBAAgB,CAAA;AAA7B,IAAA,WAAA,GAAA;QACE,IAAU,CAAA,UAAA,GAAG,OAAO,CAAC;AACrB,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;AACtD,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;KAChC;AAAA,CAAA;AAAA,CAAC;AAKI,MAAO,mBAAoB,SAAQ,gBAA8B,CAAA;AACrE,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,gBAAgB,CAAC,CAAC;KACzB;;gHAHU,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnB,mBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAA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/schema.ts","../../../libs/driver/magento/src/errors/error.class.ts","../../../libs/driver/magento/src/errors/transform-graphql.ts","../../../libs/driver/magento/src/errors/transform.ts","../../../libs/driver/magento/src/graphql/cacheable-operations/cacheable-operations-token.ts","../../../libs/driver/magento/src/graphql/cacheable-operations/apollo-cacheable-operations-link-generator.ts","../../../libs/driver/magento/src/daffodil-driver-magento.ts"],"sourcesContent":["import introspectionQueryResultData from './introspection.json';\n\nexport const schema = introspectionQueryResultData;\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_DRIVER_MAGENTO_ERROR_CODE = 'DAFF_DRIVER_MAGENTO_ERROR';\n\n/**\n * A very general error thrown when a more specific error type cannot be determined.\n */\nexport class DaffDriverMagentoError extends DaffInheritableError implements DaffError {\n
|
|
1
|
+
{"version":3,"file":"daffodil-driver-magento.mjs","sources":["../../../libs/driver/magento/src/schema/schema.ts","../../../libs/driver/magento/src/errors/error.class.ts","../../../libs/driver/magento/src/errors/transform-graphql.ts","../../../libs/driver/magento/src/errors/transform.ts","../../../libs/driver/magento/src/graphql/cacheable-operations/cacheable-operations-token.ts","../../../libs/driver/magento/src/graphql/cacheable-operations/apollo-cacheable-operations-link-generator.ts","../../../libs/driver/magento/src/daffodil-driver-magento.ts"],"sourcesContent":["import introspectionQueryResultData from './introspection.json';\n\nexport const schema = introspectionQueryResultData;\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_DRIVER_MAGENTO_ERROR_CODE = 'DAFF_DRIVER_MAGENTO_ERROR';\n\n/**\n * A very general error thrown when a more specific error type cannot be determined.\n */\nexport class DaffDriverMagentoError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_DRIVER_MAGENTO_ERROR_CODE;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import { GraphQLError } from 'graphql';\n\nimport {\n DaffError,\n DaffErrorCodeMap,\n} from '@daffodil/core';\n\nimport { DaffDriverMagentoError } from './error.class';\n\nexport function daffMagentoTransformGraphQlError<T extends DaffErrorCodeMap>(\n error: GraphQLError,\n map: T,\n): DaffError {\n const ErrorClass = map[error.extensions.category] || DaffDriverMagentoError;\n\n return new ErrorClass(error.message) ;\n};\n","import {\n DaffError,\n DaffErrorCodeMap,\n daffIsError,\n} from '@daffodil/core';\n\nimport { DaffDriverMagentoError } from './error.class';\nimport { daffMagentoTransformGraphQlError } from './transform-graphql';\n\n/**\n * Transforms the passed error according to the lookup in the passed map.\n */\n// TODO: return array of errors\nexport function daffTransformMagentoError<T extends DaffErrorCodeMap>(error: any, map: T): DaffError {\n // TODO: handle network errors\n if (error.graphQLErrors) {\n return error.graphQLErrors.map(err => daffMagentoTransformGraphQlError<T>(err, map))[0];\n } else if (daffIsError(error)) {\n return error;\n } else {\n return new DaffDriverMagentoError(error.message);\n }\n};\n","import { InjectionToken } from '@angular/core';\n\n/**\n * A multi-provider injection token of the operation names of magento queries that should\n * be cached. This is needed because queries need to be converted into GET queries in order for Magento\n * to cache them. This token should be used by daffodil driver platform modules to register operation names that are cacheable, and is\n * intended for internal daffodil use only.\n */\nexport const DAFF_MAGENTO_CACHEABLE_OPERATIONS = new InjectionToken<string[]>('DAFF_MAGENTO_CACHEABLE_OPERATIONS', { factory: () => []});\n\n/**\n * Adds an operation name to the list of cacheable Magento operations. Use only with Angular 9+.\n */\nexport function provideDaffMagentoCacheableOperation(operationName: string) {\n return {\n provide: DAFF_MAGENTO_CACHEABLE_OPERATIONS,\n useValue: operationName,\n multi: true,\n };\n}\n\n/**\n * Adds many operation names to the list of cacheable Magento operations. Use only with Angular 9+.\n */\nexport function provideManyDaffMagentoCacheableOperations(...operationNames: string[]) {\n return operationNames.map(name => ({\n provide: DAFF_MAGENTO_CACHEABLE_OPERATIONS,\n useValue: name,\n multi: true,\n }));\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { ApolloLink } from '@apollo/client/core';\n\nimport { DaffApolloCacheableOperationLinkGenerator } from '@daffodil/core/graphql';\n\nimport { DAFF_MAGENTO_CACHEABLE_OPERATIONS } from './cacheable-operations-token';\n\n/**\n * A service that will convert cacheable apollo operations into a format that Magento will understand as cacheable.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoApolloCacheableOperationsLinkGenerator implements DaffApolloCacheableOperationLinkGenerator {\n constructor(\n @Inject(DAFF_MAGENTO_CACHEABLE_OPERATIONS) private apolloGetRequests: string[],\n ) {}\n\n getLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if(this.apolloGetRequests.indexOf(operation.operationName) > -1) {\n operation.setContext({ method: 'GET' });\n }\n return forward(operation);\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAM,MAAM,GAAG;;ACGf,MAAM,8BAA8B,GAAG,4BAA4B;AAE1E;;AAEG;AACG,MAAO,sBAAuB,SAAQ,oBAAoB,CAAA;AAG9D,IAAA,WAAA,CAAY,OAAgB,EAAA;QAC3B,KAAK,CAAC,OAAO,CAAC,CAAC;QAHA,IAAI,CAAA,IAAA,GAAW,8BAA8B,CAAC;KAI7D;AACF;;ACPe,SAAA,gCAAgC,CAC9C,KAAmB,EACnB,GAAM,EAAA;AAEN,IAAA,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,sBAAsB,CAAC;AAE5E,IAAA,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAE;AACxC,CAAC;AAAA;;ACPD;;AAEG;AACH;AACgB,SAAA,yBAAyB,CAA6B,KAAU,EAAE,GAAM,EAAA;;IAEtF,IAAI,KAAK,CAAC,aAAa,EAAE;QACvB,OAAO,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GA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D,YAAA,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;AAC5B,SAAC,CAAC,CAAC;KACJ;;AAZU,iDAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iDAAiD,kBAElD,iCAAiC,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAFhC,iDAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iDAAiD,cAFhD,MAAM,EAAA,CAAA,CAAA;2FAEP,iDAAiD,EAAA,UAAA,EAAA,CAAA;kBAH7D,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;0BAGI,MAAM;2BAAC,iCAAiC,CAAA;;;ACpB7C;;AAEG;;;;"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { DaffInheritableError } from '@daffodil/core';
|
|
2
2
|
|
|
3
|
+
var DaffDriverErrorCodes;
|
|
4
|
+
(function (DaffDriverErrorCodes) {
|
|
5
|
+
DaffDriverErrorCodes["BAD_INPUT"] = "DAFF_BAD_INPUT";
|
|
6
|
+
})(DaffDriverErrorCodes || (DaffDriverErrorCodes = {}));
|
|
7
|
+
|
|
3
8
|
class DaffBadInputError extends DaffInheritableError {
|
|
4
9
|
constructor(message) {
|
|
5
10
|
super(message);
|
|
6
11
|
this.message = message;
|
|
7
|
-
this.code =
|
|
12
|
+
this.code = DaffDriverErrorCodes.BAD_INPUT;
|
|
8
13
|
}
|
|
9
14
|
}
|
|
10
15
|
|
|
@@ -12,5 +17,5 @@ class DaffBadInputError extends DaffInheritableError {
|
|
|
12
17
|
* Generated bundle index. Do not edit.
|
|
13
18
|
*/
|
|
14
19
|
|
|
15
|
-
export { DaffBadInputError };
|
|
20
|
+
export { DaffBadInputError, DaffDriverErrorCodes };
|
|
16
21
|
//# sourceMappingURL=daffodil-driver.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-driver.mjs","sources":["../../../libs/driver/src/errors/bad-input.ts","../../../libs/driver/src/daffodil-driver.ts"],"sourcesContent":["import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport class DaffBadInputError extends DaffInheritableError implements DaffError {\n public readonly code: string =
|
|
1
|
+
{"version":3,"file":"daffodil-driver.mjs","sources":["../../../libs/driver/src/errors/codes.ts","../../../libs/driver/src/errors/bad-input.ts","../../../libs/driver/src/daffodil-driver.ts"],"sourcesContent":["export enum DaffDriverErrorCodes {\n BAD_INPUT = 'DAFF_BAD_INPUT'\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffDriverErrorCodes } from './codes';\n\nexport class DaffBadInputError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffDriverErrorCodes.BAD_INPUT;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;IAAY,qBAEX;AAFD,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,WAAA,CAAA,GAAA,gBAA4B,CAAA;AAC9B,CAAC,EAFW,oBAAoB,KAApB,oBAAoB,GAE/B,EAAA,CAAA,CAAA;;ACKK,MAAO,iBAAkB,SAAQ,oBAAoB,CAAA;AAGzD,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;QADE,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;AAFlB,QAAA,IAAA,CAAA,IAAI,GAAW,oBAAoB,CAAC,SAAS,CAAC;KAI7D;AACF;;ACbD;;AAEG;;;;"}
|