@lowdefy/connection-stripe 4.0.0-alpha.1 → 4.0.0-alpha.10

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -13,10 +13,9 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import StripeRequest from './StripeRequest/StripeRequest.js';
16
+ import schema from './schema.js';
16
17
  export default {
17
- import: {
18
- schema: 'connections/Stripe/StripeSchema.json'
19
- },
18
+ schema,
20
19
  requests: {
21
20
  StripeRequest
22
21
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -14,8 +14,8 @@
14
14
  limitations under the License.
15
15
  */ import { get } from '@lowdefy/helpers';
16
16
  import Stripe from 'stripe';
17
- import schema from './StripeRequestSchema.json';
18
- async function stripeRequest({ request , connection }) {
17
+ import schema from './schema.js';
18
+ async function StripeRequest({ request , connection }) {
19
19
  const stripe = new Stripe(connection.secretKey, {
20
20
  apiVersion: connection.apiVersion,
21
21
  maxNetworkRetries: connection.maxNetworkRetries,
@@ -36,4 +36,9 @@ async function stripeRequest({ request , connection }) {
36
36
  }
37
37
  return method.call(resource, ...args || []);
38
38
  }
39
- export default stripeRequest;
39
+ StripeRequest.schema = schema;
40
+ StripeRequest.meta = {
41
+ checkRead: false,
42
+ checkWrite: false
43
+ };
44
+ export default StripeRequest;
@@ -0,0 +1,78 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ export default {
16
+ $schema: 'http://json-schema.org/draft-07/schema#',
17
+ title: 'Lowdefy Request Schema - StripeRequest',
18
+ type: 'object',
19
+ patternProperties: {
20
+ '.+': {
21
+ description: 'Stripe API resource',
22
+ type: 'object',
23
+ minProperties: 1,
24
+ maxProperties: 1,
25
+ errorMessage: {
26
+ type: 'StripeRequest resource should be an object.',
27
+ minProperties: 'StripeRequest resource should contain a method to call.',
28
+ maxProperties: 'StripeRequest resource should contain only a single method to call.',
29
+ oneOf: 'StripeRequest resource should only contain a method to call, or sub-resource with a method to call.'
30
+ },
31
+ oneOf: [
32
+ {
33
+ description: 'Stripe API method to call on the resource',
34
+ patternProperties: {
35
+ '.+': {
36
+ description: 'Parameters to pass to the resource method, if any',
37
+ type: [
38
+ 'array',
39
+ 'null'
40
+ ],
41
+ errorMessage: {
42
+ type: 'Should be an array of parameters or null.'
43
+ }
44
+ }
45
+ }
46
+ },
47
+ {
48
+ description: 'Stripe API sub-resource of the parent resource',
49
+ patternProperties: {
50
+ '.+': {
51
+ description: 'Stripe API method to call on the resource',
52
+ type: 'object',
53
+ minProperties: 1,
54
+ maxProperties: 1,
55
+ patternProperties: {
56
+ '.+': {
57
+ description: 'Parameters to pass to the sub-resource method, if any',
58
+ type: [
59
+ 'array',
60
+ 'null'
61
+ ]
62
+ }
63
+ }
64
+ }
65
+ }
66
+ },
67
+ ]
68
+ }
69
+ },
70
+ minProperties: 1,
71
+ maxProperties: 1,
72
+ errorMessage: {
73
+ type: 'StripeRequest request properties should be an object.',
74
+ additionalProperties: 'StripeRequest should contain a valid resource to call.',
75
+ minProperties: 'StripeRequest should contain a resource to call.',
76
+ maxProperties: 'StripeRequest should contain only a single resource to call.'
77
+ }
78
+ };
@@ -0,0 +1,69 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ export default {
16
+ $schema: 'http://json-schema.org/draft-07/schema#',
17
+ title: 'Lowdefy Connection Schema - Stripe',
18
+ type: 'object',
19
+ required: [
20
+ 'secretKey'
21
+ ],
22
+ properties: {
23
+ secretKey: {
24
+ type: 'string',
25
+ description: 'Stripe secret key.',
26
+ errorMessage: {
27
+ type: 'Stripe connection property "secretKey" should be a string.'
28
+ }
29
+ },
30
+ apiVersion: {
31
+ type: 'string',
32
+ description: 'Stripe API version to use.',
33
+ default: null,
34
+ errorMessage: {
35
+ type: 'Stripe connection property "apiVersion" should be a string.'
36
+ }
37
+ },
38
+ telemetry: {
39
+ type: 'boolean',
40
+ description: 'Allow Stripe to send latency telemetry.',
41
+ default: true,
42
+ errorMessage: {
43
+ type: 'Stripe connection property "telemetry" should be a boolean.'
44
+ }
45
+ },
46
+ timeout: {
47
+ type: 'integer',
48
+ description: 'Maximum time each request can take in ms.',
49
+ default: 80000,
50
+ errorMessage: {
51
+ type: 'Stripe connection property "timeout" should be an integer.'
52
+ }
53
+ },
54
+ maxNetworkRetries: {
55
+ type: 'integer',
56
+ description: 'The amount of times a request should be retried.',
57
+ default: 0,
58
+ errorMessage: {
59
+ type: 'Stripe connection property "maxNetworkRetries" should be an integer.'
60
+ }
61
+ }
62
+ },
63
+ errorMessage: {
64
+ type: 'Stripe connection properties should be an object.',
65
+ required: {
66
+ secretKey: 'Stripe connection should have required property "secretKey".'
67
+ }
68
+ }
69
+ };
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -12,13 +12,4 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ export default {
16
- import: {
17
- path: 'connections/Stripe/StripeRequest/StripeRequest.js',
18
- schema: 'connections/Stripe/StripeRequest/StripeRequestSchema.json'
19
- },
20
- meta: {
21
- checkRead: false,
22
- checkWrite: false
23
- }
24
- };
15
+ */ export { default as Stripe } from './connections/Stripe/Stripe.js';
package/dist/types.js ADDED
@@ -0,0 +1,20 @@
1
+ /* eslint-disable import/namespace */ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import * as connections from './connections.js';
16
+ export default {
17
+ connections: Object.keys(connections),
18
+ requests: Object.keys(connections).map((connection)=>Object.keys(connections[connection].requests)
19
+ ).flat()
20
+ };
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@lowdefy/connection-stripe",
3
- "version": "4.0.0-alpha.1",
3
+ "version": "4.0.0-alpha.10",
4
4
  "licence": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
7
7
  "keywords": [
8
8
  "lowdefy",
9
- "lowdefy connection"
9
+ "lowdefy connection",
10
+ "lowdefy plugin"
10
11
  ],
11
12
  "bugs": {
12
13
  "url": "https://github.com/lowdefy/lowdefy/issues"
@@ -27,8 +28,8 @@
27
28
  },
28
29
  "type": "module",
29
30
  "exports": {
30
- ".": "./dist/index.js",
31
- "./connections/*": "./dist/connections/*"
31
+ "./connections": "./dist/connections.js",
32
+ "./types": "./dist/types.js"
32
33
  },
33
34
  "files": [
34
35
  "dist/*"
@@ -42,18 +43,18 @@
42
43
  "s": "swc"
43
44
  },
44
45
  "dependencies": {
45
- "@lowdefy/helpers": "4.0.0-alpha.1",
46
- "stripe": "8.186.0"
46
+ "@lowdefy/helpers": "4.0.0-alpha.10",
47
+ "stripe": "8.201.0"
47
48
  },
48
49
  "devDependencies": {
49
- "@lowdefy/ajv": "4.0.0-alpha.1",
50
- "@swc/cli": "0.1.52",
51
- "@swc/core": "1.2.112",
52
- "@swc/jest": "0.2.9",
53
- "jest": "27.3.1"
50
+ "@lowdefy/ajv": "4.0.0-alpha.10",
51
+ "@swc/cli": "0.1.55",
52
+ "@swc/core": "1.2.135",
53
+ "@swc/jest": "0.2.17",
54
+ "jest": "27.5.1"
54
55
  },
55
56
  "publishConfig": {
56
57
  "access": "public"
57
58
  },
58
- "gitHead": "c97a8fa6b5a641e7d50df09f5601a9c586eeb65a"
59
+ "gitHead": "d697b4b5f354697d9481a371b90a00ca0944f486"
59
60
  }
@@ -1,64 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "Lowdefy Request Schema - StripeRequest",
4
- "type": "object",
5
- "patternProperties": {
6
- ".+": {
7
- "description": "Stripe API resource",
8
- "type": "object",
9
- "minProperties": 1,
10
- "maxProperties": 1,
11
- "errorMessage": {
12
- "type": "StripeRequest resource should be an object.",
13
- "minProperties": "StripeRequest resource should contain a method to call.",
14
- "maxProperties": "StripeRequest resource should contain only a single method to call.",
15
- "oneOf": "StripeRequest resource should only contain a method to call, or sub-resource with a method to call."
16
- },
17
- "oneOf": [
18
- {
19
- "description": "Stripe API method to call on the resource",
20
- "patternProperties": {
21
- ".+": {
22
- "description": "Parameters to pass to the resource method, if any",
23
- "type": [
24
- "array",
25
- "null"
26
- ],
27
- "errorMessage": {
28
- "type": "Should be an array of parameters or null."
29
- }
30
- }
31
- }
32
- },
33
- {
34
- "description": "Stripe API sub-resource of the parent resource",
35
- "patternProperties": {
36
- ".+": {
37
- "description": "Stripe API method to call on the resource",
38
- "type": "object",
39
- "minProperties": 1,
40
- "maxProperties": 1,
41
- "patternProperties": {
42
- ".+": {
43
- "description": "Parameters to pass to the sub-resource method, if any",
44
- "type": [
45
- "array",
46
- "null"
47
- ]
48
- }
49
- }
50
- }
51
- }
52
- }
53
- ]
54
- }
55
- },
56
- "minProperties": 1,
57
- "maxProperties": 1,
58
- "errorMessage": {
59
- "type": "StripeRequest request properties should be an object.",
60
- "additionalProperties": "StripeRequest should contain a valid resource to call.",
61
- "minProperties": "StripeRequest should contain a resource to call.",
62
- "maxProperties": "StripeRequest should contain only a single resource to call."
63
- }
64
- }
@@ -1,55 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "Lowdefy Connection Schema - Stripe",
4
- "type": "object",
5
- "required": [
6
- "secretKey"
7
- ],
8
- "properties": {
9
- "secretKey": {
10
- "type": "string",
11
- "description": "Stripe secret key.",
12
- "errorMessage": {
13
- "type": "Stripe connection property \"secretKey\" should be a string."
14
- }
15
- },
16
- "apiVersion": {
17
- "type": "string",
18
- "description": "Stripe API version to use.",
19
- "default": null,
20
- "errorMessage": {
21
- "type": "Stripe connection property \"apiVersion\" should be a string."
22
- }
23
- },
24
- "telemetry": {
25
- "type": "boolean",
26
- "description": "Allow Stripe to send latency telemetry.",
27
- "default": true,
28
- "errorMessage": {
29
- "type": "Stripe connection property \"telemetry\" should be a boolean."
30
- }
31
- },
32
- "timeout": {
33
- "type": "integer",
34
- "description": "Maximum time each request can take in ms.",
35
- "default": 80000,
36
- "errorMessage": {
37
- "type": "Stripe connection property \"timeout\" should be an integer."
38
- }
39
- },
40
- "maxNetworkRetries": {
41
- "type": "integer",
42
- "description": "The amount of times a request should be retried.",
43
- "default": 0,
44
- "errorMessage": {
45
- "type": "Stripe connection property \"maxNetworkRetries\" should be an integer."
46
- }
47
- }
48
- },
49
- "errorMessage": {
50
- "type": "Stripe connection properties should be an object.",
51
- "required": {
52
- "secretKey": "Stripe connection should have required property \"secretKey\"."
53
- }
54
- }
55
- }
package/dist/index.js DELETED
@@ -1,7 +0,0 @@
1
- import Stripe from './connections/Stripe/Stripe.js';
2
- export const connections = {
3
- Stripe
4
- };
5
- export default {
6
- connections
7
- };