@aws-amplify/data-schema 1.19.0 → 1.20.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/dist/cjs/Authorization.js.map +1 -1
- package/dist/cjs/ClientSchema/utilities/index.js.map +1 -1
- package/dist/cjs/CombineSchema.js +2 -2
- package/dist/cjs/CombineSchema.js.map +1 -1
- package/dist/cjs/CustomOperation.js +5 -5
- package/dist/cjs/CustomOperation.js.map +1 -1
- package/dist/cjs/CustomType.js +1 -2
- package/dist/cjs/CustomType.js.map +1 -1
- package/dist/cjs/EnumType.js +1 -2
- package/dist/cjs/EnumType.js.map +1 -1
- package/dist/cjs/Handler.js +2 -2
- package/dist/cjs/Handler.js.map +1 -1
- package/dist/cjs/ModelField.js +24 -17
- package/dist/cjs/ModelField.js.map +1 -1
- package/dist/cjs/ModelIndex.js +1 -2
- package/dist/cjs/ModelIndex.js.map +1 -1
- package/dist/cjs/ModelRelationshipField.js +4 -4
- package/dist/cjs/ModelRelationshipField.js.map +1 -1
- package/dist/cjs/ModelSchema.js +3 -3
- package/dist/cjs/ModelSchema.js.map +1 -1
- package/dist/cjs/ModelType.js +2 -2
- package/dist/cjs/ModelType.js.map +1 -1
- package/dist/cjs/RefType.js +1 -2
- package/dist/cjs/RefType.js.map +1 -1
- package/dist/cjs/SchemaProcessor.js +36 -5
- package/dist/cjs/SchemaProcessor.js.map +1 -1
- package/dist/cjs/Validate.js +145 -0
- package/dist/cjs/Validate.js.map +1 -0
- package/dist/cjs/a.js.map +1 -1
- package/dist/cjs/ai/ConversationSchemaGraphQLTypes.js.map +1 -1
- package/dist/cjs/ai/ConversationSchemaProcessor.js.map +1 -1
- package/dist/cjs/ai/ConversationType.js +3 -3
- package/dist/cjs/ai/ConversationType.js.map +1 -1
- package/dist/cjs/ai/ModelType.js +1 -2
- package/dist/cjs/ai/ModelType.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/internals/index.js.map +1 -1
- package/dist/cjs/runtime/addSchemaToClient.js +1 -2
- package/dist/cjs/runtime/addSchemaToClient.js.map +1 -1
- package/dist/cjs/runtime/addSchemaToClientWithInstance.js +1 -2
- package/dist/cjs/runtime/addSchemaToClientWithInstance.js.map +1 -1
- package/dist/cjs/runtime/bridge-types.js.map +1 -1
- package/dist/cjs/runtime/client/index.js.map +1 -1
- package/dist/cjs/runtime/client/index.v3.js.map +1 -1
- package/dist/cjs/runtime/index.js.map +1 -1
- package/dist/cjs/runtime/index.v3.js.map +1 -1
- package/dist/cjs/runtime/internals/APIClient.js +10 -10
- package/dist/cjs/runtime/internals/APIClient.js.map +1 -1
- package/dist/cjs/runtime/internals/ai/conversationMessageDeserializers.js.map +1 -1
- package/dist/cjs/runtime/internals/ai/conversationMessageSerializers.js.map +1 -1
- package/dist/cjs/runtime/internals/ai/conversationStreamEventDeserializers.js.map +1 -1
- package/dist/cjs/runtime/internals/ai/convertItemToConversation.js.map +1 -1
- package/dist/cjs/runtime/internals/ai/convertItemToConversationMessage.js.map +1 -1
- package/dist/cjs/runtime/internals/ai/createCreateConversationFunction.js.map +1 -1
- package/dist/cjs/runtime/internals/ai/createDeleteConversationFunction.js.map +1 -1
- package/dist/cjs/runtime/internals/ai/createGetConversationFunction.js.map +1 -1
- package/dist/cjs/runtime/internals/ai/createListConversationsFunction.js.map +1 -1
- package/dist/cjs/runtime/internals/ai/createListMessagesFunction.js.map +1 -1
- package/dist/cjs/runtime/internals/ai/createOnStreamEventFunction.js.map +1 -1
- package/dist/cjs/runtime/internals/ai/createSendMessageFunction.js.map +1 -1
- package/dist/cjs/runtime/internals/ai/createUpdateConversationFunction.js.map +1 -1
- package/dist/cjs/runtime/internals/ai/getCustomUserAgentDetails.js +2 -2
- package/dist/cjs/runtime/internals/ai/getCustomUserAgentDetails.js.map +1 -1
- package/dist/cjs/runtime/internals/cancellation.js +2 -3
- package/dist/cjs/runtime/internals/cancellation.js.map +1 -1
- package/dist/cjs/runtime/internals/clientUtils.js.map +1 -1
- package/dist/cjs/runtime/internals/generateCustomOperationsProperty.js +4 -5
- package/dist/cjs/runtime/internals/generateCustomOperationsProperty.js.map +1 -1
- package/dist/cjs/runtime/internals/index.js.map +1 -1
- package/dist/cjs/runtime/internals/operations/custom.js +1 -2
- package/dist/cjs/runtime/internals/operations/custom.js.map +1 -1
- package/dist/cjs/runtime/internals/operations/get.js +1 -2
- package/dist/cjs/runtime/internals/operations/get.js.map +1 -1
- package/dist/cjs/runtime/internals/operations/indexQuery.js +1 -2
- package/dist/cjs/runtime/internals/operations/indexQuery.js.map +1 -1
- package/dist/cjs/runtime/internals/operations/list.js +1 -2
- package/dist/cjs/runtime/internals/operations/list.js.map +1 -1
- package/dist/cjs/runtime/internals/operations/observeQuery.js +1 -2
- package/dist/cjs/runtime/internals/operations/observeQuery.js.map +1 -1
- package/dist/cjs/runtime/internals/operations/subscription.js +1 -2
- package/dist/cjs/runtime/internals/operations/subscription.js.map +1 -1
- package/dist/cjs/runtime/internals/operations/utils.js +2 -3
- package/dist/cjs/runtime/internals/operations/utils.js.map +1 -1
- package/dist/cjs/runtime/internals/server/generateModelsProperty.js +1 -2
- package/dist/cjs/runtime/internals/server/generateModelsProperty.js.map +1 -1
- package/dist/cjs/runtime/internals/server/index.js.map +1 -1
- package/dist/cjs/runtime/internals/utils/clientProperties/generateConversationsProperty.js +1 -2
- package/dist/cjs/runtime/internals/utils/clientProperties/generateConversationsProperty.js.map +1 -1
- package/dist/cjs/runtime/internals/utils/clientProperties/generateEnumsProperty.js.map +1 -1
- package/dist/cjs/runtime/internals/utils/clientProperties/generateGenerationsProperty.js +1 -2
- package/dist/cjs/runtime/internals/utils/clientProperties/generateGenerationsProperty.js.map +1 -1
- package/dist/cjs/runtime/internals/utils/clientProperties/generateModelsProperty.js +1 -2
- package/dist/cjs/runtime/internals/utils/clientProperties/generateModelsProperty.js.map +1 -1
- package/dist/cjs/runtime/internals/utils/runtimeTypeGuards/isApiGraphQLProviderConfig.js +1 -2
- package/dist/cjs/runtime/internals/utils/runtimeTypeGuards/isApiGraphQLProviderConfig.js.map +1 -1
- package/dist/cjs/runtime/internals/utils/runtimeTypeGuards/isConfigureEventWithResourceConfig.js +1 -2
- package/dist/cjs/runtime/internals/utils/runtimeTypeGuards/isConfigureEventWithResourceConfig.js.map +1 -1
- package/dist/cjs/runtime/internals/utils/runtimeTypeGuards/isGraphQLResponseWithErrors.js +1 -2
- package/dist/cjs/runtime/internals/utils/runtimeTypeGuards/isGraphQLResponseWithErrors.js.map +1 -1
- package/dist/cjs/runtime/utils/findIndexByFields.js +1 -2
- package/dist/cjs/runtime/utils/findIndexByFields.js.map +1 -1
- package/dist/cjs/runtime/utils/index.js.map +1 -1
- package/dist/cjs/runtime/utils/resolveOwnerFields.js +1 -2
- package/dist/cjs/runtime/utils/resolveOwnerFields.js.map +1 -1
- package/dist/cjs/runtime/utils/resolvePKFields.js +1 -2
- package/dist/cjs/runtime/utils/resolvePKFields.js.map +1 -1
- package/dist/cjs/runtime/utils/selfAwareAsync.js +1 -2
- package/dist/cjs/runtime/utils/selfAwareAsync.js.map +1 -1
- package/dist/cjs/runtime/utils/stringTransformation.js +1 -2
- package/dist/cjs/runtime/utils/stringTransformation.js.map +1 -1
- package/dist/cjs/util/Brand.js +3 -3
- package/dist/cjs/util/Brand.js.map +1 -1
- package/dist/cjs/util/index.js.map +1 -1
- package/dist/esm/Authorization.d.ts +8 -8
- package/dist/esm/Authorization.mjs.map +1 -1
- package/dist/esm/CombineSchema.mjs.map +1 -1
- package/dist/esm/CustomOperation.mjs.map +1 -1
- package/dist/esm/CustomType.mjs.map +1 -1
- package/dist/esm/EnumType.mjs.map +1 -1
- package/dist/esm/Handler.mjs.map +1 -1
- package/dist/esm/ModelField.d.ts +39 -24
- package/dist/esm/ModelField.mjs +9 -2
- package/dist/esm/ModelField.mjs.map +1 -1
- package/dist/esm/ModelIndex.mjs.map +1 -1
- package/dist/esm/ModelRelationshipField.mjs.map +1 -1
- package/dist/esm/ModelSchema.mjs.map +1 -1
- package/dist/esm/ModelType.d.ts +1 -1
- package/dist/esm/ModelType.mjs.map +1 -1
- package/dist/esm/RefType.mjs.map +1 -1
- package/dist/esm/SchemaProcessor.mjs +36 -4
- package/dist/esm/SchemaProcessor.mjs.map +1 -1
- package/dist/esm/Validate.d.ts +218 -0
- package/dist/esm/Validate.mjs +142 -0
- package/dist/esm/Validate.mjs.map +1 -0
- package/dist/esm/ai/ConversationSchemaGraphQLTypes.mjs.map +1 -1
- package/dist/esm/ai/ConversationSchemaProcessor.mjs.map +1 -1
- package/dist/esm/ai/ConversationType.mjs.map +1 -1
- package/dist/esm/ai/ModelType.mjs.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/runtime/addSchemaToClient.mjs.map +1 -1
- package/dist/esm/runtime/addSchemaToClientWithInstance.mjs.map +1 -1
- package/dist/esm/runtime/bridge-types.mjs.map +1 -1
- package/dist/esm/runtime/internals/APIClient.mjs.map +1 -1
- package/dist/esm/runtime/internals/ai/conversationMessageDeserializers.mjs.map +1 -1
- package/dist/esm/runtime/internals/ai/conversationMessageSerializers.mjs.map +1 -1
- package/dist/esm/runtime/internals/ai/conversationStreamEventDeserializers.mjs.map +1 -1
- package/dist/esm/runtime/internals/ai/convertItemToConversation.mjs.map +1 -1
- package/dist/esm/runtime/internals/ai/createCreateConversationFunction.d.ts +1 -1
- package/dist/esm/runtime/internals/ai/createCreateConversationFunction.mjs.map +1 -1
- package/dist/esm/runtime/internals/ai/createDeleteConversationFunction.d.ts +1 -1
- package/dist/esm/runtime/internals/ai/createDeleteConversationFunction.mjs.map +1 -1
- package/dist/esm/runtime/internals/ai/createGetConversationFunction.d.ts +1 -1
- package/dist/esm/runtime/internals/ai/createGetConversationFunction.mjs.map +1 -1
- package/dist/esm/runtime/internals/ai/createListConversationsFunction.d.ts +1 -1
- package/dist/esm/runtime/internals/ai/createListConversationsFunction.mjs.map +1 -1
- package/dist/esm/runtime/internals/ai/createListMessagesFunction.d.ts +1 -1
- package/dist/esm/runtime/internals/ai/createListMessagesFunction.mjs.map +1 -1
- package/dist/esm/runtime/internals/ai/createOnStreamEventFunction.d.ts +1 -1
- package/dist/esm/runtime/internals/ai/createOnStreamEventFunction.mjs.map +1 -1
- package/dist/esm/runtime/internals/ai/createSendMessageFunction.d.ts +1 -1
- package/dist/esm/runtime/internals/ai/createSendMessageFunction.mjs +1 -1
- package/dist/esm/runtime/internals/ai/createSendMessageFunction.mjs.map +1 -1
- package/dist/esm/runtime/internals/ai/createUpdateConversationFunction.d.ts +1 -1
- package/dist/esm/runtime/internals/ai/createUpdateConversationFunction.mjs.map +1 -1
- package/dist/esm/runtime/internals/ai/getCustomUserAgentDetails.mjs.map +1 -1
- package/dist/esm/runtime/internals/cancellation.mjs.map +1 -1
- package/dist/esm/runtime/internals/clientUtils.mjs.map +1 -1
- package/dist/esm/runtime/internals/generateCustomOperationsProperty.d.ts +3 -3
- package/dist/esm/runtime/internals/generateCustomOperationsProperty.mjs.map +1 -1
- package/dist/esm/runtime/internals/operations/custom.mjs.map +1 -1
- package/dist/esm/runtime/internals/operations/get.mjs.map +1 -1
- package/dist/esm/runtime/internals/operations/indexQuery.mjs +1 -1
- package/dist/esm/runtime/internals/operations/indexQuery.mjs.map +1 -1
- package/dist/esm/runtime/internals/operations/list.mjs.map +1 -1
- package/dist/esm/runtime/internals/operations/observeQuery.mjs.map +1 -1
- package/dist/esm/runtime/internals/operations/subscription.mjs.map +1 -1
- package/dist/esm/runtime/internals/operations/utils.mjs.map +1 -1
- package/dist/esm/runtime/internals/server/generateModelsProperty.mjs.map +1 -1
- package/dist/esm/runtime/internals/utils/clientProperties/generateConversationsProperty.mjs.map +1 -1
- package/dist/esm/runtime/internals/utils/clientProperties/generateEnumsProperty.d.ts +1 -1
- package/dist/esm/runtime/internals/utils/clientProperties/generateEnumsProperty.mjs.map +1 -1
- package/dist/esm/runtime/internals/utils/clientProperties/generateGenerationsProperty.mjs.map +1 -1
- package/dist/esm/runtime/internals/utils/clientProperties/generateModelsProperty.mjs.map +1 -1
- package/dist/esm/runtime/internals/utils/runtimeTypeGuards/isApiGraphQLProviderConfig.mjs.map +1 -1
- package/dist/esm/runtime/internals/utils/runtimeTypeGuards/isConfigureEventWithResourceConfig.mjs.map +1 -1
- package/dist/esm/runtime/internals/utils/runtimeTypeGuards/isGraphQLResponseWithErrors.mjs.map +1 -1
- package/dist/esm/runtime/utils/findIndexByFields.mjs.map +1 -1
- package/dist/esm/runtime/utils/resolveOwnerFields.mjs.map +1 -1
- package/dist/esm/runtime/utils/resolvePKFields.mjs.map +1 -1
- package/dist/esm/runtime/utils/selfAwareAsync.mjs.map +1 -1
- package/dist/esm/runtime/utils/stringTransformation.mjs.map +1 -1
- package/dist/esm/util/Brand.mjs.map +1 -1
- package/dist/meta/cjs.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/ModelField.ts +70 -29
- package/src/SchemaProcessor.ts +46 -2
- package/src/Validate.ts +418 -0
- package/src/index.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.observeQueryFactory =
|
|
4
|
+
exports.observeQueryFactory = observeQueryFactory;
|
|
5
5
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
6
|
// SPDX-License-Identifier: Apache-2.0
|
|
7
7
|
const rxjs_1 = require("rxjs");
|
|
@@ -117,5 +117,4 @@ function observeQueryFactory(models, model) {
|
|
|
117
117
|
});
|
|
118
118
|
return observeQuery;
|
|
119
119
|
}
|
|
120
|
-
exports.observeQueryFactory = observeQueryFactory;
|
|
121
120
|
//# sourceMappingURL=observeQuery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observeQuery.js","sources":["../../../../../src/runtime/internals/operations/observeQuery.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.observeQueryFactory =
|
|
1
|
+
{"version":3,"file":"observeQuery.js","sources":["../../../../../src/runtime/internals/operations/observeQuery.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.observeQueryFactory = observeQueryFactory;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst rxjs_1 = require(\"rxjs\");\nconst utils_1 = require(\"../../utils\");\nfunction observeQueryFactory(models, model) {\n const { name } = model;\n const observeQuery = (arg) => new rxjs_1.Observable((subscriber) => {\n // what we'll be sending to our subscribers\n const items = [];\n // To enqueue subscription messages while we collect our initial\n // result set.\n const messageQueue = [];\n // operation to take when message(s) arrive.\n // this operation will be swapped out once initial \"sync\" is complete\n // to immediately ingest messsages.\n let receiveMessages = (...messages) => {\n return messageQueue.push(...messages);\n };\n // start subscriptions\n const onCreateSub = models[name].onCreate(arg).subscribe({\n next(item) {\n receiveMessages({ item, type: 'create' });\n },\n error(error) {\n subscriber.error({ type: 'onCreate', error });\n },\n });\n const onUpdateSub = models[name].onUpdate(arg).subscribe({\n next(item) {\n receiveMessages({ item, type: 'update' });\n },\n error(error) {\n subscriber.error({ type: 'onUpdate', error });\n },\n });\n const onDeleteSub = models[name].onDelete(arg).subscribe({\n next(item) {\n receiveMessages({ item, type: 'delete' });\n },\n error(error) {\n subscriber.error({ type: 'onDelete', error });\n },\n });\n // consumes a list of messages and sends a snapshot\n function ingestMessages(messages) {\n for (const message of messages) {\n const idx = (0, utils_1.findIndexByFields)(message.item, items, pkFields);\n switch (message.type) {\n case 'create':\n if (idx < 0)\n items.push(message.item);\n break;\n case 'update':\n if (idx >= 0)\n items[idx] = message.item;\n break;\n case 'delete':\n if (idx >= 0)\n items.splice(idx, 1);\n break;\n default:\n console.error('Unrecognized message in observeQuery.', message);\n }\n }\n subscriber.next({\n items,\n isSynced: true,\n });\n }\n const pkFields = (0, utils_1.resolvePKFields)(model);\n // initial results\n (async () => {\n let firstPage = true;\n let nextToken = null;\n while (!subscriber.closed && (firstPage || nextToken)) {\n firstPage = false;\n const { data: page, errors, nextToken: _nextToken, } = await models[name].list({ ...arg, nextToken });\n nextToken = _nextToken;\n items.push(...page);\n // if there are no more pages and no items we already know about\n // that need to be merged in from sub, we're \"synced\"\n const isSynced = messageQueue.length === 0 &&\n (nextToken === null || nextToken === undefined);\n subscriber.next({\n items,\n isSynced,\n });\n if (Array.isArray(errors)) {\n for (const error of errors) {\n subscriber.error(error);\n }\n }\n }\n // play through the queue\n if (messageQueue.length > 0) {\n ingestMessages(messageQueue);\n }\n // switch the queue to write directly to the items collection\n receiveMessages = (...messages) => {\n ingestMessages(messages);\n return items.length;\n };\n })();\n // when subscriber unsubscribes, tear down internal subs\n return () => {\n // 1. tear down internal subs\n onCreateSub.unsubscribe();\n onUpdateSub.unsubscribe();\n onDeleteSub.unsubscribe();\n // 2. there is no need to explicitly stop paging. instead, we\n // just check `subscriber.closed` above before fetching each page.\n };\n });\n return observeQuery;\n}\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,mBAAmB,GAAG,mBAAmB;AACjD;AACA;AACA,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AAC9B,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;AACtC,SAAS,mBAAmB,CAAC,MAAM,EAAE,KAAK,EAAE;AAC5C,IAAI,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK;AAC1B,IAAI,MAAM,YAAY,GAAG,CAAC,GAAG,KAAK,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC,UAAU,KAAK;AACxE;AACA,QAAQ,MAAM,KAAK,GAAG,EAAE;AACxB;AACA;AACA,QAAQ,MAAM,YAAY,GAAG,EAAE;AAC/B;AACA;AACA;AACA,QAAQ,IAAI,eAAe,GAAG,CAAC,GAAG,QAAQ,KAAK;AAC/C,YAAY,OA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AAG,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,SAAS,EAAE,CAAC;AACrH,gBAAgB,SAAS,GAAG,UAAU;AACtC,gBAAgB,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AACnC;AACA;AACA,gBAAgB,MAAM,QAAQ,GAAG,YAAY,CAAC,MAAM,KAAK,CAAC;AAC1D,qBAAqB,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,SAAS,CAAC;AACnE,gBAAgB,UAAU,CAAC,IAAI,CAAC;AAChC,oBAAoB,KAAK;AACzB,oBAAoB,QAAQ;AAC5B,iBAAiB,CAAC;AAClB,gBAAgB,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AAC3C,oBAAoB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;AAChD,wBAAwB,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC;AAC/C;AACA;AACA;AACA;AACA,YAAY,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE;AACzC,gBAAgB,cAAc,CAAC,YAAY,CAAC;AAC5C;AACA;AACA,YAAY,eAAe,GAAG,CAAC,GAAG,QAAQ,KAAK;AAC/C,gBAAgB,cAAc,CAAC,QAAQ,CAAC;AACxC,gBAAgB,OAAO,KAAK,CAAC,MAAM;AACnC,aAAa;AACb,SAAS,GAAG;AACZ;AACA,QAAQ,OAAO,MAAM;AACrB;AACA,YAAY,WAAW,CAAC,WAAW,EAAE;AACrC,YAAY,WAAW,CAAC,WAAW,EAAE;AACrC,YAAY,WAAW,CAAC,WAAW,EAAE;AACrC;AACA;AACA,SAAS;AACT,KAAK,CAAC;AACN,IAAI,OAAO,YAAY;AACvB;;"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.subscriptionFactory =
|
|
6
|
+
exports.subscriptionFactory = subscriptionFactory;
|
|
7
7
|
const rxjs_1 = require("rxjs");
|
|
8
8
|
const APIClient_1 = require("../APIClient");
|
|
9
9
|
function subscriptionFactory(client, modelIntrospection, model, operation, getInternals) {
|
|
@@ -36,5 +36,4 @@ function subscriptionFactory(client, modelIntrospection, model, operation, getIn
|
|
|
36
36
|
};
|
|
37
37
|
return subscription;
|
|
38
38
|
}
|
|
39
|
-
exports.subscriptionFactory = subscriptionFactory;
|
|
40
39
|
//# sourceMappingURL=subscription.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription.js","sources":["../../../../../src/runtime/internals/operations/subscription.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.subscriptionFactory =
|
|
1
|
+
{"version":3,"file":"subscription.js","sources":["../../../../../src/runtime/internals/operations/subscription.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.subscriptionFactory = subscriptionFactory;\nconst rxjs_1 = require(\"rxjs\");\nconst APIClient_1 = require(\"../APIClient\");\nfunction subscriptionFactory(client, modelIntrospection, model, operation, getInternals) {\n const { name } = model;\n const subscription = (args) => {\n const query = (0, APIClient_1.generateGraphQLDocument)(modelIntrospection, model, operation, args);\n const variables = (0, APIClient_1.buildGraphQLVariables)(model, operation, args, modelIntrospection);\n const auth = (0, APIClient_1.authModeParams)(client, getInternals, args);\n const headers = (0, APIClient_1.getCustomHeaders)(client, getInternals, args?.headers);\n const observable = client.graphql({\n ...auth,\n query,\n variables,\n }, headers);\n return observable.pipe((0, rxjs_1.map)((value) => {\n const [key] = Object.keys(value.data);\n const data = value.data[key];\n const flattenedResult = (0, APIClient_1.flattenItems)(modelIntrospection, name, data);\n if (flattenedResult === null) {\n return null;\n }\n else if (args?.selectionSet) {\n return flattenedResult;\n }\n else {\n const [initialized] = (0, APIClient_1.initializeModel)(client, name, [flattenedResult], modelIntrospection, auth.authMode, auth.authToken);\n return initialized;\n }\n }));\n };\n return subscription;\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,mBAAmB,GAAG,mBAAmB;AACjD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AAC9B,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC;AAC3C,SAAS,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE;AACzF,IAAI,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK;AAC1B,IAAI,MAAM,YAAY,GAAG,CAAC,IAAI,KAAK;AACnC,QAAQ,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,uBAAuB,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC;AAC1G,QAAQ,MAAM,SAAS,GAAG,IAAI,WAAW,CAAC,qBAAqB,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,kBAAkB,CAAC;AAC5G,QAAQ,MAAM,IAAI,GAAG,IAAI,WAAW,CAAC,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC;AAChF,QAAQ,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,CAAC;AAC9F,QAAQ,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC;AAC1C,YAAY,GAAG,IAAI;AACnB,YAAY,KAAK;AACjB,YAAY,SAAS;AACrB,SAAS,EAAE,OAAO,CAAC;AACnB,QAAQ,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,KAAK;AAC1D,YAAY,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;AACjD,YAAY,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;AACxC,YAAY,MAAM,eAAe,GAAG,IAAI,WAAW,CAAC,YAAY,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,CAAC;AACjG,YAAY,IAAI,eAAe,KAAK,IAAI,EAAE;AAC1C,gBAAgB,OAAO,IAAI;AAC3B;AACA,iBAAiB,IAAI,IAAI,EAAE,YAAY,EAAE;AACzC,gBAAgB,OAAO,eAAe;AACtC;AACA,iBAAiB;AACjB,gBAAgB,MAAM,CAAC,WAAW,CAAC,GAAG,IAAI,WAAW,CAAC,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,eAAe,CAAC,EAAE,kBAAkB,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC;AAC1J,gBAAgB,OAAO,WAAW;AAClC;AACA,SAAS,CAAC,CAAC;AACX,KAAK;AACL,IAAI,OAAO,YAAY;AACvB;;"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
// import { GraphQLFormattedError } from '@aws-amplify/data-schema-types';
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.handleListGraphQlError = handleListGraphQlError;
|
|
8
|
+
exports.handleSingularGraphQlError = handleSingularGraphQlError;
|
|
8
9
|
/**
|
|
9
10
|
* Handle errors for list return types (list and index query operations)
|
|
10
11
|
*/
|
|
@@ -21,7 +22,6 @@ function handleListGraphQlError(error) {
|
|
|
21
22
|
throw error;
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
|
-
exports.handleListGraphQlError = handleListGraphQlError;
|
|
25
25
|
/**
|
|
26
26
|
* Handle errors for singular return types (create, get, update, delete operations)
|
|
27
27
|
*/
|
|
@@ -38,5 +38,4 @@ function handleSingularGraphQlError(error) {
|
|
|
38
38
|
throw error;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
exports.handleSingularGraphQlError = handleSingularGraphQlError;
|
|
42
41
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../../src/runtime/internals/operations/utils.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n// import { GraphQLFormattedError } from '@aws-amplify/data-schema-types';\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../../src/runtime/internals/operations/utils.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n// import { GraphQLFormattedError } from '@aws-amplify/data-schema-types';\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleListGraphQlError = handleListGraphQlError;\nexports.handleSingularGraphQlError = handleSingularGraphQlError;\n/**\n * Handle errors for list return types (list and index query operations)\n */\nfunction handleListGraphQlError(error) {\n if (error?.errors) {\n // graphql errors pass through\n return {\n ...error,\n data: [],\n };\n }\n else {\n // non-graphql errors are re-thrown\n throw error;\n }\n}\n/**\n * Handle errors for singular return types (create, get, update, delete operations)\n */\nfunction handleSingularGraphQlError(error) {\n if (error.errors) {\n // graphql errors pass through\n return {\n ...error,\n data: null,\n };\n }\n else {\n // non-graphql errors are re-thrown\n throw error;\n }\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,sBAAsB,GAAG,sBAAsB;AACvD,OAAO,CAAC,0BAA0B,GAAG,0BAA0B;AAC/D;AACA;AACA;AACA,SAAS,sBAAsB,CAAC,KAAK,EAAE;AACvC,IAAI,IAAI,KAAK,EAAE,MAAM,EAAE;AACvB;AACA,QAAQ,OAAO;AACf,YAAY,GAAG,KAAK;AACpB,YAAY,IAAI,EAAE,EAAE;AACpB,SAAS;AACT;AACA,SAAS;AACT;AACA,QAAQ,MAAM,KAAK;AACnB;AACA;AACA;AACA;AACA;AACA,SAAS,0BAA0B,CAAC,KAAK,EAAE;AAC3C,IAAI,IAAI,KAAK,CAAC,MAAM,EAAE;AACtB;AACA,QAAQ,OAAO;AACf,YAAY,GAAG,KAAK;AACpB,YAAY,IAAI,EAAE,IAAI;AACtB,SAAS;AACT;AACA,SAAS;AACT;AACA,QAAQ,MAAM,KAAK;AACnB;AACA;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.generateModelsProperty =
|
|
4
|
+
exports.generateModelsProperty = generateModelsProperty;
|
|
5
5
|
const list_1 = require("../operations/list");
|
|
6
6
|
const indexQuery_1 = require("../operations/indexQuery");
|
|
7
7
|
const get_1 = require("../operations/get");
|
|
@@ -49,5 +49,4 @@ function generateModelsProperty(client, params, getInternals) {
|
|
|
49
49
|
}
|
|
50
50
|
return models;
|
|
51
51
|
}
|
|
52
|
-
exports.generateModelsProperty = generateModelsProperty;
|
|
53
52
|
//# sourceMappingURL=generateModelsProperty.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateModelsProperty.js","sources":["../../../../../src/runtime/internals/server/generateModelsProperty.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateModelsProperty =
|
|
1
|
+
{"version":3,"file":"generateModelsProperty.js","sources":["../../../../../src/runtime/internals/server/generateModelsProperty.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateModelsProperty = generateModelsProperty;\nconst list_1 = require(\"../operations/list\");\nconst indexQuery_1 = require(\"../operations/indexQuery\");\nconst get_1 = require(\"../operations/get\");\nconst clientUtils_1 = require(\"../clientUtils\");\nfunction generateModelsProperty(client, params, getInternals) {\n const models = {};\n const { config } = params;\n const useContext = params.amplify === null;\n if (!config) {\n throw new Error('generateModelsProperty cannot retrieve Amplify config');\n }\n if (!config.API?.GraphQL) {\n return {};\n }\n const modelIntrospection = config.API.GraphQL.modelIntrospection;\n if (!modelIntrospection) {\n return {};\n }\n const SSR_UNSUPORTED_OPS = [\n 'ONCREATE',\n 'ONUPDATE',\n 'ONDELETE',\n 'OBSERVEQUERY',\n ];\n for (const model of Object.values(modelIntrospection.models)) {\n const { name } = model;\n models[name] = {};\n const enabledModelOps = (0, clientUtils_1.excludeDisabledOps)(modelIntrospection, name);\n Object.entries(enabledModelOps).forEach(([key, { operationPrefix }]) => {\n const operation = key;\n // subscriptions are not supported in SSR\n if (SSR_UNSUPORTED_OPS.includes(operation))\n return;\n if (operation === 'LIST') {\n models[name][operationPrefix] = (0, list_1.listFactory)(client, modelIntrospection, model, getInternals, useContext);\n }\n else {\n models[name][operationPrefix] = (0, get_1.getFactory)(client, modelIntrospection, model, operation, getInternals, useContext);\n }\n });\n const secondaryIdxs = (0, clientUtils_1.getSecondaryIndexesFromSchemaModel)(model);\n for (const idx of secondaryIdxs) {\n models[name][idx.queryField] = (0, indexQuery_1.indexQueryFactory)(client, modelIntrospection, model, idx, getInternals, useContext);\n }\n }\n return models;\n}\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,sBAAsB,GAAG,sBAAsB;AACvD,MAAM,MAAM,GAAG,OAAO,C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AAC,KAAK;AAChF,YAAY,MAAM,SAAS,GAAG,GAAG;AACjC;AACA,YAAY,IAAI,kBAAkB,CAAC,QAAQ,CAAC,SAAS,CAAC;AACtD,gBAAgB;AAChB,YAAY,IAAI,SAAS,KAAK,MAAM,EAAE;AACtC,gBAAgB,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,GAAG,IAAI,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,YAAY,EAAE,UAAU,CAAC;AACpI;AACA,iBAAiB;AACjB,gBAAgB,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,GAAG,IAAI,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,CAAC;AAC7I;AACA,SAAS,CAAC;AACV,QAAQ,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,kCAAkC,EAAE,KAAK,CAAC;AAC1F,QAAQ,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE;AACzC,YAAY,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,IAAI,YAAY,CAAC,iBAAiB,EAAE,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,UAAU,CAAC;AAChJ;AACA;AACA,IAAI,OAAO,MAAM;AACjB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/runtime/internals/server/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./generateModelsProperty\"), exports);\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/runtime/internals/server/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./generateModelsProperty\"), exports);\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AAChC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,0BAA0B,CAAC,EAAE,OAAO,CAAC;;"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.generateConversationsProperty =
|
|
6
|
+
exports.generateConversationsProperty = generateConversationsProperty;
|
|
7
7
|
const createCreateConversationFunction_1 = require("../../ai/createCreateConversationFunction");
|
|
8
8
|
const createGetConversationFunction_1 = require("../../ai/createGetConversationFunction");
|
|
9
9
|
const createListConversationsFunction_1 = require("../../ai/createListConversationsFunction");
|
|
@@ -48,5 +48,4 @@ function generateConversationsProperty(client, apiGraphQLConfig, getInternals) {
|
|
|
48
48
|
}
|
|
49
49
|
return conversations;
|
|
50
50
|
}
|
|
51
|
-
exports.generateConversationsProperty = generateConversationsProperty;
|
|
52
51
|
//# sourceMappingURL=generateConversationsProperty.js.map
|
package/dist/cjs/runtime/internals/utils/clientProperties/generateConversationsProperty.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateConversationsProperty.js","sources":["../../../../../../src/runtime/internals/utils/clientProperties/generateConversationsProperty.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateConversationsProperty =
|
|
1
|
+
{"version":3,"file":"generateConversationsProperty.js","sources":["../../../../../../src/runtime/internals/utils/clientProperties/generateConversationsProperty.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateConversationsProperty = generateConversationsProperty;\nconst createCreateConversationFunction_1 = require(\"../../ai/createCreateConversationFunction\");\nconst createGetConversationFunction_1 = require(\"../../ai/createGetConversationFunction\");\nconst createListConversationsFunction_1 = require(\"../../ai/createListConversationsFunction\");\nconst createDeleteConversationFunction_1 = require(\"../../ai/createDeleteConversationFunction\");\nconst createUpdateConversationFunction_1 = require(\"../../ai/createUpdateConversationFunction\");\nfunction generateConversationsProperty(client, apiGraphQLConfig, getInternals) {\n const modelIntrospection = apiGraphQLConfig?.modelIntrospection;\n // conversations will be absent from model intro schema if no conversation routes\n // are present on the source schema.\n if (!modelIntrospection?.conversations) {\n return {};\n }\n const conversations = {};\n for (const { name, conversation, message, models, nonModels, enums, } of Object.values(modelIntrospection.conversations)) {\n const conversationModel = models[conversation.modelName];\n const conversationMessageModel = models[message.modelName];\n if (!conversationModel || !conversationMessageModel) {\n return {};\n }\n const conversationModelIntrospection = {\n ...modelIntrospection,\n models: {\n ...modelIntrospection.models,\n ...models,\n },\n nonModels: {\n ...modelIntrospection.nonModels,\n ...nonModels,\n },\n enums: {\n ...modelIntrospection.enums,\n ...enums,\n },\n };\n conversations[name] = {\n update: (0, createUpdateConversationFunction_1.createUpdateConversationFunction)(client, conversationModelIntrospection, name, conversationModel, conversationMessageModel, getInternals),\n create: (0, createCreateConversationFunction_1.createCreateConversationFunction)(client, conversationModelIntrospection, name, conversationModel, conversationMessageModel, getInternals),\n get: (0, createGetConversationFunction_1.createGetConversationFunction)(client, conversationModelIntrospection, name, conversationModel, conversationMessageModel, getInternals),\n delete: (0, createDeleteConversationFunction_1.createDeleteConversationFunction)(client, conversationModelIntrospection, name, conversationModel, conversationMessageModel, getInternals),\n list: (0, createListConversationsFunction_1.createListConversationsFunction)(client, conversationModelIntrospection, name, conversationModel, conversationMessageModel, getInternals),\n };\n }\n return conversations;\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,6BAA6B,GAAG,6BAA6B;AACrE,MAAM,kCAAkC,GAAG,OAAO,CAAC,2CAA2C,CAAC;AAC/F,MAAM,+BAA+B,GAAG,OAAO,CAAC,wCAAwC,CAAC;AACzF,MAAM,iCAAiC,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC7F,MAAM,kCAAkC,GAAG,OAAO,CAAC,2CAA2C,CAAC;AAC/F,MAAM,kCAAkC,GAAG,OAAO,CAAC,2CAA2C,CAAC;AAC/F,SAAS,6BAA6B,CAAC,MAAM,EAAE,gBAAgB,EAAE,YAAY,EAAE;AAC/E,IAAI,MAAM,kBAAkB,GAAG,gBAAgB,EAAE,kBAAkB;AACnE;AACA;AACA,IAAI,IAAI,CAAC,kBAAkB,EAAE,aAAa,EAAE;AAC5C,QAAQ,OAAO,EAAE;AACjB;AACA,IAAI,MAAM,aAAa,GAAG,EAAE;AAC5B,IAAI,KAAK,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,aAAa,CAAC,EAAE;AAC9H,QAAQ,MAAM,iBAAiB,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC;AAChE,QAAQ,MAAM,w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E,wBAAwB,EAAE,YAAY,CAAC;AACjM,SAAS;AACT;AACA,IAAI,OAAO,aAAa;AACxB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateEnumsProperty.js","sources":["../../../../../../src/runtime/internals/utils/clientProperties/generateEnumsProperty.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateEnumsProperty = void 0;\nconst generateEnumsProperty = (graphqlConfig) => {\n const modelIntrospection = graphqlConfig.modelIntrospection;\n if (!modelIntrospection) {\n return {};\n }\n const enums = {};\n for (const [_, enumData] of Object.entries(modelIntrospection.enums)) {\n enums[enumData.name] = {\n values: () => enumData.values,\n };\n }\n return enums;\n};\nexports.generateEnumsProperty = generateEnumsProperty;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"generateEnumsProperty.js","sources":["../../../../../../src/runtime/internals/utils/clientProperties/generateEnumsProperty.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateEnumsProperty = void 0;\nconst generateEnumsProperty = (graphqlConfig) => {\n const modelIntrospection = graphqlConfig.modelIntrospection;\n if (!modelIntrospection) {\n return {};\n }\n const enums = {};\n for (const [_, enumData] of Object.entries(modelIntrospection.enums)) {\n enums[enumData.name] = {\n values: () => enumData.values,\n };\n }\n return enums;\n};\nexports.generateEnumsProperty = generateEnumsProperty;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,qBAAqB,GAAG,MAAM;AACtC,MAAM,qBAAqB,GAAG,CAAC,aAAa,KAAK;AACjD,IAAI,MAAM,kBAAkB,GAAG,aAAa,CAAC,kBAAkB;AAC/D,IAAI,IAAI,CAAC,kBAAkB,EAAE;AAC7B,QAAQ,OAAO,EAAE;AACjB;AACA,IAAI,MAAM,KAAK,GAAG,EAAE;AACpB,IAAI,KAAK,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE;AAC1E,QAAQ,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG;AAC/B,YAAY,MAAM,EAAE,MAAM,QAAQ,CAAC,MAAM;AACzC,SAAS;AACT;AACA,IAAI,OAAO,KAAK;AAChB,CAAC;AACD,OAAO,CAAC,qBAAqB,GAAG,qBAAqB;;"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.generateGenerationsProperty =
|
|
6
|
+
exports.generateGenerationsProperty = generateGenerationsProperty;
|
|
7
7
|
const custom_1 = require("../../operations/custom");
|
|
8
8
|
const getCustomUserAgentDetails_1 = require("../../ai/getCustomUserAgentDetails");
|
|
9
9
|
function generateGenerationsProperty(client, apiGraphQLConfig, getInternals) {
|
|
@@ -19,5 +19,4 @@ function generateGenerationsProperty(client, apiGraphQLConfig, getInternals) {
|
|
|
19
19
|
}
|
|
20
20
|
return generations;
|
|
21
21
|
}
|
|
22
|
-
exports.generateGenerationsProperty = generateGenerationsProperty;
|
|
23
22
|
//# sourceMappingURL=generateGenerationsProperty.js.map
|
package/dist/cjs/runtime/internals/utils/clientProperties/generateGenerationsProperty.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateGenerationsProperty.js","sources":["../../../../../../src/runtime/internals/utils/clientProperties/generateGenerationsProperty.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateGenerationsProperty =
|
|
1
|
+
{"version":3,"file":"generateGenerationsProperty.js","sources":["../../../../../../src/runtime/internals/utils/clientProperties/generateGenerationsProperty.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateGenerationsProperty = generateGenerationsProperty;\nconst custom_1 = require(\"../../operations/custom\");\nconst getCustomUserAgentDetails_1 = require(\"../../ai/getCustomUserAgentDetails\");\nfunction generateGenerationsProperty(client, apiGraphQLConfig, getInternals) {\n const modelIntrospection = apiGraphQLConfig?.modelIntrospection;\n // generations will be absent from model intro schema if no generation routes\n // are present on the source schema.\n if (!modelIntrospection?.generations) {\n return {};\n }\n const generations = {};\n for (const generation of Object.values(modelIntrospection.generations)) {\n generations[generation.name] = (0, custom_1.customOpFactory)(client, modelIntrospection, 'query', generation, false, getInternals, (0, getCustomUserAgentDetails_1.getCustomUserAgentDetails)(getCustomUserAgentDetails_1.AiAction.Generation));\n }\n return generations;\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,2BAA2B,GAAG,2BAA2B;AACjE,MAAM,QAAQ,GAAG,OAAO,CAAC,yBAAyB,CAAC;AACnD,MAAM,2BAA2B,GAAG,OAAO,CAAC,oCAAoC,CAAC;AACjF,SAAS,2BAA2B,CAAC,MAAM,EAAE,gBAAgB,EAAE,YAAY,EAAE;AAC7E,IAAI,MAAM,kBAAkB,GAAG,gBAAgB,EAAE,kBAAkB;AACnE;AACA;AACA,IAAI,IAAI,CAAC,kBAAkB,EAAE,WAAW,EAAE;AAC1C,QAAQ,OAAO,EAAE;AACjB;AACA,IAAI,MAAM,WAAW,GAAG,EAAE;AAC1B,IAAI,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,EAAE;AAC5E,QAAQ,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,QAAQ,CAAC,eAAe,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,2BAA2B,CAAC,yBAAyB,EAAE,2BAA2B,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AACvP;AACA,IAAI,OAAO,WAAW;AACtB;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.generateModelsProperty =
|
|
4
|
+
exports.generateModelsProperty = generateModelsProperty;
|
|
5
5
|
const list_1 = require("../../operations/list");
|
|
6
6
|
const indexQuery_1 = require("../../operations/indexQuery");
|
|
7
7
|
const get_1 = require("../../operations/get");
|
|
@@ -41,5 +41,4 @@ function generateModelsProperty(client, apiGraphQLConfig, getInternals) {
|
|
|
41
41
|
}
|
|
42
42
|
return models;
|
|
43
43
|
}
|
|
44
|
-
exports.generateModelsProperty = generateModelsProperty;
|
|
45
44
|
//# sourceMappingURL=generateModelsProperty.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateModelsProperty.js","sources":["../../../../../../src/runtime/internals/utils/clientProperties/generateModelsProperty.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateModelsProperty =
|
|
1
|
+
{"version":3,"file":"generateModelsProperty.js","sources":["../../../../../../src/runtime/internals/utils/clientProperties/generateModelsProperty.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateModelsProperty = generateModelsProperty;\nconst list_1 = require(\"../../operations/list\");\nconst indexQuery_1 = require(\"../../operations/indexQuery\");\nconst get_1 = require(\"../../operations/get\");\nconst subscription_1 = require(\"../../operations/subscription\");\nconst observeQuery_1 = require(\"../../operations/observeQuery\");\nconst clientUtils_1 = require(\"../../clientUtils\");\nfunction generateModelsProperty(client, apiGraphQLConfig, getInternals) {\n const models = {};\n const modelIntrospection = apiGraphQLConfig.modelIntrospection;\n if (!modelIntrospection) {\n return {};\n }\n const SUBSCRIPTION_OPS = ['ONCREATE', 'ONUPDATE', 'ONDELETE'];\n for (const model of Object.values(modelIntrospection.models)) {\n const { name } = model;\n models[name] = {};\n const enabledModelOps = (0, clientUtils_1.excludeDisabledOps)(modelIntrospection, name);\n Object.entries(enabledModelOps).forEach(([key, { operationPrefix }]) => {\n const operation = key;\n if (operation === 'LIST') {\n models[name][operationPrefix] = (0, list_1.listFactory)(client, modelIntrospection, model, getInternals);\n }\n else if (SUBSCRIPTION_OPS.includes(operation)) {\n models[name][operationPrefix] = (0, subscription_1.subscriptionFactory)(client, modelIntrospection, model, operation, getInternals);\n }\n else if (operation === 'OBSERVEQUERY') {\n models[name][operationPrefix] = (0, observeQuery_1.observeQueryFactory)(models, model);\n }\n else {\n models[name][operationPrefix] = (0, get_1.getFactory)(client, modelIntrospection, model, operation, getInternals);\n }\n });\n const secondaryIdxs = (0, clientUtils_1.getSecondaryIndexesFromSchemaModel)(model);\n for (const idx of secondaryIdxs) {\n models[name][idx.queryField] = (0, indexQuery_1.indexQueryFactory)(client, modelIntrospection, model, idx, getInternals);\n }\n }\n return models;\n}\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,sBAAsB,GAAG,sBAAsB;AACvD,M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xH;AACA,iBAAiB,IAAI,gBAAgB,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;AAC3D,gBAAgB,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,GAAG,IAAI,cAAc,CAAC,mBAAmB,EAAE,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,CAAC;AACnJ;AACA,iBAAiB,IAAI,SAAS,KAAK,cAAc,EAAE;AACnD,gBAAgB,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,GAAG,IAAI,cAAc,CAAC,mBAAmB,EAAE,MAAM,EAAE,KAAK,CAAC;AACtG;AACA,iBAAiB;AACjB,gBAAgB,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,GAAG,IAAI,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,CAAC;AACjI;AACA,SAAS,CAAC;AACV,QAAQ,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,kCAAkC,EAAE,KAAK,CAAC;AAC1F,QAAQ,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE;AACzC,YAAY,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,IAAI,YAAY,CAAC,iBAAiB,EAAE,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,CAAC;AACpI;AACA;AACA,IAAI,OAAO,MAAM;AACjB;;"}
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isApiGraphQLConfig =
|
|
6
|
+
exports.isApiGraphQLConfig = isApiGraphQLConfig;
|
|
7
7
|
function isApiGraphQLConfig(apiGraphQLConfig) {
|
|
8
8
|
return apiGraphQLConfig !== undefined;
|
|
9
9
|
}
|
|
10
|
-
exports.isApiGraphQLConfig = isApiGraphQLConfig;
|
|
11
10
|
//# sourceMappingURL=isApiGraphQLProviderConfig.js.map
|
package/dist/cjs/runtime/internals/utils/runtimeTypeGuards/isApiGraphQLProviderConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isApiGraphQLProviderConfig.js","sources":["../../../../../../src/runtime/internals/utils/runtimeTypeGuards/isApiGraphQLProviderConfig.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isApiGraphQLConfig =
|
|
1
|
+
{"version":3,"file":"isApiGraphQLProviderConfig.js","sources":["../../../../../../src/runtime/internals/utils/runtimeTypeGuards/isApiGraphQLProviderConfig.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isApiGraphQLConfig = isApiGraphQLConfig;\nfunction isApiGraphQLConfig(apiGraphQLConfig) {\n return apiGraphQLConfig !== undefined;\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;AAC/C,SAAS,kBAAkB,CAAC,gBAAgB,EAAE;AAC9C,IAAI,OAAO,gBAAgB,KAAK,SAAS;AACzC;;"}
|
package/dist/cjs/runtime/internals/utils/runtimeTypeGuards/isConfigureEventWithResourceConfig.js
CHANGED
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isConfigureEventWithResourceConfig =
|
|
6
|
+
exports.isConfigureEventWithResourceConfig = isConfigureEventWithResourceConfig;
|
|
7
7
|
function isConfigureEventWithResourceConfig(payload) {
|
|
8
8
|
return payload.event === 'configure';
|
|
9
9
|
}
|
|
10
|
-
exports.isConfigureEventWithResourceConfig = isConfigureEventWithResourceConfig;
|
|
11
10
|
//# sourceMappingURL=isConfigureEventWithResourceConfig.js.map
|
package/dist/cjs/runtime/internals/utils/runtimeTypeGuards/isConfigureEventWithResourceConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isConfigureEventWithResourceConfig.js","sources":["../../../../../../src/runtime/internals/utils/runtimeTypeGuards/isConfigureEventWithResourceConfig.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isConfigureEventWithResourceConfig =
|
|
1
|
+
{"version":3,"file":"isConfigureEventWithResourceConfig.js","sources":["../../../../../../src/runtime/internals/utils/runtimeTypeGuards/isConfigureEventWithResourceConfig.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isConfigureEventWithResourceConfig = isConfigureEventWithResourceConfig;\nfunction isConfigureEventWithResourceConfig(payload) {\n return payload.event === 'configure';\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,kCAAkC,GAAG,kCAAkC;AAC/E,SAAS,kCAAkC,CAAC,OAAO,EAAE;AACrD,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,WAAW;AACxC;;"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isGraphQLResponseWithErrors =
|
|
6
|
+
exports.isGraphQLResponseWithErrors = isGraphQLResponseWithErrors;
|
|
7
7
|
function isGraphQLResponseWithErrors(response) {
|
|
8
8
|
if (!response) {
|
|
9
9
|
return false;
|
|
@@ -11,5 +11,4 @@ function isGraphQLResponseWithErrors(response) {
|
|
|
11
11
|
const r = response;
|
|
12
12
|
return Array.isArray(r.errors) && r.errors.length > 0;
|
|
13
13
|
}
|
|
14
|
-
exports.isGraphQLResponseWithErrors = isGraphQLResponseWithErrors;
|
|
15
14
|
//# sourceMappingURL=isGraphQLResponseWithErrors.js.map
|
package/dist/cjs/runtime/internals/utils/runtimeTypeGuards/isGraphQLResponseWithErrors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isGraphQLResponseWithErrors.js","sources":["../../../../../../src/runtime/internals/utils/runtimeTypeGuards/isGraphQLResponseWithErrors.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isGraphQLResponseWithErrors =
|
|
1
|
+
{"version":3,"file":"isGraphQLResponseWithErrors.js","sources":["../../../../../../src/runtime/internals/utils/runtimeTypeGuards/isGraphQLResponseWithErrors.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isGraphQLResponseWithErrors = isGraphQLResponseWithErrors;\nfunction isGraphQLResponseWithErrors(response) {\n if (!response) {\n return false;\n }\n const r = response;\n return Array.isArray(r.errors) && r.errors.length > 0;\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,2BAA2B,GAAG,2BAA2B;AACjE,SAAS,2BAA2B,CAAC,QAAQ,EAAE;AAC/C,IAAI,IAAI,CAAC,QAAQ,EAAE;AACnB,QAAQ,OAAO,KAAK;AACpB;AACA,IAAI,MAAM,CAAC,GAAG,QAAQ;AACtB,IAAI,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;AACzD;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.findIndexByFields =
|
|
4
|
+
exports.findIndexByFields = findIndexByFields;
|
|
5
5
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
6
|
// SPDX-License-Identifier: Apache-2.0
|
|
7
7
|
/**
|
|
@@ -21,5 +21,4 @@ function findIndexByFields(needle, haystack, keyFields) {
|
|
|
21
21
|
}
|
|
22
22
|
return -1;
|
|
23
23
|
}
|
|
24
|
-
exports.findIndexByFields = findIndexByFields;
|
|
25
24
|
//# sourceMappingURL=findIndexByFields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findIndexByFields.js","sources":["../../../../src/runtime/utils/findIndexByFields.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.findIndexByFields =
|
|
1
|
+
{"version":3,"file":"findIndexByFields.js","sources":["../../../../src/runtime/utils/findIndexByFields.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.findIndexByFields = findIndexByFields;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Iterates through a collection to find a matching item and returns the index.\n *\n * @param needle The item to search for\n * @param haystack The collection to search\n * @param keyFields The fields used to indicate a match\n * @returns Index of `needle` in `haystack`, otherwise -1 if not found.\n */\nfunction findIndexByFields(needle, haystack, keyFields) {\n const searchObject = Object.fromEntries(keyFields.map((fieldName) => [fieldName, needle[fieldName]]));\n for (let i = 0; i < haystack.length; i++) {\n if (Object.keys(searchObject).every((k) => searchObject[k] === haystack[i][k])) {\n return i;\n }\n }\n return -1;\n}\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,iBAAiB,GAAG,iBAAiB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,iBAAiB,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE;AACxD,IAAI,MAAM,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,SAAS,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACzG,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC9C,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;AACxF,YAAY,OAAO,CAAC;AACpB;AACA;AACA,IAAI,OAAO,EAAE;AACb;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/runtime/utils/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.selfAwareAsync = exports.capitalize = exports.resolveOwnerFields = exports.findIndexByFields = exports.resolvePKFields = void 0;\nvar resolvePKFields_1 = require(\"./resolvePKFields\");\nObject.defineProperty(exports, \"resolvePKFields\", { enumerable: true, get: function () { return resolvePKFields_1.resolvePKFields; } });\nvar findIndexByFields_1 = require(\"./findIndexByFields\");\nObject.defineProperty(exports, \"findIndexByFields\", { enumerable: true, get: function () { return findIndexByFields_1.findIndexByFields; } });\nvar resolveOwnerFields_1 = require(\"./resolveOwnerFields\");\nObject.defineProperty(exports, \"resolveOwnerFields\", { enumerable: true, get: function () { return resolveOwnerFields_1.resolveOwnerFields; } });\nvar stringTransformation_1 = require(\"./stringTransformation\");\nObject.defineProperty(exports, \"capitalize\", { enumerable: true, get: function () { return stringTransformation_1.capitalize; } });\nvar selfAwareAsync_1 = require(\"./selfAwareAsync\");\nObject.defineProperty(exports, \"selfAwareAsync\", { enumerable: true, get: function () { return selfAwareAsync_1.selfAwareAsync; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/runtime/utils/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.selfAwareAsync = exports.capitalize = exports.resolveOwnerFields = exports.findIndexByFields = exports.resolvePKFields = void 0;\nvar resolvePKFields_1 = require(\"./resolvePKFields\");\nObject.defineProperty(exports, \"resolvePKFields\", { enumerable: true, get: function () { return resolvePKFields_1.resolvePKFields; } });\nvar findIndexByFields_1 = require(\"./findIndexByFields\");\nObject.defineProperty(exports, \"findIndexByFields\", { enumerable: true, get: function () { return findIndexByFields_1.findIndexByFields; } });\nvar resolveOwnerFields_1 = require(\"./resolveOwnerFields\");\nObject.defineProperty(exports, \"resolveOwnerFields\", { enumerable: true, get: function () { return resolveOwnerFields_1.resolveOwnerFields; } });\nvar stringTransformation_1 = require(\"./stringTransformation\");\nObject.defineProperty(exports, \"capitalize\", { enumerable: true, get: function () { return stringTransformation_1.capitalize; } });\nvar selfAwareAsync_1 = require(\"./selfAwareAsync\");\nObject.defineProperty(exports, \"selfAwareAsync\", { enumerable: true, get: function () { return selfAwareAsync_1.selfAwareAsync; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,eAAe,GAAG,MAAM;AACvI,IAAI,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACpD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,iBAAiB,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC;AACvI,IAAI,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC;AACxD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,mBAAmB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,mBAAmB,CAAC,iBAAiB,CAAC,EAAE,EAAE,CAAC;AAC7I,IAAI,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,CAAC;AAC1D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,oBAAoB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,oBAAoB,CAAC,kBAAkB,CAAC,EAAE,EAAE,CAAC;AAChJ,IAAI,sBAAsB,GAAG,OAAO,CAAC,wBAAwB,CAAC;AAC9D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,sBAAsB,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;AAClI,IAAI,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;AAClD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,gBAAgB,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.resolveOwnerFields =
|
|
4
|
+
exports.resolveOwnerFields = resolveOwnerFields;
|
|
5
5
|
/**
|
|
6
6
|
* Given an introspection schema model, returns all owner fields.
|
|
7
7
|
*
|
|
@@ -27,7 +27,6 @@ function resolveOwnerFields(model) {
|
|
|
27
27
|
}
|
|
28
28
|
return Array.from(ownerFields);
|
|
29
29
|
}
|
|
30
|
-
exports.resolveOwnerFields = resolveOwnerFields;
|
|
31
30
|
/**
|
|
32
31
|
* Type guard that identifies an auth attribute with an attached rules list that
|
|
33
32
|
* specifies an `allow` attribute at a minimum.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveOwnerFields.js","sources":["../../../../src/runtime/utils/resolveOwnerFields.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveOwnerFields =
|
|
1
|
+
{"version":3,"file":"resolveOwnerFields.js","sources":["../../../../src/runtime/utils/resolveOwnerFields.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveOwnerFields = resolveOwnerFields;\n/**\n * Given an introspection schema model, returns all owner fields.\n *\n * @param model Model from an introspection schema\n * @returns List of owner field names\n */\nfunction resolveOwnerFields(model) {\n const ownerFields = new Set();\n for (const attr of model.attributes || []) {\n if (isAuthAttribute(attr)) {\n for (const rule of attr.properties.rules) {\n if (rule.allow === 'owner') {\n ownerFields.add(rule.ownerField || 'owner');\n }\n else if (rule.allow === 'groups' && rule.groupsField !== undefined) {\n // only valid for dynamic group(s)\n // static group auth will have an array of predefined groups in the attribute, groups: string[]\n // but `groupsField` will be undefined\n ownerFields.add(rule.groupsField);\n }\n }\n }\n }\n return Array.from(ownerFields);\n}\n/**\n * Type guard that identifies an auth attribute with an attached rules list that\n * specifies an `allow` attribute at a minimum.\n *\n * @param attribute Any object. Ideally a model introspection schema model attribute\n * @returns True if given object is an auth attribute\n */\nfunction isAuthAttribute(attribute) {\n if (attribute?.type === 'auth') {\n if (typeof attribute?.properties === 'object') {\n if (Array.isArray(attribute?.properties?.rules)) {\n return (attribute?.properties?.rules).every((rule) => !!rule.allow);\n }\n }\n }\n return false;\n}\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,kBAAkB,CAAC,KAAK,EAAE;AACnC,IAAI,MAAM,WAAW,GAAG,IAAI,GAAG,EAAE;AACjC,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,UAAU,IAAI,EAAE,EAAE;AAC/C,QAAQ,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE;AACnC,YAAY,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE;AACtD,gBAAgB,IAAI,IAAI,CAAC,KAAK,KAAK,OAAO,EAAE;AAC5C,oBAAoB,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,IAAI,OAAO,CAAC;AAC/D;AACA,qBAAqB,IAAI,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE;AACpF;AACA;AACA;AACA,oBAAoB,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC;AACrD;AACA;AACA;AACA;AACA,IAAI,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,eAAe,CAAC,SAAS,EAAE;AACpC,IAAI,IAAI,SAAS,EAAE,IAAI,KAAK,MAAM,EAAE;AACpC,QAAQ,IAAI,OAAO,SAAS,EAAE,UAAU,KAAK,QAAQ,EAAE;AACvD,YAAY,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE;AAC7D,gBAAgB,OAAO,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;AACnF;AACA;AACA;AACA,IAAI,OAAO,KAAK;AAChB;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.resolvePKFields =
|
|
4
|
+
exports.resolvePKFields = resolvePKFields;
|
|
5
5
|
/**
|
|
6
6
|
* Given a SchemaModel from a ModelIntrospectionSchema, returns the primary key
|
|
7
7
|
* as an array of field names.
|
|
@@ -13,5 +13,4 @@ function resolvePKFields(model) {
|
|
|
13
13
|
const { primaryKeyFieldName, sortKeyFieldNames } = model.primaryKeyInfo;
|
|
14
14
|
return [primaryKeyFieldName, ...sortKeyFieldNames];
|
|
15
15
|
}
|
|
16
|
-
exports.resolvePKFields = resolvePKFields;
|
|
17
16
|
//# sourceMappingURL=resolvePKFields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvePKFields.js","sources":["../../../../src/runtime/utils/resolvePKFields.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolvePKFields =
|
|
1
|
+
{"version":3,"file":"resolvePKFields.js","sources":["../../../../src/runtime/utils/resolvePKFields.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolvePKFields = resolvePKFields;\n/**\n * Given a SchemaModel from a ModelIntrospectionSchema, returns the primary key\n * as an array of field names.\n *\n * @param model The model object\n * @returns Array of field names\n */\nfunction resolvePKFields(model) {\n const { primaryKeyFieldName, sortKeyFieldNames } = model.primaryKeyInfo;\n return [primaryKeyFieldName, ...sortKeyFieldNames];\n}\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,eAAe,GAAG,eAAe;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,eAAe,CAAC,KAAK,EAAE;AAChC,IAAI,MAAM,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,GAAG,KAAK,CAAC,cAAc;AAC3E,IAAI,OAAO,CAAC,mBAAmB,EAAE,GAAG,iBAAiB,CAAC;AACtD;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.selfAwareAsync =
|
|
4
|
+
exports.selfAwareAsync = selfAwareAsync;
|
|
5
5
|
/**
|
|
6
6
|
* Executes an `async` resolver function, providing the `Promise`-to-be-returned as the
|
|
7
7
|
* first argument to the resolver so that the resolver can refer to the `Promise` that
|
|
@@ -36,5 +36,4 @@ function selfAwareAsync(resolver) {
|
|
|
36
36
|
});
|
|
37
37
|
return resultPromise;
|
|
38
38
|
}
|
|
39
|
-
exports.selfAwareAsync = selfAwareAsync;
|
|
40
39
|
//# sourceMappingURL=selfAwareAsync.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selfAwareAsync.js","sources":["../../../../src/runtime/utils/selfAwareAsync.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.selfAwareAsync =
|
|
1
|
+
{"version":3,"file":"selfAwareAsync.js","sources":["../../../../src/runtime/utils/selfAwareAsync.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.selfAwareAsync = selfAwareAsync;\n/**\n * Executes an `async` resolver function, providing the `Promise`-to-be-returned as the\n * first argument to the resolver so that the resolver can refer to the `Promise` that\n * external callers will see.\n *\n * ```ts\n * const outer = selfAwareAsync(async inner => {\n * console.log(outer === inner); // true\n * });\n * ```\n *\n * This utility exists to reduce boilerplate in cases where promise resolving code needs\n * to track or register its \"own\" `Promise` *as seen by the caller* in some way. E.g.,\n * when mapping `Promise` chains for `client.cancel()`.\n *\n * @param resolver\n * @returns\n */\nfunction selfAwareAsync(resolver) {\n let resolve;\n let reject;\n const resultPromise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n resolver(resultPromise)\n .then((result) => {\n resolve(result);\n })\n .catch((error) => {\n reject(error);\n });\n return resultPromise;\n}\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,cAAc,GAAG,cAAc;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,cAAc,CAAC,QAAQ,EAAE;AAClC,IAAI,IAAI,OAAO;AACf,IAAI,IAAI,MAAM;AACd,IAAI,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,KAAK;AACpD,QAAQ,OAAO,GAAG,GAAG;AACrB,QAAQ,MAAM,GAAG,GAAG;AACpB,KAAK,CAAC;AACN,IAAI,QAAQ,CAAC,aAAa;AAC1B,SAAS,IAAI,CAAC,CAAC,MAAM,KAAK;AAC1B,QAAQ,OAAO,CAAC,MAAM,CAAC;AACvB,KAAK;AACL,SAAS,KAAK,CAAC,CAAC,KAAK,KAAK;AAC1B,QAAQ,MAAM,CAAC,KAAK,CAAC;AACrB,KAAK,CAAC;AACN,IAAI,OAAO,aAAa;AACxB;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.capitalize =
|
|
4
|
+
exports.capitalize = capitalize;
|
|
5
5
|
/**
|
|
6
6
|
* @param s string to capitalize
|
|
7
7
|
* @returns capitalized string
|
|
@@ -9,5 +9,4 @@ exports.capitalize = void 0;
|
|
|
9
9
|
function capitalize(s) {
|
|
10
10
|
return `${s[0].toUpperCase()}${s.slice(1)}`;
|
|
11
11
|
}
|
|
12
|
-
exports.capitalize = capitalize;
|
|
13
12
|
//# sourceMappingURL=stringTransformation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stringTransformation.js","sources":["../../../../src/runtime/utils/stringTransformation.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.capitalize =
|
|
1
|
+
{"version":3,"file":"stringTransformation.js","sources":["../../../../src/runtime/utils/stringTransformation.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.capitalize = capitalize;\n/**\n * @param s string to capitalize\n * @returns capitalized string\n */\nfunction capitalize(s) {\n return `${s[0].toUpperCase()}${s.slice(1)}`;\n}\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,UAAU,GAAG,UAAU;AAC/B;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,CAAC,EAAE;AACvB,IAAI,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/C;;"}
|
package/dist/cjs/util/Brand.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.brandSymbol = void 0;
|
|
5
|
+
exports.brand = brand;
|
|
6
|
+
exports.getBrand = getBrand;
|
|
5
7
|
exports.brandSymbol = Symbol('brand');
|
|
6
8
|
/**
|
|
7
9
|
* Create an object of a specific type Brand
|
|
@@ -21,7 +23,6 @@ function brand(brand) {
|
|
|
21
23
|
[exports.brandSymbol]: brand,
|
|
22
24
|
};
|
|
23
25
|
}
|
|
24
|
-
exports.brand = brand;
|
|
25
26
|
/**
|
|
26
27
|
*
|
|
27
28
|
* @param branded: Branded object
|
|
@@ -30,5 +31,4 @@ exports.brand = brand;
|
|
|
30
31
|
function getBrand(branded) {
|
|
31
32
|
return branded[exports.brandSymbol];
|
|
32
33
|
}
|
|
33
|
-
exports.getBrand = getBrand;
|
|
34
34
|
//# sourceMappingURL=Brand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Brand.js","sources":["../../../src/util/Brand.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.
|
|
1
|
+
{"version":3,"file":"Brand.js","sources":["../../../src/util/Brand.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.brandSymbol = void 0;\nexports.brand = brand;\nexports.getBrand = getBrand;\nexports.brandSymbol = Symbol('brand');\n/**\n * Create an object of a specific type Brand\n * string branded type.\n *\n * @param brand: The string to Brand onto a simple object\n * @returns A branded empty object\n *\n * @example\n * brand('example') => {[brandSymbol]: 'example'}\n *\n * Which I might use like this:\n * const myType = {content: \"default content\", ...brand<'example'>}\n */\nfunction brand(brand) {\n return {\n [exports.brandSymbol]: brand,\n };\n}\n/**\n *\n * @param branded: Branded object\n * @returns The string brand value\n */\nfunction getBrand(branded) {\n return branded[exports.brandSymbol];\n}\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,WAAW,GAAG,MAAM;AAC5B,OAAO,CAAC,KAAK,GAAG,KAAK;AACrB,OAAO,CAAC,QAAQ,GAAG,QAAQ;AAC3B,OAAO,CAAC,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,KAAK,CAAC,KAAK,EAAE;AACtB,IAAI,OAAO;AACX,QAAQ,CAAC,OAAO,CAAC,WAAW,GAAG,KAAK;AACpC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,QAAQ,CAAC,OAAO,EAAE;AAC3B,IAAI,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;AACvC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/util/index.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getBrand = exports.brand = void 0;\nvar Brand_1 = require(\"./Brand\");\nObject.defineProperty(exports, \"brand\", { enumerable: true, get: function () { return Brand_1.brand; } });\nObject.defineProperty(exports, \"getBrand\", { enumerable: true, get: function () { return Brand_1.getBrand; } });\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/util/index.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getBrand = exports.brand = void 0;\nvar Brand_1 = require(\"./Brand\");\nObject.defineProperty(exports, \"brand\", { enumerable: true, get: function () { return Brand_1.brand; } });\nObject.defineProperty(exports, \"getBrand\", { enumerable: true, get: function () { return Brand_1.getBrand; } });\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,KAAK,GAAG,MAAM;AACzC,IAAI,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;AAChC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;AACzG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;;"}
|